﻿:root {
    --radius-xs: 4px;
    --radius-sheet: 6px;
    --space-xxs: 4px;
    --space-xs: 6px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --control-sm: 28px;
    --control-md: 32px;
    --control-lg: 36px;
    --border-weak: rgba(15, 23, 42, .05);
    --border-normal: rgba(15, 23, 42, .08);
    --shadow-card: 0 2px 10px rgba(15, 23, 42, .05);
    --shadow-float: 0 8px 24px rgba(15, 23, 42, .10);
    --surface-0: #f3f6f9;
    --surface-1: #ffffff;
    --surface-2: #f8fafc;
    --text-1: #18212f;
    --text-3: #64748b;
    --bg: #edf1f5;
    --bg-soft: #f6f8fb;
    --bg-deep: #0f172a;
    --card: #ffffff;
    --card-soft: #f8fafc;
    --card-tint: #f2f6fb;
    --line: #d7e0ea;
    --line-soft: #e8eef5;
    --text: #18212f;
    --text-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --primary: #2563eb;
    --primary-deep: #1d4ed8;
    --primary-soft: #eaf2ff;
    --primary-soft-2: #dbeafe;
    --accent: #0f766e;
    --accent-soft: #e6fffb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --danger-line: #fecaca;
    --warn: #d97706;
    --warn-soft: #fff7ed;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
    --radius: 4px;
    --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--surface-0);
    color: var(--text-1);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    padding-bottom: 162px;
}

button {
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
}

.hidden {
    display: none !important;
}

/* ===== App ===== */

.calc-app {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-sm) var(--space-lg);
}

.hero {
    position: relative;
    overflow: visible;
    z-index: 60;
    padding: 12px 14px;
    border-radius: var(--radius-xs);
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #eff6ff;
    box-shadow: var(--shadow-card);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 -50px auto;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 68%);
    pointer-events: none;
}

.hero h1 {
    margin: 8px 0 4px;
    font-size: 22px;
    line-height: 1.1;
}

.hero p {
    max-width: 500px;
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(239, 246, 255, 0.84);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255,255,255,.14);
    font-size: 11px;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.hero-top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.hero-actions {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
}

.hero-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255,255,255,.18);
    color: #eff6ff;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: none;
}

.hero-menu-btn:hover {
    background: rgba(255, 255, 255, 0.20);
}

.hero-menu-icon {
    display: inline-block;
    font-size: 13px;
    line-height: 1;
}

.hero-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 154px;
    padding: 6px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(215, 224, 234, 0.96);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-menu-item {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.hero-menu-item:hover {
    background: #eff6ff;
    color: var(--primary-deep);
}
.hero h1,
.hero p {
    position: relative;
    z-index: 1;
}

.hero > .sale-bar {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    padding: 8px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero > .sale-bar .ai-switch {
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #eff6ff;
}

.hero > .sale-bar .ai-switch > span {
    color: rgba(239, 246, 255, 0.84);
}

.hero > .sale-bar .sale-ai-btn {
    position: relative;
    width: 100%;
    min-height: var(--control-lg);
    justify-content: flex-start;
    padding: 0 16px 0 14px;
    background: linear-gradient(180deg, #4fa1ff 0%, #2f7cf1 100%);
    color: #f8fbff;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 4px 12px rgba(37, 99, 235, 0.18);
    letter-spacing: 0.02em;
    font-size: 14px;
    font-weight: 800;
    text-shadow: none;
    overflow: hidden;
}

.hero > .sale-bar .sale-ai-btn .sale-ai-btn-title {
    flex: 0 1 auto;
    min-width: 0;
}

.hero > .sale-bar .sale-ai-btn .sale-ai-btn-note {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(239, 246, 255, 0.72);
    white-space: nowrap;
}

.hero > .sale-bar .sale-ai-btn::before {
    content: "AI";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    margin-right: 8px;
    padding: 0 7px;
    border-radius: 4px;
    background: rgba(239, 246, 255, 0.18);
    color: #eff6ff;
    font-size: 11px;
    font-weight: 900;
    text-shadow: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.hero > .sale-bar .sale-ai-btn::after {
    content: "›";
    margin-left: auto;
    color: rgba(248, 251, 255, 0.9);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.hero > .sale-bar .sale-ai-btn:hover {
    background: linear-gradient(180deg, #61adff 0%, #3d8af6 100%);
    border-color: #60a5fa;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 10px 22px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

/* ===== Common Buttons ===== */

.bonus-btn,
.ghost-btn,
.pass-btn,
.confirm-btn,
.more-btn,
.tag-btn,
.dan-btn,
.collapse-btn,
.sale-toggle {
    cursor: pointer;
    transition: all 0.18s ease;
}

.bonus-btn,
.ghost-btn,
.pass-btn {
    padding: 8px 13px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
}

.bonus-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.more-btn,
.handicap-cell,
.option-btn,
.tag-btn,
.dan-btn,
.config-card,
.config-tab,
.pass-chip,
.sheet-option,
.sale-toggle {
    border-radius: var(--radius);
}

.option-btn.selected,
.sheet-option.selected,
.tag-btn.selected,
.dan-btn.active,
.pass-chip.active,
.config-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.option-btn.selected .odds,
.option-btn.selected .label,
.sheet-option.selected .odds,
.tag-btn.selected .odds {
    color: rgba(255, 255, 255, 0.88);
}

/* ===== Sale Day / Sale Bar ===== */

.sale-day-group {
    margin-top: 6px;
}

.sale-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 0 2px;
}

.sale-day-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.sale-day-meta {
    font-size: 12px;
    color: var(--muted);
}

.sale-day-list {
    display: grid;
    gap: 6px;
}

.sale-bar-group {
    margin-bottom: 6px;
}

.sale-bar-group.collapsed {
    margin-bottom: 0;
}

.sale-bar {
    margin-top: 10px;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sale-bar-group .sale-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sale-bar-group .sale-date {
    min-width: 0;
}

.sale-date {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.sale-bar-group .sale-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sale-bar-group .sale-date strong {
    font-size: 15px;
    line-height: 1.2;
}

.sale-bar-group .sale-date span {
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    font-weight: normal;
}

.sale-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.sale-extra-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.sale-extra-row-full {
    width: 100%;
    justify-content: space-between;
}

.sale-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    background: var(--card-soft);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: var(--radius);
}

.sale-toggle:hover {
    background: #f1f5f9;
    border-color: #cdd8e5;
}

.sale-toggle span:last-child {
    display: inline-block;
    font-size: 11px;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.ai-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    white-space: nowrap;
}

.ai-switch.disabled {
    opacity: 0.42;
    pointer-events: none;
}

.hero > .sale-bar .ai-switch i {
    width: 36px;
    height: 20px;
}

.hero > .sale-bar .ai-switch i::after {
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
}

.hero > .sale-bar .ai-switch input:checked + i::after {
    transform: translateX(16px);
}

.ai-switch input {
    display: none;
}

.ai-switch i {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d5dee9;
    transition: background 0.2s ease;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
}

.ai-switch i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
    transition: transform 0.2s ease;
}

.ai-switch input:checked + i {
    background: var(--primary);
}

.ai-switch input:checked + i::after {
    transform: translateX(18px);
}

.sale-ai-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
    flex: 1 1 220px;
    min-width: 200px;
}

.sale-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.16);
}

.sale-ai-btn.ghost {
    background: #fff;
    color: var(--primary-deep);
    border-color: #bfd3ff;
    box-shadow: var(--shadow-xs);
}

.sale-ai-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Match List ===== */

.match-list,
.detail-list,
.optimize-list,
.placeholder-grid {
    display: grid;
}

.match-list {
    gap: 10px;
    margin-top: -10px;
}

.detail-list,
.optimize-list {
    gap: 12px;
}

.placeholder-grid {
    gap: 10px;
    margin-top: 14px;
}

.match-card,
.empty-card,
.detail-card,
.optimize-card,
.sport-placeholder {
    background: var(--surface-1);
    border: 1px solid var(--border-normal);
    box-shadow: var(--shadow-card);
}

.match-card,
.empty-card {
    padding: 12px;
    border-radius: var(--radius-xs);
}

.detail-card,
.optimize-card {
    padding: 12px;
    border-radius: var(--radius-xs);
    margin-bottom: 0;
}

.sport-placeholder {
    padding: 18px;
    border-radius: var(--radius);
}

.empty-card {
    text-align: center;
    color: var(--muted);
    padding: 28px 18px;
    margin-top: 15px;
}

.empty-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

.match-top,
.detail-head,
.optimize-head,
.sport-placeholder-head,
.card-actions,
.teams,
.sheet-group-header,
.config-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.match-top {
    gap: 8px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    color: var(--text-3);
}

.meta span,
.league-badge,
.pick-tag {
    border-radius: var(--radius-xs);
    background: #eef3f8;
}

.meta span,
.league-badge {
    padding: 2px 6px;
}

.league-badge {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 700;
}

.selection-pill {
    flex: 0 0 auto;
    padding: 2px 4px;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #cfe0ff;
}

.selection-pill.ai-recommendation-pill {
    background: #fff7cc;
    color: #8a6116;
    border-color: #e7d58b;
}

.teams {
    gap: 8px;
    margin-top: 10px;
}

.team-block {
    flex: 1;
    min-width: 0;
}

.team-name {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-1);
}

.team-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-3);
}

