/* 拾守 · 管理后台样式（桌面优先，移动可用） */
:root {
  --gold: #D4AF37; --gold-d: #B8912A; --gold-l: #FAF3DF;
  --ink: #1A1A1A; --ink2: #57534A; --ink3: #8E887B;
  --line: #EAE4D4; --bg: #F7F5EF; --card: #fff;
  --red: #C0392B; --amber: #B4602F; --green: #3E7D5A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; }

/* 登录 */
#login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50;
  background: radial-gradient(900px 520px at 20% 10%, #FFF8E2, #F2EEDF 60%, #EDE9DC); }
.loginbox { width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 28px; box-shadow: 0 20px 60px rgba(60, 48, 20, .12); }
.mk { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(150deg, #E3C55C, #C29E2C);
  display: grid; place-items: center; font-weight: 800; color: #221C08; margin-bottom: 14px; }
.loginbox h1 { font-size: 20px; }
.loginbox .sub { color: var(--ink3); font-size: 12.5px; margin: 3px 0 20px; }
.fld { margin-bottom: 13px; }
.fld label { display: block; font-size: 12px; color: var(--ink3); margin-bottom: 6px; }
.fld input { width: 100%; height: 43px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 14px; font-family: inherit; background: #FDFCF8; outline: none; }
.fld input:focus { border-color: var(--gold); }
.btn { height: 42px; border-radius: 10px; border: 0; padding: 0 18px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  background: linear-gradient(150deg, #E0C25A, #C9A233); color: #241D06; }
.btn:active { transform: translateY(1px); }
.btn.w { width: 100%; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.sm { height: 30px; font-size: 12px; padding: 0 11px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 布局 */
.app { display: none; min-height: 100vh; }
.app.on { display: flex; }
.side { width: 216px; flex: none; background: #FFFDF8; border-right: 1px solid var(--line);
  padding: 18px 13px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px;
  letter-spacing: .05em; padding: 0 8px 16px; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(150deg, #E3C55C, #C29E2C);
  display: grid; place-items: center; font-style: normal; font-size: 13px; color: #221C08; font-weight: 800; }
.navgrp { font-size: 10.5px; color: #B0A894; letter-spacing: .12em; padding: 13px 8px 5px; }
.nav { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px;
  font-size: 13.5px; color: var(--ink2); cursor: pointer; margin-bottom: 2px; }
.nav:hover { background: #F7F3E6; }
.nav.on { background: var(--gold-l); color: #6B5310; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top h2 { font-size: 15px; }
.top .who { margin-left: auto; font-size: 12.5px; color: var(--ink3); display: flex; gap: 10px; align-items: center; }
.wrap { padding: 20px 24px 60px; max-width: 1120px; }

/* 卡片与表 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 13px 15px; }
.kpi b { display: block; font-size: 23px; font-weight: 700; }
.kpi span { font-size: 12px; color: var(--ink3); }
.kpi .hint { font-size: 11.5px; color: var(--amber); margin-top: 3px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  padding: 16px; margin-bottom: 14px; }
.card h3 { font-size: 13.5px; color: var(--ink2); margin-bottom: 10px; letter-spacing: .05em; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--ink3); font-weight: 600; font-size: 12px;
  padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px; border-bottom: 1px solid #F3EFE3; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #F6F2E6; color: var(--ink2); border: 1px solid var(--line); }
.tag.red { background: #FBEDEB; color: var(--red); border-color: #EFD2CE; }
.tag.amber { background: #FBF1E8; color: var(--amber); border-color: #EFDCC7; }
.tag.green { background: #EFF6F0; color: var(--green); border-color: #D3E4D6; }
.tag.gold { background: var(--gold-l); color: #6B5310; border-color: #E8D8A8; }

input[type=text], input[type=password], input[type=number], textarea, select {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font-size: 13.5px;
  font-family: inherit; background: #FDFCF8; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { width: 100%; min-height: 86px; resize: vertical; }
.row2 { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #DDD6C4;
  border: 0; cursor: pointer; transition: .18s; flex: none; }
.switch.on { background: linear-gradient(150deg, #E0C25A, #C9A233); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 999px; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.switch.on::after { left: 20px; }
.switch[disabled] { opacity: .55; cursor: not-allowed; }
.note { font-size: 12px; color: var(--ink3); line-height: 1.75; background: #FBF9F2;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note.warn { background: #FDF6EF; border-color: #F0DFC9; color: #8A5B2C; }
.note.bad { background: #FBEDEB; border-color: #EFD2CE; color: var(--red); }
.verdict { font-size: 15px; font-weight: 700; padding: 10px 14px; border-radius: 10px; }
.verdict.ok { background: #EFF6F0; color: var(--green); }
.verdict.no { background: #FBEDEB; color: var(--red); }
.empty { text-align: center; color: var(--ink3); padding: 22px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(8px);
  background: rgba(26,26,26,.93); color: #fff; font-size: 13px; padding: 10px 16px;
  border-radius: 11px; opacity: 0; pointer-events: none; transition: .2s; z-index: 99; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.modal-mask { position: fixed; inset: 0; background: rgba(30,26,16,.38); display: none;
  place-items: center; z-index: 60; }
.modal-mask.on { display: grid; }
.modal { width: min(560px, 92vw); max-height: 84vh; overflow-y: auto; background: #fff;
  border-radius: 18px; padding: 20px; }
.modal h3 { font-size: 16px; margin-bottom: 12px; }
@media (max-width: 760px) {
  .side { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .app.on { display: block; }
  .navgrp { display: none; }
  .nav { display: inline-flex; margin: 0 6px 6px 0; }
}
