:root {
  --paper: #f3eee4;
  --paper-2: #eae3d4;
  --ink: #1c1814;
  --muted: #6f675c;
  --navy: #243044;
  --navy-2: #1b2433;
  --gold: #9a7b4f;
  --gold-2: #cbb892;
  --line: #d8cebd;
  --white: #fffdf8;
  --seal: #9e2a2b;
  --pass: #2f5d50;
  --warn: #9a5b12;
  --shadow: 0 18px 50px rgba(36, 48, 68, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(154, 123, 79, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(36, 48, 68, 0.12), transparent 50%),
    var(--paper);
}

.serif { font-family: "Noto Serif", "Noto Serif SC", "Songti SC", serif; }

a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.seal-mark {
  width: 38px;
  height: 38px;
  border: 2px solid var(--seal);
  color: var(--seal);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Noto Serif", "Noto Serif SC", serif;
  font-weight: 700;
  letter-spacing: 1px;
  transform: rotate(-8deg);
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  color: var(--muted);
  letter-spacing: 3px;
  font-size: 11px;
  margin-top: 2px;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.auth-wrap {
  display: grid;
  place-items: center;
}
.auth-wrap .card {
  width: min(520px, 100%);
}
.kicker {
  color: var(--gold);
  letter-spacing: 5px;
  font-size: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 16px;
  cursor: pointer;
  color: var(--muted);
}
.tab.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gold);
  font-weight: 700;
}
.card-body { padding: 24px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.full { grid-column: 1 / -1; }
.doc-block {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fbf8f1;
}
.doc-block h4 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 1px;
}
.doc-block .field { margin-bottom: 10px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(154, 123, 79, 0.15);
}
.hint { font-size: 12px; color: var(--muted); }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
}
.btn-pass { background: var(--pass); color: #fff; }
.btn-seal { background: var(--seal); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.upload {
  border: 1px dashed var(--gold-2);
  border-radius: 14px;
  padding: 14px;
  background: #fbf8f1;
  cursor: pointer;
  min-height: 148px;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.upload input { display: none; }
.upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload span { color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }
.footer {
  padding: 18px 28px 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.status.pending { background: #f6e6c8; color: var(--warn); }
.status.approved { background: #dceee6; color: var(--pass); }
.status.rejected { background: #f6d6d4; color: var(--seal); }

.dash-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 12px;
  margin: 18px 0;
}
.kv div { color: var(--muted); }
.kv b { color: var(--ink); font-weight: 600; }
.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.photos figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f7f2e8;
}
.photos figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}
.stamp {
  width: 92px;
  height: 92px;
  border: 4px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Noto Serif", "Noto Serif SC", serif;
  font-size: 22px;
  transform: rotate(-18deg);
  opacity: 0.88;
}
.stamp.ok { color: var(--pass); }
.stamp.no { color: var(--seal); }
.stamp.wait { color: var(--warn); }

.admin-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}
.side {
  background: var(--navy-2);
  color: #efe7d8;
  padding: 24px 18px;
}
.side h1 { margin: 8px 0 4px; font-size: 24px; }
.side p { color: #c9beaa; font-size: 13px; }
.stats { display: grid; gap: 10px; margin: 24px 0; }
.stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(203,184,146,0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
}
.main { padding: 22px; }
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
.table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  background: var(--white);
}
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.table th { color: var(--muted); font-weight: 600; background: #faf6ee; }
.table tr { cursor: pointer; }
.table tr:hover td { background: #f8f3ea; }
.table tr.active td { background: #efe6d4; }

.detail {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.review-box textarea {
  width: 100%;
  min-height: 110px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  resize: vertical;
}
.actions { display: flex; gap: 10px; margin-top: 12px; }
.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.error { color: var(--seal); font-size: 13px; min-height: 18px; }
.pin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 3px;
  background: #f4eee3;
  padding: 2px 8px;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .admin-shell, .detail, .grid-2, .photos, .kv {
    grid-template-columns: 1fr;
  }
  .admin-shell { display: block; }
}