.vs-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: var(--radius);
    background: #e8eef8;
    color: var(--primary-deep);
    font-size: 11px;
    font-weight: 800;
    border: 1px solid #d6e3fb;
}

/* ===== Play Board ===== */

.play-board {
    margin-top: 10px;
}

.play-type-label {
    display: none;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius);
    background: #eef4ff;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
}

.odds-row {
    display: grid;
    grid-template-columns: 42px repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.handicap-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 48px;
    overflow: hidden;
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--line-soft);
}

.handicap-cell.has-single {
    padding-top: 10px;
}

.handicap-cell.rq {
    background: #eef4ff;
    color: var(--primary-deep);
    border: 1px solid #dbe7ff;
}

.handicap-cell.rq-negative {
    color: var(--good);
}

.handicap-cell.rq-positive {
    color: var(--danger);
}

.single-corner {
    position: absolute;
    left: -14px;
    top: 4px;
    width: 46px;
    text-align: center;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    font-weight: 800;
    /*box-shadow: 0 4px 10px rgba(220, 38, 38, 0.22);*/
}

.option-btn,
.sheet-option {
    min-width: 0;
    background: #fffbe8;
    border: 1px solid #e8df9f;
    text-align: center;
}

.option-btn {
    position: relative;
    overflow: hidden;
    min-height: 48px;
    padding: 8px 4px;
    border-radius: var(--radius-xs);
    line-height: 1.25;
    transition: all 0.18s ease;
}

.option-btn:hover,
.sheet-option:hover {
    border-color: #d8cb74;
    box-shadow: none;
}

.sheet-option {
    padding: 10px 4px;
    border-radius: var(--radius-xs);
}

.option-btn .label,
.sheet-option .label {
    display: block;
    position: relative;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-1);
}

.option-btn .odds,
.sheet-option .odds {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-3);
}

.option-btn.disabled,
.sheet-option:disabled {
    background: var(--surface-2);
    color: #94a3b8;
    border-color: var(--border-weak);
    box-shadow: none;
}

.option-btn.disabled .label,
.option-btn.disabled .odds {
    color: #94a3b8;
}

/* ===== SPF 右侧更多玩法 ===== */

.spf-board-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 6px;
    align-items: stretch;
}

.spf-board-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spf-board-main .odds-row {
    margin-top: 0;
}

.spf-board-main {
    gap: 0;
}

.spf-board-main .odds-row {
    gap: 0;
}

.spf-board-main .handicap-cell,
.spf-board-main .option-btn {
    border-radius: 0;
    box-shadow: none;
}

.spf-board-main .odds-row + .odds-row {
    margin-top: -1px;
}

.spf-board-main .odds-row .option-btn,
.spf-board-main .odds-row .handicap-cell {
    margin-left: -1px;
}

.spf-board-main .odds-row .handicap-cell:first-child {
    margin-left: 0;
}

.spf-board-main .handicap-cell {
    border-color: var(--border-normal);
    background: var(--surface-2);
}

.spf-board-main .handicap-cell.rq {
    border-color: rgba(37, 99, 235, 0.16);
    background: #f4f8ff;
}

.spf-board-main .option-btn {
    border-color: #d8cf90;
    background: #fffbe8;
}

