/* ===== 全局重置与基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-lighter: #dbeafe;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 头部导航 ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.header-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.nav-tab {
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    font-weight: 500;
    opacity: 0.85;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    font-weight: 600;
}

/* ===== 主内容区 ===== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== 首页 ===== */
.home-hero {
    text-align: center;
    padding: 48px 24px 40px;
}

.home-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.home-hero p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.home-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.home-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.home-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-lighter);
    transform: translateY(-4px);
}

.home-card:hover::before {
    transform: scaleX(1);
}

.home-card .card-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-lighter);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.home-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.home-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.home-card .card-arrow {
    margin-top: 20px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== 案例探索页 ===== */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.select-dropdown {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 200px;
}

.select-dropdown:hover {
    border-color: var(--primary-light);
}

.select-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-lighter);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
}

.btn-ghost:hover {
    background: var(--primary-lighter);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 案例卡片网格 */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}
/* 利润表结构漫游：沿用默认多卡网格（每行约3张，与原布局一致），条形长度靠卡内列宽微调 */

/* 现金流结构漫游：卡片内部为左流入/右流出两栏，满宽单列避免右栏被裁切 */
#case-grid.cf-single {
    grid-template-columns: 1fr;
}

.case-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.case-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.case-card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, #eff6ff 100%);
    border-bottom: 1px solid var(--border);
}

.case-card-header .company-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.case-card-header .company-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.case-card-body {
    padding: 16px 20px;
}

.ratio-bar {
    margin-bottom: 12px;
}

.ratio-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.ratio-bar-label .label-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.ratio-bar-label .ratio-value {
    font-weight: 700;
}

.ratio-bar-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.ratio-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.ratio-bar-fill.core {
    background: var(--primary);
}

.ratio-bar-fill.investment {
    background: var(--warning);
}

.ratio-bar-fill.other {
    background: #8b5cf6;
}

.case-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-blue {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.tag-green {
    background: var(--success-light);
    color: var(--success);
}

.tag-amber {
    background: var(--warning-light);
    color: #92400e;
}

.case-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.case-card-footer .year-label {
    font-size: 12px;
    color: var(--text-light);
}

.compare-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.compare-checkbox input {
    cursor: pointer;
    accent-color: var(--primary);
}

/* 案例详情展开 */
.case-detail {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: -4px;
}

.case-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.case-detail-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.data-table th {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-weight: 600;
    text-align: left;
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.data-table .highlight-row td {
    background: #fefce8;
    font-weight: 600;
}

.analysis-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
}

.analysis-box .analysis-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.analysis-box .analysis-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 对比表格 */
.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.compare-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.compare-modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: none;
    border: none;
}

.close-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.compare-modal-body {
    padding: 24px 28px;
    overflow-x: auto;            /* 手机端宽表格横向滚动，避免列被压窄 */
    -webkit-overflow-scrolling: touch;
}

/* 对比弹窗内的表格：不强行压成 100% 宽，超出容器时横向滚动而非挤窄列 */
.compare-modal-body > table,
.compare-modal-body table {
    width: auto;
    min-width: 100%;
}
.compare-modal-body table th,
.compare-modal-body table td {
    white-space: nowrap;
}

/* 手机端：对比弹窗改为全屏，给宽表格更多横向空间 */
@media (max-width: 600px) {
    .compare-modal { padding: 0; }
    .compare-modal-content { max-height: 100vh; height: 100vh; border-radius: 0; }
    .compare-modal-header { padding: 16px; }
    .compare-modal-body { padding: 16px; }
}

/* ===== 知识点学习页 ===== */
.knowledge-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    min-height: 600px;
}

.knowledge-tree {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.tree-item {
    margin-bottom: 2px;
}

.tree-node {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.tree-node:hover {
    background: var(--primary-lighter);
}

.tree-node.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.tree-toggle {
    width: 16px;
    text-align: center;
    font-size: 12px;
    transition: transform 0.2s;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-children {
    margin-left: 20px;
    overflow: hidden;
    transition: max-height 0.3s;
}

.knowledge-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.knowledge-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-lighter);
}

.knowledge-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
}

.knowledge-content .definition-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 20px;
}

.knowledge-content .definition-box .label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 4px;
}

.knowledge-content .definition-box .text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
}

.knowledge-content .formula-box {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #92400e;
    line-height: 1.8;
}

.knowledge-content .key-points {
    margin-bottom: 20px;
}

