/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #f1f5f9;
    --border-input: #e2e8f0;
    --text: #1a1a2e;
    --text-secondary: #475569;
    --text-dim: #94a3b8;
    --accent: #1a73e8;
    --accent-hover: #1557b0;
    --green: #2e7d32;
    --green-bg: #e8f5e9;
    --red: #c62828;
    --orange-bg: #fff3e0;
    --orange: #e65100;
    --indigo: #283593;
    --indigo-bg: #e8eaf6;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 16px;
}

/* ===== PC 导航 ===== */
.pc-nav {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-logo { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.logo-img { height: 40px; width: auto; vertical-align: middle; margin: -6px 0; }
.pc-nav-tabs { display: flex; gap: 4px; }
.nav-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}
.nav-tab:hover { background: #e8f0fe; color: var(--accent); }
.nav-tab.active { background: #e8f0fe; color: var(--accent); font-weight: 600; }

/* ===== 用户区域 ===== */
.user-area { display: flex; align-items: center; }
.user-menu-link {
    display: flex; align-items: center; gap: 6px; text-decoration: none;
    padding: 4px 10px; border-radius: 20px; transition: background 0.15s;
}
.user-menu-link:hover { background: #f0f0f0; }
.user-avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.user-name { font-size: 13px; color: var(--text-secondary); }
.hidden { display: none !important; }

/* ===== 主内容区 ===== */
.app-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ===== 页脚（备案号） ===== */
.icp-footer {
    text-align: center;
    padding: 16px 12px 24px;
    font-size: 12px;
    color: #999;
}
.icp-footer a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}
.icp-footer a:hover { color: var(--accent); }

/* ===== 手机端底部 Tab ===== */
.mobile-tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
.tab-item {
    text-decoration: none;
    text-align: center;
    color: var(--text-dim);
    transition: color 0.2s;
}
.tab-item.active { color: var(--accent); }
.tab-icon { width: 22px; height: 22px; display: block; margin: 0 auto; }
.tab-label { font-size: 10px; margin-top: 2px; display: block; }

/* ===== 输入区 ===== */
.input-section { padding: 16px; }
.input-row { display: flex; gap: 12px; align-items: center; }
.url-input-wrap input {
    flex: 1; padding: 12px 40px 12px 16px; font-size: 1rem; font-family: inherit;
    border: 1.5px solid var(--border-input); border-radius: 12px; outline: none;
    transition: border-color 0.2s; background: var(--surface);
}
.url-input-wrap input:focus { border-color: var(--accent); }
.url-input-wrap input.invalid { border-color: var(--red) !important; background: #fff5f5; }

/* 牌谱输入框 ✕ 清除按钮 */
.url-input-wrap { position: relative; flex: 1; display: flex; }
.input-clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
    background: #b8b8b8; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1; padding: 0;
    opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s;
}
.input-clear.show { opacity: 1; visibility: visible; }
.input-clear:hover { background: #888; }

/* 多牌谱输入 */
.url-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.url-row .url-input-wrap { flex: 1; }
.input-del {
    width: 32px; height: 44px; border-radius: 8px; border: 1.5px solid var(--border-input);
    background: transparent; color: var(--text-dim); cursor: pointer; font-size: 14px; flex-shrink: 0;
}
.input-del:hover { background: #fdecea; border-color: var(--red); color: var(--red); }
.btn-add {
    padding: 8px 16px; border: 1.5px dashed var(--accent); color: var(--accent);
    background: transparent; border-radius: 10px; cursor: pointer; font-size: 0.9rem; white-space: nowrap;
}
.btn-add:hover { background: #e8f0fe; }
.btn-add:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-add:disabled:hover { background: transparent; }

.rule-section { margin-top: 14px; }
.rule-group {
    display: grid;
    grid-template-columns: 72px 24px repeat(6, 52px);
    gap: 8px;
    align-items: center;
}
.rule-group + .rule-group { margin-top: 8px; }
.rule-title { font-weight: 700; font-size: 0.95rem; color: var(--text-secondary); white-space: nowrap; }
.rule-tip { font-size: 0.85rem; color: var(--text-dim); cursor: help; }
.rule-radio {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.9rem; cursor: pointer; padding: 6px 0;
    border: 1.5px solid var(--border-input); border-radius: 8px;
    transition: all 0.15s; user-select: none;
}
.rule-radio:hover { background: #e8f0fe; border-color: var(--accent); }
.rule-radio input[type="radio"] { cursor: pointer; }

/* ===== 按钮 ===== */
.btn-primary {
    padding: 12px 28px; font-size: 1rem; font-family: inherit;
    background: var(--accent); color: #fff; border: none;
    border-radius: 12px; cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #e0e0e0; color: #999; cursor: not-allowed; }
.btn-shot {
    padding: 12px 14px; font-size: 13px; font-family: inherit;
    background: var(--surface); border: 1.5px solid var(--border-input);
    border-radius: 12px; cursor: pointer; color: #1e8e3e;
    transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.btn-shot:hover { border-color: var(--accent); color: var(--accent); background: #e8f0fe; }

.result-rule {
    text-align: left; color: var(--accent); font-size: 13px; font-weight: 600;
    margin-bottom: 10px;
}

.hero {
    margin-bottom: 4px;
    height: 0;
    padding-top: 12.5%;            /* 保持 8:1 宽高比（720x90），随容器宽度缩放 */
    background: #fff url('/hero.jpg') center/100% 100% no-repeat;
    border-radius: 8px;
    box-sizing: border-box;
}

/* ===== 卡片 ===== */
.result-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

/* ===== 表格 ===== */
.summary-table, .detail-table {
    width: 100%; border-collapse: collapse; table-layout: fixed;
}
.summary-table { font-size: 0.95rem; }
.summary-table th, .detail-table th {
    text-align: center; color: var(--text-secondary);
    font-weight: 700; border-bottom: 2px solid var(--border);
}
.summary-table th { padding: 8px 1px; }
.detail-table th { padding: 8px 6px; }
.summary-table td, .detail-table td {
    text-align: center; padding: 8px 6px; border-bottom: 1px solid var(--border); font-weight: 500;
}
.summary-table .label, .detail-table .label {
    text-align: left; color: var(--text-dim); font-weight: 700; font-size: 0.9rem; width: 70px;
}
.summary-table tr:last-child td, .detail-table tr:last-child td { border-bottom: none; }
.summary-table tr:last-child td { font-weight: 700; }
.detail-table { font-size: 0.9rem; }
.table-wrapper { overflow-x: auto; }
.btn-detail-toggle {
    display: block; margin: 12px auto 0; padding: 8px 20px;
    border: 1.5px solid var(--accent); color: var(--accent); background: transparent;
    border-radius: 10px; cursor: pointer; font-size: 0.9rem;
}
.btn-detail-toggle:hover { background: #e8f0fe; }

.about-page h2 { font-size: 1.3rem; margin-bottom: 4px; }
.about-subtitle { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }
.about-page h3 { font-size: 15px; margin: 20px 0 8px; }
.about-page p { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 8px; }
.about-footer { text-align: center; padding: 12px; font-size: 13px; color: var(--text-dim); margin-top: 20px; }

/* ===== 加载 & 错误 ===== */
.loading { text-align: center; padding: 40px; }
.spinner {
    width: 40px; height: 40px; margin: 0 auto 16px;
    border: 3px solid rgba(26,115,232,0.2); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg {
    margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
    background: #fef2f2; color: var(--red); font-size: 0.95rem;
}

/* ===== 认证页面 ===== */
.auth-page {
    display: flex; justify-content: center; padding-top: 40px;
}
.auth-card {
    background: var(--surface); border-radius: var(--radius); padding: 32px 24px;
    width: 100%; max-width: 380px; border: 1.5px solid var(--border); box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h2 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-dim); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.form-group input {
    padding: 10px 14px; border: 1.5px solid var(--border-input); border-radius: var(--radius-sm);
    font-size: 15px; font-family: inherit; outline: none;
}
.form-group input:focus { border-color: var(--accent); }
.auth-btn { width: 100%; margin-top: 4px; }
.auth-error {
    padding: 8px 12px; background: #fef2f2; color: var(--red);
    border-radius: var(--radius-sm); font-size: 13px;
}
.auth-switch { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: 16px; }
.auth-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-cancel-btn {
    width: 100%; padding: 10px; margin-top: 8px; font-size: 14px; font-family: inherit;
    background: none; border: none; color: var(--text-dim); cursor: pointer;
}
.auth-cancel-btn:hover { color: var(--text-secondary); }
.auth-hint {
    margin-top: 16px; padding: 12px; background: #f8fafc; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-dim); text-align: center; line-height: 1.6;
}

/* ===== 战绩列表 ===== */
.records-header { margin-bottom: 12px; }
.records-header h2 { font-size: 1.3rem; }
.records-filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-select {
    flex: 1; padding: 10px 14px; border: 1.5px solid var(--border-input);
    border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
    background: var(--surface); color: var(--text-secondary); outline: none;
    appearance: none; -webkit-appearance: none;
}

/* ===== 战绩表格 ===== */
.records-table {
    width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed;
    background: var(--surface); border-radius: var(--radius);
    overflow: hidden; border: 1.5px solid var(--border);
}
.records-table th {
    padding: 12px 10px; text-align: left; font-size: 12px;
    color: var(--text-dim); font-weight: 600; background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.records-table th:nth-child(1) { width: 12%; }
.records-table th:nth-child(2) { width: 25%; }
.records-table th:nth-child(3) { width: 7%; text-align: center; }
.records-table th:nth-child(4) { width: 8%; text-align: center; }
.records-table th:nth-child(5) { width: 8%; text-align: center; }
.records-table th:nth-child(6) { width: 7%; text-align: center; }
.records-table th:nth-child(7) { width: 13%; text-align: right; }
.records-table th:nth-child(8) { width: 12%; text-align: center; }

.record-row {
    cursor: pointer; transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}
.record-row:last-child { border-bottom: none; }
.record-row:hover { background: #f8fafc; }
.record-row td {
    padding: 12px 10px; color: var(--text-secondary);
}
.record-row td:nth-child(3) { text-align: center; }
.record-row td:nth-child(3),
.record-row td:nth-child(4) { text-align: center; }
.record-row td:nth-child(5),
.record-row td:nth-child(6) { text-align: center; }
.record-row td:nth-child(7) { text-align: right; font-weight: 700; }
.record-row td:nth-child(8) { text-align: center; }

.pos-badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
}
.pos-1 { background: var(--green-bg); color: var(--green); }
.pos-2 { background: var(--indigo-bg); color: var(--indigo); }
.pos-3 { background: var(--orange-bg); color: var(--orange); }
.pos-4 { background: #fce4ec; color: var(--red); }
td.score-positive { color: var(--green) !important; }
td.score-negative { color: var(--red) !important; }

.records-total td {
    padding: 8px 10px; font-weight: 600; font-size: 13px;
    border-bottom: 2px solid var(--accent);
    background: linear-gradient(to bottom, #f0f6ff, #f8fafc);
}
.records-total td:first-child { font-size: 13px; color: var(--text-dim); }
.records-total td:nth-child(2),
.records-total td:nth-child(3) { text-align: center; }
.records-total td:nth-child(4) { text-align: right; }

/* ===== 战绩日历 ===== */
.records-tabs {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.records-tab {
    padding: 8px 20px; border-radius: 20px; border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-secondary);
    font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
    font-family: inherit;
}
.records-tab:hover { border-color: var(--accent); color: var(--accent); }
.records-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.calendar-toolbar {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.cal-nav {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text-secondary); font-size: 18px; line-height: 1; cursor: pointer;
    transition: all 0.2s; font-family: inherit;
}
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-title { font-size: 16px; font-weight: 700; min-width: 96px; text-align: center; }
.calendar-toolbar .filter-select { flex: 0 0 auto; }

.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
    background: var(--surface); border-radius: var(--radius); padding: 12px;
    border: 1.5px solid var(--border);
}
.cal-head { display: contents; }
.cal-head-cell {
    text-align: center; font-size: 12px; font-weight: 600; color: var(--text-dim);
    padding: 4px 0 8px;
}
.calendar-day {
    min-height: 64px; border-radius: var(--radius-sm); padding: 6px;
    background: #f8fafc; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-start; gap: 4px;
    border: 1px solid transparent;
}
.calendar-day.empty { background: transparent; }
.calendar-day.today { border-color: var(--accent); }
.day-num { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.day-score { font-size: 12px; font-weight: 700; }
.calendar-day.pos { background: var(--green-bg); }
.calendar-day.pos .day-score { color: var(--green); }
.calendar-day.neg { background: #fce4ec; }
.calendar-day.neg .day-score { color: var(--red); }

.calendar-summary {
    margin-top: 12px; text-align: right; font-size: 13px; color: var(--text-secondary);
    font-weight: 600;
}

/* ===== 战绩详情 ===== */
.detail-topbar {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--accent); text-decoration: none; font-size: 15px; font-weight: 500;
    padding: 6px 0; transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.7; }
.btn-delete {
    background: none; border: 1px solid var(--red); color: var(--red);
    border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer;
    font-family: inherit;
}
.detail-meta { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

/* ===== 分析页 Tab ===== */
.analysis-tabs {
    display: flex; gap: 6px; margin-bottom: 16px;
    background: var(--surface); border-radius: var(--radius);
    padding: 4px; border: 1.5px solid var(--border);
}
.a-tab {
    flex: 1; padding: 8px 0; font-size: 13px; font-family: inherit;
    border: none; border-radius: 11px; background: transparent;
    color: var(--text-dim); cursor: pointer; transition: all 0.2s;
}
.a-tab.active {
    background: var(--accent); color: #fff; font-weight: 600;
    box-shadow: 0 1px 3px rgba(26,115,232,0.3);
}
.a-tab-content.hidden { display: none; }
.rival-sort { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 12px; }
.sort-btn {
    padding: 4px 12px; font-size: 12px; font-family: inherit;
    border: 1.5px solid var(--border-input); border-radius: 16px;
    background: var(--surface); color: var(--text-dim); cursor: pointer;
    transition: all 0.15s;
}
.sort-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.rival-list { display: flex; flex-direction: column; gap: 8px; }

.trend-limit-row {
    display: flex; align-items: center; justify-content: flex-end; gap: 2px;
    font-size: 13px; color: var(--text-dim);
}
.limit-btn {
    width: 26px; height: 26px; border: none;
    border-radius: 50%; background: var(--border);
    color: var(--text-secondary); font-size: 15px; line-height: 1;
    font-family: inherit; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.limit-btn:hover { background: var(--accent); color: #fff; }
#trendLimitVal {
    font-weight: 600; color: var(--text); min-width: 28px; text-align: center;
    font-size: 14px;
}

/* ===== 分析页 ===== */
.stats-cards {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.stat-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); padding: 16px 10px; text-align: center;
    box-shadow: var(--shadow);
}
.stat-main { grid-column: span 2; }
.stat-pos { border: none; }
.stat-value { font-size: 26px; font-weight: 800; }
.stat-value.positive { color: var(--green); }
.stat-label { font-size: 12px; margin-top: 4px; color: inherit; opacity: 0.8; }
.chart-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
    box-shadow: var(--shadow);
}
#trendChart { max-height: 180px; }
#posChart { max-height: 220px; }
.chart-card h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text-secondary); }


/* ===== 我的页面 ===== */
.me-page { text-align: center; padding-top: 24px; }
.me-header { margin-bottom: 24px; }
.me-avatar .user-avatar-img { width: 64px; height: 64px; }
.me-header h2 { font-size: 1.4rem; }
.me-header p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.me-links { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }
.me-btn {
    padding: 14px; font-size: 15px; font-family: inherit;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); cursor: pointer; color: var(--text-secondary);
    transition: all 0.2s; text-decoration: none; text-align: center; display: block;
}
.me-btn:hover { border-color: var(--accent); color: var(--accent); }
.me-btn-danger { color: var(--red); border-color: #fce4ec; }
.me-btn-danger:hover { background: #fef2f2; }

/* ===== 保存提示 ===== */
.save-toast {
    padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px;
    margin-bottom: 12px; text-align: center;
}
.save-toast.success { background: var(--green-bg); color: var(--green); }
.save-toast.warning { background: #fff8e1; color: #f57f17; }

/* 全局浮动 toast（替换原生 alert） */
.global-toast {
    position: fixed; top: 20px; left: 50%;
    transform: translate(-50%, -16px);
    padding: 12px 22px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    z-index: 999; opacity: 0;
    transition: opacity 0.28s, transform 0.28s;
    max-width: 86%; text-align: center;
}
.global-toast.show { opacity: 1; transform: translate(-50%, 0); }
.global-toast.warning { background: #fff8e1; color: #b26a00; border: 1px solid #ffe082; }
.global-toast.error { background: #fdecea; color: #c62828; border: 1px solid #f5c6cb; }
.global-toast.info { background: #e8f0fe; color: #1a73e8; border: 1px solid #c9ddf7; }

.action-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.15); z-index: 200;
}
.action-sheet {
    position: fixed; background: var(--surface);
    border-radius: 16px; padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    min-width: 140px;
}
.action-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; font-size: 14px; font-family: inherit;
    border: none; border-radius: 12px; cursor: pointer;
    background: none; color: var(--text); width: 100%;
    transition: background 0.15s;
}
.action-btn:hover { background: #f0f4ff; }
.action-btn::before { font-size: 16px; }
#btnViewDetail::before { content: '📋'; }
#btnAiReview::before { content: '🤖'; }

.empty-state {
    text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .pc-nav-tabs { display: none; }
    .mobile-tab-bar { display: flex; }
    body { padding-bottom: 72px; }
    .app-main { padding: 12px 10px 80px; }
    .input-row { flex-direction: column; gap: 8px; }
    .url-input-wrap { width: 100%; }
    .url-row input { width: 100%; }
    .btn-primary { width: 100%; }
    .btn-shot { display: none; }
    .rule-group { grid-template-columns: 56px 16px repeat(6, 42px); gap: 2px; }
    .rule-title { font-size: 0.7rem; }
    .rule-radio { font-size: 0.65rem; padding: 4px 0; }
    .result-card { padding: 12px 8px; }
    .summary-table { font-size: 0.6rem; }
    .summary-table th, .summary-table td { padding: 4px 1px; white-space: nowrap; }
    .summary-table .label { width: 28px; font-size: 0.6rem; }
    .detail-table { font-size: 0.6rem; }
    .detail-table th, .detail-table td { padding: 3px 1px; white-space: nowrap; }
    .detail-table .label { width: 40px; font-size: 0.55rem; }
    .stats-cards { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .stat-main { grid-column: span 2; }
    .stat-value { font-size: 20px; }
    .records-table { font-size: 10px; table-layout: auto; }
    .records-table th, .records-table td { padding: 6px 3px; }
    .record-row td:first-child { font-size: 9px; }
    .pos-badge { padding: 1px 5px; font-size: 9px; }
    .records-total td { font-size: 10px !important; padding: 6px 2px !important; }

    /* 战绩日历 - 移动端紧凑 */
    .calendar-toolbar { gap: 6px; }
    .cal-nav { width: 32px; height: 32px; font-size: 15px; }
    .cal-title { font-size: 14px; min-width: 76px; }
    .calendar-toolbar .filter-select { flex: 1; min-width: 0; padding: 8px 10px; font-size: 12px; }
    .calendar-grid { gap: 3px; padding: 8px; }
    .cal-head-cell { font-size: 10px; padding: 2px 0 4px; }
    .calendar-day { min-height: 42px; padding: 2px; }
    .day-num { font-size: 11px; }
    .day-score { font-size: 9px; }
    .calendar-summary { font-size: 12px; }
}

@media (min-width: 769px) {
    .pc-nav { display: flex; }
    .mobile-tab-bar { display: none; }
    .stats-cards { grid-template-columns: repeat(4, 1fr); }
    .btn-shot { display: inline-flex; align-items: center; }
}

/* ===== AI 分析 ===== */
/* AI 分析展开卡片 */
.ai-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(26,115,232,0.06);
}
.ai-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 12px 14px;
    background: #f8fafc; border-bottom: 1px solid var(--border);
}
.ai-card-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.ai-rank-badge {
    padding: 3px 12px; border-radius: 20px;
    background: #e8f0fe; color: var(--accent);
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-table th {
    padding: 8px 12px; text-align: left; font-size: 11px;
    color: var(--text-dim); font-weight: 600; background: #fafbfc;
    border-bottom: 1px solid var(--border);
}
.ai-table th:nth-child(n+2) { text-align: right; }
.ai-table td {
    padding: 10px 12px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.ai-table tbody tr:last-child td { border-bottom: none; }
.ai-table td:nth-child(n+2) { text-align: right; }
.ai-table .ai-me td { background: #e8f0fe; font-weight: 600; }
.ai-name { font-weight: 600; white-space: nowrap; }
.ai-table td.ai-rating { font-weight: 700; font-size: 16px; }
.ai-table td.ai-rating-good { color: #16a34a; }
.ai-table td.ai-rating-mid { color: #2563eb; }
.ai-table td.ai-rating-low { color: #ea580c; }
.ai-table td.ai-bad-high { color: var(--red); font-weight: 600; }
.ai-table td.ai-bad-mid { color: var(--orange); }
.ai-detail-link {
    display: block; padding: 10px 14px; text-align: center;
    font-size: 12px; color: var(--accent); text-decoration: none;
    border-top: 1px solid var(--border);
}
.ai-detail-link:hover { background: #f8fafc; }
/* AI 徽章（列表列） */
.ai-badge { display:inline-block; padding:2px 6px; border-radius:10px; font-size:11px; font-weight:600; white-space: nowrap; }
.ai-badge.green { background:#e8f5e9; color:#16a34a; }
.ai-badge.blue  { background:#e8f0fe; color:#2563eb; }
.ai-badge.gray  { background:#f1f3f4; color:#5f6368; }
.ai-badge.orange { background:#fff3e0; color:#ea580c; }
.ai-badge.pending { background:#fef7e0; color:#b06000; }
.ai-badge.err  { background:#fce8e6; color:#d93025; }
.ai-badge.none { background:transparent; color:#bdc1c6; }
.ai-analyze-btn {
    padding: 3px 10px; border-radius: 10px;
    background: #e8f0fe; color: var(--accent);
    border: 1px solid #c9ddf7; font-size: 11px; font-weight: 600;
    cursor: pointer; white-space: nowrap; font-family: inherit;
}
.ai-analyze-btn:hover { background: #d6e6fc; }
.ai-th { text-align: center; line-height: 1.3; }
.ai-th-title { display: block; }
.ai-th-hint { display: block; font-size: 10px; font-weight: 400; color: var(--text-dim); white-space: nowrap; }
.ai-badge.ai-toggle { cursor: pointer; }
.ai-badge.ai-toggle:hover { filter: brightness(0.93); }
.ai-caret { font-size: 10px; margin-left: 1px; }
.ai-expand-box { padding:12px 16px; background:#f8fafc; }
.ai-loading, .ai-error { color:#5f6368; font-size:13px; padding:4px 0; }
.ai-error { color:#d93025; }


