/* ============================================================
   A股看盘·盯盘·复盘系统  样式表  —— 券商终端风格（浅色主题）
   涨=红 跌=绿（中国市场惯例）
   ============================================================ */
:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --border: #e2e6ed;
  --border-2: #eef1f5;
  --text: #1c2331;
  --text-2: #4a5468;
  --muted: #8b93a3;
  --accent: #2559d8;
  --accent-soft: #eaf0ff;
  --up: #dc3a33;
  --up-bg: #fdeeed;
  --up-bg2: #f9d9d7;
  --down: #0f9d58;
  --down-bg: #e8f6ee;
  --down-bg2: #cfeddd;
  --flat: #78808f;
  --warn: #d98b0b;
  --warn-bg: #fff6e5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --radius: 8px;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; outline: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd3dd; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #b3bbc9; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flat { color: var(--flat) !important; }
.mut { color: var(--muted); }
.hidden { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 46px; flex: 0 0 46px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .3px; white-space: nowrap; }
.brand .logo {
  width: 24px; height: 24px; border-radius: 6px;
  background: linear-gradient(135deg, #dc3a33, #f0764e);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800;
}
.brand small { font-weight: 500; color: var(--muted); font-size: 11px; margin-left: 2px; }

.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav button {
  border: 0; background: transparent; padding: 7px 15px; border-radius: 6px;
  cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px;
  transition: all .14s;
}
.nav button:hover { background: var(--panel-2); color: var(--text); }
.nav button.on { background: var(--accent-soft); color: var(--accent); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--panel-2);
  font-size: 11.5px; color: var(--text-2); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flat); }