.spf-board-main .option-btn:hover {
    border-color: #cdbf61;
    box-shadow: none;
}

.spf-board-main .option-btn.selected {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: none;
}

.spf-board-main .option-btn.selected .label,
.spf-board-main .option-btn.selected .odds {
    color: rgba(255, 255, 255, 0.94);
}

.spf-board-main.in-sheet .odds-row,
.play-board.in-sheet .spf-board-main .odds-row {
    gap: 0;
}

.spf-board-main.in-sheet .handicap-cell,
.spf-board-main.in-sheet .option-btn,
.play-board.in-sheet .spf-board-main .handicap-cell,
.play-board.in-sheet .spf-board-main .option-btn {
    border-radius: 0;
    box-shadow: none;
}

.play-board.in-sheet .compact-grid,
.play-board.in-sheet .score-grid,
.play-board.in-sheet .card-score-grid {
    gap: 0;
}

.play-board.in-sheet .compact-grid .option-btn,
.play-board.in-sheet .score-grid .option-btn,
.play-board.in-sheet .card-score-grid .option-btn {
    border-radius: 0;
    border-color: #d8cf90;
    background: #fffbe8;
    box-shadow: none;
}

.play-board.in-sheet .compact-grid .option-btn:hover,
.play-board.in-sheet .score-grid .option-btn:hover,
.play-board.in-sheet .card-score-grid .option-btn:hover {
    border-color: #cdbf61;
    box-shadow: none;
}

.play-board.in-sheet .compact-grid .option-btn.selected,
.play-board.in-sheet .score-grid .option-btn.selected,
.play-board.in-sheet .card-score-grid .option-btn.selected {
    border-color: #2458c5;
    box-shadow: none;
}

.play-board.in-sheet .compact-grid .option-btn,
.play-board.in-sheet .score-grid .option-btn,
.play-board.in-sheet .card-score-grid .option-btn {
    margin-left: -1px;
    margin-top: -1px;
}

.play-board.in-sheet .compact-grid .option-btn:nth-child(4n+1),
.play-board.in-sheet .card-score-grid .option-btn:nth-child(4n+1) {
    margin-left: 0;
}

.play-board.in-sheet .score-grid .option-btn:nth-child(3n+1) {
    margin-left: 0;
}

#playSheetContent .compact-grid,
#playSheetContent .score-grid,
#playSheetContent .card-score-grid {
    gap: 0;
}

#playSheetContent .compact-grid .option-btn,
#playSheetContent .score-grid .option-btn,
#playSheetContent .card-score-grid .option-btn {
    margin-left: -1px;
    margin-top: -1px;
    border-radius: 0;
    border-color: #d8cf90;
    background: #fffbe8;
    box-shadow: none;
}

#playSheetContent .compact-grid .option-btn:hover,
#playSheetContent .score-grid .option-btn:hover,
#playSheetContent .card-score-grid .option-btn:hover {
    border-color: #cdbf61;
    box-shadow: none;
}

#playSheetContent .compact-grid .option-btn.selected,
#playSheetContent .score-grid .option-btn.selected,
#playSheetContent .card-score-grid .option-btn.selected {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: none;
}

#playSheetContent .compact-grid .option-btn.selected .label,
#playSheetContent .compact-grid .option-btn.selected .odds,
#playSheetContent .score-grid .option-btn.selected .label,
#playSheetContent .score-grid .option-btn.selected .odds,
#playSheetContent .card-score-grid .option-btn.selected .label,
#playSheetContent .card-score-grid .option-btn.selected .odds {
    color: rgba(255, 255, 255, 0.94);
}

#playSheetContent .compact-grid .option-btn:nth-child(4n+1),
#playSheetContent .card-score-grid .option-btn:nth-child(4n+1) {
    margin-left: 0;
}

#playSheetContent .score-grid .option-btn:nth-child(3n+1),
#playSheetContent .compact-grid.hafu-grid .option-btn:nth-child(3n+1) {
    margin-left: 0;
}

.more-btn-vertical {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #cfe0ff;
    color: var(--primary-deep);
    font-size: 11px;
    line-height: 1.15;
    font-weight: 800;
    box-sizing: border-box;
}

.more-btn-vertical span {
    display: block;
}

.card-actions.compact-note-only {
    margin-top: 8px;
}

.card-actions.compact-note-only .card-note {
    font-size: 11px;
    line-height: 1.4;
}

/* ===== AI 概率柱 ===== */

.option-btn.has-ai {
    padding-bottom: 18px;
}

.option-btn .ai-bar {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    overflow: hidden;
}

.option-btn .ai-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.2);
    transition: width 0.2s ease;
}

.option-btn .ai-text {
    position: absolute;
    right: 8px;
    bottom: 14px;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    color: var(--primary-deep);
    pointer-events: none;
}

.option-btn.ai-top1 .ai-fill {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.34), rgba(59, 130, 246, 0.4));
}

.option-btn.ai-top2 .ai-fill {
    background: rgba(59, 130, 246, 0.26);
}

.option-btn.selected .ai-bar {
    background: rgba(255, 255, 255, 0.18);
}

.option-btn.selected .ai-fill {
    background: rgba(255, 255, 255, 0.34);
}

.option-btn.selected.ai-top1 .ai-fill {
    background: rgba(255, 255, 255, 0.48);
}

.option-btn.selected.ai-top2 .ai-fill {
    background: rgba(255, 255, 255, 0.36);
}

.option-btn.selected .ai-text {
    color: rgba(255, 255, 255, 0.92);
}

/* ===== AI 角标 ===== */

.ai-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.24);
}

.option-btn.selected .ai-badge {
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-deep);
}

/* ===== Card Actions ===== */

.card-actions {
    gap: 8px;
    margin-top: 10px;
}

.card-note {
    font-size: 11px;
    line-height: 1.4;
    color: var(--muted);
}

.more-btn {
    padding: 8px 12px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #cfe0ff;
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 700;
}

/* ===== Compact Boards ===== */

.compact-board .compact-grid {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-board .hafu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-score-group + .card-score-group {
    margin-top: 8px;
}

.card-score-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 0 6px;
}

.card-score-head h3 {
    margin: 0;
    font-size: 12px;
    color: var(--text-2);
}

.card-score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.play-board .sheet-group-header {
    margin-top: 10px;
}