.knowledge-content .key-points li {
    list-style: none;
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.knowledge-content .key-points li::before {
    content: '▸';
    position: absolute;
    left: 8px;
    color: var(--primary);
    font-weight: 700;
}

.knowledge-content .case-link {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.knowledge-content .case-link .label {
    font-weight: 600;
    color: var(--success);
    font-size: 13px;
    margin-bottom: 4px;
}

.knowledge-content .case-link .text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
}

.knowledge-content .mistake-box {
    background: #fef2f2;
    border-left: 4px solid var(--danger);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 20px;
}

.knowledge-content .mistake-box .label {
    font-weight: 600;
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 4px;
}

.knowledge-content .mistake-box .text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
}

/* ===== 练习中心页 ===== */
.practice-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.practice-settings {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

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

.setting-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.difficulty-badge.basic {
    background: var(--success-light);
    color: var(--success);
}

.difficulty-badge.intermediate {
    background: var(--warning-light);
    color: #92400e;
}

.difficulty-badge.advanced {
    background: var(--danger-light);
    color: var(--danger);
}

.question-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.question-header .q-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.question-type-badge {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.question-number {
    font-size: 13px;
    color: var(--text-light);
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: var(--primary-light);
    background: #f8faff;
}

.option-item.selected {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.option-item.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.option-item.wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

.option-letter {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
    min-width: 20px;
}

.option-item.correct .option-letter {
    color: var(--success);
}

.option-item.wrong .option-letter {
    color: var(--danger);
}

.option-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.fill-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.fill-input:focus {
    outline: none;
    border-color: var(--primary);
}

.textarea-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
}

.textarea-input:focus {
    outline: none;
    border-color: var(--primary);
}

.question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.answer-reveal {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: none;
}

.answer-reveal.show {
    display: block;
}

.answer-reveal .answer-label {
    font-weight: 700;
    color: var(--success);
    font-size: 14px;
    margin-bottom: 8px;
}

.answer-reveal .answer-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.answer-reveal .explanation-label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 4px;
}

.answer-reveal .explanation-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.teacher-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--warning-light);
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 练习统计 */
.practice-stats {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

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

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

.stat-item .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== 测试模块 ===== */
.test-section {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius);
    border: 2px dashed var(--primary-light);
    text-align: center;
}

.test-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.test-section p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ===== 测试弹窗案例卡片 ===== */
.test-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}
/* 资产结构对比弹窗概览：最多 4 家，强制单行排列，方便横向比较（不影响利润来源页的网格）*/
.asset-compare-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.test-case-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.test-case-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.test-case-profile {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.test-case-ratios {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-ratio {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.test-ratio-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.test-ratio-value {
    font-size: 16px;
}

@media (max-width: 768px) {
    .test-cases-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--success);
}

/* ===== 加载动画 ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 页面切换 ===== */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .knowledge-layout {
        grid-template-columns: 1fr;
    }

    .knowledge-tree {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }

    .header-logo {
        font-size: 16px;
    }

    .header-nav {
        gap: 2px;
    }

    .nav-tab {
        padding: 6px 12px;
        font-size: 13px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .home-hero h1 {
        font-size: 24px;
    }

    .home-cards {
        grid-template-columns: 1fr;
    }

    .case-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .select-dropdown {
        width: 100%;
    }

    .practice-settings {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-group {
        width: 100%;
    }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ===== 资产结构漫游（v2 随机推荐） ===== */
.asset-roam-controls {
    margin: 16px 0 4px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.roam-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.7;
}
.roam-hint b { color: var(--primary-dark); }
.roam-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}
.roam-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.roam-check input { cursor: pointer; }
.roam-summary {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 2px 0;
    line-height: 1.6;
}
.roam-summary b { color: var(--primary-dark); }

/* 提示 / 错误占位 */
.asset-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}
.asset-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #b91c1c;
}
.asset-msg-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }

