:root {
  --bg: #0d1117; --card: #161b22; --border: #2d333b; --text: #e6edf3;
  --muted: #8b949e; --accent: #d29922; --up: #f85149; --down: #3fb950;
  --blue: #58a6ff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 14px; }
.muted { color: var(--muted); }
.warn-text { color: var(--accent); }

header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
header h1 { font-size: 18px; }
header h1 span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 12px; }
input[type="date"] { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 14px; }

nav { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
nav .tab { padding: 10px 18px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
nav .tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: bold; }
nav .tab.disabled { opacity: .4; cursor: not-allowed; }

main { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }

/* 状态条 */
.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; margin-bottom: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.status-bar .btn { margin-left: auto; }

.btn { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: rgba(210,153,34,.15); border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { background: rgba(210,153,34,.25); color: var(--text); }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }

/* 概览 */
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 20px; font-weight: bold; margin-top: 4px; }
.stat .value small { font-size: 13px; font-weight: normal; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }

.conclusion { background: linear-gradient(135deg, #1c2128, #161b22); border: 1px solid var(--accent); border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; }
.conclusion h3 { color: var(--accent); font-size: 14px; margin-bottom: 8px; }
.conclusion textarea { width: 100%; background: transparent; border: none; color: var(--text); font-size: 15px; resize: vertical; min-height: 44px; outline: none; line-height: 1.6; }

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.progress-bar { flex: 1; height: 8px; background: var(--card); border-radius: 4px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.progress-row .txt { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* 模块卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 16px; }
@media (max-width: 1040px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.card.full { grid-column: 1 / -1; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.card-head .num { color: var(--accent); font-weight: bold; margin-right: 8px; }
.card-head h3 { font-size: 15px; display: inline; }
.method { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 10px; padding: 8px 10px; background: rgba(210,153,34,.06); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; }
.done-check { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; white-space: nowrap; }
.done-check input { accent-color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; font-weight: normal; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid #21262d; }
tr:last-child td { border-bottom: none; }
th.op-col, td.op-col { width: 30px; text-align: center; }

/* 可编辑表格 */
table[data-edit] td:not(.op-col) { cursor: text; }
table[data-edit] td:not(.op-col):hover { background: rgba(88,166,255,.06); }
table[data-edit] td:not(.op-col):focus { outline: 1px solid var(--accent); background: rgba(210,153,34,.08); border-radius: 3px; }
.row-del { background: none; border: none; color: #3d444d; cursor: pointer; font-size: 13px; }
.row-del:hover { color: var(--up); }
.add-row { margin-top: 8px; background: none; border: 1px dashed var(--border); color: var(--muted); border-radius: 6px; padding: 4px 14px; font-size: 12px; cursor: pointer; }
.add-row:hover { border-color: var(--blue); color: var(--blue); }

.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #30363d; color: var(--muted); }
.tag.hot { background: rgba(248,81,73,.15); color: var(--up); }
.tag.ok { background: rgba(63,185,80,.15); color: var(--down); }
.tag.warn { background: rgba(210,153,34,.15); color: var(--accent); }

.chart { width: 100%; height: 300px; }
.note-area { margin-top: 10px; }
.note-area textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 10px; font-size: 13px; resize: vertical; min-height: 46px; outline: none; }
.note-area textarea:focus { border-color: var(--accent); }
.note-label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.sub-title { color: var(--blue); font-size: 13px; margin: 6px 0; font-weight: bold; }

.ladder { font-size: 13px; line-height: 2; }
.ladder b { color: var(--up); margin-right: 4px; }

.news-list { max-height: 300px; overflow-y: auto; font-size: 12px; line-height: 1.6; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: var(--bg); }
.news-item { padding: 4px 0; border-bottom: 1px dashed #21262d; }
.news-item:last-child { border-bottom: none; }
.news-time { color: var(--muted); margin-right: 6px; font-family: Consolas, monospace; }
.ext-links { float: right; }
.ext-links a { color: var(--blue); font-size: 12px; text-decoration: none; margin-left: 8px; }
.ext-links a:hover { text-decoration: underline; }
.report-link { color: var(--text); text-decoration: none; }
.report-link:hover { color: var(--blue); text-decoration: underline; }

.demo-tip { color: var(--muted); font-size: 12px; text-align: right; margin-top: 20px; line-height: 1.8; }

/* 板块分析策略页 */
.bk-link { color: var(--blue); cursor: pointer; }
.bk-link:hover { text-decoration: underline; }.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--accent); color: var(--text); padding: 8px 20px; border-radius: 6px; display: none; z-index: 99; }

/* 自选池 */
.zx-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.zx-toolbar input { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 14px; width: 220px; outline: none; }
.zx-toolbar input:focus { border-color: var(--accent); }
.zx-toolbar #zxStatus { font-size: 12px; color: var(--muted); }
#zxTable input, #zxTable select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; font-size: 13px; width: 90px; }
#zxTable select { width: 70px; }
#zxTable input[data-f="note"] { width: 160px; }
tr.row-alert td { background: rgba(248,81,73,.08); }
.empty-hint { color: var(--muted); text-align: center; padding: 30px 0 10px; font-size: 13px; }