.play-board .sheet-group-header h3 {
    font-size: 13px;
    color: var(--text-2);
}

.play-board .score-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.card-score-grid .option-btn.has-ai,
.score-grid .option-btn.has-ai {
    padding-bottom: 16px;
}

.card-score-grid .option-btn .ai-bar,
.score-grid .option-btn .ai-bar {
    left: 5px;
    right: 5px;
    bottom: 5px;
    height: 5px;
}

.card-score-grid .option-btn .ai-text,
.score-grid .option-btn .ai-text {
    right: 6px;
    bottom: 12px;
    font-size: 9px;
}

.card-score-grid .ai-badge,
.score-grid .ai-badge {
    top: 2px;
    right: 2px;
    font-size: 8px;
    padding: 1px 3px;
}

/* ===== Bottom Bet Bar ===== */

.bet-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 10px 10px var(--safe-bottom);
    background: #f3f6fb;
    border-top: 1px solid rgba(15, 23, 42, 0.10);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--text-1);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
}

.bet-bar-inner,
.bet-row {
    max-width: 720px;
    margin: 0 auto;
}

.bet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.top-row {
    align-items: center;
}

.middle-row {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-3);
}

.middle-row strong {
    color: var(--text-1);
    font-weight: 800;
}

.bottom-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.selected-summary {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-2);
}

.pass-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: var(--control-md);
    padding: 0 12px;
    background: #fff;
    color: var(--text-2);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-card);
}

.multiple-stepper {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: var(--control-md);
    border-radius: var(--radius-xs);
    background: #fff;
    overflow: hidden;
    border: 1px solid var(--border-normal);
    box-shadow: var(--shadow-card);
}

.multiple-stepper button,
.multiple-stepper span {
    min-width: 30px;
    min-height: var(--control-md);
    text-align: center;
    padding: 0;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.multiple-stepper span {
    cursor: pointer;
}

.multiple-stepper button {
    color: var(--text-2);
    font-weight: 700;
}

.multiple-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 81;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 12px calc(var(--safe-bottom) + 2px);
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    background: var(--surface-1);
    box-shadow: var(--shadow-float);
}

.multiple-panel-row + .multiple-panel-row {
    margin-top: 14px;
}

.multiple-panel-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
}

.multiple-panel-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    min-height: 36px;
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-xs);
    background: #fff;
}

.multiple-panel-input-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.multiple-panel-unit {
    flex: 0 0 auto;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
}

.multiple-panel-actions {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    gap: 8px;
}

.multiple-panel-actions .ghost-btn,
.multiple-panel-actions .confirm-btn {
    width: auto;
    min-width: 56px;
    padding: 0 12px;
}

.multiple-panel-actions .ghost-btn {
    background: #f1f5f9;
    color: var(--text-2);
    border: 1px solid var(--border-normal);
}

.multiple-panel-actions .ghost-btn:hover {
    background: #eaf0f6;
    color: var(--text);
    border-color: #cfd9e5;
}

.multiple-panel-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.multiple-preset-btn {
    min-width: 60px;
    min-height: 28px;
    padding: 6px 14px;
    border: 1px solid var(--border-normal);
    border-radius: 4px;
    background: #fff;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}

.multiple-preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.ghost-btn {
    background: #fff;
    color: var(--text-2);
    border: 1px solid var(--border-normal);
    border-radius: 4px;
    height: 36px;
    min-height: 36px;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    box-shadow: none;
}

.confirm-btn {
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.bottom-row .ghost-btn,
.bottom-row .confirm-btn {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-row .ghost-btn {
    width: auto;
}

.danger-btn {
    background: #eef2f7 !important;
    border: 1px solid var(--border-normal) !important;
    color: var(--text-2) !important;
}

.danger-btn:hover {
    background: #e6ebf2 !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-1) !important;
}

/* ===== Sheet ===== */

.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.42);
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 81;
    display: flex;
    flex-direction: column;
    max-width: 720px;
    width: 100%;
    max-height: 86vh;
    margin: 0 auto;
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    background: var(--surface-1);
    box-shadow: var(--shadow-float);
}

.sheet-header,
.sheet-footer {
    padding: 10px 12px 8px;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line-soft);
}

.sheet-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.sheet-header p,
.sheet-selection {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 18px;
    border: 1px solid var(--border-normal);
}

.sheet-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px 0;
    scrollbar-width: none;
    min-height: 44px;
}

.sheet-tabs::-webkit-scrollbar {
    display: none;
}

.config-tab,
.pass-chip,
.tag-btn,
.dan-btn {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--border-normal);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 12px;
}

.sheet-group + .sheet-group,
.pass-section + .pass-section,
.dan-list,
.tip-block {
    margin-top: 16px;
}

.sheet-group-header {
    gap: 10px;
    margin-bottom: 10px;
}

.sheet-group-header h3,
.pass-section h3,
.tip-block h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text);
}

.collapse-btn {
    padding: 7px 10px;
    border-radius: var(--radius);
    background: #f1f5f9;
    color: var(--text-2);
    font-size: 12px;
    border: 1px solid var(--line);
    font-weight: 700;
}

.sheet-grid.spf-grid {
    display: grid;
    gap: 10px;
}

.sheet-row {
    display: grid;
    grid-template-columns: 42px repeat(3, 1fr);
    gap: 6px;
}

.sheet-grid.option-grid,
.pass-grid,
.score-grid {
    display: grid;
    gap: 6px;
}

.sheet-grid.option-grid,
.score-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pass-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
}

.pass-chip {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
}

