:root {
  --bg: #f5f6f8;
  --panel: #fff;
  --line: #e5e6eb;
  --text: #1d2129;
  --muted: #86909c;
  --primary: #165dff;
  --primary-hover: #0e42d2;
  --success: #00b42a;
  --warning: #ff7d00;
  --danger: #f53f3f;
  --radius: 10px;
  --sidebar: #1d2129;
  --sidebar-text: #c9cdd4;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* ---------------- 登录 ---------------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, #eef2ff 0%, #f7f8fa 55%, #eef7f1 100%);
}
.login-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 30px 28px; box-shadow: 0 10px 30px rgba(31, 45, 61, .06);
}
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-card .hint { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-card .divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.login-card .divider::before, .login-card .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 14px; font-size: 17px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.brand small { display: block; font-size: 11px; color: #86909c; font-weight: 400; margin-top: 2px; letter-spacing: 0; }
.nav { flex: 1; overflow: auto; padding: 6px 10px; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 14px; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .ico { width: 16px; text-align: center; opacity: .9; }
.sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar-foot .who { color: #fff; margin-bottom: 6px; word-break: break-all; }
.sidebar-foot a { color: #86909c; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .meta { color: var(--muted); font-size: 12px; }
.view { padding: 20px 22px 40px; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; }
.card h3.mt { margin-top: 20px; }
.card h3 .sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .num { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat .label { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat.warn .num { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer;
  font-size: 13px; line-height: 1.4; white-space: nowrap;
}
.btn:hover { border-color: #c9cdd4; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #ffd2d2; }
.btn.danger:hover { background: #fff2f2; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 1.7; background: #f2f3f5; color: #4e5969; }
.badge.draft { background: #f2f3f5; color: #4e5969; }
.badge.pending { background: #fff7e8; color: #d25f00; }
.badge.approved { background: #e8ffea; color: #009a29; }
.badge.rejected { background: #ffece8; color: #cb2634; }
.badge.offline { background: #f2f3f5; color: #86909c; }
.badge.waiting_confirm, .badge.initiated { background: #fff7e8; color: #d25f00; }
.badge.agreed { background: #e8f3ff; color: #165dff; }
.badge.unlocked { background: #e8f7ff; color: #0e8fd2; }
.badge.meeting { background: #f5e8ff; color: #7826b5; }
.badge.success { background: #e8ffea; color: #009a29; }
.badge.failed, .badge.closed { background: #ffece8; color: #cb2634; }
.badge.archived { background: #f2f3f5; color: #86909c; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; }
td.actions .btn { margin-right: 6px; }
.table-wrap { overflow-x: auto; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 34px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field.wide { min-width: 240px; flex: 1; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.pager .btn { margin-left: auto; }

.empty { padding: 40px 10px; text-align: center; color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 8px; background: #fff7e8; color: #7d4e00; font-size: 13px; margin-bottom: 14px; }
.notice.info { background: #e8f3ff; color: #1d4ed8; }
.notice.danger { background: #ffece8; color: #cb2634; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 18px; border-left: 2px solid var(--line); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline .at { color: var(--muted); font-size: 12px; }
.timeline .what { font-size: 13px; }

.countdown { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: rgba(29, 33, 41, .92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 99; max-width: 80vw;
}
.toast.error { background: rgba(203, 38, 52, .95); }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { padding: 12px 14px; white-space: nowrap; }
  .brand small { display: none; }
  .nav { display: flex; gap: 4px; padding: 6px 10px; flex: 1; overflow-x: auto; }
  .nav a { margin: 0; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .topbar { padding: 0 14px; }
  .view { padding: 14px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .grid.cols-2, .form-grid { grid-template-columns: 1fr; }
}

/* 照片审核 */
.photos { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-item { width: 128px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f7f8fa; }
.photo-item img { width: 100%; height: 128px; object-fit: cover; display: block; }
.photo-actions { display: flex; gap: 6px; padding: 6px; }
.photo-actions .btn { flex: 1; justify-content: center; }
/* ---------------- v1.1 视觉统一 ---------------- */
:root {
  --bg: #f4f6fb;
  --radius: 12px;
  --sidebar: #111827;
}
body { background: radial-gradient(1200px 600px at 100% -10%, #eef4ff 0%, transparent 60%), var(--bg); }
.sidebar {
  background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
  box-shadow: 8px 0 30px rgba(15, 23, 42, .08);
}
.brand { font-size: 18px; padding: 22px 18px 16px; }
.brand::before {
  content: "牵"; display: inline-flex; width: 24px; height: 24px; margin-right: 8px;
  align-items: center; justify-content: center; border-radius: 7px;
  background: linear-gradient(135deg, #2f6bff, #165dff); color: #fff; font-size: 13px; font-weight: 700;
  vertical-align: -4px;
}
.nav a { padding: 10px 12px; border-radius: 10px; transition: background .15s ease; }
.nav a.active { background: linear-gradient(135deg, #2f6bff, #165dff); box-shadow: 0 6px 16px rgba(22, 93, 255, .35); }

.topbar {
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid #eef0f4; position: sticky; top: 0; z-index: 20;
}
.content { padding: 22px 26px 40px; }
.card {
  border: 1px solid #eef0f4; border-radius: 14px;
  box-shadow: 0 8px 28px rgba(29, 33, 41, .05);
}
.card h3 { font-size: 15px; letter-spacing: .2px; }
.stat { border-radius: 14px; box-shadow: 0 8px 24px rgba(29, 33, 41, .05); border: 1px solid #eef0f4; }
.stat .num { font-weight: 700; letter-spacing: -.5px; }

.btn { border-radius: 10px; transition: transform .12s ease, box-shadow .12s ease; }
.btn.primary {
  background: linear-gradient(135deg, #2f6bff, #165dff); border-color: #165dff;
  box-shadow: 0 6px 16px rgba(22, 93, 255, .22);
}
.btn:active { transform: translateY(1px); }

.table-wrap table thead th {
  background: #fafbfc; color: #6b7280; font-weight: 600; font-size: 12px;
  letter-spacing: .3px; border-bottom: 1px solid #eef0f4;
}
.table-wrap tbody tr:hover { background: #f8faff; }
.table-wrap td { border-bottom: 1px solid #f5f6f8; }

input, select, textarea { border-radius: 10px; border-color: #e5e7eb; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.filters { background: #fafbfc; border: 1px solid #eef0f4; border-radius: 12px; }
.badge { font-weight: 500; }
/* 首页直达链接编辑 */
.ql-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; margin-bottom: 8px; }
.ql-row input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); }
@media (max-width: 720px) { .ql-row { grid-template-columns: 1fr; } }