:root {
  --bg: #f4efe7;
  --panel: #fffdf9;
  --panel-2: #faf5ed;
  --ink: #2e2923;
  --muted: #8a7e71;
  --line: #e6dccd;
  --brand: #74452a;
  --brand-2: #a15a34;
  --brand-soft: #f0e2d1;
  --accent: #c47a45;
  --danger: #b03d36;
  --danger-soft: #f8e6e4;
  --success: #3d7a58;
  --success-soft: #e5f1ea;
  --warning: #9c6f26;
  --warning-soft: #f7eedb;
  --shadow: 0 12px 30px rgba(71, 47, 28, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button {
  font-family: inherit;
}

/* ---------- 布局 ---------- */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 238px;
  flex: 0 0 238px;
  background: linear-gradient(170deg, #3d2a1e 0%, #2b1d14 100%);
  color: #f3e7d8;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand {
  padding: 4px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c78650, #9c5330);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff8ef;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.brand h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.brand p {
  font-size: 11px;
  color: rgba(243, 231, 216, 0.55);
  margin-top: 2px;
  letter-spacing: 1.5px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(243, 231, 216, 0.72);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff6ea;
}

.nav a.active {
  background: linear-gradient(90deg, rgba(196, 122, 69, 0.28), rgba(196, 122, 69, 0.08));
  color: #ffd9b5;
  box-shadow: inset 2px 0 0 #cf8a53;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(243, 231, 216, 0.55);
}

.sidebar-foot button {
  background: none;
  border: none;
  color: rgba(243, 231, 216, 0.72);
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
}

.sidebar-foot button:hover {
  color: #ffd9b5;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 12, 0.45);
  z-index: 35;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 30px 16px;
  background: linear-gradient(180deg, rgba(244, 239, 231, 0.95), rgba(244, 239, 231, 0.75));
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.topbar p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.view {
  padding: 4px 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#menuBtn {
  display: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}

/* ---------- 卡片与统计 ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 600;
}

.card-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: 0.6;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.stat-hint strong {
  color: var(--brand-2);
  font-weight: 600;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 18px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 190px;
  padding: 10px 4px 0;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.bar-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 68%;
  max-width: 44px;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #c98a55, #8f5130);
  transition: height 0.35s ease;
  position: relative;
}

.bar.alt {
  background: linear-gradient(180deg, #cbb08d, #a88960);
}

.bar-value {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar-date {
  font-size: 11px;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: 1px;
}

/* ---------- 表格 ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

th:first-child {
  border-radius: 8px 0 0 8px;
}

th:last-child {
  border-radius: 0 8px 8px 0;
}

tbody tr:hover {
  background: #fcf8f2;
}

td.actions {
  white-space: nowrap;
}

td.actions .btn + .btn {
  margin-left: 5px;
}

.cell-main {
  font-weight: 500;
}

.cell-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.clamp {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
  font-size: 13px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s,
    transform 0.05s;
  background: var(--brand);
  color: #fff8f0;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:hover {
  background: #5f3721;
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.danger:hover {
  background: #96312b;
}

.btn.ghost.danger {
  background: transparent;
  color: var(--danger);
  border-color: #ecc9c5;
}

.btn.small {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 7px;
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.link {
  background: none;
  border: none;
  color: var(--brand-2);
  cursor: pointer;
  padding: 0;
  font-size: 12.5px;
}

.link:hover {
  text-decoration: underline;
}

.link.danger {
  color: var(--danger);
}

/* ---------- 表单 ---------- */

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.field > span b {
  color: var(--danger);
  font-weight: 500;
}

.field.span-2,
.span-2 {
  grid-column: 1 / -1;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffefb;
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  min-height: 76px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #bf8a5c;
  box-shadow: 0 0 0 3px rgba(191, 138, 92, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #b8ac9c;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.list-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.list-row input {
  flex: 1;
}

.image-row .image-thumb {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.image-row .image-thumb.empty {
  opacity: 0.35;
}

.image-row input.image-url {
  min-width: 0;
}

/* ---------- 筛选栏 ---------- */

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

.toolbar .spacer {
  flex: 1;
}

.toolbar input[type="search"],
.toolbar input[type="text"] {
  width: 220px;
}

.toolbar select {
  width: auto;
  min-width: 130px;
}

/* ---------- 标签、徽章 ---------- */

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  margin: 1px 4px 1px 0;
  white-space: nowrap;
}

.tag.grey {
  background: #f0ece6;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.green {
  background: var(--success-soft);
  color: var(--success);
}

.badge.grey {
  background: #f0ece6;
  color: var(--muted);
}

.badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.red {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- 分页 ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.pager .btn {
  padding: 5px 12px;
  font-size: 12px;
}

/* ---------- 结构化编辑器 ---------- */

.rep-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rep-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 12px 14px;
}

.rep-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rep-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kv-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.kv-row textarea {
  min-height: 42px;
}

.kv-key {
  font-size: 12px !important;
  background: #fffdf9 !important;
}

.structured + .structured {
  margin-top: 0;
}

/* ---------- 路线点位选择 ---------- */

.route-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.picker-col {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 12px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.picker-col h3 {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 2px;
}

.pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12.5px;
}

.pick-item .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-item .order {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
}

.pick-item button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.pick-item button:hover {
  color: var(--brand-2);
  border-color: var(--brand-2);
}

.pick-item button.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- 题目编辑 ---------- */

.option-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.opt-letter {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.answer-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  font-size: 12.5px;
  cursor: pointer;
}

.answer-chip:has(input:checked) {
  border-color: var(--brand-2);
  background: var(--brand-soft);
  color: var(--brand);
}

.answer-chip input {
  accent-color: var(--brand);
}

/* ---------- 弹窗 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(36, 24, 15, 0.48);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 4vh;
  overflow-y: auto;
  animation: fade 0.15s ease;
}

.modal {
  width: min(720px, 100%);
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(40, 25, 14, 0.28);
  overflow: hidden;
  animation: lift 0.18s ease;
}

.modal.wide {
  width: min(980px, 100%);
}

.modal.narrow {
  width: min(460px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.modal-head h2 {
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 20px 22px;
  max-height: 68vh;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}

.modal-body .form-grid {
  gap: 13px 16px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: #33261d;
  color: #fff6ea;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(30, 20, 12, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
  max-width: min(560px, 90vw);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #7f2c27;
}

.toast.success {
  background: #2f6247;
}

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

.small {
  font-size: 12px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
}

.detail-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 9px 14px;
  font-size: 13px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thumb-row img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
}

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

.loading::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 12px;
  border: 2px solid var(--line);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-box {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12.5px;
}

.hint-box {
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

/* ---------- 登录页 ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(196, 122, 69, 0.18), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(116, 69, 42, 0.14), transparent 46%),
    #f4efe7;
}

.login-card {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(66, 42, 24, 0.18);
}

.login-brand {
  background:
    linear-gradient(160deg, rgba(43, 29, 20, 0.92), rgba(84, 49, 28, 0.96)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 14px);
  color: #f7ecdd;
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.login-brand .brand-mark {
  width: 48px;
  height: 48px;
  font-size: 17px;
  border-radius: 13px;
}

.login-brand h1 {
  font-size: 26px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 22px;
}

.login-brand p {
  font-size: 13px;
  color: rgba(247, 236, 221, 0.62);
  margin-top: 12px;
  line-height: 1.9;
}

.login-brand-foot {
  font-size: 11px;
  color: rgba(247, 236, 221, 0.38);
  letter-spacing: 1px;
}

.login-form {
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form h2 {
  font-size: 21px;
  font-weight: 600;
}

.login-form .sub {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 26px;
}

.login-form .field {
  margin-bottom: 15px;
}

.login-form .btn {
  margin-top: 8px;
  padding: 11px 16px;
  font-size: 14px;
}

.login-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.login-error.show {
  display: block;
}

.login-tip {
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 50px rgba(30, 20, 12, 0.2);
  }
  body.nav-open .sidebar {
    transform: none;
  }
  body.nav-open .overlay {
    display: block;
  }
  #menuBtn {
    display: inline-flex;
  }
  .topbar {
    padding: 16px 18px 12px;
  }
  .topbar h1 {
    font-size: 17px;
  }
  .topbar p {
    display: none;
  }
  .view {
    padding: 4px 18px 32px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .route-picker {
    grid-template-columns: 1fr;
  }
  .kv-row {
    grid-template-columns: 110px minmax(0, 1fr) auto auto;
  }
  .login-card {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 32px 34px;
    gap: 20px;
  }
  .login-brand h1 {
    font-size: 21px;
    margin-top: 14px;
  }
  .login-form {
    padding: 34px;
  }
  .toolbar input[type="search"],
  .toolbar input[type="text"] {
    width: 100%;
  }
  .toolbar select {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px 15px;
  }
  .stat-value {
    font-size: 22px;
  }
  .card {
    padding: 16px 14px;
  }
  .topbar-right span {
    display: none;
  }
  .topbar-right .btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  .kv-row {
    grid-template-columns: 1fr auto auto;
  }
  .kv-key {
    grid-column: 1 / -1;
  }
  .login-brand {
    display: none;
  }
  .login-card {
    grid-template-columns: 1fr;
  }
  .login-form {
    padding: 30px 24px;
  }
  .chart {
    gap: 6px;
  }
  .bar-date {
    font-size: 10px;
  }
}
