/* ============================================================
   星灼 · 口腔商城商家中心（商家后台 / 独立系统）
   样式独立于运营平台 index.html，自包含，可单独部署。
   ============================================================ */
* { box-sizing: border-box; }
:root {
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --sidew: 220px;
  --radius: 12px;
}
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink); background: var(--bg); font-size: 13.5px;
}
a { color: var(--brand); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 13px; }
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
#loginPage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #38bdf8 100%); padding: 20px;
}
.login-box {
  width: 360px; background: #fff; border-radius: 16px; padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.login-box h1 { font-size: 20px; margin: 0 0 4px; }
.login-box .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.login-box label { display: block; margin: 12px 0 6px; color: var(--ink-2); font-size: 12.5px; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.login-box .btn { width: 100%; margin-top: 18px; }
.login-foot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }
#err { color: var(--red); margin-top: 10px; font-size: 12.5px; min-height: 16px; }
#err2 { color: var(--red); margin-top: 10px; font-size: 12.5px; min-height: 16px; }
.login-opt { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; }
.login-opt .chk { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.login-opt .forgot-link { color: var(--brand); text-decoration: underline; white-space: nowrap; }
.fg-row { display: flex; gap: 8px; }
.fg-row input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.fg-row .btn { flex-shrink: 0; white-space: nowrap; }
#forgotForm label { display: block; margin: 12px 0 6px; color: var(--ink-2); font-size: 12.5px; }
/* 密码显隐（眼睛） */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 4px; color: #94a3b8; }
.pw-eye:hover { color: var(--brand); }

/* ---------- 主布局 ---------- */
#mainPage { display: none; height: 100vh; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 18px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.topbar .logo { font-weight: 800; font-size: 15px; letter-spacing: .3px; }
.topbar .logo small { color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 6px; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; flex: 1; }
.topbar .who { color: var(--ink-2); font-size: 12.5px; }
.topbar .btn { margin-left: 6px; }
.wrap { display: flex; height: calc(100vh - 56px); }
.sidebar {
  width: var(--sidew); background: #fff; border-right: 1px solid var(--line);
  padding: 14px 0; overflow-y: auto; flex-shrink: 0;
}
.nav-group { margin-bottom: 8px; }
.nav-group-label { padding: 8px 18px 4px; font-size: 11px; color: #94a3b8; letter-spacing: .2px; }
.nav-group button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 9px 18px; color: var(--ink-2); cursor: pointer; font-size: 13px;
}
.nav-group button:hover { background: #f8fafc; }
.nav-group button.on { background: #eff6ff; color: var(--brand); font-weight: 600; border-right: 3px solid var(--brand); }
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ---------- 组件 ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.panel h4 { margin: 12px 0 8px; font-size: 13.5px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-bottom: 14px; }
.empty { color: #94a3b8; text-align: center; padding: 22px; font-size: 12.5px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 10px; align-items: center; }
.card .icon { font-size: 22px; }
.card .lbl { color: var(--muted); font-size: 12px; }
.card .num { font-size: 18px; font-weight: 700; margin-top: 2px; }
.card.c1 { border-left: 3px solid var(--brand); }
.card.c2 { border-left: 3px solid var(--green); }
.card.c3 { border-left: 3px solid var(--amber); }
.card.c4 { border-left: 3px solid var(--red); }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th { text-align: left; font-size: 12px; color: var(--muted); padding: 10px 10px; background: #f8fafc; border-bottom: 1px solid var(--line); }
td { padding: 10px; font-size: 12.5px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink-2); padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 12.5px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-p { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-p:hover { background: var(--brand-2); color: #fff; }
.btn-g { border-color: #cbd5e1; color: var(--ink-2); }
.btn-d { border-color: #fca5a5; color: var(--red); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; }
.b-b { background: #dbeafe; color: #1d4ed8; }
.b-g { background: #d1fae5; color: #047857; }
.b-y { background: #fef3c7; color: #b45309; }
.b-r { background: #fee2e2; color: #b91c1c; }
.b-n { background: #f1f5f9; color: #475569; }

.toolbar { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
/* 状态页签（京东/淘宝商家后台式） */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
/* 快捷入口 */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick .q { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; cursor: pointer; }
.quick .q:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(37,99,235,.08); }
.quick .q .i { font-size: 22px; }
.quick .q .t { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.row { display: flex; flex-direction: column; margin: 10px 0; }
.row label { font-size: 12px; color: var(--ink-2); margin-bottom: 5px; }
.row input, .row select, .row textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.row textarea { min-height: 60px; resize: vertical; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 520px; max-width: 96vw; max-height: 90vh; overflow-y: auto; }

/* 物流时间线 */
.tl { margin: 12px 0; }
.tl .t { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.tl .t span { color: var(--muted); min-width: 120px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff; padding: 10px 22px; border-radius: 10px;
  font-size: 13px; opacity: 0; transition: opacity .2s; z-index: 200; pointer-events: none;
}
