:root {
  color-scheme: light;
  --blue: #0967d9;
  --blue-dark: #0752b3;
  --blue-soft: #eaf3ff;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #162033;
  --muted: #6d7890;
  --line: #dbe4f2;
  --danger: #c92a2a;
  --danger-soft: #fff0f0;
  --success: #087f5b;
  --shadow: 0 8px 28px rgb(29 52 84 / 7%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1080px; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-layout { min-height: 100vh; display: grid; place-items: center; padding: 40px; }
.login-panel { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--blue); font-weight: 800; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--blue); border-radius: 9px; font-size: 18px; }
.login-eyebrow { margin: 38px 0 7px; color: var(--blue); font-weight: 700; font-size: 14px; }
.login-panel h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
.login-panel p { color: var(--muted); line-height: 1.7; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.side { padding: 24px 16px; background: #fff; border-right: 1px solid var(--line); }
.side .brand { padding: 0 10px 28px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { width: 100%; padding: 12px 13px; border: 0; border-radius: 8px; color: #4e5c73; background: transparent; text-align: left; font-weight: 650; }
.nav-item:hover { background: #f3f7fd; color: var(--blue); }
.nav-item.active { background: var(--blue); color: #fff; }
.side-note { margin: 28px 10px 0; color: var(--muted); line-height: 1.6; font-size: 12px; }

.workspace { min-width: 0; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 17px; font-weight: 750; }
.identity { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.identity strong { color: var(--ink); }
.main { max-width: 1450px; padding: 32px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }

.card { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h2, .card h3 { margin: 0; letter-spacing: 0; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.card-subtitle { margin: 7px 0 0; color: var(--muted); line-height: 1.6; font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { min-height: 118px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 12px; color: var(--blue); font-size: 30px; font-weight: 800; }
.metric-hint { margin-top: 8px; color: var(--muted); font-size: 12px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .7fr); gap: 18px; align-items: start; }
.school-layout { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(460px, 1.1fr); gap: 18px; align-items: start; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; color: #33415a; font-size: 13px; font-weight: 650; }
.field.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #bdcae0; border-radius: 7px; outline: none; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(9 103 217 / 13%); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.button { min-height: 40px; padding: 0 15px; border: 1px solid var(--blue); border-radius: 7px; color: var(--blue); background: #fff; font-weight: 700; }
.button:hover { background: var(--blue-soft); }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.danger { color: var(--danger); border-color: #f1a5a5; background: #fff; }
.button.ghost { border-color: var(--line); color: #50607a; }
.button:disabled { cursor: not-allowed; opacity: .55; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: #5c6880; background: #f8faff; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.row-button { border: 0; color: var(--blue); background: transparent; font-weight: 700; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; }
.status.paused, .status.disabled { color: var(--danger); background: var(--danger-soft); }
.status.ready { color: var(--success); background: #e7f8f1; }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.notice { margin: 14px 0 0; padding: 12px 14px; color: #385278; background: #eef5ff; border-left: 3px solid var(--blue); border-radius: 6px; line-height: 1.6; font-size: 13px; }
.alert { margin: 14px 0; padding: 11px 13px; color: #9c1f1f; background: var(--danger-soft); border: 1px solid #ffc8c8; border-radius: 7px; line-height: 1.5; }
.success { margin: 14px 0; padding: 11px 13px; color: #067051; background: #e9faf3; border: 1px solid #bcebd8; border-radius: 7px; line-height: 1.5; }
.hidden { display: none !important; }

.hour-list { display: grid; gap: 8px; }
.hour-row { display: grid; grid-template-columns: 72px 75px 1fr 1fr; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.hour-row input { min-height: 36px; padding: 6px 8px; }
.hour-row .switch-label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.hour-row .switch-label input { width: 16px; min-height: 16px; }
.price-list, .pickup-list { display: grid; gap: 10px; }
.price-row { display: grid; grid-template-columns: 80px 1fr; align-items: end; gap: 10px; }
.pickup-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.pickup-item h3 { margin-bottom: 6px; }
.muted { color: var(--muted); }
.qr-preview { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; }
.qr-preview img { width: 132px; height: 132px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: #fff; }
.qr-placeholder { display: grid; place-items: center; width: 132px; height: 132px; color: var(--muted); border: 1px dashed #b7c6dd; border-radius: 8px; background: #fafcff; text-align: center; font-size: 12px; }
.toast { position: fixed; z-index: 5; right: 24px; bottom: 24px; max-width: 380px; padding: 12px 15px; color: #fff; background: #162033; border-radius: 8px; box-shadow: var(--shadow); }
.toast.error { background: #a61e1e; }

@media (max-width: 1160px) {
  .school-layout, .split { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
