/* 李进的学习笔记 — 全局布局与响应式 */

:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4338ca;
    --color-primary-light: #818cf8;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-border: rgba(99, 102, 241, 0.15);
    --color-surface: rgba(255, 255, 255, 0.82);
    --color-bg-start: #e0e7ff;
    --color-bg-mid: #f0f4ff;
    --color-bg-end: #e8f0fe;
    --header-h: 56px;
    --tabbar-h: 56px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --max-portal: 1080px;
    --max-read: 860px;
    --bp-md: 768px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    color: var(--color-text);
    line-height: 1.6;
    background: linear-gradient(135deg, var(--color-bg-start) 0%, var(--color-bg-mid) 50%, var(--color-bg-end) 100%);
    background-attachment: fixed;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Header ── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text);
    white-space: nowrap;
}

.site-brand:hover {
    color: var(--color-text);
}

.site-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text);
    font-size: 22px;
    border-radius: 8px;
}

.menu-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px 16px;
    backdrop-filter: blur(12px);
    z-index: 99;
    box-shadow: var(--shadow);
}

.mobile-nav.open {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--color-text);
    border-radius: var(--radius-sm);
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--color-primary);
}

/* ── Main ── */

.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--max-portal);
    margin: 0 auto;
    padding: 32px 20px calc(32px + var(--tabbar-h));
}

.site-main--narrow {
    max-width: var(--max-read);
}

.site-main--center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Hero ── */

.hero {
    text-align: center;
    padding: 24px 0 32px;
}

.hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.hero h1 {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: clamp(14px, 2.5vw, 18px);
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
}

.hero-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    margin: 24px auto;
    border-radius: 2px;
}

/* ── 最新动态 ── */

.latest-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 10px 20px;
    margin-bottom: 32px;
    font-size: 14px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.latest-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 1.5s infinite;
}

.latest-bar a {
    color: var(--color-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── 模块卡片 ── */

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px 22px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    min-height: 120px;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.3);
    color: inherit;
}

.module-card.disabled {
    opacity: 0.65;
    cursor: default;
    pointer-events: none;
}

.module-card-icon {
    font-size: 28px;
    line-height: 1;
}

.module-card h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
}

.module-card p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.module-card-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    margin-top: auto;
}

/* ── 页面标题区 ── */

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 15px;
    color: var(--color-text-muted);
}

.breadcrumb {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.company-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.company-section {
    padding: 20px 22px 22px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.company-section-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.company-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.company-section-meta {
    font-size: 13px;
    color: var(--color-text-muted);
}

.company-views-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.author-view-card h3.author-view-card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ── 文章列表卡片（旧 flat 布局兼容） ── */

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.article-card {
    display: block;
    padding: 22px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    color: inherit;
}

.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--color-text-light);
}

.article-card-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    font-weight: 500;
}

.article-card h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-card-stats {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ── 财务学习页 ── */

.finance-toolbar {
    margin-bottom: 20px;
}

.finance-stock-picker {
    position: relative;
    max-width: 420px;
}

.finance-stock-trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
    background: linear-gradient(135deg, #fff 0%, #f8faff 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.finance-stock-trigger:hover,
.finance-stock-picker.is-open .finance-stock-trigger {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.finance-stock-trigger-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
}

.finance-stock-trigger-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.finance-stock-trigger-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.finance-stock-trigger-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finance-stock-trigger-chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--color-text-muted);
    border-bottom: 2px solid var(--color-text-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
}

.finance-stock-picker.is-open .finance-stock-trigger-chevron {
    transform: rotate(-135deg) translateY(2px);
}

.finance-stock-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    animation: finance-menu-in 0.18s ease;
}

@keyframes finance-menu-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.finance-stock-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--color-border);
}

.finance-stock-menu-head span {
    font-weight: 500;
}

.finance-stock-menu-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.finance-stock-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: background 0.15s;
}

.finance-stock-option:hover {
    background: rgba(99, 102, 241, 0.08);
}

.finance-stock-option.is-active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary-dark);
    font-weight: 600;
}

.finance-stock-option-name {
    flex: 1;
    min-width: 0;
}

.finance-stock-option-date {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--color-text-light);
    font-weight: 400;
}