/* 代码徽标（全局，所有卡片一致） */
.code-badge {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 5px;
    margin-left: 4px;
}
.asset-card .ratio-bar { margin-bottom: 9px; }
.asset-card .ratio-value { font-variant-numeric: tabular-nums; }
.asset-card .ratio-value .amt {
    display: inline-block;
    min-width: 74px;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
    text-align: right;
}
.asset-card .ratio-bar-fill { background: #3b82f6; }

/* 流动 / 非流动 结构条 */
.asset-split { margin: 2px 0 14px; }
.split-track {
    display: flex;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
    color: white;
    font-weight: 600;
}
.split-cur {
    background: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}
.split-noncur {
    background: #94a3b8;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}
.asset-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
}
.asset-total b { color: var(--primary-dark); font-size: 14px; }

/* 教师用特征提示 */
.asset-hints {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hint-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.hint-tag.muted {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--text-light);
}

/* 资本引入战略：五类资本引入占比条（四大类主题色 + 第五类灰显） */
.capital-stack { margin: 4px 0 4px; }
.capital-stack-track {
    display: flex;
    height: 26px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.capital-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    border-right: 1px solid rgba(255,255,255,0.55);
}
.capital-seg:last-child { border-right: none; }
.capital-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.capital-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.capital-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.capital-legend .muted-sw { background: #cbd5e1; }
.capital-legend b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* 战略类型标签（透明阈值，始终展示，供学生对照真实数据自行判断） */
.capital-strategy {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
}
.capital-strategy .sub { font-weight: 400; font-size: 11px; color: #6366f1; margin-left: 6px; }

/* 其他流动负债偏高提示（数据口径提醒，非结论） */
.capital-caveat {
    margin-top: 8px;
    font-size: 11.5px;
    line-height: 1.5;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 6px 10px;
}

/* 资本结构（负债 vs 权益）细条 */
.capital-capital-split { margin: 2px 0 12px; }
.capital-capital-split .split-cur { background: #475569; }
.capital-capital-split .split-noncur { background: #cbd5e1; color: #334155; }

/* 资产漫游：公司名称/代码搜索框 */
.roam-search { flex: 1 1 240px; min-width: 220px; }
.text-input {
    flex: 1;
    min-width: 160px;
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s;
}
.text-input:hover { border-color: var(--primary-light); }
.text-input:focus {
    outline: none;
    border-color: var(--primary);
}
.text-input::placeholder { color: #b6c2cf; }
/* 口令输入框：用 text + 圆点遮罩，既保留中文输入法（IME）正常录入，又不在界面明文显示 */
.pw-mask {
    -webkit-text-security: disc;
    text-security: disc;
    letter-spacing: 2px;
}

/* 资产漫游：卡片头部 + 加入对比按钮（仅作用于资产卡片，避免影响普通案例卡片）*/
.asset-card .case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.asset-card .case-card-header .company-head { min-width: 0; }
.asset-card .case-card-header .company-name { margin-bottom: 2px; }

.asset-add-chk {
    flex: none;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: border-color 0.15s, background 0.15s;
}
.asset-add-chk:hover { border-color: var(--primary); background: #eff6ff; }
.asset-add-chk input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.asset-add-chk:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

/* 资产漫游：底部对比操作栏（悬浮） */
.asset-compare-bar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}
.asset-compare-count { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.btn-sm { padding: 7px 16px; font-size: 13px; }

/* 资产漫游：行业两层筛选（一级可展开二级）*/
.industry-filter { position: relative; }
.industry-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 150px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}
.industry-trigger .caret { color: var(--text-light); font-size: 11px; flex: none; }
.industry-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1200;
    width: 240px;
    max-height: 360px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
}
.ind-opt, .ind-row, .ind-sub {
    display: flex;
    align-items: center;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}
.ind-opt, .ind-row { padding: 7px 8px; }
.ind-opt.ind-all { font-weight: 600; }
.ind-node { padding: 0; }
.ind-row:hover, .ind-sub:hover, .ind-opt:hover { background: #f1f5f9; }
.ind-row.active, .ind-sub.active, .ind-opt.active {
    background: #eff6ff;
    color: var(--primary-dark);
    font-weight: 600;
}
.ind-toggle {
    flex: none;
    width: 18px;
    height: 18px;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    line-height: 1;
    color: var(--primary);
    background: white;
    user-select: none;
}
.ind-toggle.empty { border: none; visibility: hidden; }
.ind-toggle.open { background: var(--primary); color: white; border-color: var(--primary); }
.ind-name { flex: 1; min-width: 0; }
.ind-count {
    flex: none;
    margin-left: 8px;
    font-size: 11px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}
.ind-subs { padding-left: 26px; }
.ind-sub { padding: 6px 8px; }
.ind-group-label {
    padding: 7px 8px 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: .3px;
}

/* ===== 教师工作台 / 口令弹窗（第①批新增） ===== */
.teacher-workspace {
    margin-top: 32px;
    padding: 20px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}
.teacher-workspace.unlocked { border-style: solid; border-color: var(--primary); background: #f0f7ff; }
.teacher-gate { display: flex; align-items: center; gap: 14px; }
.teacher-gate .tw-icon { font-size: 26px; }
.tw-gate-text { flex: 1; }
.tw-title { font-weight: 700; color: var(--primary-dark); }
.tw-sub { font-size: 13px; color: var(--text-secondary); }
.teacher-panel { margin-top: 16px; }
.tw-head { font-weight: 700; color: var(--primary-dark); font-size: 16px; margin-bottom: 12px; }
.tw-head-note { font-weight: 400; font-size: 12px; color: var(--text-secondary); margin-left: 10px; }
.tw-block { background: white; border-radius: 10px; padding: 16px 18px; }
.tw-block-title { font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.tw-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 10px; }
.tw-note { font-size: 12px; color: #94a3b8; margin-top: 8px; }

/* 口令弹窗 */
.modal-overlay {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, .45); z-index: 4000;
}
.modal-box {
    background: white; border-radius: 14px; padding: 28px 26px; width: 320px; max-width: 90vw;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.modal-title { font-weight: 700; color: var(--primary-dark); font-size: 17px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-error { color: #e11d48; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
#change-pw-modal .text-input { margin-bottom: 10px; }

/* 案例探索：引导空态 */
.guide-empty {
    grid-column: 1 / -1; text-align: center; padding: 56px 20px; color: var(--text-secondary);
    font-size: 15px; line-height: 1.8; background: #f8fafc; border-radius: 12px;
}

/* 净利润来源：减项（所得税/负向差异）以红色呈现 */
.ratio-bar-fill.neg { background: #ef4444; }
.ratio-value.neg { color: #ef4444; }

/* 净利润来源卡片：利润结构透明标签（规则化，不替学生下结论）*/
.profit-structure {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}
.profit-structure b { color: var(--warning); }

/* ===== 资本引入战略 · 双段展示·第二段 资产占用侧 ===== */
.capital-occ {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}
.occ-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.cap-seg-pay, .cap-seg-recv {
    height: 22px;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2px;
    overflow: hidden;
    box-sizing: border-box;
}
.cap-seg-pay { background: #0d9488; }
.cap-seg-recv { background: #94a3b8; }
.occ-net {
    margin-top: 10px;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
}
.occ-net.pos { background: #ecfdf5; border: 1px solid #a7f3d0; }
.occ-net.neg { background: #f1f5f9; border: 1px solid #e2e8f0; }
.occ-net-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #334155;
    gap: 8px;
}
.occ-net-val { font-size: 14px; font-weight: 700; color: #059669; white-space: nowrap; }
.occ-net.neg .occ-net-val { color: #64748b; }
.occ-net-sub { margin-top: 4px; color: #64748b; line-height: 1.5; font-size: 11.5px; }

/* ===== 现金流结构漫游 ===== */
.cf-net-title { font-size:12.5px; font-weight:700; color:#334155; margin:10px 0 6px; }
.cf-net-strip { display:flex; flex-direction:column; gap:3px; }
.cf-section-title { font-size:12.5px; font-weight:700; color:#334155; margin:14px 0 8px; }
.cf-two-col { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
.cf-col-title { font-size:11.5px; font-weight:700; padding-bottom:4px; border-bottom:1px solid #e2e8f0; margin-bottom:6px; }
.cf-col.in .cf-col-title { color:#059669; }
.cf-col.out .cf-col-title { color:#dc2626; }
.cf-row { display:flex; align-items:center; gap:8px; margin:3px 0; font-size:12.5px; }
.cf-label { width:148px; flex-shrink:0; color:#475569; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cf-act { color:#94a3b8; font-weight:600; margin-right:2px; }
.cf-bar { flex:1; height:14px; background:#f1f5f9; border-radius:7px; overflow:hidden; }
.cf-fill { display:block; height:100%; border-radius:7px; min-width:2px; }
.cf-fill.in { background:#34d399; }
.cf-fill.out { background:#f87171; }
.cf-fill.net-op { background:#0ea5e9; }
.cf-fill.net-iv { background:#8b5cf6; }
.cf-fill.net-fi { background:#f59e0b; }
.cf-fill.net-fx { background:#94a3b8; }
.cf-fill.net-base { background:#1e293b; }
.cf-fill.neg { background:#ef4444 !important; }
.cf-pct { width:58px; text-align:right; font-size:12px; font-weight:600; color:#334155; flex-shrink:0; }
.cf-pct.neg { color:#dc2626; }
.cf-subtotal .cf-label { font-weight:700; color:#1e293b; }
.cf-subtotal .cf-pct { font-weight:700; }
.cf-net-note, .cf-note { font-size:10.5px; color:#94a3b8; margin-top:6px; line-height:1.5; }
.cf-net-headline { font-size:13px; font-weight:600; color:#334155; margin:2px 0 6px; }
.cf-net-headline b { font-size:15px; font-weight:700; }
.cf-amt { width:74px; text-align:right; font-size:11.5px; color:#64748b; flex-shrink:0; font-variant-numeric:tabular-nums; }

/* ===== 偿债能力分析 ===== */
.sol-card { font-size: 12.5px; }
/* 头部与其他模块一致：公司名在左、加入对比胶囊在右 */
.sol-card .case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sol-card .case-card-header .company-head { min-width: 0; }
.sol-card .case-card-header .company-name { margin-bottom: 2px; }
.sol-bench { font-size: 11.5px; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 6px 9px; margin-bottom: 10px; }
.sol-group-title { font-size: 12px; font-weight: 700; color: #1e293b; margin: 12px 0 6px; padding-left: 8px; border-left: 3px solid var(--primary, #2563eb); }
.sol-row { margin: 7px 0; }
.sol-row-empty { display: flex; align-items: center; gap: 8px; color: #94a3b8; }
.sol-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.sol-label { flex: 1 1 auto; min-width: 0; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.sol-vals { width: 118px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; color: #64748b; font-size: 11.5px; }
.sol-self { color: #0f172a; font-weight: 700; font-size: 13px; }
.sol-slash { color: #cbd5e1; margin: 0 2px; }
.sol-meanval { color: #f59e0b; font-weight: 600; }   /* 行业均值：橙色系，与条上橙线呼应 */
.sol-rank { width: 64px; text-align: right; flex-shrink: 0; color: #94a3b8; font-size: 11px; font-variant-numeric: tabular-nums; }
/* 行业分布轴：浅灰轨道=全体同业（左=最低、右=最高），仅表示"排位"、不表示指标数值大小 */
.sol-axis { position: relative; height: 14px; background: #f1f5f9; border-radius: 7px; margin: 5px 0 1px; }
.sol-grid { position: absolute; top: 0; height: 100%; width: 0; border-left: 1px solid #e2e8f0; }
.sol-q1 { left: 25%; } .sol-q2 { left: 50%; } .sol-q3 { left: 75%; }
/* 本公司位置：方向色三角标记（非色块填充），三角尖指向轴，避免被误解为数值大小 */
.sol-mark {
    position: absolute; top: -4px; left: 0; width: 0; height: 0;
    transform: translateX(-50%);
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 10px solid #3b82f6;   /* 正向指标：蓝 */
}
.sol-row.sol-label-neg .sol-mark { border-top-color: #7c3aed; }  /* 反向指标：紫 */
.sol-label-neg { color: #6d28d9; font-weight: 600; }
/* 行业均值：橙色虚线（位置 = 行业均值在同业分布中的位置，非数值高度）；不显示文字标签以免遮挡数值 */
.sol-mean { position: absolute; top: -5px; width: 0; height: 24px; border-left: 2px dashed #f59e0b; }
.sol-axis-ends { display: flex; justify-content: space-between; font-size: 9.5px; color: #94a3b8; margin-top: 1px; }
.sol-hints { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.sol-teacher { margin-top: 10px; font-size: 10.5px; color: #b45309; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 6px; padding: 6px 8px; line-height: 1.6; }
/* 加入对比：复用 asset-add-chk 胶囊样式，与其他模块视觉一致 */
.sol-add-chk { /* 外观由 .asset-add-chk 提供，此处仅作标记类 */ }
.sol-add-chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* 对比弹窗 */
.cmp-box { max-width: 92vw; width: auto; max-height: 86vh; overflow-y: auto; }
.cmp-scroll { overflow: auto; max-height: 70vh; }
.cmp-table { border-collapse: collapse; font-size: 12.5px; }
.cmp-table th, .cmp-table td { border: 1px solid #e2e8f0; padding: 7px 10px; text-align: center; vertical-align: top; }
.cmp-table thead th { background: #f8fafc; position: sticky; top: 0; }
.cmp-label { text-align: left; background: #f8fafc; min-width: 150px; white-space: nowrap; }
.cmp-label-neg { color: #6d28d9; }
.cmp-meta { font-size: 10.5px; color: #94a3b8; font-weight: 400; margin-top: 2px; }
.cmp-val { font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.cmp-sub { font-size: 10.5px; color: #475569; margin-top: 2px; }
.cmp-sub2 { font-size: 10.5px; color: #f59e0b; margin-top: 1px; }
.cmp-teacher { font-size: 10px; color: #b45309; font-weight: 400; margin-top: 3px; white-space: normal; }
.cmp-empty { color: #cbd5e1; }

/* ===== 营运能力分析（与偿债能力同构，全为正向指标→统一蓝色，无反向紫）===== */
.op-card { font-size: 12.5px; }
.op-card .case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.op-card .case-card-header .company-head { min-width: 0; }
.op-card .case-card-header .company-name { margin-bottom: 2px; }
.op-bench { font-size: 11.5px; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 6px 9px; margin-bottom: 10px; }
.op-row { margin: 7px 0; }
.op-row-empty { display: flex; align-items: center; gap: 8px; color: #94a3b8; }
.op-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.op-label { flex: 1 1 auto; min-width: 0; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.op-vals { width: 118px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; color: #64748b; font-size: 11.5px; }
.op-self { color: #0f172a; font-weight: 700; font-size: 13px; }
.op-slash { color: #cbd5e1; margin: 0 2px; }
.op-meanval { color: #f59e0b; font-weight: 600; }   /* 行业均值：橙色系，与条上橙线呼应 */
.op-rank { width: 64px; text-align: right; flex-shrink: 0; color: #94a3b8; font-size: 11px; font-variant-numeric: tabular-nums; }
/* 行业分布轴：浅灰轨道=全体同业（左=最低、右=最高），仅表示"排位"、不表示指标数值大小 */
.op-axis { position: relative; height: 14px; background: #f1f5f9; border-radius: 7px; margin: 5px 0 1px; }
.op-grid { position: absolute; top: 0; height: 100%; width: 0; border-left: 1px solid #e2e8f0; }
.op-q1 { left: 25%; } .op-q2 { left: 50%; } .op-q3 { left: 75%; }
/* 本公司位置：方向色三角标记（非色块填充），三角尖指向轴，避免被误解为数值大小 */
.op-mark {
    position: absolute; top: -4px; left: 0; width: 0; height: 0;
    transform: translateX(-50%);
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 10px solid #3b82f6;   /* 正向指标：蓝 */
}
.op-mark-neg { border-top-color: #a855ad; }   /* 反向指标（如三费率）：紫，与正向蓝区分 */
.op-label-neg { color: #a855ad; font-weight: 600; }   /* 反向指标标签：紫 */
.op-mean { position: absolute; top: -5px; width: 0; height: 24px; border-left: 2px dashed #f59e0b; }
.op-axis-ends { display: flex; justify-content: space-between; font-size: 9.5px; color: #94a3b8; margin-top: 1px; }
.op-hints { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.op-teacher { margin-top: 10px; font-size: 10.5px; color: #b45309; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 6px; padding: 6px 8px; line-height: 1.6; }
.op-add-chk { /* 外观由 .asset-add-chk 提供，此处仅作标记类 */ }
.op-add-chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* ===== 营运能力·多公司对比轴（沿用正片分布轴：一根值轴叠多家公司三角 + 行业均值橙线）===== */
.op-cmp-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 10px; }
.op-cmp-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #1e293b; }
.op-cmp-lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.op-cmp-row { padding: 11px 2px 6px; border-bottom: 1px solid #eef2f7; }
.op-cmp-label { display: block; font-size: 12.5px; color: #334155; font-weight: 600; margin-bottom: 6px; }
.op-cmp-tip { display: inline-block; margin-left: 5px; width: 14px; height: 14px; line-height: 14px; text-align: center; font-size: 10px; color: #b45309; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 50%; cursor: help; font-style: normal; }
/* 轴加高，三角基准落在轴内偏下，拥挤分道时上浮幅度由 12px 降为 8px，最多浮 24px 且落在标签与轴之间的预留空隙内，不再大幅脱离条框 */
.op-cmp-axis { position: relative; height: 26px; background: #f1f5f9; border-radius: 8px; margin: 8px 0 1px; }
.op-cmp-q { position: absolute; top: 0; height: 100%; width: 0; border-left: 1px solid #cbd5e1; }
.op-cmp-mean { position: absolute; top: -3px; width: 0; height: 32px; border-left: 2px dashed #f59e0b; }
.op-cmp-mark { position: absolute; top: 13px; left: 0; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 11px solid #3b82f6; z-index: 2; }
.op-cmp-end { position: absolute; top: 28px; font-size: 9.5px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.op-cmp-end-l { left: 0; }
.op-cmp-end-r { right: 0; }
.op-cmp-nodata { font-size: 11px; color: #cbd5e1; padding-left: 2px; }
.op-cmp-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 15px 0 2px; font-size: 11.5px; color: #334155; font-variant-numeric: tabular-nums; }
.op-cmp-strip-item { display: inline-flex; align-items: center; gap: 5px; }
.op-cmp-strip-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.op-cmp-strip-item em { font-style: normal; color: #94a3b8; }
.op-cmp-strip-item.muted { color: #cbd5e1; }
.op-cmp-note { font-size: 10.5px; color: #94a3b8; padding: 10px 2px 0; line-height: 1.6; }

/* ===== 发展能力分析（复用 .op-* 骨架，另加板块小标题 + 增长质量双线图）===== */
/* 板块小标题：① 销售增长 / ② 资产增长 / ③ 股东权益增长 / ④ 增长质量 */
.gr-grp {
    font-size: 11.5px;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 0 5px 5px 0;
    padding: 4px 8px;
    margin: 12px 0 6px;
}
.gr-grp:first-child { margin-top: 2px; }
.gr-grp-cmp { margin: 16px 0 4px; font-size: 12.5px; }
/* 负增长数值标红，正负一眼可辨 */
.gr-neg { color: #dc2626 !important; }

/* 增长质量折叠块 */
.gr-quality {
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fcfdff;
}
.gr-quality > summary {
    cursor: pointer;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    list-style: none;
    user-select: none;
}
.gr-quality > summary::-webkit-details-marker { display: none; }
.gr-quality > summary::before { content: '▸ '; color: #94a3b8; }
.gr-quality[open] > summary::before { content: '▾ '; }
.gr-quality[open] > summary { border-bottom: 1px solid #e2e8f0; }
.gr-q-note { font-size: 10.5px; color: #94a3b8; line-height: 1.6; padding: 8px 10px 0; }
/* 单列纵向排布：卡片本身只占网格一列，双线图全宽才在手机上读得清，绝不横滑 */
.gr-q-grid { display: flex; flex-direction: column; gap: 12px; padding: 8px 10px 12px; }
.gr-q-item { border-top: 1px dashed #e2e8f0; padding-top: 10px; }
.gr-q-item:first-child { border-top: none; padding-top: 2px; }
.gr-q-title { font-size: 11.5px; font-weight: 600; color: #334155; }
.gr-q-vs { color: #94a3b8; font-weight: 400; margin: 0 2px; }
.gr-q-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 2px; }
.gr-q-lg { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: #64748b; }
.gr-q-lg i { width: 14px; height: 0; border-top-width: 2px; border-top-style: solid; display: inline-block; flex-shrink: 0; }
.gr-q-sw-a { border-top-color: #2f6fed; }
.gr-q-sw-b { border-top-color: #f59e0b; }
.gr-q-svg { display: block; width: 100%; height: auto; }
.gr-q-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.gr-q-line.gr-q-a { stroke: #2f6fed; }
.gr-q-line.gr-q-b { stroke: #f59e0b; stroke-dasharray: 4 3; }
.gr-q-dot { stroke-width: 1.2; }
.gr-q-dot.gr-q-a { fill: #2f6fed; stroke: #2f6fed; }
.gr-q-dot.gr-q-b { fill: #f59e0b; stroke: #f59e0b; }
.gr-q-dot.gr-q-clip { fill: #fff; }          /* 被夹到画布边界的极端值：空心点 */
.gr-q-zero { stroke: #cbd5e1; stroke-width: 1; stroke-dasharray: 3 3; }
.gr-q-tick { font-size: 8px; fill: #94a3b8; }
.gr-q-tip { font-size: 10.5px; color: #b45309; background: #fffbeb; border-radius: 5px; padding: 5px 7px; margin-top: 4px; line-height: 1.6; }
.gr-q-nodata { font-size: 11px; color: #cbd5e1; padding: 8px 10px; }

@media (max-width: 768px) {
    /* 手机上卡片满宽单列，图更大更好读；标签列不再省略号截断 */
    .gr-q-tick { font-size: 9px; }
    .gr-card .op-label { white-space: normal; }
    .gr-card .op-vals { width: 106px; }
    .gr-card .op-rank { width: 58px; }
}

/* ===== 利润表结构漫游 ===== */
.cs-base {
    font-size: 13px;
    color: #334155;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #6366f1;
}
.cs-base b { color: #1e293b; }
.cs-funnel {
    margin: 6px 0 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}
.cs-funnel-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 5px 0;
}
.cs-funnel-label {
    width: 64px;
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    flex-shrink: 0;
}
.cs-funnel-bar {
    flex: 1;
    height: 16px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
}
.cs-funnel-fill { display: block; height: 100%; border-radius: 8px; }
.cs-funnel-gross .cs-funnel-fill { background: #f59e0b; }
.cs-funnel-fee .cs-funnel-fill { background: #f87171; }
.cs-funnel-fee .cs-funnel-label { color: #dc2626; }
.cs-funnel-fee .cs-funnel-pct { color: #dc2626; }
.cs-funnel-op .cs-funnel-fill { background: #3b82f6; }
.cs-funnel-tp .cs-funnel-fill { background: #6366f1; }
.cs-funnel-np .cs-funnel-fill { background: #10b981; }
.cs-funnel-fill.neg { background: #ef4444 !important; margin-left: auto; }
.cs-funnel-pct {
    width: 44px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    flex-shrink: 0;
}
.cs-funnel-pct.neg { color: #ef4444; }
.cs-funnel-amt { width:72px; text-align:right; font-size:11px; color:#475569; flex-shrink:0; font-weight:600; font-variant-numeric:tabular-nums; }
.cs-amt { width:68px; text-align:right; font-size:11px; color:#64748b; flex-shrink:0; font-variant-numeric:tabular-nums; }
.cs-funnel-note { font-size: 10.5px; color: #ef4444; margin-top: 5px; opacity: .9; }
.cs-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin: 6px 0 8px;
    letter-spacing: .3px;
}
.cs-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
    font-size: 12.5px;
}
.cs-label {
    width: 106px;
    color: #334155;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-note {
    color: #a78bda;
    font-size: 10.5px;
    margin-left: 4px;
    white-space: nowrap;
}
.cs-bar {
    flex: 1;
    height: 14px;
    background: #f1f5f9;
    border-radius: 7px;
    overflow: hidden;
    display: flex;
}
.cs-fill { display: block; height: 100%; border-radius: 7px; min-width: 2px; }
.cs-cost .cs-fill { background: #f87171; }
.cs-cost .cs-pct { color: #dc2626; }
.cs-add .cs-fill { background: #4ade80; }
.cs-add .cs-pct { color: #16a34a; }
.cs-fin .cs-fill { background: #c4b5fd; }
.cs-fin .cs-pct { color: #7c3aed; }
.cs-fin .cs-label { color: #7c3aed; font-weight: 600; }
.cs-level { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e2e8f0; }
.cs-level .cs-label { font-weight: 700; color: #1e293b; }
.cs-level .cs-fill { background: #0ea5e9; }
.cs-level .cs-pct { color: #0369a1; font-weight: 700; }
.cs-level .cs-fill.neg { background: #ef4444; }
.cs-level .cs-pct.neg { color: #ef4444; }
.cs-empty .cs-pct { color: #94a3b8; }
.cs-sub .cs-label { color: #94a3b8; font-size: 11.5px; padding-left: 6px; }
.cs-yoy {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 1px 5px;
    border-radius: 6px;
    margin-left: 3px;
    white-space: nowrap;
    line-height: 1.4;
}
.cs-yoy.up { color: #dc2626; background: #fef2f2; }
.cs-yoy.down { color: #16a34a; background: #f0fdf4; }
.cs-base .cs-yoy { margin-left: 8px; vertical-align: middle; }

/* ===== 杜邦分析（v1，手机优先）===== */
.dp-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0 6px; }
.dp-cell { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; text-align: center; }
.dp-cell-name { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.dp-cell-val { font-size: 18px; font-weight: 700; }
.dp-card-hint { font-size: 12px; color: var(--primary); text-align: right; margin-top: 4px; }
.dp-detail { grid-column: 1 / -1; padding: 4px 0; }
.dp-detail-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dp-detail-title { font-size: 15px; font-weight: 600; }
.dp-section { margin-bottom: 26px; }
.dp-section-title { font-size: 15px; font-weight: 700; color: var(--primary-dark); margin-bottom: 12px; border-left: 4px solid var(--primary); padding-left: 10px; }
.dp-tree { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.dp-node { margin: 6px 0; }
.dp-node-head { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border-radius: 6px; padding: 8px 12px; margin-bottom: 4px; }
.dp-node-name { font-weight: 600; font-size: 14px; }
.dp-node-val { font-weight: 700; font-size: 15px; }
.dp-node-sub { font-size: 12px; color: var(--text-secondary); padding: 0 12px 2px; }
.dp-children { margin-left: 22px; border-left: 1px dashed var(--border); padding-left: 14px; }
.dp-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-left: 6px; }
.dp-badge.good { background: var(--success-light); color: var(--success); }
.dp-badge.bad { background: var(--danger-light); color: var(--danger); }
.dp-med { font-size: 11px; color: var(--text-light); margin-left: 6px; }
.dp-tree-note { font-size: 12px; color: var(--text-secondary); margin-top: 12px; line-height: 1.7; }
.dp-factor { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.dp-waterfall { width: 100%; height: auto; max-width: 680px; display: block; margin: 0 auto 14px; }
.dp-factor-table { margin-top: 8px; overflow-x: auto; }
.dp-factor-table table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 360px; }
.dp-factor-table th, .dp-factor-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: center; }
.dp-factor-table th { background: var(--bg); color: var(--text-secondary); font-weight: 600; }
.dp-row-total { font-weight: 700; background: var(--primary-lighter); }
.dp-pos { color: var(--success); font-weight: 600; }
.dp-neg { color: var(--danger); font-weight: 600; }
.dp-tree-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 8px; box-shadow: var(--shadow); }
.dp-tree-svg { width: 560px; max-width: none; height: auto; display: block; margin: 0 auto; }
.dp-feat { text-align: left; color: var(--text-secondary); font-weight: 400; padding: 4px 8px; background: var(--bg); border-radius: 6px; margin-top: 6px; }

@media (max-width: 480px) {
    .dp-card-grid { grid-template-columns: repeat(2, 1fr); }
    .dp-children { margin-left: 12px; padding-left: 10px; }
    .dp-node-head { padding: 7px 9px; }
    .dp-node-name { font-size: 13px; }
}

/* ===== 备案号页脚 ===== */
.site-footer {
    margin-top: 40px;
    padding: 18px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}
.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}
