/* =============== 基础 =============== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background: #fafafa;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}
a { color: #1677ff; text-decoration: none; }
a:hover { text-decoration: underline; }
table { border-collapse: collapse; width: 100%; }
input, button { font-family: inherit; outline: none; }

/* =============== Header =============== */
.top-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.logo {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #888;
}
.time-display {
    font-family: 'SF Mono', Consolas, monospace;
}
.refresh-btn {
    background: #fff;
    color: #555;
    border: 1px solid #d9d9d9;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.refresh-btn:hover { border-color: #1677ff; color: #1677ff; }

/* =============== 导航 =============== */
.tab-nav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}
.tab-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    overflow-x: auto;
}
.tab-btn {
    background: transparent;
    color: #666;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: #222; }
.tab-btn.active {
    color: #1677ff;
    border-bottom-color: #1677ff;
    font-weight: 500;
}

/* =============== 主容器 =============== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* =============== 概览摘要条 =============== */
.summary-bar {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; }
.summary-label { font-size: 12px; color: #999; margin-bottom: 2px; }
.summary-value {
    font-size: 18px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
    color: #222;
}
.summary-value.up { color: #e53935; }
.summary-value.down { color: #43a047; }

/* =============== 面板 =============== */
.panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 16px;
}
.panel-header {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}
.panel-meta { font-size: 12px; color: #999; }

/* =============== 栅格 =============== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.multi-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

/* =============== 指数卡片 =============== */
.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.index-item {
    padding: 14px 16px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.index-name { font-size: 12px; color: #888; margin-bottom: 4px; }
.index-current {
    font-size: 18px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
    margin-bottom: 2px;
}
.index-current.up { color: #e53935; }
.index-current.down { color: #43a047; }
.index-change { font-size: 12px; font-family: 'SF Mono', Consolas, monospace; }
.index-change.up { color: #e53935; }
.index-change.down { color: #43a047; }
.index-meta { font-size: 11px; color: #aaa; margin-top: 4px; }

/* =============== 数据表 =============== */
.data-table { width: 100%; font-size: 13px; }
.data-table thead th {
    background: #fafafa;
    padding: 10px 16px;
    text-align: left;
    font-weight: 500;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}
.data-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.up { color: #e53935; }
.down { color: #43a047; }
.numeric { font-family: 'SF Mono', Consolas, monospace; text-align: right; }

/* =============== 简单列表 =============== */
.simple-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.simple-item:last-child { border-bottom: none; }
.simple-item:hover { background: #fafbfc; }
.si-name { color: #333; }
.si-value { font-family: 'SF Mono', Consolas, monospace; color: #222; }

/* =============== 搜索 =============== */
.search-bar {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}
.search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 6px 12px;
    color: #333;
    font-size: 14px;
}
.search-bar input:focus { border-color: #1677ff; }
.primary-btn {
    background: #1677ff;
    color: #fff;
    border: none;
    padding: 6px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.primary-btn:hover { background: #4096ff; }
.quick-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #888;
    padding-top: 4px;
}
.quick-links a { padding: 2px 8px; color: #1677ff; }

/* =============== 详情 =============== */
.stock-detail, .fund-detail { padding: 20px; }
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}
.detail-name { font-size: 18px; font-weight: 600; color: #222; }
.detail-code { font-size: 12px; color: #999; margin-top: 2px; }
.detail-price { text-align: right; }
.detail-current {
    font-size: 26px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
}
.detail-change { font-size: 13px; font-family: 'SF Mono', Consolas, monospace; }
.detail-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.dg-item { border-left: 1px solid #f0f0f0; padding-left: 12px; }
.dg-item:first-child { border-left: none; padding-left: 0; }
.dg-label { font-size: 12px; color: #999; margin-bottom: 2px; }
.dg-value {
    font-size: 14px;
    font-weight: 500;
    font-family: 'SF Mono', Consolas, monospace;
    color: #222;
}

/* =============== 黄金卡片 =============== */
.gold-card {
    padding: 14px 16px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.gold-name { font-size: 12px; color: #888; margin-bottom: 4px; }
.gold-price {
    font-size: 18px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
    color: #222;
    margin-bottom: 2px;
}
.gold-change { font-size: 12px; font-family: 'SF Mono', Consolas, monospace; }
.gold-meta { font-size: 11px; color: #aaa; margin-top: 4px; }

/* =============== 基金分类 =============== */
.fund-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.fc-card {
    padding: 14px 16px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.fc-title { font-size: 13px; font-weight: 600; color: #222; margin-bottom: 8px; }
.fc-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.fc-label { color: #999; }
.fc-value { font-family: 'SF Mono', Consolas, monospace; color: #333; }

/* =============== 债券 =============== */
.bond-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.bond-card { padding: 14px 16px; border-right: 1px solid #f0f0f0; }
.bond-card:last-child { border-right: none; }
.bond-name { font-size: 12px; color: #888; margin-bottom: 4px; }
.bond-price {
    font-size: 18px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
    margin-bottom: 2px;
}
.bond-change { font-size: 12px; font-family: 'SF Mono', Consolas, monospace; }

.yield-curve {
    padding: 30px 20px 40px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    align-items: end;
    height: 220px;
}
.yc-bar {
    background: #1677ff;
    border-radius: 2px 2px 0 0;
    min-height: 30px;
    position: relative;
    opacity: 0.85;
}
.yc-bar:hover { opacity: 1; }
.yc-value {
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding-top: 4px;
    font-family: 'SF Mono', Consolas, monospace;
}
.yc-label {
    position: absolute;
    bottom: -22px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: #888;
}

/* =============== LPR =============== */
.lpr-cards { display: grid; grid-template-columns: 1fr 1fr; }
.lpr-card { padding: 20px; border-right: 1px solid #f0f0f0; text-align: center; }
.lpr-card:last-child { border-right: none; }
.lpr-title { font-size: 12px; color: #888; margin-bottom: 6px; }
.lpr-rate {
    font-size: 28px;
    font-weight: 600;
    color: #1677ff;
    font-family: 'SF Mono', Consolas, monospace;
}
.lpr-meta { font-size: 12px; color: #999; margin-top: 4px; }

/* =============== AI =============== */
.ai-intro {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 16px;
}
.ai-intro h2 { font-size: 18px; color: #222; margin-bottom: 6px; font-weight: 600; }
.ai-intro p { color: #666; font-size: 13px; }

.ai-tools {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.ai-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.ai-card:hover {
    border-color: #1677ff;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.1);
}
.ai-card h3 { font-size: 14px; margin-bottom: 6px; color: #222; font-weight: 600; }
.ai-card p { font-size: 12px; color: #888; line-height: 1.5; min-height: 36px; }
.ai-action { font-size: 12px; color: #1677ff; margin-top: 8px; display: block; }

.ai-chat { padding: 20px; }
.quick-questions { margin-bottom: 14px; }
.qq-title { font-size: 12px; color: #888; margin-bottom: 8px; }
.qq-btn {
    display: inline-block;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    color: #555;
    padding: 4px 12px;
    margin: 4px 4px 4px 0;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
}
.qq-btn:hover {
    background: #e6f4ff;
    border-color: #1677ff;
    color: #1677ff;
}
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
    flex: 1;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 8px 12px;
    color: #333;
    font-size: 14px;
}
.chat-input-row input:focus { border-color: #1677ff; }

/* =============== AI 结果 =============== */
.ai-result { margin-top: 16px; }
.ai-report {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-bottom: 16px;
}
.ai-report-header {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-report-header h3 { font-size: 15px; color: #222; font-weight: 600; }
.ai-report-time { font-size: 12px; color: #999; }
.ai-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.ai-section:last-child { border-bottom: none; }
.ai-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1677ff;
    margin-bottom: 10px;
}
.ai-section-content {
    font-size: 13px;
    color: #444;
    line-height: 1.8;
}
.ai-section-content strong { color: #222; font-weight: 600; }
.ai-section-content ul, .ai-section-content ol { padding-left: 20px; margin: 6px 0; }

.ai-summary-row {
    background: #fafbfc;
    padding: 16px 20px;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f0f0f0;
}
.ai-summary-item { display: flex; flex-direction: column; }
.ai-summary-label { font-size: 11px; color: #999; margin-bottom: 2px; }
.ai-summary-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, monospace;
}

/* =============== 信息面板 =============== */
.info-panel .info-content {
    padding: 20px;
    color: #444;
    line-height: 1.8;
    font-size: 13px;
}
.info-content h4 {
    color: #222;
    font-size: 13px;
    font-weight: 600;
    margin: 12px 0 6px 0;
}
.info-content ul { padding-left: 20px; margin: 4px 0; }
.info-content p { margin: 6px 0; }

/* =============== Footer =============== */
.footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #888;
}
.disclaimer { margin-top: 4px; color: #999; }

/* =============== 加载 =============== */
.global-loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-content { text-align: center; }
.loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #666; font-size: 13px; }

/* =============== 响应式 =============== */
@media (max-width: 1200px) {
    .multi-panel, .ai-tools, .fund-categories { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: repeat(3, 1fr); }
    .bond-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .two-col, .multi-panel, .ai-tools, .fund-categories { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .lpr-cards { grid-template-columns: 1fr; }
    .container { padding: 12px; }
    .header-inner { padding: 0 12px; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
