/* ========== App Shell · 天津高考报考指南 ========== */

:root {
    --app-max-width: 480px;
    --app-bg: #f2f2f7;
    --app-surface: #ffffff;
    --app-header-height: 52px;
    --tab-bar-height: 56px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-title: 17px;
    --font-body: 15px;
    --font-caption: 13px;
    --font-small: 12px;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --border-color: #e5e5ea;
    --separator: rgba(60, 60, 67, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease;
}

/* 隐藏旧版布局 */
.header,
.tabs-desktop {
    display: none !important;
}

body {
    margin: 0;
    padding: 0;
    background: #d1d1d6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: var(--font-body);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========== App 外框（桌面居中） ========== */
.app-frame {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.app-shell {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: 100dvh;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
}

/* ========== 顶部标题栏 ========== */
.app-header {
    flex-shrink: 0;
    background: var(--app-surface);
    border-bottom: 0.5px solid var(--separator);
    padding: var(--space-sm) var(--space-md);
    padding-top: calc(var(--space-sm) + env(safe-area-inset-top, 0));
    z-index: 50;
}

.app-header-main {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.app-header-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.app-header-title {
    font-size: var(--font-title);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.app-header-sub {
    font-size: var(--font-caption);
    color: var(--text-secondary);
    margin: 2px 0 0 40px;
}

.admin-badge {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: var(--success-color);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.readonly-hint {
    font-size: var(--font-small);
    color: var(--text-secondary);
    margin: 4px 0 0 40px;
}

body.is-admin .readonly-hint {
    display: none;
}

.admin-pin-input {
    -webkit-text-security: disc;
    font-family: inherit;
}

/* ========== 主内容区 ========== */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0) + var(--space-md));
}

.app-content .container {
    max-width: none;
    margin: 0;
    padding: var(--space-md);
    animation: none;
}

.tab-panel {
    display: none;
}

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

/* ========== 底部 Tab 栏 ========== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-max-width);
    height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 0.5px solid var(--separator);
    display: flex;
    z-index: 100;
}

.tab-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--transition);
}

.tab-bar-item.active {
    color: var(--primary-color);
}

.tab-bar-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tab-bar-item.active svg {
    stroke-width: 2.2;
}

/* ========== Cell 分组（iOS Settings 风格） ========== */
.cell-group {
    margin-bottom: var(--space-lg);
}

.cell-group-title {
    font-size: var(--font-caption);
    color: var(--text-secondary);
    padding: 0 var(--space-md) var(--space-sm);
    font-weight: 500;
}

.cell-group-body {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.cell {
    display: flex;
    align-items: center;
    padding: 12px var(--space-md);
    min-height: 44px;
    border-bottom: 0.5px solid var(--separator);
    gap: var(--space-sm);
}

.cell:last-child {
    border-bottom: none;
}

.cell-label {
    flex-shrink: 0;
    font-size: var(--font-body);
    color: var(--text-primary);
    min-width: 72px;
}

.cell-value {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.cell-input,
.cell-select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--font-body);
    color: var(--text-primary);
    text-align: right;
    outline: none;
    min-width: 0;
    padding: 0;
    font-family: inherit;
}

.cell-input::placeholder {
    color: var(--text-secondary);
}

.cell-select {
    appearance: none;
    cursor: pointer;
    direction: rtl;
}

.cell-hint {
    padding: 8px var(--space-md) 12px;
    font-size: var(--font-small);
    color: var(--text-secondary);
    line-height: 1.5;
    background: var(--app-surface);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-top: -1px;
}

.cell-link {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.cell-link:active {
    background: #f2f2f7;
}

.cell-chevron {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 300;
    margin-left: auto;
}

.cell-chips {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

/* ========== Chip 选科/地区 ========== */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px var(--space-md);
    background: var(--app-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.chip-item {
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--app-surface);
    font-size: var(--font-caption);
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition);
}

.chip-item:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.subject-chip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.subject-chip-grid .chip-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
}

.chip-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ========== 主操作按钮 ========== */
.app-action-bar {
    padding: var(--space-md) 0 var(--space-sm);
}

.btn-app-primary {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: #fff;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}

.btn-app-primary:active {
    background: var(--primary-hover);
}

.btn-app-secondary {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--app-surface);
    color: var(--primary-color);
    font-size: var(--font-caption);
    font-weight: 500;
    cursor: pointer;
    margin-top: var(--space-sm);
}

/* ========== 首页指南 ========== */
.home-banner {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: #fff;
    margin-bottom: var(--space-md);
}

.home-banner-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.home-banner-sub {
    font-size: var(--font-caption);
    opacity: 0.9;
    margin-bottom: 10px;
}

.home-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--font-small);
}

.score-quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.score-quick-item {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.score-quick-item.warning {
    border-left: 3px solid var(--warning-color);
}

.score-quick-item.success {
    border-left: 3px solid var(--success-color);
}

.score-quick-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.score-quick-rank {
    font-size: var(--font-caption);
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 2px;
}

.score-quick-desc {
    font-size: var(--font-small);
    color: var(--text-secondary);
    margin-top: 4px;
}

.home-section-title {
    font-size: var(--font-caption);
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    padding-left: 2px;
}

.direction-tiles {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.direction-tile {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    padding: 14px var(--space-md);
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--dir-color, var(--primary-color));
}

.direction-tile-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-sm);
}

