:root {
  --bg: #f4f6f9; --panel: #fff; --line: #e3e7ee; --text: #1f2933; --muted: #7b8794;
  --primary: #2f6fed; --primary-dark: #2458c4; --danger: #d64545; --ok: #2e9e5b; --side: #1e2a3a;
}
[v-cloak] { display: none; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h2 { font-size: 20px; } h3 { font-size: 17px; } h4 { font-size: 14px; margin: 18px 0 6px; color: var(--muted); }
.muted { color: var(--muted); } .mono { font-family: Consolas, Menlo, monospace; } .small { font-size: 12px; } .center { text-align: center; }

/* login */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 32px 28px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 18px; text-align: center; margin-bottom: 6px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 200px; background: var(--side); color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 20px 18px; font-size: 17px; font-weight: 600; color: #fff; }
.side nav { display: flex; flex-direction: column; }
.side nav a { padding: 11px 18px; color: #cbd5e1; }
.side nav a.active, .side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-foot { margin-top: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.side-foot a { color: #9fb3c8; }
.main { flex: 1; padding: 24px 28px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.inline { display: flex; gap: 8px; align-items: center; }
.summary { margin: 0 0 12px; color: var(--muted); }

/* controls */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
.btn { font: inherit; padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c5ccd6; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.error { color: var(--danger); margin: 0; font-size: 13px; }
.toast { position: fixed; top: 16px; right: 20px; z-index: 50; margin: 0; padding: 10px 16px; border-radius: 6px; background: var(--ok); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.toast.err { background: var(--danger); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card .num { font-size: 26px; font-weight: 600; }
.card .label { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* table */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 500; font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: #f6f9ff; }
.table.small th, .table.small td { padding: 6px 8px; font-size: 12px; }
.actions { white-space: nowrap; } .actions .btn { margin-right: 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #dfe6f0; color: #556; font-size: 13px; }
.icon { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #dfe6f0; color: #556; font-size: 10px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e8edf5; color: #44546a; margin-right: 4px; }
.tag.guardian { background: #e3efff; color: #1d4ed8; } .tag.cared { background: #fff1e0; color: #b45309; } .tag.linked { background: #e9f8ee; color: #15803d; }
.tag.pub { background: #e9f8ee; color: #15803d; } .tag.draft { background: #f1f3f6; color: var(--muted); }
.tag.st1 { background: #fff7d6; color: #a16207; } .tag.st2 { background: #e3efff; color: #1d4ed8; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c3cad4; margin-right: 6px; }
.dot.on { background: var(--ok); }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); }

/* panels / forms */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }

/* drawer / dialog */
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { width: 560px; max-width: 100%; background: var(--panel); height: 100%; overflow: auto; padding: 20px 24px; }
.drawer > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog { background: var(--panel); border-radius: 10px; padding: 24px; width: 420px; max-width: calc(100% - 32px); margin: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.people li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; }

/* 版本更新 */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.subtabs a { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.table td.notes { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.withdrawn { background: #fde8e8; color: var(--danger); }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side { width: auto; } .side nav { flex-direction: row; flex-wrap: wrap; } .side-foot { flex-direction: row; }
  .main { padding: 16px; }
  .table { display: block; overflow-x: auto; }
}