.pass-chip.active {
    background: linear-gradient(135deg, var(--primary), #3b82f6) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.pass-chip.disabled,
.pass-chip:disabled,
.dan-btn.disabled {
    background: #f8fafc !important;
    color: #a0a8b3 !important;
    border-color: #e4ebf3 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

.pass-chip.disabled:hover,
.pass-chip:disabled:hover {
    background: #f8fafc !important;
    color: #a0a8b3 !important;
    border-color: #e4ebf3 !important;
    transform: none !important;
}

.tip-block {
    padding: 14px;
    border-radius: var(--radius);
    background: #f8fbff;
    border: 1px solid #dbeafe;
    text-align: center;
}

.tip-block p,
.dan-limit-note,
.sheet-tip {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

.config-card {
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.config-meta {
    min-width: 0;
}

.config-title {
    font-size: 14px;
    font-weight: 700;
}

.config-sub,
.config-pick {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.config-pick {
    color: var(--primary-deep);
}

.compact-footer {
    border-top: 1px solid var(--line-soft);
}

.sheet-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sheet-actions .ghost-btn,
.sheet-actions .confirm-btn {
    flex: 1;
}

/* ===== Toast ===== */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--safe-bottom) + 118px);
    transform: translateX(-50%) translateY(14px);
    z-index: 40;
    min-width: 140px;
    max-width: calc(100vw - 40px);
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    text-align: center;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Detail / Optimize ===== */

.detail-head,
.optimize-head {
    gap: 10px;
    margin-bottom: 8px;
}

.detail-card.detail-optimize-panel.compact-card {
    display: grid;
    gap: 8px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
    border-color: #cfe0ff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
}

.detail-optimize-panel-head {
    margin-bottom: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(191, 211, 255, 0.72);
}

.detail-optimize-tabs {
    margin-top: 0;
}

.detail-optimize-note {
    margin-top: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(207, 224, 255, 0.9);
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.detail-optimize-note > div + div {
    margin-top: 3px;
}

.detail-title,
.optimize-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.detail-badge,
.optimize-badge,
.sport-placeholder-badge {
    flex: 0 0 auto;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-weight: 700;
    border: 1px solid #cfe0ff;
}

.detail-badge,
.optimize-badge {
    padding: 4px 8px;
    font-size: 12px;
}

.sport-placeholder-badge {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.detail-line {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-2);
}

.detail-line strong {
    color: var(--text);
}

.detail-subline,
.optimize-subline {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

.optimize-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.metric-box,
.range-item {
    border-radius: var(--radius);
    background: #f8fbff;
    border: 1px solid #e4edf7;
}

.metric-box {
    padding: 10px 8px;
    text-align: center;
}

.metric-label,
.range-label {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

.metric-value,
.range-value {
    display: block;
    margin-top: 4px;
    font-weight: 700;
    color: var(--primary-deep);
}

.metric-value {
    font-size: 13px;
}

.range-value {
    font-size: 14px;
}

.muted-tip,
.hit-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

.pick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    display:none;
}

.pick-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e3ebf4;
}

.pick-tag.dan {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    border-color: transparent;
}

.range-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.range-item {
    padding: 10px 12px;
}

.section-title-mini {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.detail-divider {
    height: 1px;
    margin: 12px 0;
    background: var(--line-soft);
}

/* ===== Placeholder ===== */

.sport-placeholder-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.sport-placeholder-desc {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
}

.placeholder-card {
    padding: 14px;
    border-radius: var(--radius);
    background: #f8fbff;
    border: 1px solid #e1ebf8;
}

.placeholder-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
}

.placeholder-card span {
    display: block;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

/* ===== iOS Safari 输入时页面突然放大：统一修复 ===== */

input,
select,
textarea {
    font-size: 14px !important;
    font-family: inherit;
    line-height: 1.2;
}

input[type="number"],
input[type="text"],
input[type="tel"] {
    font-size: 14px !important;
    min-height: 36px;
}

input,
select,
textarea,
button {
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--radius);
}

button,
.more-btn,
.more-btn-vertical,
.pass-btn,
.confirm-btn,
.ghost-btn,
.sale-toggle,
.bonus-btn,
.option-btn,
.sheet-option,
.pass-chip {
    touch-action: manipulation;
}

.multiple-stepper input {
    width: 44px;
    min-width: 44px;
    height: 32px;
    padding: 0 4px;
    border: 0;
    outline: none;
    background: transparent;
    color: #fff;
    text-align: center;
    font-size: 16px !important;
    line-height: 32px;
}

.bet-bar input,
.bet-bar select,
.bet-bar textarea {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.bet-bar input::placeholder,
.bet-bar textarea::placeholder {
    color: rgba(241, 245, 249, 0.55);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===== Plan Detail V2 ===== */

.plan-detail-view {
    display: grid;
    gap: 12px;
}

.detail-header .detail-sub-meta {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.detail-block {
    padding: 14px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.detail-block-title {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.detail-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.split-badge {
    padding: 4px 8px;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #cfe0ff;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.summary-item {
    padding: 12px 10px;
    border-radius: var(--radius);
    background: #f8fbff;
    border: 1px solid #e4edf7;
}

.summary-label {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

.summary-value {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    line-height: 1.2;
    color: var(--primary-deep);
    font-weight: 800;
}

.match-table {
    display: grid;
    gap: 10px;
}

.match-row {
    padding: 12px;
    border-radius: var(--radius);
    background: #fbfdff;
    border: 1px solid var(--line);
}

.match-row.is-dan {
    background: linear-gradient(135deg, #f8fbff, #eef5ff);
    border-color: #cfe0ff;
}

.match-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.match-row-head-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.lottery-id {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius);
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
}

.league-name {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.dan-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.match-row-teams {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--text);
}

.match-pick-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.match-pick-item {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line-soft);
}

.play-name {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.pick-name {
    min-width: 0;
    font-size: 13px;
    color: var(--text);
    font-weight: 700;
}

.pick-odds {
    text-align: right;
    font-size: 13px;
    color: var(--primary-deep);
    font-weight: 800;
}

.detail-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

.plan-info-list {
    display: grid;
    gap: 8px;
}

.plan-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: #f8fbff;
    border: 1px solid #e4edf7;
}

.plan-info-label {
    font-size: 12px;
    color: var(--muted);
}

.plan-info-value {
    text-align: right;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.split-list {
    display: grid;
    gap: 10px;
}

.split-card {
    padding: 12px;
    border-radius: var(--radius);
    background: #fbfdff;
    border: 1px solid var(--line);
}

.split-card-head,
.split-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.split-card-head {
    margin-bottom: 8px;
}

.split-card-head strong {
    font-size: 14px;
    color: var(--text);
}

.split-card-head span,
.split-card-foot span {
    font-size: 12px;
    color: var(--muted);
}

.split-card-content {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}

.split-card-foot {
    margin-top: 8px;
}

.detail-actions-block {
    padding-top: 12px;
}

.detail-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.detail-action-grid + .detail-action-grid {
    margin-top: 8px;
}

.detail-action-grid .ghost-btn,
.detail-action-grid .confirm-btn {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== Detail Sheet Compact Upgrade ===== */

.detail-compact-wrap {
    display: grid;
    gap: 0;
}

.detail-compact-wrap > .detail-card {
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}

.compact-card {
    padding: 10px 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.detail-summary-card.compact-card {
    padding: 8px 12px 10px;
    background: #fffdfa;
    border-color: #d9d3c7;
    box-shadow: none;
}

.ticket-summary-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #4e4338;
    font-size: 18px;
    line-height: 1.6;
}

.ticket-summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.ticket-summary-line strong,
.ticket-summary-line span {
    white-space: nowrap;
}

.ticket-summary-item {
    display: inline-block;
}

.ticket-summary-item.weak {
    color: #9a8d7d;
    font-size: 13px;
    font-weight: 500;
}

.ticket-summary-item.strong {
    font-size: 16px;
    font-weight: 900;
}

.ticket-summary-item.count {
    color: #8f1d1d;
}

.ticket-summary-item.multiple {
    color: #7c4a03;
}

.ticket-summary-item.optimize {
    color: #0f766e;
}

.compact-bet-card {
    position: relative;
    padding: 10px;
    background: #fffdfa;
    border: 1px solid #d9d3c7;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.compact-bet-card + .compact-bet-card {
    margin-top: 0;
}

.detail-compact-wrap > .detail-card + .detail-card {
    margin-top: -1px;
}

.detail-compact-wrap > .detail-card:not(:first-child):not(:last-child) {
    border-radius: 0;
}

.detail-compact-wrap > .detail-card:first-child:not(:last-child) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.detail-compact-wrap > .detail-card:last-child:not(:first-child) {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.compact-bet-card + .compact-bet-card::before {
    content: none;
}

.compact-bet-card::after,
.compact-bet-card::before {
    pointer-events: none;
}

.compact-bet-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 42px;
    border-top: 1px dashed #d9d3c7;
}

.compact-bet-card .compact-detail-head,
.compact-bet-card .compact-picks,
.compact-bet-card .compact-bet-foot {
    position: relative;
    z-index: 1;
}

.compact-bet-card .compact-detail-head {
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.compact-bet-card .compact-detail-head strong {
    color: #3b2f24;
    font-size: 18px;
    font-weight: 900;
}

.compact-bet-card .compact-detail-head span {
    color: #7a6d5d;
}

.compact-detail-head {
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: nowrap;
}

.compact-detail-head strong {
    font-size: 14px;
    line-height: 1.2;
    color: var(--text);
    white-space: nowrap;
}

.compact-detail-head span {
    font-size: 12px;
    line-height: 1.2;
    color: var(--muted);
    white-space: nowrap;
    margin-left: auto;
}

.compact-picks {
    display: grid;
    gap: 6px;
}

.compact-pick-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 60px;
    gap: 6px;
    align-items: start;
    padding: 8px 8px;
    border-radius: var(--radius);
    background: #fffdfa;
    border: 0;
}

.compact-pick-match {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 900;
    color: #2f241c;
    white-space: nowrap;
    padding-top: 2px;
}

.compact-pick-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.compact-pick-meta {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    align-items: center;
}

.compact-pick-league,
.compact-pick-teams {
    min-width: 0;
    font-size: 11px;
    line-height: 1.2;
    color: #8b7e6e;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.compact-pick-choice {
    min-width: 0;
    font-size: 16px;
    line-height: 1.2;
    color: #8f1d1d;
    font-weight: 900;
    display: block;
    white-space: nowrap;
}

.compact-pick-odds {
    text-align: right;
    font-size: 13px;
    line-height: 1.25;
    color: #5b5043;
    font-weight: 800;
    white-space: nowrap;
    padding-top: 2px;
}

.compact-bet-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd5c8;
    font-size: 12px;
    line-height: 1.3;
    color: #5b5043;
    flex-wrap: nowrap;
}

.compact-bet-foot span {
    white-space: nowrap;
}

.compact-bet-amount {
    font-size: 20px;
    line-height: 1.2;
    color: #8f1d1d;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.compact-bet-reward {
    font-size: 12px;
    line-height: 1.2;
    color: #7a6d5d;
    font-weight: 700;
}

/* ===== Share Image Stable Color Fix ===== */

.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-card,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .detail-card,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-bet-card,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .detail-summary-card.compact-card,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-pick-row,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-bet-foot,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .ticket-summary-head,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .ticket-summary-item,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-pick-match,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-pick-teams,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-pick-league,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-pick-choice,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-pick-odds,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-bet-amount,
.sharing-shot-mode #detailSheetContent.sharing-shot-target .compact-bet-reward {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ===== Share Image Mode ===== */

.sharing-shot-mode #detailSheetContent.sharing-shot-target {
    padding: 12px !important;
    background: #f6f3ee;
}

.sharing-shot-mode #detailSheetContent.sharing-shot-target .detail-compact-wrap {
    gap: 0;
}

.sharing-shot-mode #detailSheetContent.sharing-shot-target::before {
    content: none;
}

.sharing-shot-mode #detailSheetContent.sharing-shot-target::after {
    content: none;
}

/* ===== Responsive ===== */

@media (min-width: 421px) {
    .play-board .score-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 721px) {
    body {
        padding-bottom: 184px;
    }

    .sheet {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .multiple-panel {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media (max-width: 420px) {
    .hero-menu {
        width: 146px;
    }

    .save-plan-empty-actions {
        flex-direction: column;
    }
    .bonus-btn {
        width: 100%;
    }

    .teams {
        align-items: flex-start;
    }

    .option-btn .label,
    .sheet-option .label {
        font-size: 12px;
    }

    .pass-grid,
    .sheet-grid.option-grid,
    .score-grid,
    .compact-board .compact-grid,
    .card-score-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .compact-board .hafu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .odds-row,
    .sheet-row {
        grid-template-columns: 38px repeat(3, 1fr);
    }

    .match-card,
    .empty-card {
        padding: 10px;
    }

    .team-name {
        font-size: 15px;
    }

    .optimize-metrics,
    .range-box {
        grid-template-columns: 1fr;
    }

    .hero-top {
        align-items: center;
    }

    .hero > .sale-bar {
        margin-top: 10px;
        padding-top: 9px;
    }

    .sale-extra-row-full {
        justify-content: flex-start;
    }

    .sale-extra-row {
        gap: 10px;
        justify-content: flex-start;
    }

    .sale-ai-actions {
        width: 100%;
        margin-left: 0;
        min-width: 0;
    }

    .sale-ai-btn {
        flex: 1 1 0;
    }

    .top-row {
        gap: 6px;
    }

    .selected-summary {
        padding: 0 4px;
        font-size: 12px;
    }

    .pass-btn {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 13px;
    }

    .bottom-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pass-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .pass-chip {
        min-height: 42px;
        padding: 9px 10px;
        font-size: 13px;
    }

    .spf-board-layout {
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 5px;
    }

    .more-btn-vertical {
        align-self: stretch;
        height: 100%;
        min-height: 0;
        padding: 6px 3px;
        font-size: 10px;
        gap: 2px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .summary-item {
        padding: 10px 8px;
    }

    .summary-value {
        font-size: 15px;
    }

    .match-row {
        padding: 10px;
    }

    .match-pick-item {
        grid-template-columns: 74px minmax(0, 1fr) 48px;
        gap: 6px;
        padding: 7px 8px;
    }

    .play-name,
    .pick-name,
    .pick-odds {
        font-size: 12px;
    }

    .plan-info-item {
        padding: 9px 10px;
    }

    .detail-action-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .detail-compact-wrap {
        gap: 8px;
    }

    .compact-card,
    .detail-summary-card.compact-card,
    .compact-bet-card {
        padding: 8px;
    }

    .compact-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .compact-summary-item {
        padding: 7px 7px;
    }

    .compact-summary-label {
        font-size: 10px;
    }

    .compact-summary-value {
        font-size: 12px;
    }

    .compact-summary-note {
        margin-top: 6px;
        font-size: 10px;
        line-height: 1.35;
    }

    .compact-detail-head {
        margin-bottom: 6px;
    }

    .compact-detail-head strong {
        font-size: 13px;
    }

    .compact-detail-head span {
        font-size: 11px;
    }

    .compact-picks {
        gap: 5px;
    }

    .compact-pick-row {
        grid-template-columns: 58px minmax(0, 1fr) 52px;
        gap: 5px;
        padding: 6px 7px;
    }

    .compact-pick-match {
        font-size: 10px;
    }

    .compact-pick-option {
        font-size: 11px;
    }

    .compact-pick-odds {
        font-size: 10px;
    }

    .compact-bet-foot {
        margin-top: 6px;
        padding-top: 6px;
        font-size: 11px;
        gap: 6px;
    }
}

.sheet .ghost-btn {
    background: #f1f5f9;
    color: var(--text-2);
    border: 1px solid var(--line);
}

.sheet .ghost-btn:hover {
    background: #eaf0f6;
    color: var(--text);
    border-color: #cfd9e5;
}
/* 方案详情保存相关 */
/* ===== Save Plan ===== */

.detail-actions-2,
.detail-actions-3 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.danger-save-btn {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: #fff !important;
    border: 1px solid rgba(220, 38, 38, 0.22) !important;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22) !important;
}

.danger-save-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
}

.save-plan-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.save-plan-list.simple {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.save-plan-option {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: none;
}

.save-plan-option:hover {
    background: #f8fbff;
    border-color: #cfdcf0;
}

.save-plan-option.active {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    border-color: #dc2626;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.18);
}

.save-plan-option-text {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 420px) {
    .detail-actions-2,
    .detail-actions-3 {
        grid-template-columns: 1fr;
    }

    .save-plan-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== Save Sheet over Detail Sheet ===== */

#detailSheet.sheet-backgrounded {
    z-index: 79;
    pointer-events: none;
    filter: saturate(0.92) brightness(0.96);
}

#detailSheet.sheet-backgrounded .sheet-header,
#detailSheet.sheet-backgrounded .sheet-content,
#detailSheet.sheet-backgrounded .sheet-footer {
    opacity: 0.38;
}

#savePlanSheetMask {
    z-index: 82;
}

#savePlanSheet {
    z-index: 83;
}

.ai-filter-panel {
    margin-bottom: 14px;
    padding: 0;
    border-radius: 4px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ai-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--border-normal);
    box-shadow: var(--shadow-card);
}

.ai-filter-item {
    min-width: 0;
    position: relative;
}

.ai-filter-item + .ai-filter-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border-normal);
}

.ai-filter-select {
    display: block;
    position: relative;
}

.ai-filter-select::after {
    content: "▼";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 10px;
    color: #64748b;
    pointer-events: none;
}

.ai-filter-native-select {
    width: 100%;
    min-height: 32px;
    padding: 0 28px 0 12px;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: none;
}

.ai-filter-native-select:hover {
    background: rgba(255, 255, 255, 0.5);
}

#aiAssistSheet {
    height: 86vh;
}

#aiAssistSheet .sheet-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#aiAssistSheet .sheet-content > .ai-filter-panel {
    flex: 0 0 auto;
}

#aiAssistSheet .sheet-content > .ai-spf-table,
#aiAssistSheet .sheet-content > .ai-rec-empty {
    flex: 1 1 auto;
}

.ai-spf-table,
.ai-rec-empty {
    min-height: 0;
}

#aiAssistSheetTabs.sheet-tabs,
#aiAssistSheetTabs .mode-tabbar,
#aiAssistSheetTabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 148px));
    justify-content: center;
    gap: 6px;
    min-height: 56px;
}