.dot.live { background: var(--up); box-shadow: 0 0 0 3px rgba(220, 58, 51, .16); animation: pulse 1.8s infinite; }
.dot.rest { background: var(--warn); }
.dot.off { background: var(--muted); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.sel, .btn {
  border: 1px solid var(--border); background: var(--panel); border-radius: 6px;
  padding: 5px 9px; cursor: pointer; transition: all .14s; font-size: 12.5px;
}
.sel:hover, .btn:hover { border-color: #c3ccdb; background: var(--panel-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #1b47b8; }
.btn.sm { padding: 3px 8px; font-size: 11.5px; }
.btn.danger { color: var(--up); border-color: #f3c9c7; }
.btn.danger:hover { background: var(--up-bg); }

/* ---------------- 主体 ---------------- */
.main { flex: 1; overflow: hidden; position: relative; }
.page { position: absolute; inset: 0; overflow: auto; padding: 12px; display: none; }
.page.on { display: block; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-hd {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border-2); background: var(--panel-2);
}
.card-hd h3 { font-size: 13px; font-weight: 700; letter-spacing: .2px; }
.card-hd .sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.card-hd .sp { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card-bd { padding: 10px 12px; }
.card-bd.tight { padding: 0; }

/* ---------------- 指数条 ---------------- */
.idx-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px;
}
.idx-cell {
  border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px;
  cursor: pointer; background: var(--panel); transition: all .14s; position: relative; overflow: hidden;
}
.idx-cell:hover { border-color: #c3ccdb; transform: translateY(-1px); box-shadow: var(--shadow); }
.idx-cell .nm { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; justify-content: space-between; }
.idx-cell .nm em { font-style: normal; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.idx-cell .pv { font-size: 18px; font-weight: 700; font-family: var(--mono); margin: 3px 0 1px; letter-spacing: -.3px; }
.idx-cell .ch { font-size: 11.5px; font-family: var(--mono); display: flex; gap: 8px; }
.idx-cell.u { background: linear-gradient(180deg, var(--up-bg) 0%, #fff 60%); }
.idx-cell.d { background: linear-gradient(180deg, var(--down-bg) 0%, #fff 60%); }
.idx-cell .spark { position: absolute; right: 0; bottom: 0; width: 62px; height: 26px; opacity: .55; }

/* ---------------- 市场温度 ---------------- */
.temp-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 10px; align-items: center; }
.temp-bar { height: 22px; border-radius: 5px; overflow: hidden; display: flex; font-size: 11px; font-weight: 700; color: #fff; }
.temp-bar .u { background: var(--up); display: grid; place-items: center; }
.temp-bar .f { background: #b8bfcc; display: grid; place-items: center; }
.temp-bar .d { background: var(--down); display: grid; place-items: center; }
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv .k { font-size: 11px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 700; font-family: var(--mono); }

/* ---------------- 表格 ---------------- */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  position: sticky; top: 0; z-index: 5; background: var(--panel-2);
  border-bottom: 1px solid var(--border); padding: 7px 8px; text-align: right;
  font-weight: 600; color: var(--text-2); white-space: nowrap; font-size: 11.5px;
  cursor: pointer; user-select: none;
}
table.tbl th:hover { background: #eef1f6; color: var(--accent); }
table.tbl th.l, table.tbl td.l { text-align: left; }
table.tbl th.c, table.tbl td.c { text-align: center; }
table.tbl th.nosort { cursor: default; }
table.tbl th.nosort:hover { background: var(--panel-2); color: var(--text-2); }
table.tbl th .ar { font-size: 9px; opacity: .8; margin-left: 2px; }
table.tbl td {
  padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border-2);
  white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums;
}
table.tbl td.txt { font-family: inherit; }
table.tbl tbody tr { cursor: pointer; transition: background .1s; }
table.tbl tbody tr:hover { background: #f6f8fb; }
table.tbl tbody tr.sel { background: var(--accent-soft); }
table.tbl tbody tr.sel td { border-bottom-color: #d5e0ff; }
.tag {
  display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 10.5px;
  font-family: inherit; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2);
}
.tag.u { background: var(--up-bg); border-color: #f2cecb; color: var(--up); }
.tag.d { background: var(--down-bg); border-color: #c8e8d7; color: var(--down); }
.tag.w { background: var(--warn-bg); border-color: #f2dfb4; color: var(--warn); }
.tag.a { background: var(--accent-soft); border-color: #cfdcff; color: var(--accent); }
.pctcell { display: inline-block; min-width: 58px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }

/* ---------------- 布局网格 ---------------- */
.split { display: grid; grid-template-columns: 1fr 316px; gap: 12px; align-items: start; }
.split-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 1280px) { .split { grid-template-columns: 1fr; } .split-3 { grid-template-columns: 1fr; } }

/* 复盘中心：市场全景 + 涨跌分布 同一行并排（等宽对齐） */
.ov-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: stretch; }
.ov-col { display: flex; flex-direction: column; min-width: 0; min-height: 260px; }
.ov-col + .ov-col { border-left: 1px solid #eef1f5; }
.ov-col .card-hd { padding: 10px 14px; flex-shrink: 0; }
.ov-col .card-bd { padding: 12px 14px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ov-col .metrics { font-size: 11.5px; flex: 1; }
.ov-col .chart { width: 100%; flex: 1; min-height: 200px; }
.ov-inner { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; flex: 1; min-height: 0; }
.ov-inner .chart { width: 100%; height: 100%; min-height: 180px; }
.ov-inner .metrics { font-size: 11.5px; }
@media (max-width: 1100px) {
  .ov-split { grid-template-columns: 1fr; }
  .ov-col + .ov-col { border-left: 0; border-top: 1px solid #eef1f5; }
}

/* ---------------- 盘口 ---------------- */
.ob { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; font-family: var(--mono); font-size: 12px; }
.ob .lbl { color: var(--muted); }
.ob .row { display: contents; }
.ob .barwrap { position: relative; height: 17px; }
.ob .bar { position: absolute; right: 0; top: 2px; height: 13px; border-radius: 2px; opacity: .28; }
.ob .bar.a { background: var(--up); }
.ob .bar.b { background: var(--down); }
.ob-mid { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; margin: 4px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }

/* ---------------- 搜索 ---------------- */
.search-box { position: relative; }
.search-box input {
  width: 210px; padding: 5px 26px 5px 9px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--panel); transition: all .14s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 89, 216, .1); }

/* 自选股本地保存状态指示器（同步中/已缓存/离线暂存） */
.save-status {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  cursor: help;
  user-select: none;
  transition: all .25s;
}
.save-status.saved   { background: #f0f7ee; color: #2f7a3a; border: 1px solid #c5e2c0; }
.save-status.saving  { background: #fff7e6; color: #b8740a; border: 1px solid #ffd591; }
.save-status.offline { background: #fdecec; color: #b32424; border: 1px solid #f5b5b5; }
.search-box .ico { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.sug {
  position: absolute; top: calc(100% + 4px); left: 0; width: 300px; max-height: 320px; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 7px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .14); z-index: 60; display: none;
}
.sug.on { display: block; }
.sug .it { padding: 7px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-2); }
.sug .it:last-child { border-bottom: 0; }
.sug .it:hover, .sug .it.hi { background: var(--accent-soft); }
.sug .it .c { font-family: var(--mono); color: var(--muted); font-size: 11.5px; min-width: 62px; }
.sug .it .n { font-weight: 600; flex: 1; }
.sug .empty { padding: 14px; text-align: center; color: var(--muted); }

/* 自选挑拣弹层（曲线盯盘页「自选」按钮） */
.watch-picker {
  position: absolute; top: calc(100% + 6px); right: 0; width: 340px; max-height: 420px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 32px rgba(16, 24, 40, .18); z-index: 80;
  display: none; flex-direction: column;
}
.watch-picker.on { display: flex; }
.watch-picker .wp-hd {
  padding: 8px 12px; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.watch-picker .wp-hd .title { font-weight: 600; font-size: 13px; }
.watch-picker .wp-hd .ct { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.watch-picker .wp-bd {
  flex: 1; overflow: auto; padding: 4px 0;
}
.watch-picker .gp {
  border-bottom: 1px solid var(--border-2);
}
.watch-picker .gp:last-child { border-bottom: 0; }
.watch-picker .gp-hd {
  padding: 6px 12px; font-size: 11.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  background: var(--bg);
}
.watch-picker .gp-hd .nm { font-weight: 600; color: var(--text-2); }
.watch-picker .gp-hd .ct { margin-left: auto; }
.watch-picker .gp-hd a {
  color: var(--accent); cursor: pointer; font-size: 11px;
}
.watch-picker .gp-rows { padding: 2px 0; }
.watch-picker .row {
  padding: 5px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer;
  transition: background .12s;
}
.watch-picker .row:hover { background: var(--accent-soft); }
.watch-picker .row.in { color: var(--muted); }
.watch-picker .row .nm { flex: 1; font-weight: 600; font-size: 12.5px; }
.watch-picker .row .num { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.watch-picker .row .ck {
  width: 14px; height: 14px; border: 1.5px solid var(--border); border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; flex-shrink: 0;
}
.watch-picker .row.on .ck { background: var(--accent); border-color: var(--accent); }
.watch-picker .row.in .ck { background: var(--muted); border-color: var(--muted); }
.watch-picker .empty {
  padding: 28px 14px; text-align: center; color: var(--muted); font-size: 12px;
}
.watch-picker .wp-ft {
  padding: 8px 12px; border-top: 1px solid var(--border-2);
  display: flex; gap: 6px; flex-shrink: 0; background: var(--bg);
}
.watch-picker .wp-ft .btn { flex: 1; }
.watch-picker .wp-ft .acts { display: flex; gap: 4px; }

/* ---------------- 分组 ---------------- */
.groups { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.gtab {
  padding: 4px 11px; border-radius: 15px; border: 1px solid var(--border);
  background: var(--panel); cursor: pointer; font-size: 12px; transition: all .14s;
  display: inline-flex; align-items: center; gap: 5px;
}
.gtab:hover { border-color: #c3ccdb; }
.gtab.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.gtab .x { opacity: .6; font-size: 13px; line-height: 1; }
.gtab .x:hover { opacity: 1; }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; }
.chart-toolbar { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button {
  border: 0; background: var(--panel); padding: 4px 10px; cursor: pointer;
  font-size: 12px; color: var(--text-2); border-right: 1px solid var(--border); transition: all .12s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--panel-2); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }

/* ---------------- 个股头 ---------------- */
.stk-hd { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.stk-hd .name { font-size: 19px; font-weight: 700; }
.stk-hd .code { font-family: var(--mono); color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.stk-hd .big { font-size: 30px; font-weight: 700; font-family: var(--mono); line-height: 1; letter-spacing: -.8px; }
.stk-hd .chg { font-size: 14px; font-family: var(--mono); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px 14px; }
.metrics .m { display: flex; flex-direction: column; }
.metrics .m .k { font-size: 11px; color: var(--muted); }
.metrics .m .v { font-size: 13px; font-family: var(--mono); font-weight: 600; }

/* ---------------- 复盘 ---------------- */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
.heat .hc {
  border-radius: 6px; padding: 7px 8px; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s; color: #fff;
}
.heat .hc:hover { transform: scale(1.035); z-index: 2; box-shadow: var(--shadow); }
.heat .hc .n { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .hc .p { font-size: 14px; font-family: var(--mono); font-weight: 700; }
.heat .hc .l { font-size: 10.5px; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ladder { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.lad-col { min-width: 152px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.lad-col .h { padding: 5px 8px; background: var(--up-bg); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 12px; color: var(--up); display: flex; justify-content: space-between; }
.lad-col .b { max-height: 260px; overflow: auto; }
.lad-col .i { padding: 4px 8px; border-bottom: 1px solid var(--border-2); font-size: 11.5px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; }
.lad-col .i:hover { background: var(--up-bg); }
.lad-col .i .t { font-family: var(--mono); color: var(--muted); font-size: 10.5px; }

textarea.note {
  width: 100%; min-height: 168px; border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 11px; resize: vertical; line-height: 1.65; background: var(--panel-2);
}
textarea.note:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(37, 89, 216, .09); }

/* ---------------- 预警 ---------------- */
.alert-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; align-items: center; }
.alert-form input, .alert-form select {
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); width: 100%;
}
.alert-log { max-height: 320px; overflow: auto; }
.alert-log .li {
  padding: 7px 10px; border-bottom: 1px solid var(--border-2); display: flex; gap: 10px; align-items: center; font-size: 12.5px;
}
.alert-log .li .t { font-family: var(--mono); color: var(--muted); font-size: 11px; }

/* ---------------- 空态 / 载入 ---------------- */
.empty-s { padding: 42px 16px; text-align: center; color: var(--muted); }
.empty-s .ic { font-size: 30px; opacity: .35; margin-bottom: 8px; }
.loading { padding: 26px; text-align: center; color: var(--muted); font-size: 12.5px; }
.spin {
  display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; margin-right: 6px;
}
@keyframes sp { to { transform: rotate(360deg) } }

.toast-wrap { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: #232a37; color: #fff; padding: 9px 14px; border-radius: 7px; font-size: 12.5px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .22); animation: tin .22s ease; max-width: 380px;
}
.toast.u { background: var(--up); } .toast.d { background: var(--down); }
@keyframes tin { from { opacity: 0; transform: translateY(8px) } }

.flash-u { animation: fu .7s ease; } .flash-d { animation: fd .7s ease; }
@keyframes fu { 0% { background: var(--up-bg2) } 100% { background: transparent } }
@keyframes fd { 0% { background: var(--down-bg2) } 100% { background: transparent } }

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); font-family: var(--mono); }
.legend b { font-weight: 600; }

/* ---------------- 顶栏补充 ---------------- */
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chk input { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.chk-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.chk-row .chk { font-size: 12.5px; }
#st-src { display: flex; gap: 5px; padding: 3px 7px; }
#st-src .src { font-size: 10.5px; padding: 0 4px; border-radius: 3px; }
#st-src .src.good { background: var(--down-bg); color: var(--down); }
#st-src .src.bad { background: var(--up-bg); color: var(--up); }
.badge {
  display: inline-block; min-width: 15px; padding: 0 4px; margin-left: 4px; border-radius: 8px;
  background: var(--up); color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}
.dinp { padding: 3px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); font-size: 11.5px; font-family: var(--mono); }

/* ---------------- 技术评分 ---------------- */
.score-box { display: flex; align-items: center; gap: 14px; }
.score-box .ring {
  width: 76px; height: 76px; border-radius: 50%; flex: 0 0 auto;
  background: #eef1f5; display: grid; place-items: center; position: relative;
}
.score-box .ring::after {
  content: ''; position: absolute; inset: 8px; background: var(--panel); border-radius: 50%;
}
.score-box .ring b { position: relative; z-index: 1; font-size: 25px; font-family: var(--mono); font-weight: 700; line-height: 1; }
.score-box .ring em { position: relative; z-index: 1; font-style: normal; font-size: 10px; color: var(--muted); margin-top: 1px; }
.score-note { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.factors { margin-top: 10px; border-top: 1px solid var(--border-2); }
.factors .fx {
  display: grid; grid-template-columns: 15px 62px 1fr 22px; gap: 6px; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--border-2); font-size: 11.5px;
}
.factors .fx:last-child { border-bottom: 0; }
.factors .fx .d { font-weight: 700; text-align: center; }
.factors .fx.ok .d { color: var(--up); }
.factors .fx.no .d { color: var(--muted); }
.factors .fx .n { font-weight: 600; color: var(--text-2); }
.factors .fx .t { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.factors .fx .w { font-family: var(--mono); color: #b0b7c3; font-size: 10.5px; text-align: right; }

/* ---------------- 模态框 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 26, 38, .42); z-index: 300;
  display: none; align-items: flex-start; justify-content: center; padding: 60px 16px 24px; overflow: auto;
}
.modal-mask.on { display: flex; }
.modal {
  width: 100%; max-width: 780px; background: var(--panel); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .28); animation: tin .2s ease;
}
.modal-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-hd h3 { font-size: 14px; }
.modal-hd .sp { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.modal-x { font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.modal-x:hover { color: var(--text); }
.modal-bd { padding: 14px 16px 18px; }
.sec-t { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }

@media (max-width: 1180px) {
  .temp-row { grid-template-columns: 1fr 1fr; }
  .top-right .chk, .top-right #st-src { display: none; }
}

/* ---------------- 桌面通知状态胶囊 ---------------- */
.notify-stat { position: relative; }
.notify-stat.granted { color: var(--down); border-color: var(--down-bg2); background: var(--down-bg); }
.notify-stat.denied { color: var(--up); border-color: var(--up-bg2); background: var(--up-bg); }
.notify-stat.default { color: var(--warn); border-color: #f0d59a; background: var(--warn-bg); animation: npulse 1.8s ease-in-out infinite; }
.notify-stat.unsupported { color: var(--muted); }
@keyframes npulse { 0%,100% { box-shadow: 0 0 0 0 rgba(217,139,11,.35); } 50% { box-shadow: 0 0 0 4px rgba(217,139,11,0); } }

/* ---------------- 曲线盯盘 ---------------- */
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border-2); }
.cchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--panel); font-size: 12px; cursor: default;
}
.cchip b { font-weight: 600; }
.cchip .num { color: var(--muted); font-size: 11px; }
.cchip .x { cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 2px; font-size: 13px; }
.cchip .x:hover { color: var(--up); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 12px; font-size: 12px; }
.cmp-legend .l { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text-2); }
.cmp-legend .l i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.cmp-legend .l b { font-family: var(--mono); }
.cmp-grid { display: grid; gap: 10px; padding: 10px 12px 14px; }
.cmp-cell { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); overflow: hidden; cursor: pointer; transition: box-shadow .14s; }
.cmp-cell:hover { box-shadow: var(--shadow); }
.cmp-cell .hd { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border-2); border-left: 3px solid transparent; }
.cmp-cell .hd .nm { font-weight: 700; font-size: 12.5px; display: flex; gap: 6px; align-items: baseline; }
.cmp-cell .hd .nm .num { color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 400; }
.cmp-cell .hd .pv { margin-left: auto; font-family: var(--mono); font-size: 15px; font-weight: 700; }
.cmp-cell .hd .ch { font-family: var(--mono); font-size: 12px; }
.cmp-cell .ct { height: 240px; }

/* ---------------- 通知权限引导条 ---------------- */
.notify-guide {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-16px);
  z-index: 320; max-width: 680px; width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(16,24,40,.18);
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
}
.notify-guide.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.notify-guide.off { border-color: #f0d59a; background: var(--warn-bg); }
.notify-guide.denied { border-color: var(--up-bg2); background: var(--up-bg); }
.notify-guide .ng-ic { font-size: 18px; flex: 0 0 auto; }
.notify-guide .ng-txt { flex: 1; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.notify-guide .ng-txt b { color: var(--text); }
.notify-guide .ng-x { font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; flex: 0 0 auto; }
.notify-guide .ng-x:hover { color: var(--text); }

/* ===== 登录后顶栏显示 ===== */
.auth-user {
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
  padding: 2px 6px;
  background: var(--panel-2, #f0f3f8);
  border-radius: 4px;
}
#btn-logout { font-size: 12px; padding: 3px 8px; }

/* ===== 登录 Modal ===== */
.auth-mask {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20, 30, 50, 0.55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  animation: authFadeIn .18s ease;
}
.auth-mask.on { display: flex; }
@keyframes authFadeIn { from { opacity: 0 } to { opacity: 1 } }

.auth-card {
  width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  animation: authSlideUp .22s ease;
}
@keyframes authSlideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.auth-hd { text-align: center; margin-bottom: 18px; }
.auth-hd .auth-logo { font-size: 38px; display: block; margin-bottom: 8px; }
.auth-hd h2 { font-size: 18px; font-weight: 600; color: #1a1a1a; margin: 0; }

.auth-hint { font-size: 13px; color: #888; text-align: center; margin: 0 0 18px; }

.auth-lbl { display: block; margin-bottom: 12px; font-size: 12px; color: #555; }
.auth-lbl input {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 4px; padding: 9px 11px;
  border: 1px solid #d8dde6; border-radius: 6px;
  font-size: 14px; background: #fafbfd;
  transition: border .15s;
}
.auth-lbl input:focus { outline: none; border-color: #2559d8; background: #fff; }

.auth-err { color: #b32424; font-size: 12.5px; min-height: 18px; margin: 4px 0 0; text-align: center; }

.auth-ft { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.auth-btn {
  width: 100%; padding: 10px 0;
  background: linear-gradient(180deg, #3672ec, #2559d8);
  color: #fff; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.auth-btn:hover:not(:disabled) { background: linear-gradient(180deg, #4079f0, #2c61dd); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; }

.auth-link { background: none; border: none; color: #888; font-size: 12px; cursor: pointer; }
.auth-link:hover { color: #555; }
