:root {
  --bg0: #fff9f6;
  --bg1: #ffe8df;
  --ink: #2a1f1a;
  --muted: #7a6a60;
  --line: #edd9cc;
  --card: #ffffff;
  --brand: #b01a1a;
  --brand-deep: #7a1010;
  --gold: #c9a227;
  --gold-soft: #f3e2a8;
  --accent: #c45c26;
  --warn: #b45309;
  --danger: #b42318;
  --ok: #0f766e;
  --shadow: 0 12px 32px rgba(122, 16, 16, 0.08);
  --radius: 14px;
  --font-title: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(201, 162, 39, 0.16) 0%, transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(176, 26, 26, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }

.shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 36px 28px 32px;
  background: linear-gradient(180deg, #b71c1c 0%, #8b0000 52%, #6d0f0f 100%);
  color: #ffd700;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 3px solid #c9a227;
  display: flex;
  flex-direction: column;
}

.brand-block {
  padding: 0 0 8px;
  margin: 0;
}

.brand {
  font-family: "方正大标宋简体", "方正大标宋", "FZDaBiaoSong-B06S", "FZDaBiaoSong", "Noto Serif SC", "SimSun", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  color: #ffd700;
  line-height: 1.35;
  white-space: nowrap;
}

.brand-sub {
  margin: 12px 0 0;
  color: #ffd700;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.03em;
  font-family: Arial, Helvetica, sans-serif;
  white-space: nowrap;
}

.brand-divider {
  margin-top: 16px;
  height: 1px;
  width: 100%;
  background: #c9a227;
}

.nav {
  display: grid;
  gap: 10px;
  padding-top: 24px;
  flex: 1;
}
.nav a {
  color: #fff8e7;
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
  line-height: 1.55;
}
.nav a.active,
.nav a:hover {
  background: rgba(201, 162, 39, 0.22);
  border-color: #c9a227;
  color: #fff8e7;
}

.sidebar-logout { margin-top: 18px; }
.sidebar-logout button {
  width: 100%;
  justify-content: center;
  background: transparent;
  color: #ffd700;
  border: 1px solid #c9a227;
}

.content {
  padding: 36px 48px 56px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.page-title {
  margin: 0 0 8px;
  font-family: var(--font-title);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: 0.03em;
}

.page-desc {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.grid { display: grid; gap: 20px; width: 100%; }
.grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1.15fr 0.95fr 1fr; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.home-page,
.ops-page,
.tools-page,
.scripts-page,
.materials-page {
  width: 100%;
  max-width: none;
}
.home-page .home-hero { width: 100%; }
.script-quick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.script-quick-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e8d5c8;
  background: #fffaf6;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}
.script-quick-list a:hover {
  border-color: #c9a227;
  background: #fff8ef;
}
.script-quick-list .muted {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  font-size: 0.8rem;
}
.process-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border: 1px solid #e8d5c8;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.card h3,
.card h4,
.step h4 {
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: 1.08rem;
  color: var(--brand-deep);
  font-weight: 700;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}
.stat-label {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.9rem;
}

.btn, button, .file-btn {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, #c42323, #9d1515);
  color: #fff8e8;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn.secondary, button.secondary {
  background: #fff8ef;
  color: var(--brand-deep);
  border: 1px solid #e4c98a;
}
.btn.warn { background: linear-gradient(180deg, #d97706, #b45309); }
.btn:hover, button:hover { filter: brightness(1.05); transform: translateY(-1px); }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #d4b35a;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}
textarea { min-height: 90px; resize: vertical; }
label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }

.table-scroll { overflow-x: auto; }
.qr-box { margin-top: 12px; background: #fff; display: inline-block; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.qr-box svg { width: 180px; height: auto; display: block; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid #f0e4db;
  vertical-align: top;
  font-size: 0.92rem;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}
tr:hover td { background: rgba(176, 26, 26, 0.03); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fff1e4;
  color: var(--brand-deep);
}
.badge.done { background: #e8f7f1; color: var(--ok); }
.badge.warn { background: #fff4df; color: var(--warn); }
.badge.danger { background: #fde8e6; color: var(--danger); }

.flash {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7e8;
  border: 1px solid #e4c98a;
  color: #7a1010;
}

.steps { display: grid; gap: 14px; }
.step {
  border-left: 4px solid var(--gold);
  padding-left: 14px;
}
.step.active { border-left-color: var(--brand); }
.muted { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; margin-bottom: 10px; }
.kv div:nth-child(odd) { color: var(--muted); }

.todo-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0e4db;
}
.todo-item:last-child { border-bottom: none; }

.chart-wrap {
  height: 320px;
  position: relative;
}
.chart-wrap-wide {
  height: 280px;
}

/* 主页英雄区：简洁喜庆 */
.home-hero {
  position: relative;
  margin: 0 0 28px;
  padding: 32px 32px 28px;
  border-radius: 18px;
  overflow: hidden;
  color: #fff8e8;
  background:
    radial-gradient(520px 220px at 92% 10%, rgba(201, 162, 39, 0.35), transparent 65%),
    linear-gradient(125deg, #c42323 0%, #9d1515 55%, #7a1010 100%);
  box-shadow: 0 18px 40px rgba(122, 16, 16, 0.18);
  animation: homeIn 0.55s ease-out both;
}

.home-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
}

.home-wish {
  margin: 0 0 10px;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  font-weight: 600;
}

.home-hero .page-title {
  margin: 0 0 8px;
  color: #fff8e8;
  font-size: 2rem;
}

.home-desc {
  margin: 0;
  color: rgba(255, 248, 232, 0.9);
  max-width: none;
}

.fest-stat {
  border-top: 3px solid var(--gold);
  animation: homeIn 0.65s ease-out both;
}
.fest-stat:nth-child(2) { animation-delay: 0.06s; }
.fest-stat:nth-child(3) { animation-delay: 0.12s; }

.stat-kicker {
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 6px;
}

@keyframes homeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ready-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 10px;
}
.ready-list label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
  line-height: 1.5;
}
.ready-list input[type="checkbox"] {
  width: auto;
  margin-top: 4px;
  accent-color: var(--brand);
}
#readyProgress {
  margin-top: 14px;
  font-weight: 600;
  color: var(--brand-deep);
}

.hint { margin: 0 0 6px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.check-line { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.check-line input { width: auto; }
.consult-admin {
  width: 100%;
  max-width: none;
}
.consult-admin .record-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}
.consult-admin .record-table th,
.consult-admin .record-table td {
  text-align: center;
  vertical-align: middle;
}
.consult-admin .record-table thead th {
  background: #00B0F0;
  color: #fff;
  border-bottom-color: #0099d6;
  font-weight: 700;
}
.consult-admin .table-scroll {
  width: 100%;
  overflow-x: auto;
}
.consult-admin .record-table-compact .col-time { width: 16%; }
.consult-admin .record-table-compact .col-name { width: 12%; }
.consult-admin .record-table-compact .follow-head { width: 14%; }
.consult-admin .record-table-compact .col-materials { width: 12%; }
.consult-admin .record-table-compact .col-progress { width: 22%; }
.consult-admin .record-table-compact .col-actions { width: 24%; }
.consult-admin .programme-cell {
  font-weight: 600;
  color: var(--brand-deep);
}
.consult-admin .follow-cell {
  text-align: center;
}
.consult-admin .follow-cell .follow-edit,
.consult-admin .follow-cell .chip-ok,
.consult-admin .follow-cell .chip-no {
  vertical-align: middle;
}
.consult-admin .progress-cell {
  min-width: 0;
  text-align: center;
}
.consult-admin .progress-cell .progress-bar {
  margin-left: auto;
  margin-right: auto;
}
.consult-admin .progress-cell .progress-label {
  display: block;
  text-align: center;
}
.consult-admin .progress-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #FF0000;
}
.consult-admin .progress-bar .progress-done {
  display: block;
  height: 100%;
  background: #00B050;
}
.consult-admin .progress-bar .progress-todo {
  display: block;
  height: 100%;
  background: #FF0000;
}
.consult-admin .progress-bar.is-complete {
  background: #00B050;
}
.consult-admin .progress-bar.is-complete .progress-todo {
  display: none;
}
.consult-admin .progress-label {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}
.insight-brief {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.insight-brief:first-of-type { border-top: none; padding-top: 0; }
.insight-brief p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.home-desc { margin-top: 8px; }
.consult-admin .actions-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.consult-admin .actions-cell form {
  display: inline-flex;
  margin: 0;
  flex: 0 0 auto;
}
.consult-admin .actions-cell .follow-edit,
.consult-admin .actions-cell .follow-delete {
  white-space: nowrap;
}
.consult-admin .panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.consult-admin .panel-head h3 { margin: 0; }
.consult-admin .panel-actions { margin-top: 16px; gap: 10px; }
.consult-admin .panel-sub {
  margin: 18px 0 8px;
  font-size: 1rem;
  color: var(--brand-deep);
}
.consult-admin .field-ok,
.consult-admin .field-no {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
}
.consult-admin .field-ok {
  background: #e8f7f1;
  border-color: #00B050;
}
.consult-admin .field-no {
  background: #fde8e6;
  border-color: #FF0000;
}
.consult-admin .field-ok label,
.consult-admin .field-ok .check-line { color: #00B050; }
.consult-admin .field-no label,
.consult-admin .field-no .check-line { color: #FF0000; }
.consult-admin .follow-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.consult-admin th,
.consult-admin td {
  vertical-align: middle;
  text-wrap: pretty;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.45;
}
.consult-admin .cell-edit { min-width: 0; }
.consult-admin td.cell-edit:not(:has(input[type="file"])) {
  position: relative;
  height: 1px;
  padding: 0;
}
.consult-admin td.cell-edit:not(:has(input[type="file"])) > input,
.consult-admin td.cell-edit:not(:has(input[type="file"])) > select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}
.consult-admin .cell-edit input,
.consult-admin .cell-edit textarea {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
}
.consult-admin .cell-check { text-align: center; }
.consult-admin .cell-check select { font-weight: 700; }
.consult-admin .cell-ok { background: #00B050; }
.consult-admin .cell-ok select,
.consult-admin .cell-ok input,
.consult-admin .cell-ok textarea { color: #00B050; background: #fff; }
.consult-admin .cell-no { background: #FF0000; }
.consult-admin .cell-no select,
.consult-admin .cell-no input,
.consult-admin .cell-no textarea { color: #FF0000; background: #fff; }
.consult-admin .cell-edit input[type="file"] { min-width: 0; font-size: 12px; }
.receipt-mini { margin-top: 8px; }
.receipt-mini img { width: 88px; height: 56px; object-fit: cover; border-radius: 6px; background: #fff; }
.receipt-mini .hint, .receipt-mini p { margin: 4px 0; font-size: 12px; }
.profile-dialog {
  width: min(520px, calc(100vw - 48px));
  border: none;
  border-radius: 12px;
  padding: 22px;
}
.profile-dialog::backdrop { background: rgba(42, 31, 26, 0.45); }
.profile-dialog label { margin-top: 10px; }
.profile-dialog .secondary { margin-top: 14px; }
.follow-edit {
  display: inline-flex;
  margin-top: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fff8ef;
  color: var(--brand-deep);
  border: 1px solid #e4c98a;
  font-weight: 700;
  line-height: 1.4;
}
.follow-delete {
  display: inline-flex;
  margin-top: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fde8e6;
  color: var(--danger);
  border: 1px solid #f0b4ad;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.follow-delete:hover {
  background: #fbd0cb;
}
.chip-ok, .chip-no {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.chip-ok { color: #00B050; background: #e8f7f1; }
.chip-no { color: #FF0000; background: #fde8e6; }
.follow-panel { margin-bottom: 18px; }
.receipt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.receipt-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.receipt-card img { width: 100%; height: 160px; object-fit: contain; background: #fff8f4; border-radius: 8px; }
.note-ok { color: #00B050; font-weight: 600; }
.note-no { color: #FF0000; font-weight: 600; }
.report-bar { margin-top: 16px; }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 3px solid #c9a227;
  }
  .brand,
  .brand-sub { white-space: normal; }
  .grid.stats, .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 28px 24px 40px; }
  .home-hero { padding: 22px 18px; }
}