#aiAssistSheetTabs .mode-tabbar,
#aiAssistSheetTabs {
    background: linear-gradient(180deg, #f5f9ff 0%, #edf4ff 100%);
    border: 1px solid #d7e3ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#aiAssistSheetTabs .mode-tab,
#aiAssistSheetTabs .mode-tabbar .mode-tab,
#aiAssistSheetTabs > .mode-tab {
    appearance: none;
    border: 0;
    flex: 0 1 148px;
    height: 40px;
    padding: 8px 10px 7px;
    border-radius: 4px;
    background: transparent;
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    cursor: pointer;
    transition: .18s ease;
    overflow: hidden;
}

#aiAssistSheetTabs .mode-tab-text,
#aiAssistSheetTabs .mode-tab-note {
    display: block;
    line-height: 1.1;
    white-space: nowrap;
}

#aiAssistSheetTabs .mode-tab-text {
    font-size: 13px;
    font-weight: 800;
}

#aiAssistSheetTabs .mode-tab-note {
    font-size: 11px;
    font-weight: 600;
    color: rgba(71, 85, 105, 0.76);
}

#aiAssistSheetTabs .mode-tab:hover,
#aiAssistSheetTabs > .mode-tab:hover {
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
}

#aiAssistSheetTabs .mode-tab.active,
#aiAssistSheetTabs > .mode-tab.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
}

