/* 百花里物业 · 管理后台 */
:root {
  --g900: #082f26;
  --g800: #0b3b2e;
  --g700: #0f5b4a;
  --g600: #16735d;
  --mint: #e8f1ea;
  --mint-2: #f1f7f2;
  --cream: #f7f6f0;
  --bg: #f3f5f0;
  --paper: #ffffff;
  --ink: #16352d;
  --muted: #71837b;
  --soft: #93a39c;
  --line: #e5e9e2;
  --accent: #dd7f36;
  --accent-soft: #fbeee2;
  --red: #b8443a;
  --red-soft: #fbecea;
  --blue: #326fa8;
  --blue-soft: #eaf2fb;
  --shadow: 0 16px 40px rgba(12, 59, 46, 0.06);
  --shadow-lg: 0 30px 80px rgba(9, 54, 43, 0.18);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 13px; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 13px; }
button { cursor: pointer; }
a { color: inherit; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; }
[hidden] { display: none !important; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px;
  background:
    radial-gradient(1000px 540px at 90% -10%, rgba(221,127,54,.14), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(15,91,74,.12), transparent 60%),
    var(--cream);
}
.login-card {
  width: min(1040px, 100%); min-height: 620px; display: grid; grid-template-columns: 1.08fr .92fr;
  background: var(--paper); border-radius: 28px; overflow: hidden; box-shadow: 0 40px 100px rgba(9,54,43,.16);
  border: 1px solid rgba(255,255,255,.8);
}
.login-art {
  position: relative; overflow: hidden; padding: 46px 48px; color: #f4f1e7;
  background:
    radial-gradient(420px 300px at 105% 0%, rgba(221,127,54,.3), transparent 65%),
    linear-gradient(155deg, #0e5a49 0%, #082f26 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art::before {
  content: ""; position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px;
  border: 1px solid rgba(244,241,231,.12); border-radius: 50%;
}
.login-art::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 240px; height: 240px;
  border: 1px solid rgba(244,241,231,.1); border-radius: 50%;
}
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  font-family: "Songti SC", "STSong", serif; font-size: 25px; color: #f7f3e8;
}
.login-brand h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .04em; }
.login-brand p { font-size: 9px; margin: 3px 0 0; letter-spacing: .24em; color: rgba(244,241,231,.5); }
.login-copy { position: relative; z-index: 1; margin: 40px 0; }
.login-copy .eyebrow { font-size: 10px; letter-spacing: .26em; color: #e6a874; font-weight: 700; }
.login-copy h2 { font-size: 42px; line-height: 1.22; margin: 18px 0 18px; letter-spacing: -.03em; font-weight: 600; }
.login-copy p { font-size: 12px; line-height: 1.9; color: rgba(244,241,231,.6); max-width: 330px; margin: 0; }
.login-art-foot { position: relative; z-index: 1; display: flex; gap: 34px; }
.login-art-foot div { font-size: 10px; color: rgba(244,241,231,.45); }
.login-art-foot strong { display: block; margin-top: 4px; color: #f4f1e7; font-size: 13px; font-weight: 500; }
.login-form-wrap { padding: 54px 52px; display: flex; flex-direction: column; justify-content: center; }
.login-form-wrap h3 { font-size: 25px; margin: 0 0 8px; letter-spacing: -.02em; }
.login-form-wrap > p { margin: 0 0 30px; color: var(--muted); font-size: 12px; }
.login-form .field { margin-bottom: 16px; }
.login-form .label { font-size: 11px; font-weight: 600; color: #41574e; margin-bottom: 7px; display: block; }
.login-form .input { height: 46px; }
.login-error { display: none; background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 11px; margin-bottom: 14px; line-height: 1.55; }
.login-error.show { display: block; }
.login-hint { margin-top: 20px; font-size: 10px; color: var(--soft); line-height: 1.8; }
.login-hint b { color: var(--g700); font-weight: 600; }
.login-copyright { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font-size: 10px; color: #9caaa4; letter-spacing: .04em; }

/* ---------------- 布局 ---------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 246px; z-index: 30;
  background:
    radial-gradient(360px 240px at 20% 0%, rgba(255,255,255,.05), transparent 70%),
    linear-gradient(180deg, #0c4437 0%, #082f26 100%);
  color: #dce7e0; display: flex; flex-direction: column; padding: 22px 14px 16px;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 22px; }
.side-mark {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center;
  font-family: "Songti SC", "STSong", serif; font-size: 21px; color: #f7f3e8;
}
.side-brand h1 { font-size: 14px; margin: 0; color: #f1f5f2; letter-spacing: .03em; font-weight: 600; }
.side-brand p { margin: 3px 0 0; font-size: 9px; letter-spacing: .06em; color: rgba(220,231,224,.48); }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 0; }
.side-label { font-size: 9px; letter-spacing: .18em; color: rgba(220,231,224,.32); padding: 14px 12px 7px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: rgba(220,231,224,.72); font-size: 12.5px; text-decoration: none; margin-bottom: 2px;
  transition: background .15s, color .15s; position: relative;
}
.nav-item .ic { width: 17px; height: 17px; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #e6a874; }
.nav-badge { margin-left: auto; background: #dd7f36; color: #fff; font-size: 9px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; font-weight: 700; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 10px 2px; display: flex; align-items: center; gap: 9px; }
.side-avatar { width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; font-size: 11px; color: #f4f1e7; font-weight: 600; flex: 0 0 auto; }
.side-user { min-width: 0; flex: 1; }
.side-user b { display: block; font-size: 11px; color: #eef4ef; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user span { display: block; font-size: 9px; color: rgba(220,231,224,.42); margin-top: 2px; }
.side-logout { border: 0; background: transparent; color: rgba(220,231,224,.5); padding: 5px; border-radius: 6px; }
.side-logout:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { margin-left: 246px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 34px; background: rgba(243,245,240,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229,233,226,.8); position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--soft); }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb span.sep { color: #c4cec7; }
.top-right { display: flex; align-items: center; gap: 16px; }
.top-date { font-size: 11px; color: var(--muted); }
.top-date b { color: var(--ink); font-weight: 600; margin-left: 5px; }
.top-user { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.top-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--g700); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 600; }
.top-user span { font-size: 11px; font-weight: 600; }
.menu-toggle { display: none; }
.page { padding: 26px 34px 50px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.03em; font-weight: 700; }
.page-head p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-eyebrow { font-size: 9px; letter-spacing: .2em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  height: 36px; padding: 0 14px; border-radius: 9px; font-size: 12px; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.btn .ic { width: 15px; height: 15px; }
.btn:hover { border-color: #c9d5cd; background: #fbfcf9; }
.btn.primary { background: var(--g700); border-color: var(--g700); color: #fff; box-shadow: 0 6px 14px rgba(15,91,74,.16); }
.btn.primary:hover { background: #0d5343; border-color: #0d5343; }
.btn.warm { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-ghost { color: var(--red); border-color: #efd3cf; background: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { height: 29px; padding: 0 10px; font-size: 11px; border-radius: 7px; }
.btn.icon { width: 34px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { border: 0; background: transparent; color: var(--g700); font-size: 11px; font-weight: 600; padding: 4px 2px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------------- 卡片 ---------------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 18px rgba(12,59,46,.03); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid #eef1ec; }
.panel-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.panel-title small { font-size: 10px; color: var(--soft); font-weight: 400; margin-left: 3px; }
.panel-body { padding: 19px; }
.panel-body.flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 15px 13px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 66px; height: 66px; border-radius: 50%; background: var(--mint-2); opacity: .7; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.kpi-label { font-size: 10.5px; color: var(--muted); }
.kpi-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: var(--mint); color: var(--g700); }
.kpi-icon .ic { width: 14px; height: 14px; }
.kpi-icon.warm { background: var(--accent-soft); color: #b96824; }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin: 9px 0 2px; font-variant-numeric: tabular-nums; line-height: 1; position: relative; z-index: 1; }
.kpi-value small { font-size: 11px; font-weight: 500; color: var(--soft); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { font-size: 9.5px; color: var(--soft); position: relative; z-index: 1; }
.kpi-foot b { color: var(--g700); font-weight: 600; }

/* ---------------- 图表 ---------------- */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted); }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.chart-wrap { padding: 8px 10px 2px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-axis { font-size: 9px; fill: #9aa9a2; }
.chart-grid-line { stroke: #eef1ec; stroke-width: 1; }
.chart-bar { transition: opacity .15s; }
.chart-bar:hover { opacity: .72; }

/* ---------------- 列表 ---------------- */
.order-list { display: flex; flex-direction: column; }
.order-row { display: flex; align-items: center; gap: 12px; padding: 13px 19px; border-bottom: 1px solid #f0f2ed; }
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: #fbfcf9; }
.order-main { flex: 1; min-width: 0; }
.order-title { font-size: 12px; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.order-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-time { font-size: 9.5px; color: var(--soft); flex: 0 0 auto; text-align: right; }
.urgency { font-size: 8.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--red-soft); color: var(--red); }
.urgency.normal { background: #f0f3ee; color: #7d8d85; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 12px 19px; border-bottom: 1px solid #f2f4ef; }
.feed-item:last-child { border-bottom: 0; }
.feed-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--mint); color: var(--g700); flex: 0 0 auto; }
.feed-icon .ic { width: 14px; height: 14px; }
.feed-icon.warn { background: var(--accent-soft); color: #b96824; }
.feed-main { flex: 1; min-width: 0; }
.feed-main b { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 3px; }
.feed-main span { display: block; font-size: 10px; color: var(--muted); line-height: 1.5; }
.feed-time { font-size: 9px; color: var(--soft); flex: 0 0 auto; }
.empty { padding: 40px 20px; text-align: center; color: var(--soft); font-size: 11px; }
.empty .ic { width: 28px; height: 28px; color: #c8d3cc; margin-bottom: 8px; }

/* ---------------- 工具栏 ---------------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; background: #eaeee8; border-radius: 9px; padding: 3px; }
.tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 11px; color: var(--muted); font-weight: 500; }
.tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(12,59,46,.08); }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #a4b2ab; }
.search-box input { height: 34px; padding: 0 12px 0 31px; width: 210px; }
.input, .select, .textarea {
  border: 1px solid #dfe6de; background: #fff; border-radius: 9px; padding: 8px 11px; outline: none;
  color: var(--ink); transition: border-color .15s, box-shadow .15s; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: #8cb5a2; box-shadow: 0 0 0 3px rgba(15,91,74,.08); }
.input::placeholder, .textarea::placeholder { color: #aab7b1; }
.input.date { width: 136px; height: 34px; color: var(--muted); }
.select { height: 34px; padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2371837b' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.select.wide { width: 180px; }
.textarea { min-height: 92px; resize: vertical; line-height: 1.7; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.data th { text-align: left; font-size: 9.5px; letter-spacing: .06em; color: var(--soft); font-weight: 600; padding: 10px 13px; border-bottom: 1px solid #edf1eb; background: #fbfcf9; white-space: nowrap; }
table.data td { padding: 12px 13px; border-bottom: 1px solid #f1f3ee; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcf9; }
table.data td.strong { font-weight: 600; }
table.data td.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: -.01em; color: #4f655c; }
.cell-main { font-weight: 600; font-size: 11.5px; }
.cell-sub { font-size: 9.5px; color: var(--soft); margin-top: 3px; }
.row-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.pending { background: #fff2e2; color: #a8621e; }
.badge.accepted { background: var(--blue-soft); color: var(--blue); }
.badge.done { background: #e4f2e9; color: #217a55; }
.badge.cancelled { background: #f1f0ee; color: #7c7f7b; }
.badge.role-admin { background: #fdf0e4; color: #a8621e; }
.badge.role-engineer { background: var(--blue-soft); color: var(--blue); }
.badge.role-security { background: var(--mint); color: var(--g700); }
.badge.plain { background: #f0f3ee; color: #6c7e77; }
.badge.plain::before { display: none; }
.badge.on { background: #e4f2e9; color: #217a55; }
.badge.off { background: #f1f0ee; color: #8a8f8a; }
.badge.type { background: var(--mint); color: var(--g700); }
.badge.type.visitor { background: var(--accent-soft); color: #a8621e; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-top: 1px solid #eef1ec; font-size: 10.5px; color: var(--muted); }
.pager { display: flex; gap: 4px; }
.pager button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-size: 10px; color: var(--muted); }
.pager button.active { background: var(--g700); border-color: var(--g700); color: #fff; }
.pager button:disabled { opacity: .4; }

/* ---------------- 二维码 ---------------- */
.qr-tabs { display: flex; gap: 2px; background: #eaeee8; border-radius: 10px; padding: 3px; width: fit-content; margin-bottom: 16px; }
.qr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: center; transition: box-shadow .15s, transform .15s; }
.qr-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.qr-card img { width: 100%; max-width: 150px; aspect-ratio: 1; display: block; margin: 0 auto 10px; border-radius: 8px; border: 1px solid #eef1ec; padding: 6px; background: #fff; }
.qr-card h4 { margin: 0 0 3px; font-size: 12px; }
.qr-card p { margin: 0 0 10px; font-size: 9px; color: var(--soft); word-break: break-all; line-height: 1.5; }
.qr-card .qr-actions { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.qr-placeholder { aspect-ratio: 1; max-width: 150px; margin: 0 auto 10px; border: 1px dashed #d7dfd8; border-radius: 10px; display: grid; place-items: center; color: #b3c0b8; font-size: 9px; background: #fafbf7; }
.qr-info { background: linear-gradient(145deg,#0f5b4a,#0a3d32); color: #f4f1e7; border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; position: relative; overflow: hidden; }
.qr-info::after { content: ""; position: absolute; right: -50px; top: -70px; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.qr-info h3 { margin: 0 0 7px; font-size: 16px; }
.qr-info p { margin: 0; font-size: 11px; line-height: 1.75; color: rgba(244,241,231,.66); max-width: 620px; }
.qr-info .state { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 10px; color: #e6b98e; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 5px 10px; border-radius: 999px; }

/* ---------------- 表单 / 弹层 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: span 2; }
.form-field label { font-size: 10.5px; font-weight: 600; color: #40564d; }
.form-field label em { font-style: normal; color: var(--accent); }
.form-field .hint { font-size: 9.5px; color: var(--soft); line-height: 1.6; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf9; }
.switch-row span { font-size: 11px; }
.switch { position: relative; width: 36px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d9e2db; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch input:checked + i { background: var(--g700); }
.switch input:checked + i::after { transform: translateX(16px); }
.modal-overlay { position: fixed; inset: 0; background: rgba(9,40,33,.42); backdrop-filter: blur(3px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { width: min(600px, 100%); max-height: 90vh; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease; }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 19px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.modal-head p { margin: 0; font-size: 10.5px; color: var(--muted); }
.modal-close { border: 0; background: #f3f5f1; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.modal-close:hover { background: #e9eeea; }
.modal-body { padding: 4px 22px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid #eef1ec; display: flex; justify-content: flex-end; gap: 8px; background: #fbfcf9; }
.detail-hero { background: #f8faf6; border: 1px solid #e9ede7; border-radius: 13px; padding: 15px; margin-bottom: 14px; }
.detail-hero h4 { margin: 0 0 7px; font-size: 14px; line-height: 1.5; }
.detail-hero p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.7; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0; }
.detail-grid div span { display: block; font-size: 9px; color: var(--soft); margin-bottom: 3px; }
.detail-grid div b { font-size: 11px; font-weight: 500; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 13px 18px; font-size: 10.5px; }
.timeline li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--g700); box-shadow: 0 0 0 3px #e9f1eb; }
.timeline li::after { content: ""; position: absolute; left: 4.5px; top: 14px; bottom: 0; width: 1px; background: #e5ebe4; }
.timeline li:last-child::after { display: none; }
.timeline b { font-size: 11px; }
.timeline p { margin: 2px 0; color: var(--muted); line-height: 1.55; }
.timeline time { color: var(--soft); font-size: 9px; }
.photo-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.photo-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.photo-viewer { position: fixed; inset: 0; z-index: 90; background: rgba(5,25,20,.88); display: grid; place-items: center; padding: 30px; cursor: zoom-out; }
.photo-viewer img { max-width: 92vw; max-height: 88vh; border-radius: 8px; }
.input-group { display: flex; gap: 7px; }
.input-group .input { flex: 1; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf9; }
.tag { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #dde5de; border-radius: 7px; padding: 4px 7px; font-size: 10px; }
.tag button { border: 0; background: transparent; color: #a2afa8; font-size: 13px; line-height: 1; padding: 0; }
.tag-editor input { border: 0; outline: none; background: transparent; min-width: 110px; flex: 1; font-size: 11px; }
.setting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ---------------- Toast ---------------- */
.toast-root { position: fixed; top: 20px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast-item { background: #103f34; color: #fff; border-radius: 10px; padding: 10px 15px; font-size: 11px; box-shadow: 0 12px 30px rgba(9,54,43,.22); animation: toastIn .2s ease; max-width: 330px; line-height: 1.5; }
.toast-item.err { background: #8e332c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.loading { display: flex; align-items: center; gap: 9px; padding: 40px; justify-content: center; color: var(--soft); font-size: 11px; }
.spinner { width: 16px; height: 16px; border: 2px solid #dce5de; border-top-color: var(--g700); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg,#f1f4ef 25%,#f7f9f5 37%,#f1f4ef 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- 打印 ---------------- */
#printRoot { display: none; }
.print-sheet { background: #fff; color: #111; padding: 12mm; }
.print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9mm; }
.print-card { border: 1px solid #d8ddd6; border-radius: 5mm; padding: 6mm; text-align: center; break-inside: avoid; }
.print-card .print-org { font-size: 9pt; color: #667a70; letter-spacing: 2px; }
.print-card h3 { font-size: 17pt; margin: 2mm 0 1mm; }
.print-card .print-meta { font-size: 9pt; color: #697a72; margin-bottom: 3mm; }
.print-card img { width: 54mm; height: 54mm; }
.print-card .print-code { font-family: var(--mono); font-size: 8.5pt; color: #89958e; margin-top: 2mm; }
.print-card .print-tip { font-size: 8pt; color: #7c8c84; margin-top: 2mm; line-height: 1.5; }
@media print {
  body * { visibility: hidden; }
  #printRoot, #printRoot * { visibility: visible; }
  #printRoot { display: block; position: absolute; inset: 0; }
  .print-sheet { padding: 0; }
  @page { size: A4; margin: 12mm; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1220px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 246px; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .page { padding: 20px 18px 44px; }
  .topbar { padding: 0 18px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
  .setting-grid { grid-template-columns: 1fr; }
  .login-card { grid-template-columns: 1fr; min-height: 0; }
  .login-art { display: none; }
  .login-form-wrap { padding: 40px 30px; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-head h2 { font-size: 21px; }
  .login-wrap { padding: 14px; }
  .top-date { display: none; }
  .top-user span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: span 1; }
  .qr-grid { grid-template-columns: 1fr 1fr; }
  .qr-card img { max-width: 120px; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 23px; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 18px; }
  .toolbar .search-box input { width: 100%; }
  .search-box { flex: 1; min-width: 140px; }
  .input.date { width: 120px; }
}
