:root {
  --bg: #f6f4ee;
  --card: #ffffff;
  --ink: #1d1f1c;
  --ink-2: #5c615b;
  --ink-3: #8d928a;
  --line: #e6e2d6;
  --line-2: #d6d0c0;
  --brand: #1c5c4a;
  --brand-soft: #e7f0ec;
  --gold: #b0812f;
  --gold-soft: #f6efdf;
  --up: #c0392b;
  --down: #1e8449;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 31, 28, .04), 0 6px 18px rgba(29, 31, 28, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 18px 90px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 238, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #f4e6c8;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text small { font-size: 11px; color: var(--ink-3); }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink-2);
  transition: .16s;
}
.nav a:hover { background: #eceade; color: var(--ink); }
.nav a.on { background: var(--brand); color: #fff; }

.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.uname { font-size: 13px; color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink-2);
}
.btn-ghost:hover { background: #fff; border-color: var(--ink-3); filter: none; }
.btn-gold { background: var(--gold); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}
.card-hd h3 { font-size: 15px; white-space: nowrap; }
.card-hd .hint { font-size: 12px; color: var(--ink-3); }
.card-bd { padding: 16px 18px; }
.card-bd.tight { padding: 8px 18px 16px; overflow-x: auto; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.hero-main {
  background: linear-gradient(140deg, #1c5c4a 0%, #17493c 100%);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  color: #f2efe4;
  position: relative;
  overflow: hidden;
}
.hero-main::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(244, 230, 200, .16);
  box-shadow: 0 0 0 40px rgba(244, 230, 200, .05);
}
.hero-kicker {
  font-size: 12px;
  letter-spacing: .12em;
  color: #d9cba6;
  margin-bottom: 10px;
}
.hero-main h1 { font-size: 25px; line-height: 1.35; margin-bottom: 10px; }
.hero-sub { font-size: 13px; color: #cdd8d1; }
.hero-side { display: grid; gap: 12px; }
.hero-mini {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.hero-mini .k { font-size: 12px; color: var(--ink-3); }
.hero-mini .v { font-size: 24px; font-weight: 600; margin-top: 2px; }
.hero-mini .v small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }

/* ---------- chips / tabs ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  transition: .16s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.7;
  background: #efede4;
  color: var(--ink-2);
  white-space: nowrap;
}
.badge-new { background: #fdeceb; color: var(--up); }
.badge-grow { background: var(--gold-soft); color: var(--gold); }
.badge-stable { background: var(--brand-soft); color: var(--brand); }
.badge-decline { background: #eef1f0; color: #6c7570; }
.badge-unknown { background: #f1efea; color: var(--ink-3); }

/* ---------- stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--ink-3); }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 3px; letter-spacing: -.02em; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid #f1eee5;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: #faf8f2; }
.table .r { text-align: right; }
.table .name { font-weight: 500; }
.table .sub { font-size: 12px; color: var(--ink-3); }

/* ---------- 价格三档（最低 ~ 最高 / 均价） ---------- */
.th-sub { display: block; font-size: 10px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.price-cell { line-height: 1.35; }
.px-main { font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.px-lo { color: var(--down); }
.px-hi { color: var(--up); }
.px-sep { color: var(--ink-3); font-weight: 400; margin: 0 2px; font-size: 12px; }
.px-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; }
.px-demo {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  background: #f1ede2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* 走势弹窗的统计格：桌面 4 列，窄屏 2 列（4 列在 390px 下会把第 4 格挤出去） */
#m-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) {
  #m-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 当日摊位明细（走势弹窗内展开） ---------- */
.stat-link { cursor: pointer; transition: border-color .15s, background .15s; }
.stat-link:hover { border-color: var(--brand); background: var(--brand-soft); }
.stat-link.is-off { cursor: default; }
.stat-link.is-off:hover { border-color: var(--line); background: var(--card); }
.k-more { font-size: 13px; color: var(--brand); margin-left: 3px; font-weight: 400; }
.stat-link.is-off .k-more { display: none; }

.stall-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf6;
}
.stall-head {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.stall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stall-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.stall-card-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.stall-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stall-card-price { font-size: 14px; font-weight: 600; color: var(--brand); flex: 0 0 auto; }
.stall-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  margin: 9px 0 0;
  font-size: 12px;
}
.stall-kv dt { color: var(--ink-3); }
.stall-kv dd { margin: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stall-card-ft {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stall-empty {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  padding: 14px 0;
}
@media (max-width: 640px) {
  .stall-grid { grid-template-columns: 1fr; }
}

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--ink-3); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: .16s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(28, 92, 74, .1);
}
.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.form-row.two { grid-template-columns: 1fr 1fr; }

/* ---------- task picker ---------- */
.task-list { display: flex; flex-direction: column; max-width: 720px; }
.task-row {
  display: grid;
  grid-template-columns: 26px 1fr 132px;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid #f2efe6;
}
.task-row:last-child { border-bottom: none; }
.task-row .tname { font-size: 14px; }
.task-row .tcat { font-size: 11px; color: var(--ink-3); margin-left: 6px; }
.task-row input[type=number] { padding: 6px 8px; font-size: 13px; text-align: right; }
.task-row .thead { font-size: 11px; color: var(--ink-3); text-align: right; }
.task-row .thead.l { text-align: left; }
.task-row.off { opacity: .45; }

/* 自定义任务：默认一个按钮，点开变输入行 */
.task-add { padding: 12px 4px 0; max-width: 720px; }
.task-add .plus { font-size: 15px; line-height: 1; margin-right: 2px; }
.task-new {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 720px;
  padding: 12px 4px 0;
}
.task-new input[type=text] {
  flex: 1 1 220px;
  /* 全局 input 是 width:100%，在 flex 里会独占一行，得改回 auto */
  width: auto;
  min-width: 0;
  padding: 7px 11px;
  font-size: 13px;
}
/* display:flex 会盖掉 [hidden] 的 display:none，得显式补回来 */
.task-new[hidden] { display: none; }
.task-new select {
  flex: 0 0 auto;
  width: auto;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
}
input[type=checkbox] {
  width: 17px; height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ---------- list ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f2efe6;
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t1 { font-size: 14px; font-weight: 500; }
.list-row .t2 { font-size: 12px; color: var(--ink-3); }

/* ---------- guides ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.guide-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: .18s;
  display: block;
}
.guide-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.guide-card h3 { font-size: 16px; margin-bottom: 8px; line-height: 1.45; }
.guide-card p { font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.guide-meta { display: flex; gap: 10px; font-size: 12px; color: var(--ink-3); margin-top: 12px; }

.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: 26px; line-height: 1.4; margin-bottom: 12px; }
.article-body { font-size: 15px; line-height: 1.85; color: #2b2e2a; }
.article-body h2 { font-size: 19px; margin: 28px 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }
.article-body h3 { font-size: 16px; margin: 22px 0 8px; }
.article-body p { margin: 12px 0; }
.article-body ul, .article-body ol { margin: 12px 0; padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.article-body th { background: #faf8f2; font-weight: 500; }
.article-body code {
  background: #f2efe6;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.article-body pre {
  background: #1f2320;
  color: #e8e5da;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
}
.article-body pre code { background: none; color: inherit; padding: 0; }

/* ---------- charts ---------- */
.chart { width: 100%; display: block; }
.chart-empty {
  height: 120px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 13px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
}

/* ---------- empty ---------- */
.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* ---------- auth ---------- */
.auth-wrap { max-width: 400px; margin: 48px auto; }
.auth-card { padding: 30px 28px; }
.auth-card h2 { font-size: 20px; margin-bottom: 6px; }
.auth-card .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  background: #fdeceb;
  color: var(--up);
}

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(24, 26, 23, .42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}
.modal-mask.on { display: flex; }
.modal {
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}
.modal-hd h3 { font-size: 16px; }
.modal-bd { padding: 16px 20px 20px; }
.modal-close {
  background: none; border: none; font-size: 20px;
  color: var(--ink-3); cursor: pointer; line-height: 1; padding: 4px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 12px);
  background: #1f2320;
  color: #f2efe4;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .22s;
  z-index: 200;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tabbar (mobile) ---------- */
.tabbar { display: none; }

.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  line-height: 1.8;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 12px;
}
.section-title h2 { font-size: 17px; }
.section-title a { font-size: 13px; color: var(--brand); }

/* 标题右侧的操作区：服务器选择器 + 时间区间，横向排开 */
.ledger-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2.wide-left { grid-template-columns: 1.4fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- 服务器选择器 ---------- */
.server-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.server-bar .btn { margin-left: auto; }

.sp { position: relative; }
.sp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.sp-trigger:hover { border-color: var(--brand); }
.sp-trigger[aria-expanded="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.sp-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex: 0 0 auto;
}
.sp-name { font-weight: 500; }
.sp-arrow { color: var(--ink-3); transition: transform .18s; }
.sp-trigger[aria-expanded="true"] .sp-arrow { transform: rotate(180deg); }

.sp-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 70;
  width: min(560px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(29, 31, 28, .17);
  overflow: hidden;
}
/* 底部渐隐：提示列表还能往下滚（60 个未标注服一屏放不下） */
.sp-panel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}
.sp-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sp-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fcfbf7;
}
.sp-search:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.sp-body {
  max-height: min(62vh, 470px);
  overflow-y: auto;
  padding: 11px 12px 18px;
}
.sp-group + .sp-group { margin-top: 15px; }
.sp-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.sp-title span {
  background: var(--bg);
  border-radius: 20px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
}
.sp-item {
  display: block;
  padding: 7px 6px;
  text-align: center;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: .12s;
}
.sp-item:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.sp-item.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}
.sp-empty {
  padding: 26px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- 截图识价 ---------- */
/* hidden 属性会被 display:flex 之类的规则覆盖，这里强制生效 */
[hidden] { display: none !important; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 32px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  background: #fcfbf7;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  text-align: center;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dz-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.dz-sub { font-size: 12px; color: var(--ink-3); }
.dz-note { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  color: var(--ink-2);
}

.uploading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 34px 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.spinner {
  width: 17px; height: 17px;
  flex: 0 0 auto;
  border: 2px solid var(--line-2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: ocr-spin .8s linear infinite;
}
@keyframes ocr-spin { to { transform: rotate(360deg); } }

.shot-layout {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
/* grid 子项默认 min-width:auto，会被表格的固有宽度撑破容器，必须显式归零 */
.shot-layout > * { min-width: 0; }
.shot-card { position: sticky; top: 76px; }
.shot-wrap {
  position: relative;
  line-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0e1420;
}
.shot-wrap img { width: 100%; display: block; cursor: zoom-in; }
.shot-boxes { position: absolute; inset: 0; }
.shot-box {
  position: absolute;
  border: 1px solid rgba(28, 92, 74, .35);
  background: rgba(28, 92, 74, .05);
  border-radius: 3px;
  transition: background .12s, border-color .12s;
}
.shot-box.suspect {
  border-color: rgba(176, 129, 47, .6);
  border-style: dashed;
  background: rgba(176, 129, 47, .08);
}
.shot-box.on {
  /* 价格数字本身就在红色胶囊里，用红色高亮等于没高亮；
     白色 + 外发光在红底和深蓝底上都跳得出来 */
  border: 2px solid #fff;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 0 14px rgba(255, 255, 255, .9);
}
.shot-tip { font-size: 11px; color: var(--ink-3); margin-top: 9px; line-height: 1.6; }

.ocr-table { table-layout: fixed; }
.ocr-table td { vertical-align: top; }
.ocr-row.warn { background: #fffaf0; }
.ocr-row:hover { background: #f4f9f6; }
.ocr-row.warn:hover { background: #fdf4e4; }
.ocr-sel, .ocr-price {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.ocr-price { text-align: right; font-variant-numeric: tabular-nums; }
.ocr-sel:focus, .ocr-price:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ocr-raw {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-all;
}
.ocr-flag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.ocr-flag.ok { background: var(--brand-soft); color: var(--brand); }
.ocr-flag.warn { background: var(--gold-soft); color: var(--gold); }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
}
.shot-item { overflow: hidden; }
.shot-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top;
  display: block;
  background: #ece9e0;
}
.shot-item-bd { padding: 9px 11px 11px; }
.shot-item-bd .t1 { font-size: 12.5px; color: var(--ink); }
.shot-item-bd .t2 { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-2.wide-left, .grid-3 { grid-template-columns: 1fr; }
  .shot-layout { grid-template-columns: minmax(0, 1fr); }
  .shot-card { position: static; }
  /* 窄屏用底部抽屉，避免绝对定位的面板被视口右边缘裁掉 */
  .sp-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 74vh;
  }
  .sp-body { max-height: 56vh; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .wrap { padding-bottom: 96px; }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 60;
  }
  .tabbar a {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--ink-3);
    padding: 6px 0;
  }
  .tabbar a .ico { display: block; font-size: 16px; margin-bottom: 1px; }
  .tabbar a.on { color: var(--brand); font-weight: 500; }
  .table th, .table td { padding: 9px 6px; font-size: 13px; }
  /* 窄屏把三档价压小一档，否则「41.11~77.78」会把表格撑出横向滚动 */
  .px-main { font-size: 12.5px; }
  .px-sep { margin: 0 1px; font-size: 11px; }
  .px-sub { font-size: 10px; }
  .th-sub { font-size: 9px; }
  /* 表格里的次要列在窄屏一律隐藏（之前只对 .task-row 生效过） */
  .col-hide { display: none !important; }
  .task-row { grid-template-columns: 24px 1fr 92px; row-gap: 6px; }
}

@media (max-width: 400px) {
  .hero-main h1 { font-size: 21px; }
  .stat .v { font-size: 19px; }
}

/* ---------- 实时采集 ---------- */
.live-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.live-interval {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.live-interval select {
  font-family: inherit; font-size: 13px; color: var(--ink);
  padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--card);
}
.live-status {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-3);
}
.live-status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2);
}
.live-status.is-ok { color: var(--brand); }
.live-status.is-ok::before { background: var(--down); box-shadow: 0 0 0 3px rgba(30, 132, 73, .16); }
.live-status.is-warn::before { background: var(--gold); }
.live-status.is-bad { color: var(--up); }
.live-status.is-bad::before { background: var(--up); }

.live-tip { margin-top: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.live-tip b { color: var(--ink); }

.live-grid {
  display: grid; grid-template-columns: 1.12fr .88fr;
  gap: 14px; margin-bottom: 14px;
}
.live-stage {
  position: relative; aspect-ratio: 16 / 10; background: #14160f;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 0 0 var(--radius) var(--radius);
}
.live-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.live-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #6f7468; font-size: 13px; letter-spacing: .04em;
}

.live-empty { padding: 28px 18px; text-align: center; color: var(--ink-3); font-size: 13px; }
.live-owner {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.live-items { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.live-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--line);
}
.live-item b { color: var(--up); font-variant-numeric: tabular-nums; }
.live-item i { font-style: normal; font-size: 11px; padding: 1px 5px; border-radius: 5px; }
.live-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.live-note.is-warn { color: var(--up); }

.live-log, .stall-list { max-height: 330px; overflow-y: auto; }
.log-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.log-text { color: var(--ink-2); }

.stall-row { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.stall-row:last-child { border-bottom: none; }
.stall-row:hover { background: var(--bg); }
.stall-main { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.stall-meta { display: flex; gap: 12px; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.stall-area {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  line-height: 17px;
  align-self: center;
}

@media (max-width: 760px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-controls { gap: 8px; }
  .live-status { margin-left: 0; }
  .live-stage { aspect-ratio: 4 / 3; }
}

.live-tip.is-warn {
  margin-top: 8px; padding: 8px 12px; border-radius: 9px;
  background: var(--gold-soft); color: #7a5a1c; font-size: 12.5px;
}
.live-tip.is-warn code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; background: rgba(255, 255, 255, .6);
  padding: 1px 5px; border-radius: 4px;
}

/* ---------- 记账中心：金价行情 ---------- */
.gold-hd-right { display: flex; align-items: center; gap: 10px; }
.gold-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.gold-main { display: flex; align-items: baseline; gap: 6px; }
.gold-main .num {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}
.gold-main small { font-size: 13px; color: var(--ink-3); }
.gold-sub { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.gold-sub b { color: var(--brand); font-variant-numeric: tabular-nums; }
.gold-meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px 22px;
  font-size: 12px;
}
.gold-meta > div { display: flex; flex-direction: column; gap: 2px; }
.gold-meta span { color: var(--ink-3); }
.gold-meta b { font-size: 13px; color: var(--ink); font-weight: 600; }

/* 服务器名做成紧跟标题的标签：金价是按服走的，不标清楚等于没说 */
.gold-srv {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft, #e8f1ec);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  vertical-align: 2px;
}
.gold-note {
  margin-top: 8px;
  font-size: 12px;
  color: #7a5a1c;
  background: var(--gold-soft);
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-block;
}
.gold-peers {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.gold-peers b { color: var(--ink); font-weight: 600; }
.gold-peers .sep { color: var(--ink-3); }
@media (max-width: 760px) {
  .gold-main .num { font-size: 24px; }
  .gold-meta { grid-template-columns: repeat(2, auto); gap: 8px 18px; }
  /* 标题带服务器标签后一行放不下，右侧口径说明在窄屏没信息量，让位 */
  .gold-hd-right .hint { display: none; }
  .card-hd { gap: 8px; }
  .card-hd .hint { font-size: 11px; }

  /* 记账中心头部：标题独占一行，选择器和区间换到下面 */
  .section-title.ledger-head { flex-wrap: wrap; gap: 10px; }
  .section-title.ledger-head h2 { white-space: nowrap; }
  .ledger-head-right { width: 100%; justify-content: flex-start; }
}