.direction-tile-name {
    font-size: var(--font-body);
    font-weight: 600;
}

.direction-tile-summary {
    font-size: var(--font-small);
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.direction-tile-rank {
    font-size: var(--font-small);
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
}

.direction-tile-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: 10px;
}

.btn-tile {
    flex: 1;
    min-height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-small);
    font-weight: 600;
    cursor: pointer;
}

.btn-tile-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-tile-ghost {
    background: var(--app-bg);
    color: var(--primary-color);
}

.cwb-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-md);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cwb-scroll::-webkit-scrollbar {
    display: none;
}

.cwb-pill {
    flex-shrink: 0;
    width: 130px;
    background: var(--app-surface);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-card);
}

.cwb-pill.chong { border-top: 3px solid #ef4444; }
.cwb-pill.wen { border-top: 3px solid #10b981; }
.cwb-pill.bao { border-top: 3px solid #2563eb; }

.cwb-pill-level {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cwb-pill-desc {
    font-size: var(--font-small);
    color: var(--text-secondary);
    line-height: 1.4;
}

.guide-expand-section {
    margin-bottom: var(--space-lg);
}

.guide-expand-section .cell-group-body {
    margin-top: var(--space-sm);
}

.guide-detail-card {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.guide-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--space-md);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--font-caption);
    -webkit-tap-highlight-color: transparent;
}

.guide-detail-body {
    padding: 0 var(--space-md) var(--space-md);
}

.guide-detail-body.collapsed {
    display: none;
}

.guide-conclusion-text {
    font-size: var(--font-caption);
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 12px var(--space-md);
    background: var(--app-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

/* ========== 数据页工具栏 ========== */
.data-toolbar-app {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    align-items: center;
}

.data-search-wrap {
    flex: 1;
    position: relative;
}

.data-search-input {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 20px;
    background: var(--app-surface);
    padding: 0 16px;
    font-size: var(--font-caption);
    outline: none;
    box-shadow: var(--shadow-card);
}

.data-sort-select {
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--app-surface);
    padding: 0 10px;
    font-size: var(--font-small);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    max-width: 100px;
}

.btn-icon-add {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.data-scope-banner {
    background: #eff6ff;
    border: 0.5px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 10px var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: var(--font-small);
    color: #1e40af;
    line-height: 1.5;
}

.data-scope-banner strong {
    display: block;
    font-size: var(--font-caption);
    margin-bottom: 2px;
}

.data-count-badge {
    font-size: var(--font-caption);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* 预测行：提高选择器优先级，兼容 iOS / 微信内置浏览器 */
table.mini-table.scores-table tbody tr.score-predict-row > td {
    color: #6d28d9 !important;
    -webkit-text-fill-color: #6d28d9 !important;
    background-color: #f5f3ff !important;
    border-top: 1px dashed #c4b5fd !important;
    font-weight: 600;
}

table.mini-table.scores-table tbody tr.score-predict-row > td strong,
table.mini-table.scores-table tbody tr.score-predict-row > td .predict-value {
    color: #6d28d9 !important;
    -webkit-text-fill-color: #6d28d9 !important;
    font-weight: 700;
}

.predict-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: #7c3aed !important;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.predict-value {
    color: #6d28d9 !important;
    -webkit-text-fill-color: #6d28d9 !important;
    font-weight: 600;
}

.predict-hint {
    font-size: 11px;
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
    margin-top: 6px;
    line-height: 1.4;
}

.exam-population-banner {
    margin: var(--space-sm) var(--space-md) 0;
    padding: 10px 12px;
    background: #eff6ff;
    border-radius: var(--radius-sm);
    font-size: var(--font-small);
    color: #1e40af;
    line-height: 1.5;
}

.exam-population-banner strong {
    color: #1d4ed8;
}

.level-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

.level-chip-minban {
    color: #9a3412;
    background: #ffedd5;
    border-color: #fdba74;
}

.level-chip-sino {
    color: #1e40af;
    background: #dbeafe;
    border-color: #93c5fd;
}

.level-chip-voc {
    color: #5b21b6;
    background: #ede9fe;
    border-color: #c4b5fd;
}

.list-program .program-name {
    word-break: break-word;
}

.civil-service-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

.civil-service-detail {
    font-size: var(--font-caption);
    color: #92400e;
    line-height: 1.5;
    margin: 0;
}

.btn-export-excel {
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--app-surface);
    color: var(--primary-color);
    font-size: var(--font-small);
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}

/* ========== 匹配结果 ========== */
.segment-alert {
    background: #fff7ed;
    border: 0.5px solid #fed7aa;
    border-radius: var(--radius-md);
    padding: 12px var(--space-md);
    margin-bottom: var(--space-md);
    font-size: var(--font-caption);
    color: #9a3412;
}

.match-results {
    margin-top: var(--space-md);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    background: var(--app-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-card);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: var(--font-small);
    color: var(--text-secondary);
}

.result-section {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--space-md);
    font-weight: 600;
    font-size: var(--font-body);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.result-header.chong { color: #dc2626; background: #fef2f2; }
.result-header.wen { color: #059669; background: #ecfdf5; }
.result-header.bao { color: #2563eb; background: #eff6ff; }

.result-list {
    border-top: 0.5px solid var(--separator);
}

.result-section.collapsed .result-list {
    display: none;
}

.result-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.result-export-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.result-export-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
}

/* ========== 列表项 App 化 ========== */
.expandable-list {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.list-item {
    border-bottom: 0.5px solid var(--separator);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-summary {
    display: grid;
    grid-template-columns: 24px 1fr auto auto 14px;
    gap: 2px 8px;
    padding: 12px var(--space-md);
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.list-item-summary .col-school {
    grid-column: 2;
}

.list-item-summary .col-score {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
}

.list-item-summary .col-subject {
    grid-column: 4;
    grid-row: 1 / 3;
    align-self: center;
}

.list-item-summary .col-action {
    grid-column: 5;
    grid-row: 1 / 3;
    align-self: center;
}

.col-index {
    font-size: var(--font-small);
    color: var(--text-secondary);
    font-weight: 600;
}

.list-school {
    font-size: var(--font-body);
    font-weight: 600;
    color: var(--text-primary);
}

.list-program {
    font-size: var(--font-small);
    color: var(--text-secondary);
}

.col-score {
    text-align: right;
}

.list-score {
    font-size: var(--font-caption);
    font-weight: 600;
    color: var(--primary-color);
}

.list-rank {
    font-size: var(--font-small);
    color: var(--text-secondary);
}

.list-chevron {
    color: var(--text-secondary);
    font-size: 16px;
}

.list-item-detail {
    display: none;
    padding: 0 var(--space-md) var(--space-md);
    font-size: var(--font-caption);
}

.list-item.expanded .list-item-detail {
    display: block;
}

.list-empty {
    padding: 32px var(--space-md);
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-caption);
}

.list-header {
    display: none;
}

.meta-chip {
    font-size: var(--font-small);
    background: var(--app-bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.level-badge {
    font-size: var(--font-small);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.level-badge.chong { background: #fef2f2; color: #dc2626; }
.level-badge.wen { background: #ecfdf5; color: #059669; }
.level-badge.bao { background: #eff6ff; color: #2563eb; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.detail-label {
    font-size: var(--font-small);
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.detail-value {
    font-size: var(--font-caption);
    font-weight: 500;
}

.detail-section {
    margin-top: var(--space-sm);
}

.detail-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.detail-actions .btn {
    flex: 1;
    justify-content: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.pagination button {
    min-height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--app-surface);
    color: var(--primary-color);
    font-size: var(--font-caption);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: var(--font-caption);
    color: var(--text-secondary);
}

/* ========== 我的页面 ========== */
.mine-summary {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: #fff;
    margin-bottom: var(--space-md);
}

.mine-summary-title {
    font-size: 14px;
    opacity: 0.9;
}

.mine-summary-value {
    font-size: 28px;
    font-weight: 700;
    margin: 4px 0;
}

.mine-summary-sub {
    font-size: var(--font-small);
    opacity: 0.85;
}

.stats-compact .chart-container {
    background: var(--app-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-card);
}

.stats-compact .chart-title {
    font-size: var(--font-caption);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.app-version {
    text-align: center;
    font-size: var(--font-small);
    color: var(--text-secondary);
    padding: var(--space-lg) 0;
}

/* ========== 底部抽屉 Sheet ========== */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition);
}

.sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.sheet {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    bottom: 0;
    width: 100%;
    max-width: var(--app-max-width);
    max-height: 92dvh;
    background: var(--app-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 400;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.sheet.show {
    transform: translateX(-50%) translateY(0);
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--space-md);
    background: var(--app-surface);
    border-bottom: 0.5px solid var(--separator);
    flex-shrink: 0;
}

.sheet-title {
    font-size: var(--font-body);
    font-weight: 600;
}

.sheet-btn {
    border: none;
    background: none;
    font-size: var(--font-body);
    cursor: pointer;
    padding: 4px 8px;
    min-height: 36px;
}

.sheet-btn-cancel {
    color: var(--text-secondary);
}

.sheet-btn-save {
    color: var(--primary-color);
    font-weight: 600;
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    -webkit-overflow-scrolling: touch;
}

.sheet .form-group {
    margin-bottom: var(--space-md);
}

.sheet .form-label {
    display: block;
    font-size: var(--font-caption);
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.sheet .form-input,
.sheet .form-textarea,
.sheet .form-select {
    width: 100%;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--app-surface);
    padding: 12px;
    font-size: var(--font-body);
    font-family: inherit;
    outline: none;
    box-shadow: var(--shadow-card);
}

.sheet .form-textarea {
    min-height: 80px;
    resize: vertical;
}

.sheet .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sheet .checkbox-item {
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--app-surface);
    font-size: var(--font-caption);
    cursor: pointer;
}

.sheet .checkbox-item:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sheet .score-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 0.5px solid var(--separator);
}

.sheet .score-year {
    grid-column: 1 / -1;
    font-weight: 600;
    font-size: var(--font-caption);
}

/* ========== 弹窗 App 化 ========== */
.modal {
    align-items: flex-end;
    z-index: 500;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: var(--app-max-width);
    margin: 0 auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 80dvh;
    overflow-y: auto;
}

/* ========== Toast ========== */
.toast {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    max-width: calc(var(--app-max-width) - 32px);
    bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0) + 16px);
    top: auto;
    text-align: center;
}

/* ========== 加载 ========== */
#loadingIndicator {
    background: var(--app-bg) !important;
}

.loading {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ========== 覆盖旧 card 样式 ========== */
.app-content .card {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
}

.app-content .card:hover {
    transform: none;
    box-shadow: none;
}

/* ========== 按钮在 App 内 ========== */
.app-content .btn-primary {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--radius-sm);
    min-height: 40px;
}

.app-content .btn-secondary {
    background: var(--app-surface) !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--border-color) !important;
}

.app-content .btn-danger {
    background: var(--danger-color) !important;
    color: #fff !important;
}

.app-content .btn-success {
    background: var(--success-color) !important;
    color: #fff !important;
}

.mini-table {
    width: 100%;
    font-size: var(--font-small);
    border-collapse: collapse;
}

.mini-table th,
.mini-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 0.5px solid var(--separator);
}

.tag {
    display: inline-block;
    font-size: var(--font-small);
    padding: 2px 8px;
    background: var(--app-bg);
    border-radius: 4px;
    margin-right: 4px;
}

.bar-chart .bar-item {
    margin-bottom: 8px;
}

.bar-label {
    font-size: var(--font-small);
    margin-bottom: 4px;
}

.bar-wrapper {
    height: 20px;
    background: var(--app-bg);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    padding-left: 6px;
    min-width: 24px;
    border-radius: 4px;
}