#aiAssistSheetTabs .mode-tab.active .mode-tab-note,
#aiAssistSheetTabs > .mode-tab.active .mode-tab-note {
    color: rgba(255, 255, 255, 0.76);
}

.ai-rec-list {
    display: grid;
    gap: 14px;
}

.ai-rec-card {
    padding: 14px;
    border-radius: 4px;
    background: #fffdf2;
    border: 1px solid #ece3ac;
    box-shadow: var(--shadow-card);
}

.ai-rec-head,
.ai-rec-body,
.ai-rec-foot {
    display: grid;
    gap: 8px;
}

.ai-rec-body,
.ai-rec-foot {
    margin-top: 10px;
}

.ai-rec-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.ai-rec-sub {
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.ai-rec-picks {
    display: grid;
    gap: 8px;
}

.ai-rec-pick {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 4px;
    background: #fff9df;
    border: 1px solid #ebe1a7;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-2);
}

.ai-rec-card .ai-rec-pick + .ai-rec-pick {
    position: relative;
}

.ai-rec-card .ai-rec-pick + .ai-rec-pick::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 10px;
    right: 10px;
    height: 1px;
    background: rgba(148, 163, 184, 0.18);
}

.ai-rec-pick span:last-child {
    flex: 0 0 auto;
    color: #475569;
    font-weight: 400;
}

