/* 经营罗盘 · shared look (v0.42). Design tokens after Open Props (spacing / type / radius / shadow scales) and the
   AdminLTE layout idea (fixed side menu, sticky filter bar, cards); written here, no outside files. */
:root {
  /* colour */
  --bg: #f3f5f9; --panel: #ffffff; --panel-2: #f8fafc; --ink: #18212d; --muted: #667388; --line: #e2e7ef; --line-2: #eef1f6;
  --brand: #1f5fbf; --brand-ink: #ffffff; --brand-soft: #e8f0fc;
  --good: #188756; --good-soft: #e5f5ed; --warn: #b7790b; --warn-soft: #fdf3dc; --bad: #c8392f; --bad-soft: #fbe9e7;
  --chip: #eef2f8;
  /* scales */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px;
  --fs-0: 12px; --fs-1: 13px; --fs-2: 14px; --fs-3: 16px; --fs-4: 20px; --fs-5: 24px;
  --r1: 6px; --r2: 10px; --r3: 14px; --radius: var(--r3);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-2: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .05);
  --nav-w: 208px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --panel: #171d26; --panel-2: #1c2330; --ink: #e6ebf2; --muted: #95a2b5; --line: #29323f; --line-2: #222a36;
    --brand: #6ea2ff; --brand-ink: #0d1420; --brand-soft: #1d2a42;
    --good: #4cc38a; --good-soft: #15281f; --warn: #e6b14a; --warn-soft: #2a2414; --bad: #ff7a6e; --bad-soft: #2d1a19;
    --chip: #222b37; --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 6px 18px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: var(--fs-2)/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h3 { font-size: var(--fs-3); margin: 0 0 var(--s3); }
h4 { font-size: var(--fs-2); margin: var(--s5) 0 var(--s2); color: var(--muted); }

/* ---- side menu (bottom bar on phones) ---- */
.jy-nav { position: fixed; inset: 0 auto 0 0; width: var(--nav-w); background: var(--panel); border-right: 1px solid var(--line);
  padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: 2px; z-index: 10; }
.jy-brand { font-weight: 700; font-size: 18px; padding: var(--s1) var(--s3) var(--s4); letter-spacing: .5px; }
.jy-brand small { display: block; font-weight: 400; font-size: var(--fs-0); color: var(--muted); letter-spacing: 0; }
.jy-link, .jy-entry { padding: 9px var(--s3); border-radius: var(--r2); color: var(--ink); display: flex; gap: var(--s3); align-items: center;
  transition: background .15s; }
.jy-link span, .jy-entry span, .jy-logout span { width: 18px; text-align: center; opacity: .8; }
.jy-link:hover, .jy-entry:hover { background: var(--panel-2); text-decoration: none; }
.jy-link.active, .jy-entry.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.jy-foot { margin-top: auto; display: flex; gap: var(--s1); align-items: center; border-top: 1px solid var(--line-2); padding-top: var(--s3); }
.jy-foot .jy-entry { flex: 1; }
.jy-logout { display: inline-flex; align-items: center; gap: var(--s1); padding: 8px 10px; color: var(--muted); border-color: transparent; }
.jy-logout em { font-style: normal; font-size: var(--fs-1); }
.jy-foot .jy-logout em { display: none; }       /* icon next to 手动录入; the full words show as a tooltip */
.jy-logout:hover { color: var(--bad); background: var(--bad-soft); }

.jy-main { margin-left: var(--nav-w); padding: 0 var(--s6) 48px; max-width: 1280px; }
.jy-bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  padding: var(--s4) 0 var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center;
  border-bottom: 1px solid var(--line-2); margin-bottom: var(--s4); }
.jy-bar h1 { font-size: var(--fs-4); margin: 0 auto 0 0; letter-spacing: .3px; }

/* ---- controls ---- */
select, input, textarea, button { font: inherit; font-size: var(--fs-2); color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r1); padding: 7px 10px; transition: border-color .15s, box-shadow .15s; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea { width: 100%; min-height: 180px; resize: vertical; }
button { cursor: pointer; }
button:hover { background: var(--panel-2); }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--panel-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
.filter { display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.filter > span:first-child { color: var(--muted); font-size: var(--fs-1); white-space: nowrap; }
.filter input[hidden], .filter span[hidden] { display: none; }
a.btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--r1); color: var(--ink);
  background: var(--panel); white-space: nowrap; }
