/* 六合矩算 - 原型风格样式 */

:root {
    --bg-body: #0b1120;
    --bg-card: #141e30;
    --bg-card-inner: #0f1923;
    --bg-input: #0d1520;
    --border-card: #1e3048;
    --border-input: #1e3a55;
    --header-from: #5c1a1a;
    --header-to: #7a2828;
    --accent-gold: #d4a843;
    --accent-gold-dim: rgba(212, 168, 67, 0.15);
    --accent-purple: #7c3aed;
    --accent-purple-hover: #6d28d9;
    --accent-blue: #3b82f6;
    --text-primary: #e8e6e3;
    --text-secondary: #8b95a5;
    --text-muted: #4a5568;
    --text-gold: #d4a843;
    --green: #22c55e;
    --red: #ef4444;
    --radius: 10px;
    --radius-sm: 6px;
    --font-sans: 'Noto Sans SC', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-card); border-radius: 2px; }

/* ===== 顶部导航 ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--header-from), var(--header-to));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-box {
    width: 36px;
    height: 36px;
    background: var(--accent-gold);
    color: #1a0a0a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    flex: 0 0 auto;
}
.brand-logo-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.brand-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 1px;
}

.btn-odds {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--font-sans);
}
.btn-odds:hover { background: rgba(255,255,255,0.2); }

/* ===== 主内容区 ===== */
.main-content {
    padding: 12px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-badge {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #0b1120;
}

.badge-open { background: var(--accent-gold); }
.badge-bet { background: var(--accent-gold); }
.badge-result { background: var(--accent-gold); }

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.card-body {
    padding: 0 14px 14px;
}

.card-footer-right {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* ===== 开奖号码（彩球样式） ===== */
.card-numbers {
    padding: 0;
    overflow: hidden;
}

.draw-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-card);
    background: var(--bg-card);
}

.draw-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.draw-tab .tab-icon { font-size: 16px; }

.draw-tab.active {
    color: var(--text-primary);
    font-weight: 600;
}

.draw-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 2px 2px 0 0;
}

.draw-panel {
    display: none;
    padding: 14px 12px;
}

.draw-panel.active { display: block; }

.draw-input-row {
    display: flex;
    gap: 8px;
}

.draw-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 1px;
    transition: border-color 0.2s;
}
.draw-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}
.draw-input::placeholder { color: var(--text-muted); font-family: var(--font-sans); letter-spacing: 0; }

.btn-draw-save {
    padding: 0 16px;
    background: var(--accent-gold);
    color: #0b1120;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--font-sans);
    white-space: nowrap;
}
.btn-draw-save:hover { background: #e0b84e; }
.btn-draw-save:active { transform: scale(0.97); }

.draw-balls {
    margin-top: 10px;
}

.balls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 2px;
}

.ball-plus {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 2px;
    flex-shrink: 0;
}

.lottery-ball {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 700;
    color: #0b1120;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.lottery-ball.ball-red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #e53935 50%, #c62828);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.lottery-ball.ball-blue {
    background: radial-gradient(circle at 30% 30%, #64b5f6, #3949ab 50%, #1a237e);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.lottery-ball.ball-green {
    background: radial-gradient(circle at 30% 30%, #81c784, #43a047 50%, #1b5e20);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.balls-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 2px 4px;
}

.ball-info {
    width: 40px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.ball-info .zodiac { color: var(--text-primary); }

.ball-info .divider {
    color: var(--text-muted);
    margin: 0 1px;
}

.ball-info .element { font-weight: 600; }
.ball-info .element.el-jin { color: #f1c40f; }
.ball-info .element.el-mu { color: #2ecc71; }
.ball-info .element.el-shui { color: #3498db; }
.ball-info .element.el-huo { color: #e74c3c; }
.ball-info .element.el-tu { color: #e67e22; }

.ball-info-plus {
    width: auto;
    color: transparent;
    margin: 0 2px;
}

.draw-action {
    display: flex;
    justify-content: center;
    padding: 0 12px 14px;
}

.btn-calculate {
    padding: 9px 28px;
    background: var(--accent-gold);
    color: #0b1120;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-calculate:hover { background: #e0b84e; transform: scale(1.02); }
.btn-calculate:active { transform: scale(0.97); }

/* ===== 投注内容 ===== */
.bet-textarea {
    width: 100%;
    min-height: 180px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.8;
    resize: vertical;
    transition: border-color 0.2s;
}
.bet-textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
}
.bet-textarea::placeholder { color: var(--text-muted); }

.action-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
}
/* 操作按钮区：各按钮等宽铺满整行，文字不竖排 */
.action-bar > button {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}
.action-bar > button svg {
    flex: 0 0 auto;
}
.action-bar .btn-calculate {
    padding: 10px 18px;
    font-size: 14px;
    height: 40px;
    margin-left: 0;
}

.random-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.random-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-random-num {
    padding: 6px 14px;
    font-size: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-mono);
    white-space: nowrap;
    min-width: 48px;
    text-align: center;
}
.btn-random-num:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(212, 168, 67, 0.1);
}
.btn-random-num:active {
    transform: scale(0.95);
}

.random-wrap {
    position: relative;
}

.btn-random-toggle {
    background: linear-gradient(135deg, rgba(212,168,67,0.2), rgba(212,168,67,0.08));
    color: var(--accent-gold);
    border: 1px solid rgba(212,168,67,0.4);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}
.btn-random-toggle:hover {
    background: rgba(212,168,67,0.25);
    border-color: var(--accent-gold);
}

.random-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 50;
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.rp-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.rp-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rp-chip {
    padding: 5px 12px;
    font-size: 12px;
    background: var(--panel-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.rp-chip:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.rp-chip.rp-chip-custom {
    border-style: dashed;
}

.rp-custom {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    align-items: center;
}
.rp-custom input {
    flex: 1;
    padding: 6px 10px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono);
    outline: none;
}
.rp-custom input:focus { border-color: var(--accent-gold); }

.rp-ok-btn {
    padding: 6px 12px;
    background: var(--accent-gold);
    color: #0f1419;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
}
.rp-ok-btn:hover { filter: brightness(1.1); }

.rp-tip {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.btn-ai {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent-purple);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--font-sans);
}
.btn-ai:hover { background: var(--accent-purple-hover); }
.btn-ai:active { transform: scale(0.97); }

.btn-engine {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--font-sans);
}
.btn-engine:hover { background: var(--accent-blue-hover, #3a8eef); }
.btn-engine:active { transform: scale(0.97); }

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-icon:hover { background: var(--border-card); color: var(--text-primary); }
.btn-icon.btn-warn { color: var(--accent-gold); border-color: rgba(212,168,67,0.3); }
.btn-icon.btn-warn:hover { background: var(--accent-gold-dim); }
.btn-icon.btn-gold { color: var(--accent-gold); border-color: rgba(212,168,67,0.3); background: var(--accent-gold-dim); }
.btn-icon.btn-gold:hover { background: rgba(212,168,67,0.25); }

/* 随机生成按钮菜单 */
.btn-random-wrap {
    position: relative;
    display: inline-flex;
}
.random-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    padding: 4px;
    min-width: 120px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.btn-random-wrap:hover .random-menu,
.btn-random-wrap.active .random-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.random-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.random-item:hover {
    background: var(--border-card);
    color: var(--accent-gold);
}

/* ===== 计算结果 ===== */
.result-placeholder {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* AI 解析说明 */
.ai-note {
    padding: 12px 14px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ai-note-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.ai-note pre {
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: 4px;
    padding: 8px 10px;
    margin: 6px 0;
    font-family: var(--font-mono);
    font-size: 11px;
    overflow-x: auto;
}

.ai-note details summary {
    cursor: pointer;
    color: #a78bfa;
    font-size: 11px;
    margin: 4px 0;
}

/* 旋转动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

.result-group-card {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.result-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(212,168,67,0.08);
    border-bottom: 1px solid var(--border-card);
}

.result-group-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
}

.result-group-stats {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.result-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-card);
}

.result-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(30,48,72,0.5);
    color: var(--text-primary);
}

.result-table tr:last-child td { border-bottom: none; }

.result-table .col-type { color: var(--accent-gold); font-weight: 500; }
.result-table .col-values { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.result-table .col-amount { font-family: var(--font-mono); color: var(--accent-blue); }
.result-table .col-odds { font-family: var(--font-mono); color: var(--text-muted); }
.result-table .col-win { font-family: var(--font-mono); font-weight: 600; color: var(--green); }

.result-table .row-total td {
    background: rgba(212,168,67,0.05);
    font-weight: 600;
    border-top: 1px solid var(--border-card);
}

/* 结果明细表（与引擎拆解同款 parse-table，紧凑化以容纳计算列） */
.result-table.result-detail {
    font-size: 11px;
}
.result-table.result-detail th,
.result-table.result-detail td {
    padding: 7px 6px;
    white-space: nowrap;
}
.result-table.result-detail th:nth-child(4),
.result-table.result-detail td:nth-child(4),
.result-table.result-detail th:nth-child(5),
.result-table.result-detail td:nth-child(5),
.result-table.result-detail th:nth-child(6),
.result-table.result-detail td:nth-child(6),
.result-table.result-detail th:nth-child(7),
.result-table.result-detail td:nth-child(7) {
    text-align: center;
}
.result-table.result-detail .col-value-text {
    white-space: normal;
    min-width: 70px;
}
.result-table.result-detail .col-win {
    font-weight: 700;
}
.result-group-card .parse-group-header {
    padding: 12px 14px 6px;
}
.result-group-card .parse-group-raw {
    margin: 6px 14px;
}

/* 汇总条 */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}

.summary-item {
    padding: 10px 8px;
    background: var(--bg-card-inner);
    text-align: center;
}

.summary-item .s-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-item .s-value {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 2px;
}

.summary-item .s-value.gold { color: var(--accent-gold); }
.summary-item .s-value.green { color: var(--green); }

/* ===== 解析结果样式 ===== */
.parse-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
    background: var(--bg-card-inner);
    border-radius: 8px;
    padding: 4px;
}

.parse-summary-item {
    padding: 10px 8px;
    text-align: center;
    background: var(--bg-card);
    border-radius: 6px;
}

.ps-label {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.ps-value {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 3px;
}

.ps-value.gold { color: var(--accent-gold); }
.ps-value.blue { color: var(--accent-blue); }

/* 收起/展开工具栏 */
.parse-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.parse-toolbar .parse-summary {
    flex: 1;
    margin-bottom: 0;
}

.parse-toolbar-bottom {
    margin-bottom: 0;
    margin-top: 10px;
    justify-content: center;
}

.parse-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--border-card);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--accent-gold);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-out;
    white-space: nowrap;
    flex-shrink: 0;
}

.parse-collapse-btn:hover {
    background: var(--bg-card-inner);
    border-color: var(--accent-gold-dim);
    transform: scale(1.03);
}

.parse-collapse-btn:active {
    transform: scale(0.97);
}

.parse-collapse-btn svg {
    transition: transform 0.2s ease-out;
}

.parse-group {
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    overflow: hidden;
}

/* 拆解视图手风琴收起 */
.seg-acc-header { cursor: pointer; user-select: none; }
.seg-acc-header:active { background: rgba(212,168,67,0.08); }
.seg-acc-chevron {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; font-size: 12px; color: var(--text-secondary);
    transition: transform 0.18s ease;
}
.seg-acc-group.open .seg-acc-chevron { transform: rotate(90deg); color: var(--accent-gold); }
.seg-acc-group .seg-acc-body { display: none; }
.seg-acc-group.open .seg-acc-body { display: block; }
.seg-acc-group.open .pg-name { color: #f0d98a; }
.parse-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.parse-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(74, 158, 255, 0.05));
    border-bottom: 1px solid var(--border-card);
}

.parse-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-index {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

.pg-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.parse-group-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pg-count {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-card-inner);
    padding: 2px 8px;
    border-radius: 10px;
}

.pg-amount {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-blue);
}

.parse-group-raw {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-card);
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.parse-group-raw::before {
    content: "原文";
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    font-size: 10px;
    margin-right: 8px;
    vertical-align: middle;
    font-family: var(--font-ui);
    letter-spacing: 0;
}

/* 引擎「多组+各组金额」写法被自动补全为 N 连肖的修正标注（B 方案） */
.pg-recovered-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
    font-size: 10px;
    margin-right: 8px;
    vertical-align: middle;
    font-family: var(--font-ui);
    letter-spacing: 0;
    font-weight: 600;
}

/* 段标题行（AI分段） */
.segment-row td {
    background: #1a2030;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--accent-gold);
    font-weight: 600;
    border-left: 3px solid var(--accent-gold);
    letter-spacing: 0.5px;
}

/* 校验错误 */
.parse-group-error {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pg-error-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.parse-validation-errors {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.pve-title {
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 8px;
}

.pve-item {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 0;
    line-height: 1.5;
}

.pve-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    opacity: 0.8;
}

.pg-skipped {
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
}

.pve-type {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 8px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.parse-group-body {
    padding: 4px 0;
}

.parse-table {
    width: 100%;
    border-collapse: collapse;
}

.parse-table th {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: left;
    background: var(--bg-card-inner);
    letter-spacing: 0.3px;
}

.parse-table td {
    padding: 9px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-row);
    color: var(--text-primary);
}

.parse-table tr:last-child td {
    border-bottom: none;
}

.parse-table .col-region { width: 48px; text-align: center; }
.parse-table .col-type { width: 90px; }
.parse-table .col-value { }
.parse-table .col-amount { width: 70px; text-align: right; }
.col-value-text { font-family: var(--font-mono); font-size: 12px; }
.region-badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.region-hk { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.region-mo { background: rgba(74, 158, 255, 0.2); color: #4a9eff; }
.col-amount-text { text-align: right; font-family: var(--font-mono); font-weight: 600; color: var(--accent-gold); }

/* AI修正标记 */
.parse-table .modified-row {
    background: rgba(212, 168, 67, 0.08);
}
.parse-table .modified-row td {
    border-left: 2px solid var(--accent-gold);
}
.modified-tip {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(212, 168, 67, 0.2);
    color: var(--accent-gold);
    cursor: help;
    vertical-align: middle;
    font-family: var(--font-sans);
    font-weight: 500;
}

.parse-table .error-row {
    background: rgba(239, 68, 68, 0.08);
}
.parse-table .error-row td {
    border-left: 2px solid #ef4444;
}
.error-tip {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    cursor: help;
    vertical-align: middle;
    font-family: var(--font-sans);
    font-weight: 500;
}
/* AI 核对行：引擎结果下方追加，标色便于对比（不删引擎数据） */
.aicheck-reason-row td {
    background: rgba(74, 158, 255, 0.06);
    border-top: 1px solid var(--border) !important;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 5px 12px !important;
}
.aicheck-badge {
    display: inline-block;
    margin-right: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    background: rgba(74, 158, 255, 0.22);
    color: var(--accent-blue);
    vertical-align: middle;
    letter-spacing: 0.5px;
}
.aicheck-reason {
    vertical-align: middle;
    font-family: var(--font-sans);
}
.aicheck-row td {
    background: rgba(74, 158, 255, 0.05) !important;
    border-left: 2px solid var(--accent-blue);
}
.aicheck-row .col-amount-text {
    color: var(--accent-blue);
    font-weight: 600;
}
/* 引擎原版对比行（AI 扶正后留档） */
.engine-orig-row td {
    background: rgba(180, 180, 180, 0.06) !important;
    color: var(--text-secondary);
    text-decoration: line-through;
    text-decoration-color: rgba(180, 180, 180, 0.5);
}
.engine-orig-row .col-amount-text {
    color: var(--text-secondary);
    font-weight: 400;
}
/* AI 改正标签 */
.ai-correct-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(74, 158, 255, 0.18);
    color: var(--accent-blue);
    vertical-align: middle;
    letter-spacing: 0.5px;
}
.ai-correct-tag.orig {
    background: rgba(180, 180, 180, 0.15);
    color: var(--text-secondary);
    text-decoration: none;
}

/* ===== AI 建议对照区（引擎为准，AI 解法仅展示·绝不参与计算）===== */
.ai-suggestion-divider td {
    background: rgba(245, 158, 11, 0.08) !important;
    border-top: 1px dashed rgba(245, 158, 11, 0.55) !important;
    padding: 6px 12px !important;
    font-size: 12px;
}
.aisug-badge {
    display: inline-block;
    margin-right: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.22);
    color: #d97706;
    vertical-align: middle;
    letter-spacing: 0.5px;
}
.aisug-note {
    color: var(--text-muted);
    margin-right: 8px;
    vertical-align: middle;
}
.aisug-reason {
    color: var(--text-secondary);
    vertical-align: middle;
}
.ai-suggestion-row td {
    background: rgba(245, 158, 11, 0.05) !important;
    border-left: 2px dashed rgba(245, 158, 11, 0.6);
    color: var(--text-secondary);
}
.ai-suggestion-row .col-amount-text {
    color: #d97706;
    font-weight: 600;
}
.ai-suggestion-row .aisug-no-calc {
    color: var(--text-muted);
    font-size: 11px;
}
.ai-correct-tag.sug {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
}

/* ===== AI 补全（引擎未识别残段，AI 按玩法补出·已参与计算·请核对）===== */
.seg-recovered {
    margin-left: 12px;
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
}
.ai-recovered-row td {
    background: rgba(16, 185, 129, 0.06) !important;
    border-left: 2px solid rgba(16, 185, 129, 0.55);
}
.ai-correct-tag.recovered {
    background: rgba(16, 185, 129, 0.18);
    color: #059669;
}
/* AI 改写（引擎未识别写法→标准话术回灌）段标题下的改写话术展示 */
.seg-normalized {
    margin-top: 4px;
    padding: 4px 10px;
    font-size: 13px;
    color: #34d399;
    background: rgba(16, 185, 129, 0.08);
    border-left: 2px solid #10b981;
    border-radius: 3px;
    width: fit-content;
}
.seg-normalized-text {
    font-weight: 700;
    color: #6ee7b7;
    letter-spacing: 0.5px;
}

/* 段标题行（AI分段用） */
.segment-header-row td {
    background: rgba(212, 168, 67, 0.08);
    border-left: 3px solid var(--accent-gold);
    padding: 8px 12px !important;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border) !important;
}
.segment-header-row .seg-index {
    display: inline-block;
    margin-right: 10px;
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
}
.segment-header-row .seg-text {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    /* 分段原文完整展示、自动换行，不再省略截断 */
    white-space: normal;
    word-break: break-all;
    line-height: 1.6;
}
.segment-header-row td { white-space: normal; }
.segment-header-row .seg-recovered,
.segment-header-row .seg-error { white-space: normal; }
.segment-header-row .seg-error {
    margin-left: 12px;
    color: #ef4444;
    font-size: 12px;
}
.segment-empty td {
    text-align: center;
    color: var(--text-muted);
    padding: 12px !important;
    font-size: 12px;
}

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-te { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-ping { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-ping-xiao { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-tail { background: rgba(74, 158, 255, 0.15); color: #60a5fa; }
.badge-bz { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge-bao { background: rgba(212, 168, 67, 0.15); color: var(--accent-gold); }
.badge-default { background: var(--bg-card-inner); color: var(--text-secondary); }

@keyframes card-flash {
    0% { border-color: var(--accent-gold); }
    100% { border-color: var(--border-card); }
}
.card-flash { animation: card-flash 0.6s ease-out; }

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--bg-card);
    border-top: 1px solid var(--border-card);
    z-index: 150;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 11px; }

.nav-item.nav-active { color: var(--accent-gold); }
.nav-item:hover { color: var(--text-secondary); }

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border-card);
    border-radius: 2px;
    margin: 10px auto 0;
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
}

.modal-header-row h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, transform 0.1s;
}
.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }

.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 18px 18px;
}

.modal-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-card);
    background: var(--bg-card-inner);
}

.modal-text-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
}
.modal-text-input:focus { outline: none; border-color: var(--accent-gold); }
.modal-text-input::placeholder { color: var(--text-muted); }

.btn-send {
    padding: 10px 18px;
    background: var(--accent-purple);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.2s, transform 0.1s;
}
.btn-send:hover { background: var(--accent-purple-hover); }

.modal-footer-row {
    padding: 12px 18px;
    border-top: 1px solid var(--border-card);
    display: flex;
    justify-content: flex-end;
}

.btn-save-odds {
    padding: 10px 24px;
    background: var(--accent-gold);
    color: #0b1120;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.2s, transform 0.1s;
}
.btn-save-odds:hover { background: #e0b84e; }

/* AI 消息 */
.ai-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.ai-msg-ai .ai-avatar {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

.ai-msg-user {
    flex-direction: row-reverse;
}

.ai-msg-user .ai-avatar {
    background: rgba(59,130,246,0.15);
    color: var(--accent-blue);
}

.ai-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.ai-msg-ai .ai-bubble {
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
}

.ai-msg-user .ai-bubble {
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.2);
    color: var(--text-primary);
}

.ai-bubble pre {
    background: var(--bg-body);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 8px 10px;
    margin: 6px 0;
    font-family: var(--font-mono);
    font-size: 11px;
    overflow-x: auto;
}

.typing-cursor::after {
    content: '|';
    color: var(--accent-gold);
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 赔率表单 */
.odds-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.odds-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.odds-field label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
}

.odds-field input {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
}
.odds-field input:focus { outline: none; border-color: var(--accent-gold); }

/* 知识库 */
.knowledge-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.k-select {
    width: 80px;
    padding: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: var(--font-sans);
}
.k-select:focus { outline: none; border-color: var(--accent-gold); }

.k-input {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
}
.k-input:focus { outline: none; border-color: var(--accent-gold); }
.k-input::placeholder { color: var(--text-muted); }

.btn-k-add {
    padding: 8px 14px;
    background: var(--accent-gold);
    color: #0b1120;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
}

.k-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
}

.k-tab {
    flex: 1;
    padding: 10px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.k-tab:hover {
    color: var(--text-primary);
}

.k-tab.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.k-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.k-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.k-item .k-cat {
    padding: 2px 6px;
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.k-item .k-text {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.k-item .k-del {
    cursor: pointer;
    color: var(--text-muted);
    border: none;
    background: none;
    font-size: 14px;
    padding: 2px;
}
.k-item .k-del:hover { color: var(--red); }

/* ===== 赔率设置弹窗 ===== */
.modal-center {
    align-items: center;
    justify-content: center;
}

.modal-center::before {
    background: rgba(0,0,0,0.45);
}

.odds-modal {
    position: relative;
    width: 420px;
    max-width: 92vw;
    max-height: 85vh;
    background: #1a2332;
    border: 1px solid #2a3a50;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.odds-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #2a3a50;
}

.odds-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-gold);
}

.odds-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 16px;
}

.odds-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 16px;
    border-top: 1px solid #2a3a50;
}

/* ===== 运算次数消耗确认弹窗 ===== */
.consume-modal {
    max-width: 340px;
    padding: 28px 24px 24px;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(165deg, #1b2740 0%, #141d31 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.08) inset;
}
.consume-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background: radial-gradient(circle at 35% 30%, rgba(240, 200, 90, 0.35), rgba(212, 175, 55, 0.12));
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.25);
}
.consume-title {
    font-size: 19px;
    font-weight: 700;
    color: #f3e6c0;
    margin: 0 0 8px;
}
.consume-desc {
    font-size: 14px;
    color: #b8c2d4;
    margin: 0 0 18px;
    line-height: 1.5;
}
.consume-desc b { color: var(--accent-gold); font-weight: 700; }
.consume-rule {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--accent-gold);
    border-radius: 8px;
    text-align: left;
}
.consume-rule .cr-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.consume-rule .cr-name em { font-style: normal; color: var(--accent-gold); }
.consume-rule .cr-desc {
    font-size: 12.5px;
    color: #a6b1c6;
    line-height: 1.55;
}
.consume-balance {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.18);
}
.consume-balance .cb-label { font-size: 13px; color: #9aa7bd; }
.consume-balance .cb-num { font-size: 26px; font-weight: 800; color: var(--accent-gold); line-height: 1; }
.consume-balance .cb-unit { font-size: 13px; color: #9aa7bd; }
.consume-actions {
    display: flex;
    gap: 12px;
}
.consume-actions button {
    flex: 1;
    height: 46px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.consume-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #31415c;
    color: #b8c2d4;
}
.consume-cancel:hover { background: rgba(255, 255, 255, 0.09); }
.consume-confirm {
    background: linear-gradient(135deg, #e8c766, #c9a227);
    border: 1px solid rgba(240, 210, 110, 0.7);
    color: #1a1405;
    box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
}
.consume-confirm:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(201, 162, 39, 0.45); }
.consume-confirm:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ===== 应用内通用提示弹窗（替代原生 alert） ===== */
.notice-modal {
    max-width: 330px;
    width: calc(100% - 48px);
    padding: 30px 24px 24px;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(165deg, #1b2740 0%, #141d31 100%);
    border: 1px solid rgba(212, 175, 55, 0.32);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.06) inset;
    position: relative;
    animation: noticePop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes noticePop {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.notice-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    background: radial-gradient(circle at 35% 30%, rgba(240, 200, 90, 0.32), rgba(212, 175, 55, 0.1));
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 26px rgba(212, 175, 55, 0.22);
}
.notice-title {
    font-size: 19px;
    font-weight: 700;
    color: #f3e6c0;
    margin: 0 0 10px;
}
.notice-desc {
    font-size: 14px;
    color: #b8c2d4;
    line-height: 1.65;
    margin: 0 0 22px;
}
.notice-desc b { color: var(--accent-gold); font-weight: 700; }
.notice-actions {
    display: flex;
    gap: 12px;
}
.notice-actions button {
    flex: 1;
    height: 46px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.notice-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #31415c;
    color: #b8c2d4;
}
.notice-cancel:hover { background: rgba(255, 255, 255, 0.09); }
.notice-confirm {
    background: linear-gradient(135deg, #e8c766, #c9a227);
    border: 1px solid rgba(240, 210, 110, 0.7);
    color: #1a1405;
    box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
}
.notice-confirm:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(201, 162, 39, 0.45); }


.odds-section {
    margin-bottom: 14px;
}

.odds-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212,168,67,0.2);
}

.odds-section-note {
    font-size: 12px;
    color: var(--text-primary);
    margin-top: 8px;
    margin-bottom: 4px;
    padding: 8px 10px;
    background: rgba(212,168,67,0.1);
    border: 1px solid rgba(212,168,67,0.25);
    border-radius: 6px;
    line-height: 1.6;
    font-weight: 500;
}

.odds-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    margin-bottom: 6px;
}

.odds-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.odds-field label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 48px;
    flex-shrink: 0;
    white-space: nowrap;
}

.odds-field input {
    flex: 1;
    padding: 7px 8px;
    background: #0f1923;
    border: 1px solid #2a3a50;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    min-width: 0;
    transition: border-color 0.2s;
}
.odds-field input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* 返水输入行：四个主分类标题下各一条 */
.odds-row.odds-fanshui-row {
    grid-template-columns: 1fr;
    margin-bottom: 8px;
}
.odds-fanshui-field {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
}
.odds-fanshui-field label {
    font-size: 12px;
    color: var(--green);
    min-width: 40px;
    flex-shrink: 0;
    white-space: nowrap;
}
.odds-fanshui-field input {
    flex: 1;
    padding: 6px 8px;
    background: #0f1923;
    border: 1px solid rgba(34,197,94,0.4);
    border-radius: 6px;
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 13px;
    min-width: 0;
}
.odds-fanshui-field input:focus {
    outline: none;
    border-color: var(--green);
}
.odds-fanshui-pct {
    color: var(--green);
    font-size: 13px;
    flex-shrink: 0;
}

