:root {
  --navy: #1B365D;
  --navy-2: #25467A;
  --ink: #1C2430;
  --muted: #5B6570;
  --line: #D5DBE3;
  --cream: #FFF6E8;
  --pale: #F3F6FA;
  --best: #0F6B3C;
  --best-bg: #E7F6EE;
  --up: #0F6B3C;
  --down: #9B1C1C;
  --card: #fff;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: #EEF1F6;
  color: var(--ink);
  font-family: "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
body { min-height: 100dvh; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px 10px;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.top h1 { font-size: 20px; font-weight: 700; }
.top-right { text-align: right; font-size: 12px; }
#updated { opacity: .95; }
.logout { color: #fff; opacity: .85; margin-top: 4px; display: inline-block; }
.filters {
  padding: 10px 16px 6px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 64px;
  z-index: 15;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
#q {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  margin-bottom: 6px;
}
.status { padding: 8px 16px; font-size: 13px; color: var(--muted); }
.status.warn { color: #8A5A00; background: var(--cream); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 0 24px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: right; vertical-align: middle; }
th {
  background: #243E68;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  position: sticky;
  top: 126px;
  z-index: 5;
}
.th-sub { font-weight: 400; opacity: .85; font-size: 10px; }
th.sticky, td.sticky {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 4;
  min-width: 138px;
}
th.sticky { background: #243E68; z-index: 6; }
td.sticky { font-weight: 700; color: var(--navy); }
.model { display: block; font-size: 13px; }
.storage { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--pale); }
tbody tr:hover td.sticky { background: var(--pale); }
tbody tr.on td, tbody tr.on td.sticky { background: var(--cream); }
.price { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; font-weight: 650; }
.dash { color: #9AA3AD; font-weight: 400; }
.sub { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.chg { font-size: 11px; font-weight: 700; margin-left: 2px; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.hi { background: var(--best-bg) !important; color: var(--best); border-radius: 8px; padding: 4px 6px; }
.tag { display: inline-block; font-size: 9px; background: #EEF1F8; color: #31405F; border-radius: 4px; padding: 1px 4px; margin-left: 3px; }
.detail {
  margin: 0 12px 16px;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 14px 16px;
  box-shadow: 0 4px 16px rgba(27,54,93,.08);
}
.detail.hidden { display: none; }
.detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.detail-head h2 { font-size: 16px; color: var(--navy); }
.detail-note { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
#detail-close {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
}
.foot { padding: 8px 16px 28px; font-size: 12px; color: var(--muted); }
.foot p { margin-bottom: 6px; }
/* login */
.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #1B365D, #2A4A7A);
  padding: 20px;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.login-brand { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.login-card h1 { font-size: 24px; color: var(--navy); margin: 4px 0 8px; }
.login-card .hint { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; margin: 10px 0; color: var(--navy); font-weight: 600; }
.login-card input {
  display: block; width: 100%; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit;
}
.login-card button {
  width: 100%; margin-top: 14px; background: var(--navy); color: #fff;
  border: 0; border-radius: 10px; padding: 12px; font: inherit; font-weight: 700;
}
.err { background: #FDECEC; color: #9B1C1C; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
@media (max-width: 640px) {
  th { top: 132px; font-size: 11px; }
  .top h1 { font-size: 18px; }
  table { min-width: 680px; }
}
