:root {
  --bg: #f4f0e8;
  --paper: #fbf8f2;
  --ink: #1f2a2a;
  --muted: #62706d;
  --line: #d8d0c2;
  --history: #2d6a5f;
  --admin: #6b3f1d;
  --school: #355070;
  --accent-soft: #dce8e3;
  --danger-soft: #efe1d6;
  --shadow: 0 18px 50px rgba(42, 51, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(45, 106, 95, 0.09), transparent 30%),
    linear-gradient(180deg, #f6f2ea 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.shell.narrow {
  width: min(720px, calc(100vw - 32px));
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.hero,
.page-head {
  background: rgba(251, 248, 242, 0.86);
  border: 1px solid rgba(216, 208, 194, 0.8);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.eyebrow {
  letter-spacing: 0.14em;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-copy,
.page-head p {
  max-width: 720px;
  line-height: 1.7;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nav-card,
.panel,
.result-card,
.info-panel {
  background: rgba(251, 248, 242, 0.92);
  border: 1px solid rgba(216, 208, 194, 0.85);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.nav-card {
  padding: 24px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.nav-card:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 80, 112, 0.4);
}

.nav-tag,
.mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 12px;
}

.nav-tag.history,
.mini-tag {
  background: var(--accent-soft);
  color: var(--history);
}

.nav-tag.admin {
  background: var(--danger-soft);
  color: var(--admin);
}

.nav-tag.school {
  background: rgba(53, 80, 112, 0.12);
  color: var(--school);
}

.info-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 24px;
}

.panel,
.result-card {
  padding: 24px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffcf7;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.button {
  border: 1px solid rgba(31, 42, 42, 0.16);
  background: #f8f4ec;
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.button.primary {
  background: var(--history);
  color: #fff;
  border-color: transparent;
}

.button.subtle {
  padding: 8px 14px;
}

.result-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-card.wide {
  grid-column: 1 / -1;
}

.result-box {
  background: #fffdf9;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.flat-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.muted,
.muted-cell {
  color: var(--muted);
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

@media (max-width: 900px) {
  .grid.two,
  .grid.three,
  .result-grid,
  .info-panel {
    grid-template-columns: 1fr;
  }
}

/* ── OCR 拖拽上传区 ─────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--paper);
  min-height: 90px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--history);
  background: var(--accent-soft);
}

.drop-zone p {
  margin: 0 0 8px;
  color: var(--muted);
  pointer-events: none;
}

.file-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85em;
  background: var(--accent-soft);
  margin-bottom: 4px;
}

.remove-file {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
}

.remove-file:hover {
  color: var(--ink);
}
