:root {
  --bg: #eef0e9;
  --surface: #fbfcf8;
  --ink: #1b2821;
  --muted: #738078;
  --line: rgba(29, 48, 37, 0.12);
  --green: #285f48;
  --green-soft: #e1ede4;
  --orange: #d96f46;
  --orange-soft: #f6e2d7;
  --sidebar: #172d23;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
}

.auth-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(240, 210, 140, 0.2), transparent 28%),
    rgba(17, 37, 28, 0.92);
  backdrop-filter: blur(10px);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(390px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(5, 19, 12, 0.28);
}

.auth-card .eyebrow {
  margin-top: 22px;
}

.auth-card h1 {
  margin: 8px 0 9px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 28px;
}

.auth-card p {
  margin: 0 0 23px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.auth-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: white;
  font-size: 12px;
}

.auth-card input:focus {
  border-color: var(--green);
}

.auth-card button {
  width: 100%;
  height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.auth-error {
  min-height: 18px;
  padding-top: 7px;
  color: #a84227;
  font-size: 9px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px 22px;
  background:
    radial-gradient(circle at 0% 100%, rgba(226, 158, 83, 0.14), transparent 32%),
    var(--sidebar);
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  background: #f0d28c;
  color: var(--sidebar);
  font-family: "STSong", "Songti SC", serif;
  font-size: 24px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-family: "STSong", "Songti SC", serif;
  font-size: 17px;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.side-nav {
  display: grid;
  gap: 7px;
  margin-top: 48px;
}

.side-nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.47);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.side-nav-item span {
  font-family: Georgia, serif;
  font-size: 9px;
  opacity: 0.65;
}

.side-nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.side-nav-item:disabled {
  cursor: not-allowed;
}

.sidebar-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note span {
  color: #efcd82;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.44);
  font-size: 10px;
  line-height: 1.7;
}

.return-link {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  padding: 10px 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.return-link:hover {
  color: white;
}

.workspace {
  width: min(1480px, 100%);
  padding: 38px clamp(24px, 3vw, 48px) 48px;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.eyebrow {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.workspace-head h1 {
  margin: 9px 0 7px;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.workspace-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quiet-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.operator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operator-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--orange-soft);
  color: #8b442d;
  font-family: "STSong", "Songti SC", serif;
  font-weight: 800;
}

.operator strong,
.operator span {
  display: block;
}

.operator strong {
  font-size: 10px;
}

.operator span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.stat {
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 252, 248, 0.84);
  box-shadow: 0 9px 25px rgba(30, 45, 36, 0.04);
}

.stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat strong {
  display: block;
  margin: 12px 0 7px;
  font-family: Georgia, "STSong", serif;
  font-size: 27px;
}

.stat small {
  color: #98a19b;
  font-size: 8px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(510px, 1.05fr) minmax(430px, 0.95fr);
  gap: 14px;
  align-items: start;
  margin-top: 17px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 13px 34px rgba(29, 44, 35, 0.045);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 21px 17px;
}

.panel-head h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 19px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
}

.live-dot::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.order-table-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.65fr 0.6fr;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f6f7f2;
  color: #929b95;
  font-size: 8px;
  font-weight: 700;
}

.admin-order-list {
  max-height: calc(100vh - 370px);
  min-height: 340px;
  overflow-y: auto;
}

.admin-order {
  display: grid;
  width: 100%;
  grid-template-columns: 1.4fr 1fr 0.65fr 0.6fr;
  gap: 12px;
  align-items: center;
  padding: 15px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: 0.16s ease;
}

.admin-order:hover {
  background: #f8faf5;
}

.admin-order.active {
  background: var(--green-soft);
  box-shadow: inset 3px 0 var(--green);
}

.order-main strong {
  display: block;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-main span {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-summary {
  overflow: hidden;
  color: #536259;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef1eb;
  color: #66736b;
  font-size: 8px;
  font-weight: 800;
}

.admin-status.pending {
  background: var(--orange-soft);
  color: #98472d;
}

.admin-status.settled {
  background: var(--green-soft);
  color: var(--green);
}

.order-money {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 800;
}

.table-loading {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.detail-panel {
  min-height: 500px;
}

.detail-empty {
  display: grid;
  min-height: 500px;
  place-items: center;
  align-content: center;
  padding: 40px;
  text-align: center;
}

.detail-empty-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px 18px 18px 6px;
  background: var(--green-soft);
  color: var(--green);
  font-family: "STSong", "Songti SC", serif;
  font-size: 25px;
}

.detail-empty h2 {
  margin: 18px 0 7px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 20px;
}

.detail-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.detail-head {
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(218, 171, 84, 0.15), transparent 35%),
    var(--sidebar);
  color: white;
}

.detail-head-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.detail-id {
  color: rgba(255, 255, 255, 0.46);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}

.detail-head h2 {
  margin: 8px 0 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 21px;
}

.detail-amount {
  margin-top: 21px;
  color: #f0d28c;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 800;
}

.detail-amount small {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.42);
  font-family: inherit;
  font-size: 9px;
}

.detail-body {
  padding: 19px 20px;
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.summary-cell {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8f9f5;
}

.summary-cell span,
.summary-cell strong {
  display: block;
}

.summary-cell span {
  color: var(--muted);
  font-size: 8px;
}

.summary-cell strong {
  margin-top: 6px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-section {
  margin-top: 20px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.detail-section-head h3 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 16px;
}

.detail-section-head span {
  color: var(--muted);
  font-size: 8px;
}

.inspect-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcf8;
}

.inspect-item + .inspect-item {
  margin-top: 8px;
}

.inspect-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
}

.inspect-title {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
}

.inspect-quote {
  flex: 0 0 auto;
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 800;
}

.inspect-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.inspect-form {
  display: grid;
  grid-template-columns: 0.7fr 1fr auto;
  gap: 7px;
  margin-top: 10px;
}

.inspect-form input,
.inspect-form select {
  min-width: 0;
  height: 33px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: white;
  font-size: 9px;
}

.inspect-form button {
  min-width: 57px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.inspect-result {
  display: inline-flex;
  margin-top: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.inspect-result.pass {
  background: var(--green-soft);
  color: var(--green);
}

.inspect-result.reject {
  background: var(--orange-soft);
  color: #98472d;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 19px;
}

.action-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.action-button.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.action-button.orange {
  border-color: var(--orange);
  background: var(--orange);
  color: white;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 11px;
  background: rgba(22, 37, 29, 0.94);
  box-shadow: 0 14px 34px rgba(21, 31, 24, 0.2);
  color: white;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .admin-shell {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .sidebar {
    align-items: center;
    padding: 24px 12px;
  }

  .brand > div:last-child,
  .side-nav-item:not(.active) {
    display: none;
  }

  .side-nav {
    margin-top: 35px;
  }

  .side-nav-item {
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .side-nav-item span {
    font-size: 10px;
  }

  .sidebar-note,
  .return-link {
    display: none;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    position: static;
    display: none;
  }

  .workspace {
    padding: 22px 15px 35px;
  }

  .workspace-head {
    align-items: start;
  }

  .head-actions {
    align-items: end;
    flex-direction: column-reverse;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-grid {
    display: block;
  }

  .detail-panel {
    margin-top: 14px;
  }

  .order-table-head,
  .admin-order {
    grid-template-columns: 1.3fr 0.8fr 0.7fr;
  }

  .order-table-head span:nth-child(2),
  .admin-order .order-summary {
    display: none;
  }

  .inspect-form {
    grid-template-columns: 1fr 1fr;
  }

  .inspect-form button {
    height: 36px;
  }
}