.finance-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.ytd-group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ytd-group-tab {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ytd-group-tab:hover {
    color: var(--color-text);
    border-color: rgba(99, 102, 241, 0.35);
}

.ytd-group-tab.is-active {
    color: var(--color-primary-dark);
    background: #fff;
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.finance-tab {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.finance-tab:hover {
    color: var(--color-text);
    background: rgba(99, 102, 241, 0.06);
}

.finance-tab.is-active {
    color: var(--color-primary-dark);
    font-weight: 600;
    background: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.finance-tab-icon {
    font-size: 16px;
    line-height: 1;
}

.finance-viewer {
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.finance-viewer--empty {
    text-align: center;
    padding: 48px 24px;
}

.finance-viewer-head {
    margin-bottom: 16px;
}

.finance-viewer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.finance-viewer-desc {
    font-size: 14px;
    color: var(--color-text-muted);
}

.finance-viewer-meta {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.finance-cat-icon {
    font-size: 20px;
    line-height: 1;
}

.finance-figure {
    margin: 0;
}

.finance-figure img {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.finance-empty-hint {
    font-size: 14px;
    color: var(--color-text-muted);
}

.finance-stock-option-score {
    font-size: 12px;
    color: var(--color-primary, #2563eb);
    font-weight: 600;
}

.finance-viewer--score {
    padding: 24px;
}

.finance-score-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 20px;
    padding: 22px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.finance-score-hero-kicker {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.finance-score-hero-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
}

.finance-score-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.finance-score-stat {
    min-width: 110px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.finance-score-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.finance-score-stat-value.is-grade {
    font-size: 32px;
}

.finance-score-stat-value.is-grade-a { color: #059669; }
.finance-score-stat-value.is-grade-b { color: #2563eb; }
.finance-score-stat-value.is-grade-c { color: #d97706; }
.finance-score-stat-value.is-grade-d { color: #ea580c; }
.finance-score-stat-value.is-grade-e { color: #dc2626; }

.finance-score-stat-label {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.finance-score-rule-cards {
    display: grid;
    gap: 12px;
}

.finance-score-rule-card {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.finance-score-rule-card strong {
    display: block;
    font-size: 22px;
    margin: 6px 0 4px;
}

.finance-score-rule-card span {
    font-size: 13px;
    color: var(--color-text-muted);
}

.finance-score-rule-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
}

.finance-score-section {
    margin-bottom: 22px;
}

.finance-score-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.finance-score-factor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.finance-score-factor {
    padding: 14px;
    text-align: center;
    border-radius: var(--radius-sm);
    background: var(--color-bg, #f8fafc);
    border: 1px solid var(--color-border);
}

.finance-score-factor strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.finance-score-note,
.finance-score-disclaimer {
    font-size: 12px;
    color: var(--color-text-muted);
}

.finance-score-disclaimer {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px dashed var(--color-border);
}

.finance-score-bars {
    display: grid;
    gap: 12px;
}

.finance-score-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 14px;
}

.finance-score-bar-meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.finance-score-bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.finance-score-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s ease;
}

.finance-score-bar-fill.is-good { background: #059669; }
.finance-score-bar-fill.is-mid { background: #2563eb; }
.finance-score-bar-fill.is-warn { background: #d97706; }
.finance-score-bar-fill.is-bad { background: #dc2626; }
.finance-score-bar-fill.is-neutral { background: #94a3b8; }

.finance-score-checks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.finance-score-check {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg, #f8fafc);
}

.finance-score-check.is-pass {
    border-color: rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.06);
}

.finance-score-check.is-fail {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(220, 38, 38, 0.04);
}

.finance-score-check-mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.finance-score-check.is-pass .finance-score-check-mark {
    color: #059669;
    background: rgba(5, 150, 105, 0.12);
}

.finance-score-check.is-fail .finance-score-check-mark {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.finance-score-check p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.finance-score-insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.finance-score-list {
    margin: 0;
    padding-left: 18px;
    color: var(--color-text);
}

.finance-score-list.is-warn {
    color: #b45309;
}

.finance-score-radar .finance-figure {
    max-width: 720px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .finance-stock-picker {
        max-width: none;
    }

    .finance-stock-trigger-name {
        font-size: 16px;
    }

    .finance-tab {
        padding: 9px 12px;
        font-size: 12px;
    }

    .finance-viewer {
        padding: 16px;
    }

    .finance-score-hero {
        grid-template-columns: 1fr;
    }

    .finance-score-factor-grid,
    .finance-score-insights {
        grid-template-columns: 1fr;
    }
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px dashed var(--color-border);
}

/* ── Footer ── */

.site-footer {
    padding: 20px 24px calc(20px + var(--tabbar-h));
    text-align: center;
    font-size: 13px;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.5);
}

.site-footer a {
    color: var(--color-primary);
}

.site-footer a:hover {
    text-decoration: underline;
}

/* ── Bottom Tab（手机） ── */

.bottom-tab {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.bottom-tab-inner {
    display: flex;
    height: var(--tabbar-h);
}

.bottom-tab a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    color: var(--color-text-muted);
    min-height: 44px;
}

.bottom-tab a .tab-icon {
    font-size: 20px;
    line-height: 1;
}

.bottom-tab a.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* ── 响应式 ── */

@media (max-width: 1024px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .site-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .site-main {
        padding: 20px 16px calc(20px + var(--tabbar-h));
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        flex-direction: row;
        align-items: center;
        min-height: auto;
        padding: 18px 20px;
        gap: 16px;
    }

    .module-card-icon {
        font-size: 32px;
        flex-shrink: 0;
    }

    .module-card-tag {
        margin-top: 0;
        margin-left: auto;
        flex-shrink: 0;
    }

    .article-grid,
    .company-views-grid {
        grid-template-columns: 1fr;
    }

    .latest-bar {
        border-radius: var(--radius-sm);
        font-size: 13px;
    }

    .site-footer {
        padding-bottom: calc(16px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    }

    .bottom-tab {
        display: block;
    }

    .breadcrumb .mid {
        display: none;
    }
}

.module-card.full-width {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
}

/* ──  prose 内容卡片 ── */

.prose-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.prose-card h2,
.legal-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.15);
}

.prose-card h2:first-child,
.legal-card h2:first-of-type { margin-top: 0; }

.prose-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.prose-meta {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
}

.prose-card p,
.prose-card li,
.legal-card p,
.legal-card li {
    font-size: 15px;
    color: #334155;
    margin-bottom: 10px;
}

.prose-card ul,
.prose-card ol,
.legal-card ul,
.legal-card ol {
    margin: 0 0 12px 20px;
}

.prose-highlight {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 14px 16px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
    font-size: 14px;
    color: #78350f;
}

.prose-badge {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.prose-muted {
    margin-top: 24px !important;
    font-size: 13px !important;
    color: var(--color-text-light) !important;
}

@media (max-width: 640px) {
    .prose-card, .legal-card { padding: 24px 18px; }
    .prose-title { font-size: 22px; }
}

/* 股东人数筛选与回测 */
.shareholder-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.shareholder-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.shareholder-select {
    min-width: min(100%, 420px);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 14px;
    background: var(--color-surface);
}
.shareholder-section {
    margin-top: 28px;
}
.shareholder-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
}
.shareholder-table-wrap--scroll-hint {
    position: relative;
}
.shareholder-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}
.shareholder-table .cell-name {
    white-space: nowrap;
}
.shareholder-table .cell-code {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.shareholder-table th,
.shareholder-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shareholder-table th {
    background: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
}
.shareholder-table th.num,
.shareholder-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.shareholder-table--screen col.col-rank { width: 4%; }
.shareholder-table--screen col.col-code { width: 11%; }
.shareholder-table--screen col.col-name { width: 24%; }
.shareholder-table--screen col.col-num { width: 11%; }
.shareholder-table--screen col.col-date { width: 12%; }
.shareholder-table--backtest col.col-rank { width: 8%; }
.shareholder-table--backtest col.col-name { width: 36%; }
.shareholder-table--backtest col.col-num { width: 18%; }
.shareholder-table tbody tr:last-child td {
    border-bottom: none;
}
.shareholder-backtest-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--color-surface);
}
.shareholder-backtest-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
}
.shareholder-backtest-period {
    flex: 1 1 auto;
    min-width: 0;
}
.shareholder-backtest-returns {
    display: flex;
    flex-shrink: 0;
    gap: 20px;
    align-items: flex-end;
}
.shareholder-backtest-ret-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 4.5rem;
}
.shareholder-backtest-ret-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.shareholder-backtest-ret {
    font-size: 20px;
    line-height: 1.2;
}
.shareholder-backtest-ret.is-up { color: #059669; }
.shareholder-backtest-ret.is-down { color: #dc2626; }
.shareholder-table-wrap--compact .shareholder-table th,
.shareholder-table-wrap--compact .shareholder-table td {
    padding: 8px 10px;
}

@media (max-width: 640px) {
    .shareholder-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .shareholder-select {
        min-width: 0;
        width: 100%;
    }
    .shareholder-section {
        margin-top: 20px;
    }
    .shareholder-table {
        font-size: 12px;
    }
    .shareholder-table th,
    .shareholder-table td {
        padding: 8px 6px;
    }
    .shareholder-table .col-mobile-hide {
        display: none;
    }
    .shareholder-table col.col-mobile-hide {
        width: 0 !important;
    }
    .shareholder-table--screen {
        table-layout: fixed;
        min-width: 0;
    }
    .shareholder-table--screen col.col-rank { width: 8%; }
    .shareholder-table--screen col.col-code { width: 22%; }
    .shareholder-table--screen col.col-name { width: 18%; }
    .shareholder-table--screen col.col-num { width: 17%; }
    .shareholder-table--screen col.col-date { width: 0; }
    .shareholder-table--screen .cell-name {
        max-width: 3.2em;
    }
    .shareholder-table--screen .cell-code {
        font-size: 11px;
    }
    .shareholder-table--backtest col.col-rank { width: 10%; }
    .shareholder-table--backtest col.col-name { width: 28%; }
    .shareholder-table--backtest col.col-num { width: 20%; }
    .shareholder-table--backtest .cell-name {
        max-width: 3.2em;
    }
    .shareholder-backtest-head {
        flex-direction: column;
        align-items: stretch;
    }
    .shareholder-backtest-returns {
        justify-content: flex-end;
        gap: 16px;
    }
    .shareholder-backtest-ret {
        font-size: 18px;
    }
}
