:root {
  --bg: #f3f5f2;
  --panel: #ffffff;
  --ink: #1d2922;
  --muted: #778179;
  --line: #e5e9e4;
  --brand: #d9462e;
  --brand-soft: #fff0e8;
  --green: #24764a;
  --green-soft: #eaf6ee;
  --amber: #a46119;
  --sidebar: #17231c;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  padding: 26px 18px;
  background:
    radial-gradient(circle at 20% 0, rgba(217,70,46,.2), transparent 30%),
    var(--sidebar);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 700;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: 1px; }
.brand small { margin-top: 4px; color: rgba(255,255,255,.55); font-size: 11px; letter-spacing: 2px; }
.nav { display: grid; gap: 7px; margin-top: 24px; }
.nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255,255,255,.67);
  transition: .18s ease;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: #fff; color: var(--ink); font-weight: 700; }
.sidebar-foot {
  position: absolute;
  right: 26px;
  bottom: 24px;
  left: 26px;
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.55);
  font-size: 12px;
}
.sidebar-foot a:hover { color: #fff; }
.main { width: calc(100% - 230px); margin-left: 230px; padding: 30px 36px 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: 3px; }
h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 31px; }
.site-link { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 12px; }
.flash { margin-bottom: 18px; padding: 13px 16px; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.flash.error { background: #fff0ed; color: #a63826; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card, .panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(31,49,39,.04);
}
.stat-card { padding: 22px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 10px; font-family: "Songti SC", "STSong", serif; font-size: 34px; }
.grid-2 { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; margin-top: 18px; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head a { color: var(--brand); font-size: 12px; }
.panel-body { padding: 18px 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid #eef0ed; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
td { font-size: 13px; line-height: 1.55; }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.tag { display: inline-block; padding: 4px 9px; border-radius: 999px; background: var(--brand-soft); color: #954017; font-size: 11px; font-weight: 700; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.gray { background: #f0f2ef; color: #69736c; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.toolbar input {
  min-width: 280px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
}
.toolbar input:focus { border-color: #b9c6bc; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.button.secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button.danger { background: #b63c2b; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.pagination a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.pagination a.disabled { pointer-events: none; opacity: .4; }
.empty { padding: 46px 20px; color: var(--muted); text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  outline: none;
}
.field.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 15%, rgba(244,181,104,.45), transparent 26%),
    linear-gradient(135deg, #cb3528, #e65a35);
}
.login-card { width: min(420px, 100%); padding: 34px; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(92,28,17,.25); }
.login-card .brand-mark { margin-bottom: 20px; background: var(--brand-soft); color: var(--brand); border-color: #f1d7cb; }
.login-card h1 { margin-bottom: 8px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.login-card .field { margin-top: 14px; }
.login-card .button { width: 100%; margin-top: 20px; min-height: 46px; }
.error-text { margin-top: 12px; color: #b13525; font-size: 12px; }
.hint { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; padding: 15px; }
  .brand { padding-bottom: 14px; }
  .nav { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; margin-top: 14px; }
  .nav a { white-space: nowrap; text-align: center; }
  .sidebar-foot { position: static; margin-top: 15px; }
  .admin-shell { display: block; }
  .main { width: 100%; margin: 0; padding: 22px 16px 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
