:root {
    --bg: #e0e0e0;
    --hd: #e0e0e0;
    --sub: #e0e0e0;
    --fg: #34304b;
    --title: #1a1a1a;
    --red: #de0422;
    --muted: #9a9a9a;
    --line: #e0e0e0;
    --chipbg: #e0e0e0;
    --chipfg: #222222;
    --selbg: #e0e0e0;
    --btnbg: #e0e0e0;
    --btnfg: #8a8a8a;
    --btnbd: #d8d8d8;
    --down: #4caf50;
    --stock-flat: #9a9a9a;
    --catfg: #bf5b0b;
    --time: #b8860b;
    --accent: #de0422;
    --badge: #e60012;
    --scrollbar: #64748b;
    --vipbg: #e0e0e0;
}
html.dark {
    --bg: #1e232d;
    --hd: #191d25;
    --sub: #191d25;
    --fg: #e0e0e0;
    --title: #e0e0e0;
    --red: #d22222;
    --muted: #888888;
    --line: #333333;
    --chipbg: #191d25;
    --chipfg: #01bcdd;
    --selbg: #0e1b2c;
    --btnbg: #191d25;
    --btnfg: #888888;
    --btnbd: #333333;
    --down: #4eeeee;
    --stock-flat: #e0e0e0;
    --catfg: #01bcdd;
    --time: #ffd000;
    --accent: #01bcdd;
    --badge: #d22222;
    --scrollbar: #555555;
    --vipbg: #11151d;
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background: #888;
    background-clip: padding-box;
    border: 0 solid transparent;
}
::-webkit-scrollbar-thumb:vertical { border-width: 0 2.5px; }
::-webkit-scrollbar-thumb:horizontal { border-width: 2.5px 0; }
::-webkit-scrollbar-thumb:hover { background: #f90; border-width: 0; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) var(--line); }

body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", SimHei, SimSun, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.hd {
    flex: 0 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: var(--hd);
}
.brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--title);
}
.vip-badge {
    background: var(--accent, var(--badge));
    color: #e0e0e0;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 2px;
}
html.dark .brand .vip-badge { background: var(--red); }
.item .vip-badge {
    background: #d22222;
    font-size: 10px;
    line-height: 15px;
    padding: 0 3px;
    margin-right: 2px;
    vertical-align: 1px;
}
.sub {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px 0 4px;
    background: var(--sub);
    border-bottom: 1px solid var(--line);
}
.tabs { display: flex; align-items: center; }
.tab {
    height: 21px;
    padding: 0 5px;
    line-height: 21px;
    font-size: 13px;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.tab.on { color: var(--accent); font-weight: 700; }
.tools {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.search {
    width: 150px;
    min-width: 60px;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--fg);
    outline: none;
    font-family: inherit;
}
.search::placeholder { color: var(--muted); }
.chip {
    font-size: 12px;
    padding: 2px 7px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.chip.on {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--selbg);
}
.chip.hide { display: none; }
html.dark .tab:hover,
html.dark .chip:hover { background: var(--selbg); }

.list {
    flex: 1 1 auto;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}
.item {
    padding: 6px 2px 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: justify;
    color: var(--fg);
}
.item.vip { background: var(--vipbg); border-radius: 4px; }
.item .line {
    word-break: break-word;
    overflow-wrap: break-word;
}
.item .line.body-line {
    white-space: pre-wrap;
}
.item .line.body-text {
    text-indent: 2em;
    text-justify: inter-ideograph;
}
.item .head-line { margin-bottom: 1px; }
.time {
    color: var(--time);
    font-weight: 700;
}
.item.red .time,
.item.red .ttl,
.item.red .body-line { color: var(--red); }
.item.red .time { color: var(--time); }
.ttl { font-weight: 700; }
a.ttl {
    color: inherit;
    text-decoration: none;
}
a.ttl:hover { text-decoration: underline; }
.stocks-line { margin-top: 2px; }
.stock {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 2px;
    margin: 2px 4px 2px 0;
    text-decoration: none;
}
.stock {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: rgb(255 255 255 / .05);
    border: 1px solid rgb(255 255 255 / .08);
    padding: 2px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px 4px 2px 0;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #e0e0e0;
}
html:not(.dark) .stock {
    background: rgb(0 0 0 / .05);
    border-color: rgb(0 0 0 / .12);
}
.stock:hover {
    background: #1f477a;
    border-color: rgb(44 82 130 / .3);
}
.stock .name {
    margin-right: 0px;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #e0e0e0;
    position: relative;
    z-index: 1;
}
html:not(.dark) .stock .name { color: #000000; }
.stock .pct {
    font-weight: 400;
    font-size: 11px;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    margin-left: -6px;
    padding-right: 4px;
    box-sizing: border-box;
    text-align: right;
}
.stock .board-mark { font-size: 8px; margin-left: 1px; }
.stock .bm-c, .stock .bm-k { color: #01bcdd; }
.stock .bm-b { color: #9332e6; }
.stock .pct.up { color: var(--red); }
.stock .pct.down { color: var(--down); }
.stock .pct.flat { color: var(--stock-flat); }
.stock .pct.limit-up { background: #800000; color: #e0e0e0; border-radius: 2px; }
.stock .pct.limit-down { background: #006006; color: #e0e0e0; border-radius: 2px; }
.cat {
    display: inline-block;
    background: var(--chipbg);
    color: var(--catfg);
    font-size: 12px;
    padding: 0 6px;
    border-radius: 2px;
    margin-right: 2px;
}
.meta {
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0 14px;
}
.empty {
    padding: 64px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}
.more-hint {
    padding: 8px 0 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.foot {
    flex: 0 0 24px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
    border-top: 1px solid var(--line);
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%);
    background: var(--red);
    color: #e0e0e0;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    white-space: nowrap;
    z-index: 10;
}
.toast.show { display: block; }

@media (max-width: 640px) {
    .search { width: 96px; }
    .brand { font-size: 13px; }
}

/* 说明书 / 最近更新（与直播项目保持一致） */
.header-actions {
    position: fixed;
    top: -2px;
    right: 10px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 24px;
}
.help-btn {
    width: 10px;
    height: 24px;
    font-size: 11px;
    line-height: 24px;
    color: #555555;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: color .2s;
}
.help-btn:hover { color: #FFA500; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, .8);
    z-index: 1000;
    overflow: hidden;
    margin: 0;
    padding: 0;
}
.modal-content {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #1e232d;
}
.help-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #1e232d;
}

@keyframes clsVipUpdatesFlash { 0%, 100% { color: #ffff00; } 50% { color: #D22222; } }