a.btn:hover { background: var(--panel-2); text-decoration: none; }
a.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ---- cards and figures ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5);
  box-shadow: var(--shadow); margin-bottom: var(--s4); }
.card > h3:first-child { margin-top: 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--line-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4);
  box-shadow: var(--shadow); overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line); }
.kpi.good::before { background: var(--good); } .kpi.warn::before { background: var(--warn); } .kpi.bad::before { background: var(--bad); }
.kpi .label { color: var(--muted); font-size: var(--fs-1); }
.kpi .value { font-size: var(--fs-5); font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; letter-spacing: .3px; }
.kpi.good .value { color: var(--good); } .kpi.bad .value { color: var(--bad); }
.kpi .sub { color: var(--muted); font-size: var(--fs-0); }
.view-tools { display: flex; justify-content: flex-end; gap: var(--s2); margin: calc(-1 * var(--s2)) 0 var(--s3); }

/* ---- tables ---- */
.table-wrap { overflow: auto; border-radius: var(--r1); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: var(--fs-1); background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
th:not(:first-child) { text-align: center; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 2; }
th:first-child { background: var(--panel-2); z-index: 3; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--brand) 4%, var(--panel)); }
tr.total td { font-weight: 700; background: var(--panel-2); }
table.grid td { text-align: left; }
table.grid td:first-child { font-weight: 600; }
.center, table.grid td.center { text-align: center; }

/* ---- text and states ---- */
.neg { color: var(--bad); }
.muted { color: var(--muted); }
.note { font-size: var(--fs-1); color: var(--muted); }
.err { color: var(--bad); }
.ok { color: var(--good); }
.empty { text-align: center; color: var(--muted); padding: var(--s7); }
.problems { border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn-soft) 60%, var(--panel)); }
.problems li { margin: 3px 0; }
.tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: var(--r1); font-size: 11px; background: var(--warn-soft); color: var(--warn); }
.city-head { margin: var(--s5) 0 var(--s2); padding-left: var(--s2); border-left: 4px solid var(--brand); font-size: var(--fs-3); }
.eye { cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--chip); font-size: var(--fs-1); }
.masked { letter-spacing: 2px; color: var(--muted); }
details.fixed { margin-top: 10px; }
details.fixed summary { cursor: pointer; color: var(--brand); }

/* ---- entry cells ---- */
input.cell { width: 110px; padding: 5px 7px; text-align: right; }
input.cell.wide { width: 230px; text-align: left; }
input.cell.missing { border: 2px solid var(--bad); background: var(--bad-soft); }
input.cell.estimate { border: 2px dashed var(--warn); }
input.cell.saved { border: 2px solid var(--good); }
input.cell.failed { border: 2px solid var(--bad); }
.savebar { position: sticky; bottom: 0; display: flex; gap: var(--s3); align-items: center; justify-content: flex-end; padding: 10px 0;
  background: var(--bg); border-top: 1px solid var(--line); }
.savebar[hidden] { display: none; }
.upload-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

/* ---- dialogs ---- */
.jy-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink);
  max-width: min(960px, 96vw); padding: var(--s5) var(--s6); box-shadow: var(--shadow-2); }
.jy-dialog::backdrop { background: rgba(10, 16, 26, .45); backdrop-filter: blur(2px); }
.jy-dialog h3 { margin-top: 0; }

/* ---- phones ---- */
@media (max-width: 760px) {
  .jy-nav { inset: auto 0 0 0; width: auto; height: 62px; flex-direction: row; justify-content: space-around; align-items: stretch;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .jy-brand { display: none; }
  .jy-link, .jy-entry { flex-direction: column; gap: 0; font-size: 11px; padding: 4px 2px; justify-content: center; flex: 1; white-space: nowrap; min-width: 0; }
  .jy-foot { margin: 0; border: 0; padding: 0; flex: 2; gap: 0; }
  .jy-logout { flex-direction: column; gap: 0; padding: 4px 6px; font-size: 11px; }
  .jy-foot .jy-logout em { display: block; font-size: 11px; }
  .jy-main { margin-left: 0; padding: 0 var(--s4) 88px; }
  .jy-bar h1 { width: 100%; font-size: 18px; }
  .card { padding: var(--s3) var(--s4); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .kpi { padding: var(--s3); }
  .kpi .value { font-size: var(--fs-4); }
  .savebar { bottom: 62px; }
  .jy-dialog { padding: var(--s4); }
}