.ai-rec-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ai-rec-metric {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 4px;
    background: #fff8d6;
    border: 1px solid #e9dda0;
    box-shadow: none;
}

.ai-rec-metric span {
    font-size: 11px;
    color: var(--muted);
}

.ai-rec-metric strong {
    font-size: 17px;
    color: var(--primary-deep);
    font-weight: 500;
}

.ai-rec-actions {
    display: flex;
    justify-content: flex-end;
}

.ai-import-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    box-shadow: none;
    margin-top: 2px;
}

.ai-import-btn:hover {
    background: var(--primary-deep);
}

.ai-spf-table {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 4px;
    border: 1px solid #e8dfac;
    background: #fffdf2;
    box-shadow: var(--shadow-card);
}

.ai-spf-table-head,
.ai-spf-table-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 92px 82px 72px;
    gap: 10px;
    align-items: center;
    padding: 12px;
}

.ai-spf-table-head {
    background: linear-gradient(180deg, #fff8d9 0%, #fff1bf 100%);
    border-bottom: 1px solid #e8dfac;
    font-size: 12px;
    font-weight: 500;
    color: #7a6b2a;
}

.ai-spf-table-row + .ai-spf-table-row {
    border-top: 1px solid rgba(232, 223, 172, 0.85);
}

.ai-spf-cell {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-2);
}

.ai-spf-index,
.ai-spf-odds,
.ai-spf-probability,
.ai-spf-action {
    text-align: center;
}

.ai-spf-matches {
    color: var(--text);
}

.ai-spf-table-row {
    background: #fffdf2;
}

.ai-spf-table-row:nth-child(even) {
    background: #fff8dc;
}

.ai-table-match-line {
    color: var(--text);
    font-weight: 400;
}

.ai-table-match-line strong {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-deep);
    margin-right: 6px;
}

.ai-table-pick-line {
    margin-top: 4px;
    color: var(--text-3);
    font-size: 11px;
}

.ai-spf-odds,
.ai-spf-probability {
    font-weight: 500;
    color: var(--primary-deep);
}

.ai-rec-empty {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    padding: 20px 14px;
    border-radius: 4px;
    background: #fffdf2;
    border: 1px dashed #ddd28f;
    text-align: center;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-3);
    box-shadow: none;
}

.ai-empty-block {
    padding: 28px 14px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--line);
    text-align: center;
    box-shadow: var(--shadow-xs);
}

.ai-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.ai-empty-desc {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

@media (min-width: 640px) {
    .ai-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
    }
}

@media (max-width: 420px) {
    .ai-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    #aiAssistSheetTabs .mode-tabbar,
    #aiAssistSheetTabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #aiAssistSheetTabs .mode-tab,
    #aiAssistSheetTabs .mode-tabbar .mode-tab,
    #aiAssistSheetTabs > .mode-tab {
        flex: none;
    }

    .ai-rec-pick {
        flex-direction: column;
    }

    .ai-rec-pick span:last-child {
        flex: 1 1 auto;
    }

    .ai-rec-metrics {
        grid-template-columns: 1fr;
    }

    .ai-rec-actions {
        justify-content: stretch;
    }

    .ai-import-btn {
        width: 100%;
    }

    .ai-spf-table-head {
        display: none;
    }

    .ai-spf-table-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px 10px;
        align-items: start;
    }

    .ai-spf-odds,
    .ai-spf-probability,
    .ai-spf-action {
        text-align: left;
    }

    .ai-spf-cell.ai-spf-odds::before {
        content: "最终赔率：";
        color: var(--muted);
        font-weight: 600;
    }

    .ai-spf-cell.ai-spf-probability::before {
        content: "概率：";
        color: var(--muted);
        font-weight: 600;
    }

    .ai-spf-cell.ai-spf-action::before {
        content: "操作：";
        color: var(--muted);
        font-weight: 600;
        display: inline-block;
        margin-right: 6px;
    }

    .ai-spf-index {
        grid-row: span 4;
        font-size: 14px;
        font-weight: 800;
    }

    .ai-spf-action .ai-import-btn {
        width: auto;
    }

    .ai-table-pick-line {
        margin-top: 2px;
    }
}

.save-plan-empty-card {
    padding: 22px 14px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    text-align: center;
    box-shadow: var(--shadow-xs);
}

.save-plan-empty-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.save-plan-empty-desc {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

.save-plan-empty-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.save-plan-empty-actions .ghost-btn,
.save-plan-empty-actions .confirm-btn {
    flex: 1;
}
