/* Wadason — one stylesheet, system fonts only (nothing fetched from outside China-reachable origin). */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #16202c; --muted: #66748a; --line: #e2e7ee;
  --accent: #1f6feb; --accent-ink: #ffffff; --ok: #1a8f4e; --warn: #c7791a; --bad: #c92a2a;
  --chip: #eef2f7; --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --panel: #171e27; --ink: #e6ecf3; --muted: #8b99ab; --line: #263040;
    --accent: #4c8dff; --chip: #212b38; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 380px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand h1 { font-size: 18px; margin: 0; }
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.btn { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.msg { margin-top: 10px; font-size: 13px; min-height: 18px; }
.msg.bad { color: var(--bad); } .msg.ok { color: var(--ok); }
.lang-toggle { position: fixed; top: 12px; right: 14px; }

/* App shell */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .brand { margin: 0; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 8px; }
.top nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.top nav a.on { background: var(--chip); color: var(--ink); }
.top .spacer { flex: 1; }
.top .who { color: var(--muted); font-size: 13px; }
main { padding: 18px 16px 48px; max-width: 1180px; margin: 0 auto; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }

.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); }
.banner.bad { border-color: var(--bad); color: var(--bad); }
.banner.ok { border-color: var(--ok); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tile .l { font-size: 12px; color: var(--muted); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row input[type=search], .row input[type=text] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 220px; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--accent); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--chip); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.dim { color: var(--muted); }
.wrap-table { overflow-x: auto; border-radius: var(--radius); }
.name { display: flex; align-items: center; gap: 8px; }
.ico { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: #8a93a2; flex: none; }
.ico.folder { background: #e9a53b; } .ico.pdf { background: #d64545; } .ico.xlsx, .ico.xls, .ico.xlsm, .ico.csv { background: #1f8a4c; } .ico.docx, .ico.doc { background: #2b6cd4; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; color: var(--muted); }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } .top nav a { padding: 6px 8px; } }
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: 18px; max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.pw-reveal { padding: 10px; background: var(--chip); border-radius: 8px; margin: 10px 0; }
