/* 皮肤检测仪门店管理后台 · 基础样式
   不依赖前端构建，直接由浏览器加载，部署时无需 npm。 */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e3e6ec;
  --text: #1f2430;
  --muted: #6b7280;
  --brand: #1f6feb;
  --brand-soft: #eaf1fe;
  --ok: #12855b;
  --ok-soft: #e6f5ef;
  --warn: #b26a00;
  --warn-soft: #fdf3e2;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --radius: 10px;
  --sidebar: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans CJK SC", "WenQuanYi Micro Hei", "PingFang SC",
    "Helvetica Neue", "Segoe UI", "PT Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

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

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: #101828;
  color: #cdd5e0;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__brand { color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.sidebar__brand small { display: block; color: #7d8899; font-weight: 400; font-size: 12px; }
.sidebar__group { color: #667085; font-size: 11px; text-transform: uppercase; margin: 16px 8px 6px; letter-spacing: .06em; }
.sidebar a {
  display: block; padding: 8px 10px; border-radius: 8px; color: #cdd5e0; font-size: 14px;
}
.sidebar a:hover { background: #1d2939; text-decoration: none; }
.sidebar a.is-active { background: var(--brand); color: #fff; }

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

.topbar {
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 12px 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.topbar__title { font-size: 16px; font-weight: 600; margin-right: auto; }
.topbar__meta { color: var(--muted); font-size: 13px; }

.content { padding: 20px 22px 40px; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.card__title { font-weight: 600; margin-bottom: 12px; }

.grid { display: grid; gap: 14px; }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat__label { color: var(--muted); font-size: 13px; }
.stat__value { font-size: 26px; font-weight: 600; margin-top: 2px; }
.stat__hint { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
caption { text-align: left; color: var(--muted); font-size: 13px; padding-bottom: 8px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; font-size: 13px; background: #fafbfc; }
tbody th { font-weight: 500; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid transparent; }
.tag--ok { background: var(--ok-soft); color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }
.tag--muted { background: #f1f3f6; color: var(--muted); }
.tag--brand { background: var(--brand-soft); color: var(--brand); }

.btn {
  display: inline-block; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px; line-height: 1.4;
}
.btn:hover { background: #f7f8fa; text-decoration: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: #1a5fd0; }
.btn--danger { color: var(--danger); border-color: #f0c8c2; }
.btn--link { border: none; background: none; color: var(--brand); padding: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

input, select, textarea {
  font: inherit; color: inherit; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; width: 100%;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
select[multiple] { min-height: 120px; }

.field { margin-bottom: 12px; }
.field__label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field__hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.field__error { color: var(--danger); font-size: 12px; margin: 4px 0 0; }
.required::after { content: " *"; color: var(--danger); }

.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.alert--ok { background: var(--ok-soft); color: var(--ok); }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--info { background: var(--brand-soft); color: #1a4fa0; }
.alert--warn { background: var(--warn-soft); color: var(--warn); }

.hint { color: var(--muted); font-size: 12px; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.pager .spacer { flex: 1; }

.empty { text-align: center; color: var(--muted); padding: 36px 10px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px; }
.login-box h1 { font-size: 18px; margin: 0 0 4px; }
.login-box .hint { margin-bottom: 18px; }

/* 错误页 */
.error-code { font-size: 40px; font-weight: 700; color: var(--brand); line-height: 1.1; margin-bottom: 6px; }
.error-box { max-width: 460px; }
.error-box .hint { margin-bottom: 18px; }

.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.bar { height: 8px; border-radius: 999px; background: #eef1f5; overflow: hidden; margin-top: 6px; }
.bar__fill { height: 100%; background: var(--brand); }
.bar__fill--ok { background: var(--ok); }
.bar__fill--warn { background: var(--warn); }
.bar__fill--danger { background: var(--danger); }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 150px; margin-top: 10px; }
.trend__item { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.trend__bar { width: 100%; background: var(--brand-soft); border-radius: 6px 6px 0 0; position: relative; }
.trend__bar span { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 4px; font-size: 12px; color: var(--brand); }
.trend__label { font-size: 11px; color: var(--muted); text-align: center; }

.cond-group { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.cond-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cond-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }

.progress-list { display: flex; flex-direction: column; gap: 8px; }
.progress-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 10px; align-items: center; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; }
  .sidebar__group { display: none; }
  .cond-row { grid-template-columns: 1fr; }
}