.btn-odds-reset {
    padding: 8px 18px;
    background: #2a3a50;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.2s, transform 0.1s;
}
.btn-odds-reset:hover { background: #3a4a60; color: var(--text-primary); }

.btn-odds-save {
    padding: 8px 24px;
    background: var(--accent-gold);
    color: #0b1120;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background 0.2s, transform 0.1s;
}
.btn-odds-save:hover { background: #e0b84e; }

/* 赔率弹窗 - 手机端适配 */
@media (max-width: 480px) {
    .odds-modal {
        width: 96vw;
        max-height: 90vh;
        border-radius: 10px;
    }

    .odds-modal-header {
        padding: 12px 14px 10px;
    }

    .odds-modal-header h3 {
        font-size: 15px;
    }

    .odds-modal-body {
        padding: 10px 12px 12px;
    }

    .odds-modal-footer {
        padding: 10px 14px 14px;
    }

    .odds-section {
        margin-bottom: 10px;
    }

    .odds-section-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .odds-section-note {
        font-size: 11px;
        padding: 7px 8px;
    }

    .odds-row {
        gap: 6px 8px;
    }

    .odds-field label {
        min-width: 52px;
        font-size: 11px;
    }

    .odds-field input {
        padding: 6px 8px;
        font-size: 12px;
    }

    .btn-odds-reset,
    .btn-odds-save {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ===== 响应式 ===== */
@media (min-width: 600px) {
    .main-content {
        padding: 16px;
    }
}

/* ===== 批量测试 ===== */
.batch-test-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.batch-config {
    background: rgba(212, 168, 67, 0.05);
    border: 1px solid rgba(212, 168, 67, 0.15);
    border-radius: 6px;
    padding: 12px 14px;
}

.batch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.batch-row:last-child { margin-bottom: 0; }

.batch-label {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 64px;
    flex-shrink: 0;
}

.batch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--panel-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.chip:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.chip.active {
    background: var(--accent-gold);
    color: #0f1419;
    border-color: var(--accent-gold);
    font-weight: 500;
}

.batch-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 168, 67, 0.1);
    flex-wrap: wrap;
}

.batch-actions .btn-engine,
.batch-actions .btn-ai,
.batch-actions .btn-stop {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.batch-actions .btn-engine {
    background: rgba(74, 158, 255, 0.15);
    color: #4a9eff;
}
.batch-actions .btn-engine:hover { background: rgba(74, 158, 255, 0.25); }

.batch-actions .btn-ai {
    background: var(--accent-gold);
    color: #0f1419;
    font-weight: 500;
}
.batch-actions .btn-ai:hover { filter: brightness(1.1); }

.batch-actions .btn-stop {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.batch-actions .btn-stop:hover { background: rgba(239, 68, 68, 0.25); }

.batch-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-gold), #f0c865);
    border-radius: 3px;
    transition: width 0.2s ease;
}
.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    min-width: 60px;
    text-align: right;
}

.batch-stats {
    display: flex;
    gap: 8px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
}
.stat-item {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    border-radius: 4px;
}
.stat-num {
    display: block;
    font-size: 20px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}
.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.stat-pass .stat-num { color: #22c55e; }
.stat-eng .stat-num { color: var(--accent-gold); }
.stat-ai .stat-num { color: #ef4444; }
.stat-err .stat-num { color: #f97316; }

.batch-textarea-wrap {
    flex: 1;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.batch-ta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--panel-bg);
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.batch-ta-count {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-gold);
}
.batch-textarea {
    flex: 1;
    width: 100%;
    min-height: 120px;
    background: #0a0d12;
    color: var(--text-primary);
    border: none;
    padding: 8px 10px;
    font-size: 12px;
    font-family: 'JetBrains Mono', 'Noto Sans SC', monospace;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}
.batch-textarea:focus { background: #0a0d12; }

.batch-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.batch-results-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}
.batch-result-item {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(42, 48, 64, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.batch-result-item:hover { background: rgba(212, 168, 67, 0.06); }
.batch-result-item:last-child { border-bottom: none; }

.br-idx {
    flex-shrink: 0;
    width: 28px;
    text-align: right;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}
.br-status {
    flex-shrink: 0;
    width: 42px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    border-radius: 3px;
    padding: 1px 0;
}
.br-ok { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.br-eng { background: rgba(212, 168, 67, 0.15); color: var(--accent-gold); }
.br-ai { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.br-err { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.br-text {
    flex: 1;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.br-detail {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(42, 48, 64, 0.6);
    font-size: 11px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    display: none;
}
.batch-result-item.expanded .br-detail {
    display: block;
}
.br-expand-icon {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 10px;
    transition: transform 0.2s ease;
}
.batch-result-item.expanded .br-expand-icon {
    transform: rotate(90deg);
}

@media (max-width: 600px) {
    .batch-test-body { padding: 12px; gap: 10px; }
    .batch-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .batch-label { min-width: auto; }
    .batch-stats { flex-wrap: wrap; }
    .stat-item { flex: 1 1 40%; }
    .batch-actions .btn-engine,
    .batch-actions .btn-ai,
    .batch-actions .btn-stop { min-width: auto; font-size: 12px; padding: 7px 10px; }
}

/* ===== 五行颜色 ===== */
.el-jin { color: #e8c55a; }
.el-mu { color: #34d399; }
.el-shui { color: #60a5fa; }
.el-huo { color: #f87171; }
.el-tu { color: #d4a574; }

/* ===== 开奖彩球区域 ===== */
.draw-section {
    padding: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.draw-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.draw-tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.draw-tab.active {
    color: var(--text-primary);
}

.draw-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 2px;
}

.draw-panel { display: none; padding: 14px; }
.draw-panel.active { display: block; }

.draw-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.draw-input-row input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.draw-input-row input:focus { border-color: var(--accent-gold); }

.btn-save-draw {
    padding: 10px 18px;
    background: var(--accent-gold);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.draw-balls-display { margin-top: 12px; }

.balls-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.balls-info-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 12px;
}

.lottery-ball {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 -3px 6px rgba(0,0,0,0.3), inset 0 3px 6px rgba(255,255,255,0.2);
}

.ball-red { background: radial-gradient(circle at 30% 30%, #ff6b6b, #c92a2a); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.ball-blue { background: radial-gradient(circle at 30% 30%, #74c0fc, #1864ab); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.ball-green { background: radial-gradient(circle at 30% 30%, #69db7c, #2b8a3e); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.ball-empty { background: #2a3040; color: #5a6273; border: 1px dashed #3a4050; }
.ball-te { border: 2px solid var(--accent-gold); box-sizing: border-box; }

.ball-plus {
    color: var(--text-secondary);
    font-size: 22px;
    font-weight: 300;
    flex-shrink: 0;
    padding: 0 2px;
}

.ball-info {
    flex: 1;
    text-align: center;
    min-width: 0;
    font-size: 12px;
}

.ball-info-plus { color: transparent; flex: 0.5; }
.ball-info .zodiac { color: var(--text-primary); }
.ball-info .divider { color: var(--text-secondary); margin: 0 2px; }

/* 球内嵌输入框 */
.ball-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    text-align: center;
    color: #fff;
    font-weight: 700;
    font-size: inherit;
    font-family: inherit;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
    caret-color: #fff;
    padding: 0;
    cursor: text;
}
.ball-empty .ball-input { color: #e8e6e3; text-shadow: none; opacity: .9; }
.lottery-ball.ball-editing {
    box-shadow: 0 0 0 2px #d4a843, 0 0 12px rgba(212,168,67,.5);
}

@media (max-width: 380px) {
    .lottery-ball { width: 36px; height: 36px; font-size: 14px; }
    .balls-info-row { font-size: 11px; }
}

/* ===== 计算结果总览 & 分类统计 ===== */
.result-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}
.overview-cell {
    padding: 14px 10px;
    background: var(--bg-card-inner);
    text-align: center;
}
.overview-cell .o-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.overview-cell .o-value {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
}
.o-value.gold { color: var(--accent-gold); }
.o-value.blue { color: var(--signal-blue); }
.o-value.red { color: var(--red); }
.o-value.green { color: var(--green); }
.o-value.purple { color: #a78bfa; }

.result-category {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
    padding: 8px;
    background: var(--bg-card-inner);
    border-radius: var(--radius-sm);
}
.cat-card {
    text-align: center;
    padding: 8px 4px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-card);
}
.cat-card .cat-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.cat-card .cat-row {
    display: flex;
    justify-content: space-around;
    font-family: var(--font-mono);
    font-size: 12px;
    gap: 4px;
}
.cat-card .cat-cost { color: var(--text-primary); }
.cat-card .cat-win { color: var(--green); }

/* 计算结果总览区 */
.result-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.summary-row .summary-block { min-width: 0; }
.summary-row-main {
    margin-bottom: 0;
}
.summary-row-main-second {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0;
}
.summary-block {
    flex: 1;
    text-align: center;
}
.s-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.s-value {
    /* 长数字自适应：窄屏自动缩小，防溢出 */
    font-size: clamp(13px, 4.6vw, 22px);
    font-weight: bold;
    font-family: var(--font-mono);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}
.s-gold { color: #d4a843; }
.s-blue { color: #4a9eff; }
.s-green { color: var(--green); }
.s-red { color: var(--red); }
.s-purple { color: #a78bfa; }

.summary-divider {
    height: 1px;
    background: var(--border-card);
    margin: 12px 0;
}

.summary-row-cats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cat-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
}
.cat-name {
    color: var(--gold);
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
}
.cat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 0;
    gap: 8px;
}
.cat-row span {
    color: var(--text-sub);
    font-size: 12px;
    flex-shrink: 0;
}
.cat-row b {
    color: #d4a843;
    font-weight: 600;
    font-family: var(--mono-font);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    flex: 1;
}
.cat-row b.s-blue { color: #4a9eff; }
.cat-row.cat-fanshui {
    margin-top: 2px;
    border-top: 1px dashed rgba(255, 255, 255, 0.09);
}
.cat-row.cat-fanshui span { color: var(--green); }

/* 空球占位文字 */
.ball-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #d0d0d0;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    pointer-events: none;
}
.lottery-ball { position: relative; }

.toast-modal {
    width: 340px;
    max-width: 86vw;
    background: linear-gradient(180deg, #1a2332 0%, #131820 100%);
    border: 1px solid #2a3a50;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,168,67,0.1);
    animation: toastFadeIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes toastFadeIn {
    from { opacity: 0; transform: scale(0.9) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.toast-top {
    height: 4px;
    background: linear-gradient(90deg, #d4a843, #f0c856, #d4a843);
}
/* 中奖组列表弹窗 */
.hitgroups-modal {
    position: relative;
    z-index: 10;
    width: 720px;
    max-width: 92vw;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a2332 0%, #131820 100%);
    border: 1px solid #2a3a50;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,168,67,0.1);
    animation: toastFadeIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hitgroups-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #243045;
}
.hitgroups-title {
    font-size: 16px;
    font-weight: 600;
    color: #f0c856;
    white-space: nowrap;
}
.hitgroups-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hitgroups-tools .acc-tool-btn {
    padding: 6px 14px;
    font-size: 13px;
}
.hitgroups-head .modal-close {
    background: none;
    border: none;
    color: #8fa3bf;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.hitgroups-head .modal-close:hover { color: #fff; }
.hitgroups-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hitgroups-list .acc-group {
    min-height: 64px;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.hitgroups-list .acc-group .acc-header {
    min-height: 64px;
    box-sizing: border-box;
}
.hitgroups-empty {
    text-align: center;
    color: #8fa3bf;
    padding: 30px 0;
}
.hitgroups-footer {
    padding: 12px;
    border-top: 1px solid #243045;
    text-align: center;
}
.hitgroups-footer .btn-gold { min-width: 120px; }
.toast-icon {
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
}
.toast-icon-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212,168,67,0.15), rgba(212,168,67,0.05));
    border: 2px solid rgba(212,168,67,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.toast-title {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 24px 4px;
}
.toast-body {
    text-align: center;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 4px 24px 20px;
}
.toast-footer {
    padding: 0 24px 24px;
    display: flex;
    justify-content: center;
}
.btn-gold {
    background: linear-gradient(180deg, #d4a843 0%, #b89135 100%);
    color: #1a1610;
    border: none;
    padding: 12px 56px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(212,168,67,0.3);
}
.btn-gold:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(212,168,67,0.4);
}
.btn-gold:active { transform: translateY(0); }

/* Tip 弹窗提亮重写 */
.tip-modal .toast-modal {
    background: linear-gradient(180deg, #253044 0%, #1a2233 100%);
}
.tip-modal .btn-gold {
    white-space: nowrap;
    min-width: 200px;
    font-size: 16px;
    padding: 14px 48px;
}

.tip-modal .toast-modal {
    width: 520px;
    max-width: 90vw;
}

/* Tip 弹窗 - 明亮版 */
.tip-modal .toast-modal {
    background: #ffffff !important;
    color: #1a1f2e !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
.tip-modal .toast-title {
    color: #d4a843 !important;
}
.tip-modal .toast-body {
    color: #1a1f2e !important;
}
.tip-modal .toast-icon-wrap {
    background: linear-gradient(135deg, #fff5e0 0%, #ffe8b0 100%) !important;
    border-color: #d4a843 !important;
}
.tip-modal .toast-icon-wrap svg {
    stroke: #d4a843 !important;
}
.tip-modal .toast-footer {
    border-top-color: #e8e6e3 !important;
}
.modal-center.tip-modal::before {
    background: rgba(0,0,0,0.35) !important;
}

/* 投注区按钮：三等分铺满一行 */
.action-bar {
    flex-wrap: nowrap !important;
    gap: 6px;
}
.action-bar > button {
    flex: 1 1 0 !important;
    min-width: 0;
    justify-content: center;
    font-size: 12px !important;
    padding: 10px 4px !important;
    gap: 3px;
}
.action-bar > button svg { width: 14px; height: 14px; }
.action-bar .btn-calculate {
    margin-left: 0 !important;
    padding: 10px 4px !important;
    font-size: 12px !important;
}
.action-bar-4 > button {
    flex: 1 1 0 !important;
    font-size: 12px !important;
    padding: 10px 4px !important;
}

/* ===== 记录按钮角标 ===== */
.record-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 4px;
    background: #ef4444;
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* ===== 记录抽屉 ===== */
.records-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

.records-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: #1a1f2e;
    border-left: 1px solid #2a3040;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.records-drawer.drawer-open {
    transform: translateX(0);
}

.records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a3040;
    flex-shrink: 0;
}

.records-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #e8e6e3;
}

.records-count {
    font-size: 12px;
    color: #8b95a5;
    font-weight: 400;
    background: #0f1419;
    padding: 2px 8px;
    border-radius: 10px;
}

.records-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.records-clear {
    background: transparent;
    border: 1px solid #2a3040;
    color: #8b95a5;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.records-clear:hover {
    color: #ef4444;
    border-color: #ef4444;
}

.records-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #8b95a5;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.records-close:hover { color: #e8e6e3; }

/* 记录列表 */
.records-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.records-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #8b95a5;
    text-align: center;
}
.records-empty svg {
    margin-bottom: 12px;
    opacity: 0.4;
}
.records-empty p {
    font-size: 15px;
    margin-bottom: 6px;
    color: #e8e6e3;
}
.records-empty span {
    font-size: 12px;
    opacity: 0.7;
}

/* 记录卡片 */
.record-card {
    background: #0f1419;
    border: 1px solid #2a3040;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.record-card:hover {
    border-color: #d4a843;
    transform: translateY(-1px);
}

.record-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.record-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #e8e6e3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-card-status {
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.status-pending { background: rgba(74, 158, 255, 0.15); color: #4a9eff; }
.status-running { background: rgba(212, 168, 67, 0.15); color: #d4a843; }
.status-done { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.record-retry-btn {
    flex: 0 0 auto;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #1a1610;
    background: linear-gradient(135deg, #d4a843 0%, #c49a38 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.record-retry-btn:hover { opacity: 0.9; }
.record-retry-btn:active { transform: scale(0.96); }
.record-retry-btn:disabled { opacity: 0.55; cursor: default; }

.record-card-desc {
    font-size: 12px;
    color: #8b95a5;
    line-height: 1.5;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.record-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #8b95a5;
    padding-top: 10px;
    border-top: 1px solid #2a3040;
}

.record-card-result {
    display: flex;
    gap: 12px;
    font-size: 11px;
}
.record-card-result .item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.record-card-result .label { color: #8b95a5; }
.record-card-result .value { color: #e8e6e3; font-weight: 500; }
.record-card-result .profit.win { color: #22c55e; }
.record-card-result .profit.lose { color: #ef4444; }

.record-card-del {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.record-card:hover .record-card-del { opacity: 1; }

/* 加载中动画 */
.record-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(212, 168, 67, 0.3);
    border-top-color: #d4a843;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 记录详情弹窗 */
.record-detail-modal {
    width: 92vw;
    max-width: 680px;
    max-height: 85vh;
    background: #1a1f2e;
    border: 1px solid #2a3040;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.detail-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-title {
    font-size: 16px;
    font-weight: 600;
    color: #e8e6e3;
}

.detail-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.record-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-section {
    margin-bottom: 20px;
}
.detail-section:last-child { margin-bottom: 0; }

.detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #d4a843;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #d4a843;
    border-radius: 2px;
}

.detail-text {
    font-size: 13px;
    color: #e8e6e3;
    line-height: 1.7;
    background: #0f1419;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #2a3040;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 加入记录按钮 */
.btn-add-record {
    background: linear-gradient(135deg, #4a9eff, #2563eb);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: filter 0.2s;
    flex: 1;
    justify-content: center;
}
.btn-add-record:hover { filter: brightness(1.1); }
.btn-add-record:active { transform: scale(0.97); }

.form-label {
    display: block;
    font-size: 13px;
    color: #8b95a5;
    margin-bottom: 8px;
}
.form-tip {
    font-size: 12px;
    color: #8b95a5;
    line-height: 1.5;
}

/* 备注编辑 */
.record-edit-remark {
    background: transparent;
    border: 1px solid #d4a843;
    color: #e8e6e3;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    outline: none;
}

/* ================================================================
   会员中心（我的 / 登录 / 套餐 / 订单）
   ================================================================ */

/* 全屏页面 */
.page-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #0f1419;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: pageIn 0.25s ease-out;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- 我的页面 ---------- */
.profile-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(64px + env(safe-area-inset-bottom));
}

/* 会员身份卡 */
.vip-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.vip-card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 140% at 85% -20%, rgba(240,217,138,0.35) 0%, rgba(212,168,67,0.12) 35%, rgba(26,31,46,0.9) 70%),
    linear-gradient(135deg, #232838 0%, #161b29 100%);
  border: 1px solid rgba(212,168,67,0.45);
}
.vip-card.is-member .vip-card-bg {
  background:
    radial-gradient(130% 150% at 80% -20%, rgba(240,217,138,0.55) 0%, rgba(212,168,67,0.22) 40%, rgba(30,26,18,0.95) 75%),
    linear-gradient(135deg, #2b2616 0%, #1a1710 100%);
  border: 1px solid rgba(240,217,138,0.7);
}
.vip-card-inner { position: relative; padding: 20px 18px; }
.vip-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vip-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vip-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #1a1f2e;
  background: linear-gradient(135deg, #f0d98a, #d4a843);
  box-shadow: 0 4px 12px rgba(212,168,67,0.4);
  overflow: hidden;
}
.avatar-logo-img {
  width: 100%; height: 100%; border-radius: 50%;
  display: block; object-fit: cover;
}
.vip-userinfo { min-width: 0; }
.vip-name {
  font-size: 18px; font-weight: 700; color: #f5f3ef;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: rgba(139,149,165,0.18); color: #8b95a5;
  border: 1px solid rgba(139,149,165,0.3);
}
.vip-card.is-member .vip-badge {
  background: linear-gradient(135deg, rgba(240,217,138,0.25), rgba(212,168,67,0.15));
  color: #f0d98a; border-color: rgba(240,217,138,0.5);
}
.vip-crown { font-size: 13px; }
.vip-login-btn {
  flex: 0 0 auto;
  padding: 8px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #f0d98a, #d4a843);
  color: #1a1f2e; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(212,168,67,0.35);
}
.vip-login-btn:active { transform: scale(0.96); }

.vip-expire {
  margin-top: 10px; font-size: 12px; color: #c9b470;
}
.vip-quota {
  margin-top: 18px;
  display: flex; align-items: flex-end; justify-content: space-between;
  border-top: 1px solid rgba(212,168,67,0.18);
  padding-top: 16px;
}
.quota-block { }
.quota-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 34px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #f5e3a0, #d4a843);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.quota-num.low { background: linear-gradient(135deg, #ff8a8a, #ef4444); -webkit-background-clip: text; background-clip: text; }
.quota-label { font-size: 12px; color: #8b95a5; margin-top: 6px; }
.quota-recharge {
  padding: 10px 20px; border-radius: 22px;
  background: linear-gradient(135deg, #f0d98a, #d4a843);
  color: #1a1f2e; font-size: 14px; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 6px 16px rgba(212,168,67,0.4);
}
.quota-recharge:active { transform: scale(0.96); }

/* 会员推广条 */
.member-promo {
  margin-top: 14px;
  padding: 14px 16px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(120deg, rgba(212,168,67,0.16), rgba(212,168,67,0.05));
  border: 1px solid rgba(212,168,67,0.35);
  cursor: pointer;
}
.member-promo:active { transform: scale(0.99); }
.promo-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.promo-crown {
  font-size: 22px; color: #f0d98a;
  filter: drop-shadow(0 2px 6px rgba(240,217,138,0.5));
}
.promo-title { font-size: 14px; font-weight: 700; color: #f0d98a; }
.promo-sub { font-size: 11px; color: #8b95a5; margin-top: 2px; }
.promo-arrow { font-size: 22px; color: #d4a843; }

/* 功能菜单 */
.profile-menu { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.menu-group {
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 12px;
  overflow: hidden;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid #232a3a;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: rgba(212,168,67,0.06); }
.menu-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: #232a3a;
}
.menu-icon-gold { background: rgba(212,168,67,0.18); }
.menu-icon-blue { background: rgba(74,158,255,0.18); color: #4a9eff; }
.menu-text { flex: 1; font-size: 15px; color: #e8e6e3; }
.menu-extra { font-size: 12px; color: #8b95a5; }
.menu-arrow { font-size: 18px; color: #5a6472; }

.profile-version { text-align: center; color: #4a5362; font-size: 12px; margin-top: 24px; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { max-width: 400px; margin: 0 auto; padding: 20px 24px calc(64px + env(safe-area-inset-bottom)); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth-back { position: absolute; top: 18px; left: 18px; color: #8b95a5; font-size: 16px; cursor: pointer; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-mark {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; color: #1a1f2e;
  background: linear-gradient(135deg, #f0d98a, #d4a843);
  box-shadow: 0 10px 28px rgba(212,168,67,0.4);
  overflow: hidden;
}
.auth-logo-img {
  width: 100%; height: 100%; border-radius: 18px; display: block;
}
.auth-title { font-size: 26px; font-weight: 800; color: #f5f3ef; letter-spacing: 2px; }
.auth-slogan { font-size: 13px; color: #8b95a5; margin-top: 8px; }
.auth-tabs { display: flex; background: #1a1f2e; border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 12px; border: none; background: transparent;
  color: #8b95a5; font-size: 15px; font-weight: 600; border-radius: 9px; cursor: pointer;
}
.auth-tab.active {
  background: linear-gradient(135deg, #f0d98a, #d4a843); color: #1a1f2e;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field {
  display: flex; align-items: center; gap: 10px;
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 12px;
  padding: 0 14px;
}
.auth-field:focus-within { border-color: rgba(212,168,67,0.6); }
.auth-field-icon { font-size: 16px; }
.auth-field input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #e8e6e3; font-size: 16px; padding: 15px 0;
}
.auth-field input::placeholder { color: #5a6472; }
.auth-submit {
  margin-top: 8px; padding: 16px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #f0d98a, #d4a843);
  color: #1a1f2e; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 20px rgba(212,168,67,0.35);
}
.auth-submit:active { transform: scale(0.98); }
.auth-tip { text-align: center; font-size: 11px; color: #5a6472; margin-top: 6px; }

/* ---------- 套餐页 ---------- */
.plans-wrap { max-width: 640px; margin: 0 auto; padding: 0 16px calc(64px + env(safe-area-inset-bottom)); }
.plans-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 16px 0; background: #0f1419;
}
.plans-back { position: absolute; left: 0; color: #8b95a5; font-size: 16px; cursor: pointer; }
.plans-title { font-size: 17px; font-weight: 700; color: #f5f3ef; }
.plans-tabs { display: flex; gap: 10px; margin: 8px 0 18px; }
.plans-tab {
  flex: 1; padding: 12px; border-radius: 10px;
  background: #1a1f2e; border: 1px solid #2a3040;
  color: #8b95a5; font-size: 14px; font-weight: 600; cursor: pointer;
}
.plans-tab.active {
  background: linear-gradient(135deg, rgba(240,217,138,0.2), rgba(212,168,67,0.1));
  border-color: rgba(212,168,67,0.6); color: #f0d98a;
}
.plans-list { display: flex; flex-direction: column; gap: 14px; }

/* 套餐卡片 */
.plan-card {
  position: relative;
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 14px;
  padding: 18px; cursor: pointer; overflow: hidden;
}
.plan-card:active { transform: scale(0.99); }
.plan-card.recommend {
  border-color: rgba(212,168,67,0.7);
  background: linear-gradient(120deg, rgba(212,168,67,0.12), #1a1f2e 60%);
  box-shadow: 0 6px 20px rgba(212,168,67,0.15);
}
.plan-card.forever {
  border-color: rgba(240,217,138,0.8);
  background: linear-gradient(120deg, rgba(240,217,138,0.18), #141009 65%);
}
.plan-tag {
  position: absolute; top: 0; right: 0;
  padding: 4px 14px; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, #f0d98a, #d4a843); color: #1a1f2e;
  border-radius: 0 14px 0 12px;
}
.plan-tag.hot { background: linear-gradient(135deg, #ff9d6c, #ef4444); color: #fff; }
.plan-name { font-size: 18px; font-weight: 800; color: #f5f3ef; display: flex; align-items: center; gap: 8px; }
.plan-crown { color: #f0d98a; }
.plan-price { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; }
.plan-price .cur { font-size: 15px; color: #f0d98a; font-weight: 700; }
.plan-price .amt { font-size: 30px; font-weight: 800; color: #f0d98a; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.plan-price .unit { font-size: 12px; color: #8b95a5; }
.plan-quota {
  margin-top: 12px; padding: 10px 12px; border-radius: 9px;
  background: rgba(212,168,67,0.08); font-size: 13px; color: #e8c870;
}
.plan-desc { margin-top: 8px; font-size: 12px; color: #8b95a5; line-height: 1.6; }
.plan-buy {
  margin-top: 14px; width: 100%; padding: 12px; border-radius: 10px;
  background: linear-gradient(135deg, #f0d98a, #d4a843); color: #1a1f2e;
  font-size: 15px; font-weight: 800; border: none; cursor: pointer;
}
.plan-buy:active { transform: scale(0.98); }
.plan-buy.owned { background: #232a3a; color: #5a6472; cursor: default; }
.plans-note { margin-top: 18px; font-size: 11px; color: #5a6472; line-height: 1.7; text-align: center; }

/* ---------- 订单确认 ---------- */
.order-wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 100px; }
.order-card {
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 14px;
  padding: 22px; text-align: center; margin-bottom: 16px;
}
.order-item-title { font-size: 19px; font-weight: 800; color: #f5f3ef; }
.order-item-desc { font-size: 13px; color: #8b95a5; margin-top: 10px; line-height: 1.7; }
.order-item-amount { margin-top: 16px; font-size: 34px; font-weight: 800; color: #f0d98a; font-family: 'JetBrains Mono', monospace; }
.pay-methods { background: #1a1f2e; border: 1px solid #2a3040; border-radius: 14px; padding: 8px 16px; }
.pay-method-title { font-size: 13px; color: #8b95a5; padding: 12px 0 4px; }
.pay-method { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; border-bottom: 1px solid #232a3a; }
.pay-method:last-child { border-bottom: none; }
.pay-method input { width: 18px; height: 18px; accent-color: #d4a843; }
.pay-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: #fff; }
.pay-wechat { background: #07c160; }
.pay-alipay { background: #1677ff; }
.pay-name { flex: 1; font-size: 15px; color: #e8e6e3; }
.order-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #161b29; border-top: 1px solid #2a3040;
}
.order-total { font-size: 14px; color: #8b95a5; }
.order-total span { font-size: 24px; font-weight: 800; color: #f0d98a; font-family: 'JetBrains Mono', monospace; margin-left: 6px; }
.order-pay-btn {
  padding: 13px 34px; border-radius: 24px; border: none;
  background: linear-gradient(135deg, #f0d98a, #d4a843); color: #1a1f2e;
  font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 16px rgba(212,168,67,0.4);
}
.order-pay-btn:active { transform: scale(0.97); }

/* ---------- 订单列表 ---------- */
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-row {
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 12px; padding: 16px;
}
.order-row-top { display: flex; justify-content: space-between; align-items: center; }
.order-row-title { font-size: 15px; font-weight: 700; color: #e8e6e3; }
.order-row-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 14px; }
.order-row-status.paid { background: rgba(34,197,94,0.15); color: #22c55e; }
.order-row-status.pending { background: rgba(239,177,68,0.15); color: #efb144; }
.order-row-meta { font-size: 12px; color: #8b95a5; margin-top: 8px; display: flex; justify-content: space-between; }
.order-row-amt { font-size: 18px; font-weight: 800; color: #f0d98a; font-family: 'JetBrains Mono', monospace; }
.orders-empty { text-align: center; color: #5a6472; padding: 60px 0; font-size: 14px; }

/* ================================================================
   计算结果 - 手风琴折叠分组
   ================================================================ */
.acc-group {
  border: 1px solid #2a3040;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #161b29;
  overflow: hidden;
}
.acc-group.open {
  border-color: rgba(212,168,67,0.45);
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}

/* 组标题条（收起态可见） */
.acc-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.acc-header:active { background: rgba(212,168,67,0.08); }
.acc-chevron { margin-top: 4px; }
.acc-num { margin-top: 1px; }
.acc-chevron {
  flex: 0 0 auto;
  font-size: 13px;
  color: #8b95a5;
  transition: transform 0.2s ease;
  width: 12px;
  text-align: center;
}
.acc-group.open .acc-chevron {
  transform: rotate(90deg);
  color: #d4a843;
}
.acc-num {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  color: #d4a843;
  font-weight: 700;
  width: 30px;
  text-align: center;
}
.acc-group.open .acc-num { color: #f0d98a; }
.acc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 折叠条标题：原文完整展示、自动换行，不再单行省略截断 */
.acc-raw {
  font-size: 14px;
  color: #e8e6e3;
  font-weight: 600;
  white-space: normal;
  word-break: break-all;
  line-height: 1.55;
  padding-right: 4px;
}
.acc-raw-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.acc-copy {
  flex: 0 0 auto;
  margin-top: 2px;
  background: none;
  border: 1px solid #2a3040;
  color: #8b95a5;
  font-size: 11px;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.acc-copy:hover { border-color: rgba(212,168,67,0.5); color: #d4a843; }
.acc-cols {
  display: flex;
  align-items: center;
  gap: 6px;
}
.acc-col {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #232a3a;
  border-radius: 7px;
  padding: 5px 9px;
  min-width: 0;
}
.acc-col em {
  font-style: normal;
  font-size: 11px;
  color: #8b95a5;
  flex: 0 0 auto;
}
.acc-col b {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #e8e6e3;
  white-space: nowrap;
}
.acc-col .acc-cost { color: #8b95a5; }
.acc-col .acc-win.green { color: #4a9eff; }
.acc-col .acc-pnl.green { color: #22c55e; }
.acc-col .acc-pnl.red { color: #ef4444; }

/* 折叠体 */
.acc-body {
  display: none;
  padding: 0 10px 12px;
  animation: accOpen 0.2s ease-out;
}
.acc-group.open .acc-body { display: block; }
@keyframes accOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 展开后内部卡片去掉重复边框 */
.acc-body .result-group-card {
  border: none; border-radius: 0; margin: 0;
  background: transparent;
}
.acc-body .result-group-header { display: none; }
.acc-body .parse-group-raw {
  background: #1a1f2e; border-left: 2px solid #d4a843;
  border-radius: 6px; margin: 2px 0 10px;
}

/* 展开全部/收起全部 操作条 */
.acc-toolbar {
  display: flex; justify-content: flex-end; gap: 12px;
  margin: 0 2px 10px;
}
.acc-tool-btn {
  background: none; border: 1px solid #2a3040; color: #8b95a5;
  font-size: 12px; padding: 5px 12px; border-radius: 14px; cursor: pointer;
}
.acc-tool-btn:active { border-color: rgba(212,168,67,0.5); color: #d4a843; }

/* ===== 人工修复 ===== */
/* 组内操作条：修复 / 重置回引擎 */
.fix-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 10px;
  flex-wrap: wrap;
}
.fix-btn {
  background: rgba(212,168,67,0.12);
  border: 1px solid rgba(212,168,67,0.45);
  color: #f0d98a;
  font-size: 12px; font-weight: 600;
  padding: 6px 16px; border-radius: 6px; cursor: pointer;
  transition: background .15s ease;
}
.fix-btn:hover { background: rgba(212,168,67,0.22); }
.fix-reset-btn {
  background: none; border: 1px solid #2a3040; color: #8b95a5;
  font-size: 12px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
}
.fix-reset-btn:hover { border-color: rgba(239,68,68,0.5); color: #ef4444; }
.fix-manual-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, rgba(212,168,67,0.25), rgba(184,145,46,0.15));
  border: 1px solid rgba(212,168,67,0.6);
  color: #f0d98a; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 10px;
}

/* 修复面板 */
.fix-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(212,168,67,0.35);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.fix-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fix-row {
  display: grid;
  grid-template-columns: 52px 120px 1fr 78px 56px 30px;
  gap: 8px; align-items: center;
}
.fix-row select.fix-region { text-align: center; text-align-last: center; font-weight: 700; }
.fix-row.fix-row-head {
  font-size: 11px; color: #8b95a5;
}
.fix-row select,
.fix-row input {
  width: 100%;
  background: #141a28;
  border: 1px solid #2a3040;
  color: #e8e6e3;
  font-size: 13px;
  padding: 7px 8px;
  border-radius: 6px;
  box-sizing: border-box;
}
.fix-row select:focus,
.fix-row input:focus { outline: none; border-color: rgba(212,168,67,0.6); }
.fix-row .fix-check {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #8b95a5; justify-content: center;
}
.fix-row .fix-check input { width: auto; }
.fix-row.fix-voided select,
.fix-row.fix-voided input { opacity: 0.45; text-decoration: line-through; }
.fix-del {
  background: none; border: 1px solid #3a2a2a; color: #c06060;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font-size: 14px; line-height: 1;
}
.fix-del:hover { border-color: #ef4444; color: #ef4444; }
.fix-type-hint {
  grid-column: 2; font-size: 10px; color: #6b7488; margin-top: -4px;
}
.fix-panel-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.fix-save {
  background: linear-gradient(135deg, #d4a843, #b8912e);
  color: #1a1205; border: none; font-size: 13px; font-weight: 700;
  padding: 8px 22px; border-radius: 6px; cursor: pointer;
}
.fix-add {
  background: rgba(74,158,255,0.12); border: 1px solid rgba(74,158,255,0.4);
  color: #7cb8ff; font-size: 12px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
}
.fix-cancel {
  background: none; border: 1px solid #2a3040; color: #8b95a5;
  font-size: 12px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
}
.fix-sumline { font-size: 12px; color: #8b95a5; margin-left: auto; }
.fix-sumline b { color: #f0d98a; font-family: 'JetBrains Mono', monospace; }

/* 按原文快速重解析 */
.fix-reparse {
  background: rgba(212,168,67,0.07);
  border: 1px solid rgba(212,168,67,0.28);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.fix-reparse-h {
  font-size: 12.5px; font-weight: 700; color: #f0d98a; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.fix-reparse-text {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: #141a28; border: 1px solid #2a3040; color: #e8e6e3;
  font-size: 13px; line-height: 1.5; padding: 8px 10px; border-radius: 6px;
  font-family: inherit;
}
.fix-reparse-text:focus { outline: none; border-color: rgba(212,168,67,0.6); }
.fix-reparse-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap;
}
.fix-reparse-btn {
  background: linear-gradient(135deg, #d4a843, #b8912e);
  color: #1a1205; border: none; font-size: 12.5px; font-weight: 700;
  padding: 7px 16px; border-radius: 6px; cursor: pointer;
}
.fix-reparse-btn:disabled { opacity: 0.6; cursor: default; }
.fix-reparse-msg { font-size: 11.5px; color: #8b95a5; }
.fix-reparse-msg.ok { color: #4ade80; }
.fix-reparse-msg.err { color: #f87171; }

/* ===== 分享按钮 ===== */
.summary-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.summary-head-title { font-size: 17px; font-weight: 700; color: #e8e6e3; }
.btn-share {
  background: linear-gradient(135deg, #d4a843, #b8912e);
  color: #1a1205; border: none; font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-share::before { content: '↗'; font-size: 14px; font-weight: 700; }
.btn-share:hover { box-shadow: 0 4px 16px rgba(212,168,67,0.35); }
.btn-share:active { transform: scale(0.96); }

/* ===== 分享弹窗 ===== */
.share-modal {
  position: fixed; inset: 0; z-index: 2000; display: none;
  align-items: center; justify-content: center;
}
.share-modal.show { display: flex; }
.share-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.share-card {
  position: relative; z-index: 1;
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 10px;
  padding: 20px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.share-title { color: #f0d98a; font-size: 16px; font-weight: 700; margin-bottom: 14px; text-align: center; }
.share-card img { width: 100%; max-width: 420px; border-radius: 8px; display: block; }
.share-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: center; }
.share-btn {
  padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
.share-btn.gold { background: linear-gradient(135deg, #d4a843, #b8912e); color: #1a1205; border: none; }
.share-btn.ghost { background: none; border: 1px solid #2a3040; color: #8b95a5; }
.share-btn:active { transform: scale(0.97); }

/* 分享弹窗内的常驻保存提示条（点保存后显示，不自动消失） */
.share-tip {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.share-tip.ok {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}
.share-tip.warn {
    background: rgba(212, 168, 67, 0.14);
    border: 1px solid rgba(212, 168, 67, 0.45);
    color: #f0d98a;
}

/* ========== 我的页 · 会员中心四卡 ========== */
.member-center {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 18px 16px;
    margin-bottom: 14px;
}
.mc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.mc-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mc-crown { color: var(--accent-gold); }
.mc-state {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    padding: 3px 12px;
}
.mc-state.on { color: var(--accent-gold); background: var(--accent-gold-dim); }

/* ========== 今日额度概览 ========== */
.mc-usage {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card-inner);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.mcu-item { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mcu-ico {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 2px;
}
.mcu-ico-daily { background: rgba(240,180,41,0.14); border: 1px solid rgba(240,180,41,0.35); }
.mcu-ico-pack { background: rgba(251,146,60,0.14); border: 1px solid rgba(251,146,60,0.35); }
.mcu-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.mcu-label { font-size: 12px; color: var(--text-secondary); }
.mcu-sep { width: 1px; align-self: stretch; background: var(--border-card); }

/* ========== 时间会员对比表 ========== */
.plan-list { margin-bottom: 14px; }
.plan-table {
    width: 100%;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.plan-tr {
    display: grid;
    grid-template-columns: 1.7fr 1fr 0.8fr 1fr 0.72fr;
    align-items: center;
    gap: 6px;
    padding: 12px 12px;
    font-size: 13px;
}
@media (max-width: 420px) {
    .plan-tr { padding: 10px 8px; gap: 4px; font-size: 12px; }
    .pt-ico { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
    .pt-name { font-size: 13px; }
    .pt-price { font-size: 15px; }
    .pt-redeem-btn { padding: 6px 10px; font-size: 12px; }
    .pt-col-name { gap: 6px; }
}
.plan-th {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--border-card);
}
.plan-td + .plan-td { border-top: 1px solid var(--border-card); }
.plan-td.rec {
    background: linear-gradient(90deg, rgba(212,168,67,0.16), rgba(212,168,67,0.03));
}
/* 套餐列：图标徽章 + 名称 */
.pt-col-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pt-ico {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border-card);
}
.pt-ico.ico-monthly   { background: linear-gradient(135deg, rgba(96,165,250,0.22), rgba(96,165,250,0.06)); border-color: rgba(96,165,250,0.4); }
.pt-ico.ico-quarterly { background: linear-gradient(135deg, rgba(167,139,250,0.22), rgba(167,139,250,0.06)); border-color: rgba(167,139,250,0.4); }
.pt-ico.ico-yearly    { background: linear-gradient(135deg, rgba(240,180,41,0.28), rgba(240,180,41,0.08)); border-color: rgba(240,180,41,0.5); }
.pt-ico.ico-pack_once { background: linear-gradient(135deg, rgba(251,146,60,0.22), rgba(251,146,60,0.06)); border-color: rgba(251,146,60,0.4); }
.pt-namewrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pt-name { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.pt-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pt-tags .pl-badge, .pt-tags .pt-rec, .pt-tags .pl-owned { margin-left: 0; }
.pl-badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
    font-weight: 600;
    white-space: nowrap;
}
.pt-rec {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f0b429, #d4a843);
    color: #1a1205;
    font-weight: 700;
    white-space: nowrap;
}
.pl-owned {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
    font-weight: 700;
    white-space: nowrap;
}
/* 价格 / 数据列 */
.pt-col-price { color: var(--accent-gold); display: flex; flex-direction: column; gap: 2px; }
.pt-price { font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.pt-period { font-size: 11px; color: var(--text-secondary); }
.pt-col-daily, .pt-col-total { color: var(--text-primary); font-weight: 600; }
.pt-na { color: var(--text-secondary); font-weight: 400; }
.pt-forever {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    background: rgba(212,168,67,0.12);
    border: 1px solid rgba(212,168,67,0.3);
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
}
/* 操作列：兑换按钮 */
.pt-col-op { display: flex; justify-content: flex-end; }
.pt-redeem-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--accent-gold);
    background: rgba(212,168,67,0.1);
    color: var(--accent-gold);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s;
}
.pt-redeem-btn:hover { background: rgba(212,168,67,0.22); }
.pt-redeem-btn:active { transform: scale(0.95); }

/* ========== 卡密兑换弹窗 ========== */
.redeem-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.redeem-mask {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 20, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.redeem-dialog {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: linear-gradient(170deg, #18243a, #111a2b);
    border: 1px solid rgba(212,168,67,0.35);
    border-radius: 18px;
    padding: 26px 22px 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,168,67,0.12) inset;
    animation: redeemPop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes redeemPop {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.redeem-close {
    position: absolute;
    top: 12px; right: 14px;
    width: 30px; height: 30px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.redeem-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.redeem-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
}
.redeem-key { font-size: 22px; }
.redeem-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.redeem-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-input);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: 1px;
    outline: none;
    margin-bottom: 12px;
}
.redeem-input:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(212,168,67,0.15); }
.redeem-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    font-weight: 800;
    color: #1a1205;
    background: linear-gradient(135deg, #f0a828, #e0890f);
    box-shadow: 0 8px 20px rgba(224,137,15,0.32);
    cursor: pointer;
}
.redeem-btn:disabled { opacity: 0.6; }
.redeem-btn:active { transform: scale(0.985); }

/* ========== 规则提示 ========== */
.plan-rules {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-card-inner);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.plan-rule {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.pr-ico { flex-shrink: 0; }
.plan-rule b { color: var(--text-primary); font-weight: 700; }

/* ========== 菜单彩色方块图标 ========== */
.menu-icon-green { background: rgba(34,197,94,0.18); color: #22c55e; }
.menu-icon-purple { background: rgba(124,58,237,0.2); color: #a78bfa; }

/* ========== 资讯中心 ========== */
.news-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px calc(72px + env(safe-area-inset-bottom));
}
.news-header { text-align: center; margin-bottom: 16px; }
.news-title {
    font-size: 22px; font-weight: 700; color: #f5f3ef;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.news-logo {
    width: 30px; height: 30px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; color: #1a1f2e;
    background: linear-gradient(135deg, #f0d98a, #d4a843);
    box-shadow: 0 4px 12px rgba(212,168,67,0.4);
}
.news-subtitle { margin-top: 4px; font-size: 12.5px; color: #8b95a5; letter-spacing: 2px; }

/* Banner */
.news-banner {
    position: relative; overflow: hidden;
    border-radius: 14px; margin-bottom: 18px;
    border: 1px solid rgba(212,168,67,0.4);
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.news-banner-glow {
    position: absolute; inset: 0;
    background:
        radial-gradient(120% 150% at 88% -20%, rgba(240,217,138,0.42) 0%, rgba(212,168,67,0.14) 38%, rgba(26,31,46,0.92) 72%),
        linear-gradient(135deg, #232838 0%, #161b29 100%);
}
.news-banner-inner { position: relative; padding: 20px 18px; }
.nb-tag {
    display: inline-block; font-size: 11px; font-weight: 700;
    color: #1a1f2e; background: linear-gradient(135deg, #f0d98a, #d4a843);
    padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.nb-headline { font-size: 21px; font-weight: 700; color: #fbf7ec; line-height: 1.35; }
.nb-desc { margin-top: 8px; font-size: 13px; color: #c7c2b8; line-height: 1.6; }
.nb-btn {
    margin-top: 14px; font-size: 13.5px; font-weight: 600;
    color: #1a1f2e; background: linear-gradient(135deg, #f0d98a, #d4a843);
    border: none; border-radius: 999px; padding: 9px 20px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(212,168,67,0.35);
    transition: transform 0.18s ease-out;
}
.nb-btn:active { transform: scale(0.96); }

/* 分类筛选 */
.news-cats {
    display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.news-cats::-webkit-scrollbar { display: none; }
.nw-cat {
    flex: 0 0 auto; font-size: 13px; color: #b8c0cc;
    background: #1a1f2e; border: 1px solid #2a3040;
    padding: 7px 15px; border-radius: 999px; cursor: pointer;
    transition: all 0.18s ease-out;
}
.nw-cat.active {
    color: #1a1f2e; font-weight: 700;
    background: linear-gradient(135deg, #f0d98a, #d4a843);
    border-color: rgba(212,168,67,0.6);
}

/* 置顶速查 */
.news-pin-label { font-size: 13px; font-weight: 600; color: #d4a843; margin: 4px 2px 10px; }
.news-pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.nw-pin {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: #1a1f2e; border: 1px solid #2a3040; border-radius: 12px;
    padding: 14px 6px; cursor: pointer; text-align: center;
    transition: transform 0.18s ease-out, border-color 0.18s ease-out;
}
.nw-pin:active { transform: scale(0.96); border-color: rgba(212,168,67,0.5); }
.nw-pin-ico { font-size: 24px; line-height: 1; }
.nw-pin-name { font-size: 14px; font-weight: 700; color: #f5f3ef; margin-top: 2px; }
.nw-pin-desc { font-size: 11px; color: #8b95a5; }

/* 资讯卡片 */
.news-feed { display: flex; flex-direction: column; gap: 12px; }
.nw-card {
    background: #1a1f2e; border: 1px solid #2a3040; border-radius: 12px;
    padding: 14px 15px; transition: border-color 0.18s ease-out;
}
.nw-card.nw-open { border-color: rgba(212,168,67,0.45); }
.nw-card-head { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.nw-card-ico {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; background: rgba(212,168,67,0.12); border: 1px solid rgba(212,168,67,0.25);
}
.nw-card-title { font-size: 15px; font-weight: 600; color: #f0eee9; line-height: 1.4; flex: 1; }
.nw-hot {
    flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #ff7a59, #e0482d);
    padding: 2px 7px; border-radius: 6px;
}
.nw-card-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 10px; padding-top: 9px; border-top: 1px dashed #2a3040;
    cursor: pointer;
}
.nw-card-meta > span:first-child { font-size: 12px; color: #8b95a5; }
.nw-toggle { font-size: 12.5px; color: #d4a843; font-weight: 600; }
.nw-card-body { margin-top: 12px; animation: nwFade 0.22s ease-out; }
@keyframes nwFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.nw-para { margin-bottom: 14px; }
.nw-para:last-child { margin-bottom: 0; }
.nw-para-h {
    font-size: 13.5px; font-weight: 700; color: #d4a843;
    margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.nw-para-h::before { content: ''; width: 3px; height: 13px; background: #d4a843; border-radius: 2px; }
.nw-para-x { font-size: 13.5px; color: #c9cdd6; line-height: 1.75; }
.nw-para-x b { color: #f0eee9; font-weight: 600; }
.nw-para-x code {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    background: #0f1419; color: #f0d98a;
    padding: 1.5px 6px; border-radius: 5px; border: 1px solid #2a3040;
}
.nw-tip {
    display: flex; gap: 8px; align-items: flex-start;
    background: rgba(212,168,67,0.08); border: 1px solid rgba(212,168,67,0.22);
    border-radius: 9px; padding: 10px 12px; margin-bottom: 12px;
    font-size: 13px; color: #d9d2bf; line-height: 1.65;
}
.nw-tip-ico { flex: 0 0 auto; }
.nw-empty { text-align: center; color: #5a6273; font-size: 13px; padding: 40px 0; }

/* 号码球速查表 */
.nw-balls { display: flex; flex-direction: column; gap: 9px; }
.nw-ball-row { display: flex; align-items: flex-start; gap: 10px; }
.nw-row-label {
    flex: 0 0 44px; height: 26px; line-height: 26px; text-align: center;
    font-size: 12.5px; font-weight: 700; color: #d4a843;
    background: rgba(212,168,67,0.1); border: 1px solid rgba(212,168,67,0.25);
    border-radius: 7px; margin-top: 2px;
}
.nw-row-balls { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.nw-ball {
    width: 29px; height: 29px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600;
}
.nw-ball.ball-red { background: radial-gradient(circle at 30% 30%, #ff6b6b, #c92a2a); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.nw-ball.ball-blue { background: radial-gradient(circle at 30% 30%, #74c0fc, #1864ab); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.nw-ball.ball-green { background: radial-gradient(circle at 30% 30%, #69db7c, #2b8a3e); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.nw-ball.ball-zodiac { background: #2a3040; color: #e8e6e3; border: 1px solid #3a4256; }
.nw-ball.ball-tail { background: #222838; color: #b8c0cc; border: 1px solid #333c4e; }

.news-foot { text-align: center; font-size: 11.5px; color: #5a6273; margin-top: 26px; }

/* ==========================================================
   全平台响应式自适应（安卓 / 苹果 / 平板 / 桌面 / 横竖屏）
   断点：≤768 平板 → ≤640 手机 → ≤480 小手机 → ≤380 极小
   桌面端不在断点内，保持原有宽屏布局不变。
   ========================================================== */

/* —— 全局基础（所有设备）：盒模型、防横向溢出、安全区变量 —— */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; }
body {
    /* iOS 动态视口：地址栏/工具栏伸缩时高度跟随，避免内容被挡 */
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
/* iOS 刘海 / 底部 Home 指示条安全区变量（viewport-fit=cover 时生效） */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* 明细/解析表格：卡片内自适应，禁止横滑条；窄屏列宽收紧、内容换行，全部列一屏可见 */
.parse-group-body,
.result-group-card .parse-table-wrap {
    overflow-x: hidden;
    max-width: 100%;
}
/* 段头长原文在任何宽度都允许换行，不撑破布局 */
.segment-header-row td { white-space: normal !important; word-break: break-word; }
.seg-text { display: inline; word-break: break-word; }
.seg-recovered, .seg-normalized, .seg-error { white-space: normal; word-break: break-word; }

/* 弹层高度统一用动态视口（带 vh 兜底），iOS Safari 地址栏伸缩不挡按钮 */
.modal-sheet { max-height: 92vh; max-height: 92dvh; }
.modal-center .modal-mask { align-items: center; }

/* 触控目标：移动端按钮/可点区域不小于 44px（苹果 HIG / 安卓建议） */
@media (hover: none) and (pointer: coarse) {
    .nav-item,
    button, .fix-reparse-btn, .fix-save, .fix-add, .fix-cancel,
    .acc-arrow, [data-action], .nw-cat, .nw-pin, .nb-btn {
        touch-action: manipulation;
    }
}

/* —— 平板 / 中小屏（≤768px） —— */
@media (max-width: 768px) {
    .main-content { width: 100%; max-width: 640px; margin: 0 auto; }
    .acc-title { word-break: break-word; }
    .acc-header-left { min-width: 0; }
}

/* —— 手机（≤640px，安卓/苹果通用） —— */
@media (max-width: 640px) {
    .main-content { padding-left: 10px; padding-right: 10px; max-width: 100%; }
    .news-wrap, .plans-wrap, .order-wrap { padding-left: 12px; padding-right: 12px; max-width: 100%; }

    /* ===== 结果明细/解析表格：一屏自适应，禁止横向滚动 ===== */
    .parse-table, .result-table { min-width: 0 !important; width: 100%; table-layout: fixed; }
    .result-group-card, .acc-body { overflow-x: hidden; }
    /* 收紧单元格内边距与字号，6 列（地区/类型/内容/金额/赔率/结果）一屏排下 */
    .parse-table th { padding: 6px 4px; font-size: 10px; letter-spacing: 0; }
    .parse-table td { padding: 7px 4px; font-size: 12px; }
    .result-table.result-detail th,
    .result-table.result-detail td { padding: 6px 3px; white-space: normal; word-break: break-word; }
    .result-table.result-detail th { font-size: 10px; }
    /* 徽章紧凑化 */
    .region-badge { padding: 1px 5px; font-size: 11px; }
    .type-badge { padding: 2px 5px; font-size: 10.5px; line-height: 1.3; white-space: normal; }
    .col-value-text { font-size: 11px !important; min-width: 0 !important; word-break: break-word; }
    .col-amount-text { font-size: 11px !important; white-space: nowrap; }
    .result-table .col-odds { font-size: 10.5px; white-space: nowrap; }
    .result-table .col-win { font-size: 11px; white-space: nowrap; }
    /* 明细列宽分配：百分比总和 100%，table-layout:fixed 下严格铺满、右侧不留空 */
    .result-table.result-detail col,
    .parse-table col { }
    .result-table.result-detail th:nth-child(1),
    .result-table.result-detail td:nth-child(1),
    .parse-table .col-region { width: 34px; text-align: center !important; }
    .result-table.result-detail th:nth-child(2),
    .result-table.result-detail td:nth-child(2) { width: 46px; }
    .result-table.result-detail th:nth-child(3),
    .result-table.result-detail td:nth-child(3) { width: auto; }
    .result-table.result-detail th:nth-child(4),
    .result-table.result-detail td:nth-child(4) { width: 50px; text-align: right !important; }
    .result-table.result-detail th:nth-child(5),
    .result-table.result-detail td:nth-child(5) { width: 44px; text-align: center !important; }
    .result-table.result-detail th:nth-child(6),
    .result-table.result-detail td:nth-child(6) { width: 52px; text-align: center !important; }
    /* parse 拆解表（4列）列宽 */
    .parse-table .col-region { width: 30px; }
    .parse-table .col-type { width: auto; }
    .parse-table .col-amount { width: 50px; }
    /* 数字列紧凑，不被内容列挤占 */
    .result-table.result-detail td:nth-child(1),
    .result-table.result-detail td:nth-child(5),
    .result-table.result-detail td:nth-child(6) { padding-left: 1px; padding-right: 1px; }
    .result-table.result-detail td:nth-child(4) { padding-left: 2px; padding-right: 4px; }
    .result-table.result-detail .col-amount-text,
    .result-table.result-detail .col-odds,
    .result-table.result-detail .col-win { letter-spacing: -0.3px; }

    /* 顶部栏 */
    .topbar { padding: 10px 12px; gap: 8px; }
    .brand-title { font-size: 15px; }
    .brand-subtitle { font-size: 10px; }
    .toolbar-buttons, .input-actions { gap: 8px; }

    /* 结果卡统计块 / 标题 */
    .summary-row { gap: 8px; }
    .summary-block { padding: 10px 8px; }
    .summary-label { font-size: 11px; }
    .summary-value { font-size: 16px; }
    .acc-header { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
    .acc-title { font-size: 15px; }

    /* 修复面板：按钮满宽、五行网格压缩为一屏自适应，禁止横滑 */
    .fix-panel { padding: 12px; }
    .fix-reparse-text { font-size: 13px; min-height: 64px; }
    .fix-reparse-actions { gap: 8px; }
    .fix-reparse-btn { width: 100%; justify-content: center; display: inline-flex; }
    .fix-rows { overflow-x: visible; padding-bottom: 4px; }
    .fix-row { grid-template-columns: 40px 84px 1fr 50px 44px 24px; gap: 5px; }
    .fix-row-head { white-space: nowrap; font-size: 10px; gap: 4px; padding: 0; }
    .fix-row select, .fix-row input { padding: 6px 5px; font-size: 12px; }
    .fix-panel-actions { gap: 8px; }
    .fix-save { flex: 1 1 auto; padding: 10px 14px; }
    .fix-add, .fix-cancel { padding: 10px 12px; }
    .fix-sumline { flex-basis: 100%; margin-left: 0; text-align: right; }

    /* 弹窗 / 底部弹层留安全边距 */
    .modal-center .odds-modal,
    .share-card { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
    .modal-header-row { padding: 12px 14px 8px; }
    .modal-body-scroll { padding: 8px 14px 16px; }
    .modal-input-row { padding: 10px 14px; gap: 6px; }
    .modal-text-input { font-size: 14px; min-width: 0; }

    /* 底部导航避开 iOS Home 指示条（安卓安全区为 0，无副作用） */
    .bottom-nav { padding-bottom: var(--safe-bottom); }
    .main-content { padding-bottom: calc(80px + var(--safe-bottom)); }
}

/* —— 小手机（≤480px） —— */
@media (max-width: 480px) {
    .fix-row { grid-template-columns: 36px 76px 1fr 46px 40px 22px; gap: 4px; }
    .fix-row select, .fix-row input { font-size: 12px; padding: 6px 4px; }
    .fix-row .fix-check { font-size: 10px; gap: 2px; }
    /* 四个操作按钮：等宽铺满、紧凑、文字不换行 */
    .action-bar { gap: 6px; }
    .action-bar > button { font-size: 12.5px; padding: 10px 4px; gap: 4px; }
    .action-bar > button svg { width: 15px; height: 15px; }
    /* 表格进一步压缩，保证最窄屏也一屏显示 */
    .parse-table td { padding: 6px 3px; font-size: 11.5px; }
    .result-table.result-detail th,
    .result-table.result-detail td { padding: 5px 2px; }
    .result-table.result-detail td:nth-child(1),
    .result-table.result-detail th:nth-child(1) { width: 30px; }
    .result-table.result-detail td:nth-child(2),
    .result-table.result-detail th:nth-child(2) { width: 48px; }
    .type-badge { font-size: 10px; padding: 1px 4px; }
    .col-value-text { font-size: 10.5px !important; }
    .col-amount-text { font-size: 10.5px !important; }
    .result-table .col-win { font-size: 10.5px; }
    .nw-pin-grid { gap: 8px; }
    .nb-headline { font-size: 19px; }
}

/* —— 极小屏（≤380px，如 iPhone SE1 / 小尺寸安卓） —— */
@media (max-width: 380px) {
    .main-content { padding-left: 8px; padding-right: 8px; }
    .fix-row { grid-template-columns: 34px 70px 1fr 42px 38px 20px; gap: 4px; }
    .fix-row select, .fix-row input { font-size: 11.5px; padding: 5px 3px; }
    .fix-row .fix-check { font-size: 9px; }
    .fix-row-head { display: none; }
    /* 极小屏表格极限压缩 */
    .parse-table td, .result-table.result-detail td { font-size: 11px; padding: 5px 2px; }
    .result-table.result-detail th, .parse-table th { font-size: 9px; padding: 4px 2px; }
    .type-badge { font-size: 9.5px; padding: 1px 3px; }
    .region-badge { font-size: 10px; padding: 1px 4px; }
    .col-value-text { font-size: 10px !important; }
    .col-amount-text, .result-table .col-win { font-size: 10px !important; }
    .summary-value { font-size: 15px; }
    .brand-title { font-size: 14px; }
}

/* —— 横屏 / 矮屏（手机横过来高度不足）：弹层用更高比例、顶部栏压缩 —— */
@media (max-height: 480px) and (orientation: landscape) {
    .modal-sheet { max-height: 96vh; max-height: 96dvh; }
    .modal-header-row { padding-top: 8px; padding-bottom: 6px; }
    .topbar { padding-top: 6px; padding-bottom: 6px; }
    .bottom-nav { height: 52px; }
    .nav-label { font-size: 10px; }
}

/* ================================================================
   全站移动端兜底自适应（安卓 / 苹果，所有页面所有按钮）
   原则：≤640px 手机档，所有横向排布按钮等分铺满、不溢出、不竖排；
   所有弹层/卡片/输入区宽度安全、可滚动、内容不裁切。
   ================================================================ */
@media (max-width: 640px) {
    /* —— 顶部栏：品牌 + 记录/赔率 按钮自动收缩 —— */
    .topbar { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
    .topbar .brand { min-width: 0; flex: 1 1 auto; }
    .btn-odds, .topbar button, .topbar .btn {
        flex: 0 0 auto; padding: 7px 12px; font-size: 12.5px;
        white-space: nowrap; max-width: 46vw;
    }

    /* —— 通用按钮：任何一行里的按钮都能收缩、文字不竖排、不溢出 —— */
    .btn-secondary, .btn-primary, .btn-gold, .btn-save-odds,
    .btn-odds-save, .btn-odds-reset, .modal-footer-row button,
    .result-actions button, .acc-actions button, .card-actions button,
    .record-actions button, .profile-actions button,
    .plans-wrap button, .order-wrap button, .nw-btn, .nb-btn {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* —— 弹窗底部按钮区：多按钮自动等分铺满一行，放得下就不换行 —— */
    .modal-footer-row, .modal-input-row {
        display: flex; flex-wrap: wrap; gap: 8px;
        padding-left: 12px; padding-right: 12px;
    }
    .modal-footer-row > button, .modal-input-row > button {
        flex: 1 1 auto; min-width: 0; padding: 10px 12px; font-size: 13.5px;
    }
    .modal-footer-row > button:only-child { flex: 1 1 100%; }

    /* —— 所有弹层宽度安全（防固定宽溢出），高度可滚 —— */
    .odds-modal, .tip-modal .toast-modal, .share-card,
    .modal-center > div, .modal-sheet {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: 88vh;
    }
    .odds-modal-body, .modal-body-scroll { -webkit-overflow-scrolling: touch; }

    /* —— 卡片/区块：圆角与内边距收紧，宽度不超屏 —— */
    .card, .result-group-card, .parse-group, .input-section,
    .summary-card, .plans-wrap .card, .order-wrap .card {
        max-width: 100%; box-sizing: border-box;
    }

    /* —— 结果统计块 / 盈亏条：等分铺满（分类汇总区单独走 grid，见下）—— */
    .summary-row:not(.summary-row-cats), .stats-row {
        display: flex; flex-wrap: wrap; gap: 8px;
    }
    .summary-block, .stat-block {
        flex: 1 1 calc(50% - 8px); min-width: 0; box-sizing: border-box;
    }
    .summary-value, .stat-value { word-break: break-all; }

    /* —— 顶部汇总：两行始终各 3 格，窄屏也不换行（数字靠 clamp 自适应缩小）—— */
    .summary-row-main { flex-wrap: nowrap; }
    .summary-row-main .summary-block { flex: 1 1 0; min-width: 0; }

    /* —— 四大类汇总：始终 2×2 等宽 grid，不被 flex 兜底打乱 —— */
    .summary-row-cats {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .cat-block { min-width: 0; box-sizing: border-box; width: auto !important; flex: none; }
    .cat-row b { min-width: 0; word-break: break-word; }

    /* —— 分享结果按钮（位于结果标题栏，不撑满整行，只保证不溢出/不竖排）—— */
    .summary-head { flex-wrap: nowrap; gap: 8px; }
    .summary-head-title { min-width: 0; flex: 1 1 auto; }
    .btn-share { flex: 0 0 auto; white-space: nowrap; padding: 7px 14px; font-size: 13px; }

    /* —— 「我的 / 记录 / 套餐 / 订单」页按钮组铺满 —— */
    .profile-actions, .record-actions, .plans-wrap .btn-row,
    .order-wrap .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
    .profile-actions > button, .record-actions > button,
    .plans-wrap .btn-row > button, .order-wrap .btn-row > button {
        flex: 1 1 auto; min-width: 0; }

    /* —— 输入框/文本域/下拉不超屏 —— */
    input, textarea, select { max-width: 100%; box-sizing: border-box; }
    .bet-input, textarea { width: 100%; box-sizing: border-box; }

    /* —— 长标题/号码串允许换行，不撑破卡片 —— */
    .acc-title, .group-title, .seg-text, .record-title {
        word-break: break-word; overflow-wrap: anywhere;
    }
}

/* 极小屏（≤380px）再收紧一档 */
@media (max-width: 380px) {
    .btn-odds, .topbar button, .topbar .btn { padding: 6px 10px; font-size: 12px; }
    .modal-footer-row > button, .modal-input-row > button { font-size: 12.5px; padding: 9px 8px; }
    .summary-block, .stat-block { flex: 1 1 100%; }
    .summary-row-main .summary-block { flex: 1 1 0; }
}

/* 全屏页 / 账户 / 套餐 / 订单 / 记录页 兜底，保证任何一页不横滑、按钮铺满 */
@media (max-width: 640px) {
    .page-screen { overflow-x: hidden; max-width: 100vw; }

    /* 会员卡片 / 会员中心：信息不撑破，按钮自适应 */
    .vip-card-inner, .vip-top, .member-center { max-width: 100%; box-sizing: border-box; }
    .vip-top { flex-wrap: wrap; gap: 10px; }
    .vip-login-btn { flex: 0 0 auto; white-space: nowrap; }

    /* 套餐/订单页：列表单列铺满，返回栏不溢出 */
    .plans-wrap, .order-wrap { max-width: 100%; box-sizing: border-box; padding: 12px; }
    .plans-header { flex-wrap: nowrap; gap: 8px; }
    .plans-title { min-width: 0; flex: 1 1 auto; }
    .plans-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
    .plans-tab { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
    .plans-list { display: flex; flex-direction: column; gap: 12px; }
    .plans-list > * { max-width: 100%; box-sizing: border-box; }

    /* 订单页：合计 + 立即支付 一行等分 */
    .order-footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .order-total { flex: 1 1 auto; min-width: 0; }
    .order-pay-btn { flex: 1 1 200px; min-width: 0; white-space: nowrap; }
    .pay-methods { display: flex; flex-direction: column; gap: 10px; }

    /* 明细展开/收起工具栏：两按钮等分铺满 */
    .acc-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
    .acc-tool-btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; }

    /* 结果组头：本金/中奖/盈亏 三列在极窄屏可压缩不溢出 */
    .acc-header, .acc-cols { flex-wrap: nowrap; gap: 6px; min-width: 0; }
    .acc-main { flex: 1 1 auto; min-width: 0; }
    .acc-col { white-space: nowrap; }
    .acc-raw { word-break: break-word; overflow-wrap: anywhere; }

    /* 记录卡片：状态/标题不溢出，删除按钮触控足够大 */
    .record-card-header { flex-wrap: wrap; gap: 6px; }
    .record-card-title { min-width: 0; flex: 1 1 auto; word-break: break-word; }
    .record-card-del { flex: 0 0 auto; min-width: 32px; min-height: 32px; }
}

/* Tip 弹窗按钮：极窄屏去固定宽度，铺满弹窗 */
@media (max-width: 420px) {
    .tip-modal .btn-gold { min-width: 0; width: 100%; padding: 13px 20px; font-size: 15px; }
    .tip-modal .toast-modal { width: calc(100vw - 24px) !important; }
}

/* ===== 额度消耗记录 ===== */
.usage-summary { margin-bottom: 14px; }
.usage-sum-card {
    display: flex; flex-direction: column; gap: 4px;
    background: linear-gradient(135deg, rgba(212,168,67,.16), rgba(212,168,67,.05));
    border: 1px solid rgba(212,168,67,.35); border-radius: 12px; padding: 16px 18px;
}
.usage-sum-label { font-size: 13px; color: #c8cdd8; }
.usage-sum-val { font-size: 26px; font-weight: 800; color: #f0d98a; font-family: "JetBrains Mono", monospace; }
.usage-sum-sub { font-size: 12px; color: #8b95a5; }
.usage-count { font-size: 13px; color: #f87171; font-weight: 700; font-family: "JetBrains Mono", monospace; }
.usage-count.gift { color: #f0d98a; }
.usage-src { font-size: 12px; color: #8b95a5; }
.usage-src.pack { color: #60a5fa; }
.usage-src.daily { color: #4ade80; }
.usage-preview {
    font-size: 12px; color: #8b95a5; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block;
}

/* ============================================================
   华为鸿蒙 / 旧内核 兼容兜底（ArkWeb、微信X5、QQ内核、老安卓WebView）
   说明：以下为纯兼容性覆盖，不改变现代浏览器表现。
   1) inset 简写部分旧内核不识别 → 显式补 top/right/bottom/left
   2) 100vh 在地址栏收缩时高度异常 → 优先 100dvh（旧内核忽略 dvh 自动回退 vh）
   ============================================================ */

/* —— 全屏遮罩 / 弹层：inset:0 兜底为四向 0（注意：右侧抽屉 .records-drawer 不在此列，它靠 translateX 藏出屏，不能给 left:0，否则会露出竖条挡内容） —— */
.modal-overlay,
.modal-overlay::before,
.records-overlay,
.page-screen,
.vip-card-bg,
.share-modal,
.share-mask,
.redeem-modal,
.redeem-mask,
.news-banner-glow,
.ball-placeholder {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* 右侧记录抽屉：保持原始 top/right + width + translateX(100%) 出屏，仅补高度安全区，严禁加 left:0 */
.records-drawer {
    top: 0;
    right: 0;
    bottom: auto;
    left: auto;
}

/* —— 动态视口高度：dvh 优先，旧内核自动回退 vh —— */
/* 全屏页 / 抽屉 / 登录等全屏容器，避免鸿蒙地址栏收缩导致遮挡或内容溢出 */
@supports (height: 100dvh) {
    .records-drawer { height: 100dvh; }
    .page-screen { height: 100dvh; }
    .auth-wrap { min-height: 100dvh; }
    .share-card { max-height: 88dvh; }
}

/* 微信 / QQ / 鸿蒙内置内核下，长按保存图片时禁止系统默认的拖拽/选中干扰 */
#share-img, .share-card img {
    /* 允许长按图片弹出系统「保存图片 / 存储图像」菜单（套壳 App / 微信保存到相册依赖此菜单）：
       不要设 user-select:none，否则部分 WebView 长按不弹保存菜单 */
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
    pointer-events: auto;
}

/* ============================================================
   全机型移动端兼容加固（iOS Safari / 安卓 Chrome / 鸿蒙 ArkWeb /
   微信 / QQ / UC / 夸克 内置内核 通吃）
   纯兼容性补丁，不改变现代浏览器表现；旧内核忽略其不认识的属性自动回退。
   ============================================================ */

/* 1) 根元素用动态视口高度，防 iOS/安卓地址栏收缩导致 100vh 遮挡/漏白 */
html { height: 100%; }
body {
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;   /* 防 iOS 横屏/旋转时字体自动放大 */
    text-size-adjust: 100%;
}

/* 2) 统一去除移动端按钮/链接点击灰底与长按高亮，点击更跟手（华为/iOS 重点） */
a, button, .nav-item, .card, .share-btn, .action-bar > button, .mini-btn,
[role="button"], select, input[type="submit"], input[type="button"] {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 3) 按钮/可点元素 touch-action 让点击响应更快，消除 300ms 延迟与双击缩放干扰 */
button, .nav-item, .share-btn, .mini-btn, [role="button"] {
    touch-action: manipulation;
    cursor: pointer;
}

/* 4) 输入框/按钮：iOS 圆角归一、appearance 归一；select/checkbox/radio 保留原生（各机型最稳，不丢箭头） */
input, textarea, button {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}
input, textarea { -webkit-border-radius: 6px; border-radius: 6px; }
/* select 下拉保留系统原生外观与箭头（兼容性最好，避免旧内核箭头丢失/样式冲突） */
select,
input[type="checkbox"], input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
}
/* 搜索框去掉 iOS 原生圆角与放大镜错位 */
input[type="search"] { -webkit-appearance: none; appearance: none; border-radius: 8px; }

/* 5) 顶部栏 sticky 补 iOS 旧版前缀 + 刘海/挖孔安全区（全屏/PWA 时不被状态栏遮挡） */
.topbar {
    position: -webkit-sticky;
    position: sticky;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
}

/* 6) 底部导航补全左右安全区（横屏刘海机） */
.bottom-nav {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

/* 7) 禁止整页橡皮筋滚动穿透到 body 时的横向溢出（部分安卓 UC/夸克会横向乱跳） */
html, body { overflow-x: hidden; max-width: 100%; }

/* 8) 图片/媒体在小屏不溢出容器 */
img, video, canvas { max-width: 100%; }

/* 9) iOS 下数字/文本输入禁用原生阴影，保证深色主题下输入框不发灰 */
input, textarea { background-clip: padding-box; -webkit-background-clip: padding-box; }

/* 10) 旧内核不识别 backdrop-filter 时，遮罩本身已有半透明底色，保证可读性（不透明兜底） */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .redeem-mask { background: rgba(5, 10, 20, 0.88); }
}

/* ========== 资讯中心（名人堂专家推荐） ========== */
.news-page {
    max-width: 640px; margin: 0 auto;
    padding: 8px 12px calc(80px + env(safe-area-inset-bottom));
}
/* ===== Hero 头部 ===== */
/* ===== 港澳地区带图卡片（置顶） ===== */
.news-region-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 4px 0 12px;
}
.region-card {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 9px 10px 9px 9px; border-radius: 16px;
    background: linear-gradient(145deg, #1d2436, #151a28);
    border: 1px solid #2a3040;
    cursor: pointer; text-align: left; overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.region-card:active { transform: scale(.97); }
.region-img {
    width: 50px; height: 50px; flex: 0 0 auto; border-radius: 50%;
    overflow: hidden; border: 2px solid rgba(255,255,255,.12);
    box-shadow: 0 3px 10px rgba(0,0,0,.4);
    background: #0e1320;
}
.region-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.region-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.region-name {
    font-size: 15px; font-weight: 700; color: #e8ecf5; letter-spacing: .5px;
    white-space: nowrap;
}
.region-sub { font-size: 10.5px; color: #7f889a; white-space: nowrap; }
.region-check {
    position: absolute; top: 7px; right: 7px;
    width: 18px; height: 18px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f0d98a, #d4a843); color: #1a1f2e;
    box-shadow: 0 2px 6px rgba(212,168,67,.5);
}
.region-card.active {
    border-color: rgba(212,168,67,.75);
    box-shadow: 0 6px 18px rgba(212,168,67,.22);
    background: linear-gradient(145deg, #242b3e, #181d2c);
}
.region-card.active .region-img { border-color: rgba(240,217,138,.9); }
.region-card.active .region-name {
    background: linear-gradient(120deg, #f7eecb, #e6c869);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.region-card.active .region-check { display: flex; }

/* 玩法分类 Tab */
.news-betcats {
    display: flex; gap: 8px; overflow-x: auto; padding: 7px 4px 12px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.news-betcats::-webkit-scrollbar { display: none; }
.news-betcat {
    flex: 0 0 auto; padding: 8px 16px; border-radius: 20px;
    border: 1px solid #2a3040; background: #1a1f2e; color: #8b95a5;
    font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: all .18s;
}
.news-betcat.active {
    background: linear-gradient(135deg, #f0d98a, #d4a843); color: #1a1f2e;
    font-weight: 700; border-color: transparent;
}

/* 次级玩法 Tab（某分类内多个玩法，自动换行完整展示，避免右侧截断） */
.news-bettab-wrap { margin: 2px 4px 10px; padding: 0; }
.news-betrow { display: flex; flex-wrap: wrap; gap: 6px; }
.news-bettab {
    flex: 0 0 auto; padding: 6px 13px; border-radius: 16px;
    border: 1px solid #2a3040; background: #141925; color: #aab2c0;
    font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: all .18s;
}
.news-bettab.active {
    background: #d4a843; color: #1a1f2e; font-weight: 700; border-color: transparent;
}

/* 专家卡片列表 */
.news-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.news-card {
    display: flex; gap: 12px; align-items: center;
    background: #1a1f2e; border: 1px solid #2a3040; border-radius: 10px;
    padding: 12px 12px; position: relative;
}
.news-card.top1 { border-color: rgba(212,168,67,.6); box-shadow: 0 0 0 1px rgba(212,168,67,.2) inset; }
.news-card.top2 { border-color: rgba(148,163,184,.4); }
.news-card.top3 { border-color: rgba(212,120,80,.4); }
.news-rank {
    flex: 0 0 22px; height: 22px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; background: #141925; color: #8b95a5;
}
.news-card.top1 .news-rank { background: linear-gradient(135deg,#f0d98a,#d4a843); color:#1a1f2e; }
.news-card.top2 .news-rank { background: #b8c0cc; color:#1a1f2e; }
.news-card.top3 .news-rank { background: #d48650; color:#1a1f2e; }
.news-av {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
    background: #141925; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
}
.news-av img { width: 100%; height: 100%; object-fit: cover; }
.news-av svg { width: 100%; height: 100%; display: block; }
.news-av-fallback {
    font-size: 18px; font-weight: 700; color: #d4a843;
}
.news-main { flex: 1; min-width: 0; }
.news-name-row { display: flex; align-items: center; gap: 8px; }
.news-name {
    font-size: 15px; font-weight: 700; color: #f0ece4;
    max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-acc {
    font-size: 12.5px; font-weight: 700; color: #22c55e;
    margin-left: auto; white-space: nowrap; flex-shrink: 0;
    font-family: 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
}
.news-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.news-meta-item { font-size: 12px; color: #8b95a5; }
.news-zodiac-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 7px; width: 100%; }
.news-zodiac { display: flex; flex-wrap: wrap; gap: 4px; }
.news-zod {
    padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 700;
    background: #141925; border: 1px solid #2a3040; color: #e8e6e3;
}
/* top1 专家卡号码球与普通专家一致（白字深底），仅保留金边/金排名框 */
.news-card.top1 .news-zod { border-color: #2a3040; color: #e8e6e3; }

/* 复制按钮（meta 行最右端，带文字胶囊） */
.news-copy {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 12px; border-radius: 6px;
    border: 1px solid #d4a843; background: rgba(212,168,67,.12); color: #e8c76a;
    font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.6;
    flex-shrink: 0; margin-left: auto;
    transition: all .18s ease-out;
}
.news-copy:active {
    background: #d4a843; color: #1a1f2e; border-color: transparent;
    transform: scale(.94);
}

/* 空态 / 提示 */
.news-empty { text-align: center; padding: 60px 20px; color: #8b95a5; }
.news-empty-icon {
    width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
    background: #1a1f2e; border: 1px solid #2a3040;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #d4a843; letter-spacing: 2px;
}
.news-empty p { font-size: 14px; }
.news-refresh2 {
    margin-top: 16px; padding: 10px 26px; border-radius: 22px;
    border: 0; background: linear-gradient(135deg,#f0d98a,#d4a843);
    color: #1a1f2e; font-size: 14px; font-weight: 700; cursor: pointer;
}
.news-fill { height: 8px; }
.news-empty-tip { padding: 30px; text-align: center; color: #8b95a5; font-size: 13.5px; }

/* 战绩入口（点击弹战绩详情） */
.news-combo {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1px 6px; margin-left: 2px;
    background: rgba(225,45,45,.08); border: 1px dashed rgba(225,45,45,.4);
    border-radius: 4px; font-size: 12px; font-weight: 800;
    cursor: pointer; line-height: 1.5; flex-shrink: 0;
    text-decoration: underline; text-underline-offset: 2px;
    transition: all .18s ease-out;
}
.news-combo:active { transform: scale(.92); background: rgba(225,45,45,.2); }

/* ===== 战绩详情弹窗 ===== */
.news-history-mask {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
}
.news-history-box {
    width: 100%; max-width: 460px; max-height: 82vh;
    display: flex; flex-direction: column;
    background: #171c2b; border: 1px solid #2a3040; border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden;
}
.news-history-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid #2a3040;
}
.news-history-title { font-size: 15px; font-weight: 800; color: #f0d98a; }
.news-history-close {
    border: 0; background: transparent; color: #8b95a5; font-size: 22px; line-height: 1;
    cursor: pointer; padding: 2px 8px;
}
.news-history-close:active { color: #fff; transform: scale(.9); }
.news-history-body { padding: 12px 16px 16px; overflow-y: auto; }
.news-history-loading { text-align: center; color: #8b95a5; padding: 30px; font-size: 13.5px; }
.news-history-empty { text-align: center; color: #8b95a5; padding: 24px; font-size: 13.5px; }

.news-history-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid #262d3f;
}
.news-history-top > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hh-name { font-size: 16px; font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-type { font-size: 12px; color: #f0d98a; background: rgba(212,168,67,.14); padding: 2px 8px; border-radius: 4px; flex-shrink: 0; }
.hh-record { font-size: 12.5px; color: #6fce9c; flex-shrink: 0; }

.hh-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.hh-row {
    display: flex; align-items: center; gap: 8px;
    background: #1d2336; border: 1px solid #262d3f; border-radius: 8px;
    padding: 7px 10px; font-size: 12.5px;
}
.hh-period { color: #8b95a5; font-weight: 700; flex-shrink: 0; min-width: 58px; }
.hh-zod { color: #e2e6f0; flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-all; line-height: 1.5; }
.hh-open { color: #6fce9c; flex-shrink: 0; }
.hh-pending { color: #8b95a5; font-size: 12px; flex-shrink: 0; }
.hh-judge { flex-shrink: 0; font-weight: 800; }
.hh-judge.win { color: #6fce9c; }
.hh-judge.lose { color: #e15a57; }

.news-history-copy {
    display: block; width: 100%; padding: 11px 0; border: 0; border-radius: 8px;
    background: linear-gradient(135deg,#f0d98a,#d4a843); color: #1a1f2e;
    font-size: 14px; font-weight: 800; cursor: pointer;
    transition: all .18s ease-out;
}
.news-history-copy:active { transform: scale(.97); opacity: .9; }

/* 名人堂自带 toast 提示（复制成功等） */
#news-toast {
    position: fixed; left: 50%; bottom: 110px; z-index: 10000;
    transform: translate(-50%, 16px);
    background: linear-gradient(135deg,#f0d98a,#d4a843);
    color: #1a1610; padding: 11px 26px; border-radius: 10px;
    font-size: 14px; font-weight: 700; max-width: 84vw; text-align: center;
    box-shadow: 0 8px 30px rgba(212,168,67,.45);
    opacity: 0; pointer-events: none; transition: opacity .22s ease-out, transform .22s ease-out;
}
#news-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== 平台推荐置顶卡（矩算大师，复用专家卡） ===================== */
/* 矩算大师：与下方专家卡同款深色底 + 金边，仅描边/光更重以体现"平台内供" */
.news-card.rc-master {
    background: linear-gradient(150deg, #221d38 0%, #1a1f2e 62%);
    border: 1px solid rgba(150,120,235,.75);
    box-shadow: 0 0 0 1px rgba(124,58,237,.22) inset, 0 6px 20px rgba(0,0,0,.35), 0 0 16px rgba(139,92,246,.18);
    flex-wrap: wrap;
}
/* 左侧"荐"徽标：与三十位专家普通排名框一致（深色框、白/灰字，不描金） */
.rc-rank {
    background: linear-gradient(135deg,#a875ff,#7c3aed) !important;
    color: #15092e !important; font-size: 13px !important; font-weight: 800;
    width: 22px; flex-basis: 22px; height: 22px;
    box-shadow: 0 0 8px rgba(124,58,237,.55);
}
.news-card.rc-master .news-av {
    border: 2px solid rgba(240,217,138,.8);
    box-shadow: 0 0 12px rgba(212,168,67,.35);
}
.news-card.rc-master .news-name {
    background: linear-gradient(120deg,#f7eecb,#e6c869);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap;
    flex: 0 0 auto;
}
/* "平台推荐"金色小旗标 */
.rc-flag {
    font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #1c1405;
    padding: 1px 7px; border-radius: 4px;
    background: linear-gradient(160deg,#f5e3a0,#d4a843);
    box-shadow: 0 2px 6px rgba(212,168,67,.4);
}
.rc-master .news-meta-item { color: #c9b98a; }
/* 左上角角标行：平台内供 + 21:30公开验证 + 已开 + N期解锁查看；解锁按钮靠右；给左侧头像与头部顶部让位避免重叠 */
.news-card.rc-master { padding-top: 30px; }
.news-card.rc-master .news-rank,
.news-card.rc-master .news-av { margin-top: 22px; }
.rc-corner-row {
    position: absolute; top: 8px; left: 10px; right: 10px; z-index: 4;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.rc-corner-row > .rc-tag,
.rc-corner-row > .rc-judge { flex: 0 0 auto; }
.rc-corner-unlock { margin-left: auto; flex: 0 0 auto; display: flex; }
.rc-corner-row > .rc-next-unlock { margin-left: auto; }
.rc-corner-unlock .rc-next-unlock { margin-left: 0; }
.rc-flag-corner {
    position: static; font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #1c1405;
    padding: 1px 7px; border-radius: 4px; flex: 0 0 auto;
    background: linear-gradient(160deg,#f5e3a0,#d4a843);
    box-shadow: 0 2px 6px rgba(212,168,67,.4);
}
.rc-exp-corner {
    font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
    white-space: nowrap; padding: 1px 9px; border-radius: 999px; flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(135deg,#ff5a4d,#e0273a);
    border: 1px solid rgba(255,150,140,.75);
    box-shadow: 0 0 10px rgba(255,60,60,.4), 0 2px 6px rgba(0,0,0,.3);
    text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.rc-streak {
    font-size: 10.5px; color: #ff8f8f; font-weight: 700;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.32);
}
.rc-exp { font-size: 11px; color: #8b95a5; }
/* 平台内供/正确率容器：相对定位（保留兼容） */
.news-card.rc-master { position: relative; }
/* 正确率推到第一行最右（与专家卡一致） */
.news-card.rc-master .news-name-row .news-acc { margin-left: auto; }
/* 复制按钮移到第二行(meta)最右，即正确率正下方，与专家卡同款金色描边 */
.news-card.rc-master .news-meta .news-copy {
    margin-left: auto; flex: 0 0 auto;
}
.news-card.rc-master .news-meta .news-copy:active { transform: scale(.94); }
/* 号码球行右侧：N期解锁按钮（复制按钮下方） */
.rc-pick-row .rc-pick-tags .rc-next-unlock { margin-left: auto; }
.news-card.rc-master .news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 矩算大师战绩入口（X对X，金色下划线胶囊） */
.rc-combo {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1px 6px; margin-left: 2px;
    background: rgba(212,168,67,.1); border: 1px solid rgba(212,168,67,.45);
    border-radius: 4px; font-size: 12px; font-weight: 800;
    cursor: pointer; line-height: 1.5; flex-shrink: 0;
    color: #e8c76a;
    text-decoration: underline; text-underline-offset: 2px;
    transition: all .18s ease-out;
}
.rc-combo:active { transform: scale(.92); background: rgba(212,168,67,.22); }
.rc-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 5px; }
.rc-win { color: #5fd38d; background: rgba(95,211,141,.12); border: 1px solid rgba(95,211,141,.35); }
.rc-lose { color: #ff8f8f; background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.32); }
.rc-pending { color: #aeb6c6; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.rc-judge-win { color: #5fd38d; background: rgba(95,211,141,.12); border: 1px solid rgba(95,211,141,.35); }
.rc-judge-lose { color: #ff8f8f; background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.32); }
.rc-judge-pending { color: #aeb6c6; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }

/* 号码球行：左球 + 右侧标签/操作，与下方专家卡复制按钮对齐 */
.rc-pick-row { gap: 6px; margin-top: 8px; }
.rc-pick-balls, .rc-pick-row .rc-picks { display: contents; }
/* 大师卡号码球：一排容纳更多（九肖一排），不折行；样式与专家卡普通球一致 */
.news-card.rc-master .rc-pick-row .news-zod {
    padding: 2px 8px; font-size: 12px; gap: 0;
}
/* 卡片同时带 top1；大师卡号码球用金字金描边，高优先级固定 */
.news-card.rc-master.top1 .rc-pick-row .news-zod {
    color: #f0d98a;
    background: #141925;
    border-color: rgba(212,168,67,.5);
    box-shadow: none;
}
.rc-pick-tags {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: auto; flex: 0 0 auto;
}
.rc-pick-tags .rc-combo { margin-left: 0; }
.rc-pick-row .rc-rec-copy { margin-top: 0; flex: 0 0 auto; }

/* 未解锁：小号「N期解锁查看」按钮，与复制按钮同尺寸同位置 */
.rc-next-unlock {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 6px;
    border: 1px solid rgba(212,168,67,.65);
    background: linear-gradient(160deg,#f5e3a0,#d4a843);
    color: #1c1405; font-size: 11.5px; font-weight: 800;
    line-height: 1.6; cursor: pointer; white-space: nowrap;
    flex: 0 0 auto; transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 2px 8px rgba(212,168,67,.35);
}
.rc-next-unlock:active { transform: scale(.95); }
.rc-next-unlock.is-opened {
    background: rgba(255,255,255,.07);
    color: #8a93ab; cursor: default;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: none;
}
.rc-next-unlock.is-opened:active { transform: none; }
/* 待开资料未生成(15:30前)：外观与金色解锁按钮完全一致，仅点击行为不同（toast 提示，不进解锁） */
.rc-next-unlock.is-waiting { cursor: pointer; }

/* ===== 大师卡移动端适配：新布局，杜绝溢出/遮挡 ===== */
@media (max-width: 640px) {
    /* 标题行：名称完整不截断，正确率靠右 */
    .news-card.rc-master .news-name-row { flex-wrap: nowrap; }
    .news-card.rc-master .news-name { white-space: normal; word-break: break-all; line-height: 1.2; font-size: 18px; }
    .news-card.rc-master .news-acc { margin-left: auto; font-size: 12px; white-space: nowrap; }
    /* meta 第二行：期号/9对9/已开/连对 + 复制靠右，允许换行不遮挡球 */
    .news-card.rc-master .news-meta { gap: 4px 8px; }
    .news-card.rc-master .news-meta .news-copy { padding: 2px 8px; font-size: 11px; }
    .news-card.rc-master .rc-pick-row { gap: 6px 4px; margin-top: 6px; }
    /* 球：一排尽量多放，超出自然折行 */
    .news-card.rc-master .rc-pick-row .news-zod { padding: 2px 7px; font-size: 12px; }
    /* 角标行：平台内供/21:30/已开/N期解锁，窄时自然换行不溢出 */
    .news-card.rc-master { padding-top: 52px; }
    .news-card.rc-master .rc-exp-corner { font-size: 10px; padding: 1px 7px; }
    .news-card.rc-master .rc-corner-row { left: 8px; right: 8px; gap: 5px 6px; }
    .news-card.rc-master .rc-next-unlock { white-space: nowrap; padding: 2px 9px; font-size: 11px; }
    /* 左上角平台内供小旗标，头像略下移避让 */
    .news-card.rc-master .rc-flag-corner { font-size: 9.5px; }
    .news-card.rc-master .rc-corner-row .rc-tag { padding: 1px 7px; font-size: 10px; }
}
@media (max-width: 380px) {
    .news-card.rc-master .rc-pick-row .news-zod { padding: 2px 6px; font-size: 11.5px; }
}
/* 顶部分类 tab：手机端换行完整显示，所有分类（含最后一个）都不被裁切 */
@media (max-width: 640px) {
    .news-betcats {
        flex-wrap: wrap; overflow-x: visible;
        gap: 7px; padding: 7px 0 10px;
    }
    .news-betcat { flex: 1 1 auto; text-align: center; padding: 8px 8px; min-width: 18%; }
}


/* 解锁弹窗（旧大按钮样式保留兼容，已不再使用） */
.rc-avail-row { align-items: center; gap: 10px !important; }
.rc-avail-row .news-zod {
    border: 1px dashed rgba(212,168,67,.5); color: #6d7690; background: rgba(255,255,255,.04);
}
.rc-unlock-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; cursor: pointer;
    font-size: 13px; font-weight: 800; letter-spacing: .5px;
    color: #1c1405; padding: 7px 18px; border-radius: 20px;
    background: linear-gradient(160deg,#f5e3a0,#d4a843);
    box-shadow: 0 4px 14px rgba(212,168,67,.45);
    transition: transform .15s ease; flex: 0 0 auto;
}
.rc-unlock-btn svg { width: 15px; height: 15px; }
.rc-unlock-btn:active { transform: scale(.96); }

/* 解锁弹窗 */
.rc-unlock-mask {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 28px;
    background: rgba(8,11,18,.66); backdrop-filter: blur(3px);
    animation: rc-fade .18s ease-out;
}
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
.rc-unlock-box {
    position: relative; width: 100%; max-width: 340px;
    border-radius: 18px; padding: 24px 20px 20px;
    background: linear-gradient(160deg, #242c40, #181d2c);
    border: 1px solid rgba(208,168,67,.35);
    box-shadow: 0 18px 50px rgba(0,0,0,.55);
    text-align: center;
}
.rc-unlock-close {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px; border-radius: 50%;
    border: none; cursor: pointer; color: #9aa4b6;
    background: rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
}
.rc-unlock-body .rc-ul-icon { font-size: 38px; line-height: 1; margin-bottom: 8px; }
.rc-ul-title { font-size: 17px; font-weight: 800; color: #f4ecd6; }
.rc-ul-desc { font-size: 12.5px; color: #9aa4b6; line-height: 1.7; margin: 8px 0 14px; }
.rc-ul-price {
    font-size: 16px; font-weight: 900; letter-spacing: .5px;
    background: linear-gradient(180deg,#ffe9a8 0%,#f5cf6a 45%,#d99a2b 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 0 12px rgba(240,197,98,.35);
}
.rc-ul-contact { font-size: 12px; color: #aeb6c6; margin-bottom: 6px; }
.rc-ul-wx {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    font-size: 16px; font-weight: 800; letter-spacing: .5px; color: #f0d98a;
    padding: 10px; border-radius: 10px; margin-bottom: 16px;
    background: rgba(212,168,67,.1); border: 1px dashed rgba(208,168,67,.4);
}
.rc-ul-wx span { line-height: 1; }
.rc-ul-cico { width: 22px; height: 22px; flex: 0 0 auto; display: block; }
.rc-ul-input {
    width: 100%; box-sizing: border-box; text-align: center;
    font-size: 15px; letter-spacing: 1px; color: #f4ecd6;
    padding: 12px 12px; border-radius: 10px; margin-bottom: 6px;
    background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.14);
    outline: none;
}
.rc-ul-input:focus { border-color: rgba(240,217,138,.7); }
.rc-ul-msg { font-size: 12px; min-height: 16px; margin-bottom: 8px; color: #5fd38d; }
.rc-ul-msg.err { color: #ff8f8f; }
.rc-ul-actions { display: flex; gap: 10px; }
.rc-ul-btn {
    flex: 1; cursor: pointer; border-radius: 10px;
    font-size: 14px; font-weight: 700; padding: 11px 8px; border: 1px solid transparent;
    transition: transform .15s ease;
}
.rc-ul-btn:active { transform: scale(.97); }
.rc-ul-btn:disabled { opacity: .6; cursor: default; }
.rc-ul-ghost {
    color: #c2cad8; background: transparent;
    border-color: rgba(255,255,255,.18);
}
.rc-ul-primary {
    color: #1c1405; background: linear-gradient(160deg, #f5e3a0, #d4a843);
    box-shadow: 0 4px 12px rgba(212,168,67,.35);
}

/* ===== 图库板块 ===== */
.gallery-page {
    min-height: 100%;
    height: max-content;
    padding: 16px 14px 96px;
    background: radial-gradient(1200px 500px at 20% -10%, rgba(168,117,255,.14), transparent 60%),
                radial-gradient(800px 400px at 110% 20%, rgba(212,168,67,.10), transparent 55%),
                #0d1020;
    color: #eef1f8;
}
/* 顶部横排：搜索框 + 期号 */
.gallery-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px 14px;
    width: 100%;
    min-width: 0;
}
.gallery-topbar .gallery-search {
    flex: 1 1 auto;
    min-width: 0;          /* 关键：允许搜索框收缩，防止 input 固有宽度把期号挤出屏幕 */
    margin-bottom: 0;
}
.gallery-topbar .gallery-period {
    margin-bottom: 0;
    flex: 0 0 auto;
}
/* 搜索框 */
.gallery-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    margin-bottom: 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.gallery-search.focus {
    border-color: rgba(212,168,67,.6);
    box-shadow: 0 0 0 3px rgba(212,168,67,.14);
    background: rgba(255,255,255,.08);
}
.gallery-search-ico {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding-left: 12px;
    color: #9aa4bd;
}
.gallery-search-input {
    flex: 1 1 auto;
    min-width: 0;          /* 关键：input 默认 min-width:auto 会撑爆 flex 容器 */
    width: 100%;
    background: none;
    border: none;
    outline: none;
    color: #eef1f8;
    font-size: 14px;
    padding: 11px 10px;
}
.gallery-search-input::placeholder { color: #7e88a3; }
.gallery-search-clear {
    flex: 0 0 auto;
    background: rgba(255,255,255,.12);
    border: none;
    color: #c2cad8;
    width: 22px; height: 22px;
    border-radius: 50%;
    margin-right: 9px;
    font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
/* 港澳地区切换 */
.gallery-region-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.gallery-region-btn {
    flex: 1;
    padding: 11px 0;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    color: #aeb6c8;
    font-size: 15px;
    font-weight: 600;
    transition: all .2s;
}
.gallery-region-btn.active {
    color: #1c1405;
    background: linear-gradient(160deg, #f5e3a0, #d4a843);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(212,168,67,.3);
    font-weight: 700;
}
/* 期号胶囊（位于顶部横排搜索框右侧） */
.gallery-period {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #d8c8ff;
    background: rgba(168,117,255,.16);
    border: 1px solid rgba(168,117,255,.3);
    padding: 7px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.gallery-item {
    position: relative;
    display: block;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: transform .15s, border-color .2s, box-shadow .2s;
}
.gallery-item:active { transform: scale(.97); }
.gallery-item:hover {
    border-color: rgba(212,168,67,.5);
    box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.gallery-item-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background: #151a2c;
}
.gallery-item-namebar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 18px 8px 8px;
    background: linear-gradient(to top, rgba(5,8,20,.92), rgba(5,8,20,0));
}
.gallery-item-name {
    font-size: 12.5px;
    text-align: center;
    color: #f0e6c0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.gallery-empty {
    padding: 60px 20px;
    text-align: center;
    color: #aeb6c8;
    font-size: 14px;
}
.gallery-fill { height: 20px; }
@media (min-width: 560px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 大图弹层 */
.gallery-viewer {
    position: fixed; inset: 0; z-index: 9990;
    display: flex; align-items: center; justify-content: center;
    padding: 14px;
    animation: gv-in .22s ease;
}
@keyframes gv-in { from { opacity: 0; } to { opacity: 1; } }
.gallery-viewer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.9); }
.gallery-viewer-body {
    position: relative;
    display: flex; flex-direction: column;
    width: 100%;
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
    background: #0d1020;
    border-radius: 16px;
    overflow: hidden;
    animation: gv-pop .26s cubic-bezier(.2,.9,.25,1.1);
}
@keyframes gv-pop {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}
.gallery-viewer-top {
    display: flex; align-items: center; gap: 8px;
    flex: 0 0 auto;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.gallery-viewer-name {
    flex: 1;
    font-size: 15px; font-weight: 600; color: #f0e6c0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-viewer-badge {
    font-size: 12px; color: #f0e6c0; font-weight: 600;
    background: linear-gradient(160deg, #f5e3a0, #d4a843);
    color: #1c1405;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.gallery-viewer-close {
    font-size: 26px; line-height: 1; color: #c2cad8; background: none; border: none;
    padding: 0 4px; cursor: pointer;
}
/* 图片区：水平+垂直居中，整体 contain 适配；大图左右留白、不超边框，小图也居中适中 */
.gallery-viewer-scroll {
    flex: 1 1 auto; min-height: 0;
    overflow: auto; -webkit-overflow-scrolling: touch;
    display: flex; align-items: center; justify-content: center;
    padding: 10px;
}
.gallery-viewer-scroll img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 124px);
    width: auto; height: auto;
    margin: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity .2s;
}
@media (orientation: landscape) {
    .gallery-viewer-scroll img { max-height: calc(100dvh - 112px); }
}
