:root {
  --bg: #f4efe8;
  --panel: rgba(255, 250, 244, 0.9);
  --panel-strong: #fffaf5;
  --ink: #20262a;
  --muted: #68757d;
  --line: rgba(32, 38, 42, 0.1);
  --line-strong: rgba(32, 38, 42, 0.18);
  --primary: #aa5c31;
  --primary-strong: #7d3e18;
  --accent: #245f74;
  --success: #28765a;
  --danger: #af4436;
  --warning: #b4842f;
  --shadow: 0 20px 50px rgba(88, 58, 29, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Helvetica Neue",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(170, 92, 49, 0.15), transparent 28%),
    radial-gradient(circle at right 10%, rgba(36, 95, 116, 0.12), transparent 20%),
    linear-gradient(180deg, #f8f1e9 0%, #f4efe8 45%, #ebe2d7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 88%);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(24, 35, 40, 0.94);
  color: #f7f1ea;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #c87d46, #7d3e18);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand p,
.brand span,
.nav-button,
.side-card p,
.side-card li,
.hero-copy,
.status-note,
.metric-card p,
.panel-head p,
.record-card p,
.empty,
.field label,
.field small,
.table-wrap td,
.table-wrap th,
.pill {
  margin: 0;
}

.brand p {
  font-size: 1rem;
  font-weight: 700;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: rgba(247, 241, 234, 0.64);
  font-size: 0.78rem;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-button {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(247, 241, 234, 0.78);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.nav-button:hover,
.nav-button.active {
  transform: translateX(4px);
  background: rgba(200, 125, 70, 0.18);
  color: #fff5ea;
}

.side-card {
  margin-top: 24px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-card h3 {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.side-card ul {
  padding-left: 18px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.main {
  padding: 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  max-width: 12ch;
}

.eyebrow,
.panel-head p {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy {
  margin-top: 16px;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.8;
}

.hero-card,
.metric-card,
.panel,
.record-card,
.form-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.hero-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.3rem;
}

.hero-card .meta {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
}

.button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.danger-button {
  background: rgba(175, 68, 54, 0.12);
  color: var(--danger);
}

.metrics,
.content-grid,
.dashboard-grid,
.cards-grid {
  display: grid;
  gap: 18px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
}

.metric-card {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.metric-card p {
  color: var(--muted);
  line-height: 1.6;
}

.content-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  margin-top: 24px;
}

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

.panel,
.form-shell {
  border-radius: var(--radius-xl);
  padding: 20px;
}

.panel-head h2,
.form-shell h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-head .head-row,
.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head .description,
.status-note,
.field small,
.record-card p,
.table-wrap td {
  color: var(--muted);
  line-height: 1.7;
}

.records-table {
  margin-top: 16px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table-wrap th {
  font-size: 0.84rem;
  color: var(--primary-strong);
  background: rgba(170, 92, 49, 0.06);
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.action-row,
.status-row,
.form-grid,
.field-actions,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-row {
  margin-top: 14px;
}

.field-actions {
  margin-top: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pill.status-正常,
.pill.status-在岗,
.pill.status-已闭环,
.pill.status-已完成,
.pill.status-已归档,
.pill.status-已入库 {
  color: var(--success);
  background: rgba(40, 118, 90, 0.12);
}

.pill.status-待采购,
.pill.status-待检验,
.pill.status-待整改,
.pill.status-待办,
.pill.status-待落实,
.pill.status-在途 {
  color: var(--warning);
  background: rgba(180, 132, 47, 0.14);
}

.pill.status-停用,
.pill.status-高风险,
.pill.status-逾期,
.pill.status-阻塞 {
  color: var(--danger);
  background: rgba(175, 68, 54, 0.12);
}

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

.record-card {
  border-radius: 18px;
  padding: 18px;
}

.record-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.card-meta,
.meta-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.meta-list strong {
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.status-note {
  margin-top: 10px;
}

.empty {
  padding: 28px 20px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  border-radius: 16px;
  padding: 14px 16px;
  color: white;
  box-shadow: var(--shadow);
  z-index: 30;
}

.toast.success {
  background: #296d55;
}

.toast.error {
  background: #9a3d32;
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .hero,
  .metrics,
  .content-grid,
  .dashboard-grid,
  .cards-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .hero h1 {
    max-width: none;
  }
}
