:root {
    --bg: #f5f6fa;
    --card: #ffffff;
    --text: #1f2329;
    --text2: #5a6474;
    --muted: #a8b1c0;
    --line: #f0f2f5;
    --up: #e5484d;
    --down: #2e9e5b;
    --flat: #8a94a6;
    --primary: #3467d6;
    --primary-press: #2b56b8;
    --danger: #e5484d;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

#app { max-width: 560px; margin: 0 auto; padding: 14px 14px 76px; }

.page { display: none; }
.page-active { display: block; }

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(30, 40, 60, 0.05);
}

.card-title { font-size: 16px; font-weight: 600; }
.card-sub { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.6; }

.input-row { display: flex; gap: 10px; margin-top: 12px; }

.code-input {
    flex: 1;
    height: 44px;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    background: #fafbfd;
    min-width: 0;
}
.code-input:focus { border-color: var(--primary); background: #fff; }

.btn-primary {
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary:active { background: var(--primary-press); }
.btn-primary:disabled { opacity: 0.5; }

.btn-ghost {
    height: 38px;
    padding: 0 14px;
    border: 1px solid #dfe4ec;
    border-radius: 10px;
    background: #fff;
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.error-text { margin-top: 10px; color: var(--danger); font-size: 13px; line-height: 1.6; }

.chips-title { margin-top: 14px; font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
    padding: 6px 12px;
    background: #eef3fd;
    border-radius: 16px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}
.chip .chip-code { margin-left: 6px; color: var(--muted); font-size: 12px; }

.state { padding: 60px 0; text-align: center; color: var(--muted); font-size: 14px; }

.empty-inline { padding: 14px 0 4px; font-size: 13px; color: var(--muted); }

/* 报告 */
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; }
.quote-name { font-size: 20px; font-weight: 600; }
.quote-code { font-size: 13px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.quote-date { margin-top: 4px; font-size: 12px; color: var(--muted); }
.quote-price-wrap { text-align: right; }
.quote-price { font-size: 24px; font-weight: 600; }
.quote-change { font-size: 13px; margin-top: 2px; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; }
.grid-item { }
.grid-label { font-size: 12px; color: var(--muted); }
.grid-value { margin-top: 2px; font-size: 15px; font-weight: 500; }

.row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: none; }
.row.row-head { color: var(--muted); font-size: 12px; padding: 12px 0 4px; }
.row-name { color: var(--text); }
.row.row-head .row-name { color: var(--muted); }
.row-right { color: var(--text); }
.row.row-head .row-right { color: var(--muted); }
.row-pct { width: 76px; text-align: right; }
.row-code { color: var(--muted); font-size: 12px; margin-left: 6px; }
.row-tap { cursor: pointer; }

.news-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-item.news-tap { cursor: pointer; }
.news-title { font-size: 14px; line-height: 1.6; color: var(--text); }
.news-meta { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.news-arrow { color: #c3cad4; }

.actions-card { display: flex; gap: 10px; }
.actions-btn { flex: 1; height: 42px; }

.disclaimer { margin-top: 14px; font-size: 11px; line-height: 1.7; color: var(--muted); }

/* 自选页 */
.row-head-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.watch-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.watch-item:last-child { border-bottom: none; }
.watch-name { font-size: 15px; }
.watch-code { font-size: 12px; color: var(--muted); margin-left: 6px; }
.watch-actions { display: flex; gap: 8px; }
.watch-actions .btn-ghost { height: 34px; padding: 0 12px; font-size: 12px; }
.watch-actions .btn-danger { color: var(--danger); border-color: #f3c8ca; }

.suggestions { margin-top: 10px; border: 1px solid #e3e7ee; border-radius: 10px; overflow: hidden; }
.suggestion { display: flex; justify-content: space-between; padding: 11px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.suggestion:last-child { border-bottom: none; }
.suggestion:active { background: #f2f6ff; }
.suggestion .s-code { color: var(--muted); font-size: 12px; }

/* 正文页 */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.btn-back { border: none; background: none; font-size: 16px; color: var(--primary); cursor: pointer; padding: 6px 4px; }
.topbar-title { font-size: 15px; font-weight: 600; }

.art-title { font-size: 19px; font-weight: 600; line-height: 1.5; }
.art-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.art-body { margin-top: 18px; }
.art-p { margin-bottom: 14px; font-size: 15px; line-height: 1.9; color: #2c333d; text-align: justify; }
.art-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.7; color: var(--muted); }
.art-copy { color: var(--primary); margin-left: 6px; cursor: pointer; }

/* 底部导航 */
.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-width: 560px; margin: 0 auto;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}
.tab {
    flex: 1;
    text-align: center;
    padding: 13px 0;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
}
.tab-active { color: var(--primary); font-weight: 600; }
