/* 神运碰碰后台类网页的公共样式（ADR-0029 R3）：颜色与字体、布局（左侧导航 + 内容）、按钮与表单、面板、表格、抽屉、弹层、提示、登录页骨架。
   商户台、开发者中心共用；各端自己的样式写在自己的 app.css 里，在它之后加载。 */
:root {
  color-scheme: light;
  --canvas: #eef0f3;
  --surface: #ffffff;
  --ink: #161922;
  --ink2: #3a3f4d;
  --muted: #697083;
  --line: #dadde4;
  --line2: #e8eaef;
  --act: #2f45d8;
  --act-ink: #ffffff;
  --act-soft: #e9ecfd;
  --ticket: #ffd24a;
  --ticket-ink: #3b2a00;
  --ok: #198754;
  --ok-soft: #e4f4ec;
  --warn: #9a6200;
  --warn-soft: #fff4d6;
  --bad: #c93a3a;
  --bad-soft: #fbe9e9;
  --r: 10px;
  --font: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.6 var(--font); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--act); }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: var(--act-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; }
.hidden { display: none !important; }
/* ── 布局 ── */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; background: var(--ink); color: #c9cdd8; }
.rail .shop { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.rail .shop img { width: 34px; height: 34px; flex: none; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.rail .shop > div { min-width: 0; }
.rail .shop b { display: block; color: #fff; font-size: 16px; line-height: 1.3; }
.rail .shop span { font-size: 12px; color: #8b91a3; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.rail nav a:hover { background: #222634; color: #fff; }
.rail nav a.on { background: #fff; color: var(--ink); font-weight: 600; }
.rail nav a .ic { width: 18px; height: 18px; flex: none; }
.rail nav a .badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--ticket); color: var(--ticket-ink); font-size: 12px; font-weight: 600; text-align: center; }
.rail nav .sep { height: 1px; margin: 10px 8px; background: #2a2f3e; }
.rail .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #2a2f3e; font-size: 13px; }
.rail .me b { color: #fff; font-weight: 500; }
.rail .me button { margin-top: 6px; padding: 0; border: 0; background: none; color: #8b91a3; cursor: pointer; }
.rail .me button:hover { color: #fff; }
main { min-width: 0; padding: 28px 36px 60px; }
.page { max-width: 1180px; margin: 0 auto; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.head h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: .01em; }
.head p { margin: 2px 0 0; color: var(--muted); }
.head .grow { flex: 1; }
/* ── 控件 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #b9bdc8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--act); border-color: var(--act); color: var(--act-ink); font-weight: 600; }
.btn.primary:hover { background: #2337c4; }
.btn.big { height: 46px; padding: 0 22px; font-size: 16px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink2); }
.btn.ghost:hover { background: #e3e6ec; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
textarea.input { height: auto; min-height: 76px; padding: 8px 11px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--act); outline: none; box-shadow: 0 0 0 3px var(--act-soft); }
.input[readonly], .input:disabled { background: #f4f5f8; color: var(--muted); }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; }
label.f > small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--act); }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: #e2e5eb; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: var(--ink2); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 25, 34, .12); }
.search { position: relative; }
.search .input { padding-left: 34px; width: 260px; }
.search svg { position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); }
.panel > h2, .sec > h2 { margin: 0; font-size: 15px; font-weight: 650; }
.panel.pad { padding: 20px 22px; }
.sec { margin-top: 26px; }
.sec > h2 { margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; margin-bottom: 6px; color: var(--ink); font-size: 16px; }
.empty .btn { margin-top: 14px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef0f4; color: var(--ink2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.act { background: var(--act-soft); color: var(--act); }
/* ── 表格 ── */
table.t { width: 100%; border-collapse: collapse; }
table.t th { padding: 10px 14px; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line2); }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f7f8fa; }
/* ── 抽屉 ── */
.drawer-mask { position: fixed; inset: 0; z-index: 40; background: rgba(22, 25, 34, .35); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(760px, 100vw); overflow: auto; background: var(--canvas); box-shadow: -12px 0 40px rgba(22, 25, 34, .18); animation: slide .18s ease-out; }
.drawer .dh { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line2); }
.drawer .dh h2 { margin: 0; font-size: 18px; }
.drawer .db { padding: 20px 24px 40px; }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  .drawer { animation: none; }
}
dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; word-break: break-all; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; margin-bottom: 14px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
/* ── 弹层 ── */
.modal-mask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(22, 25, 34, .42); }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px; border-radius: 14px; background: var(--surface); box-shadow: 0 24px 60px rgba(22, 25, 34, .3); }
.modal.wide { width: min(880px, 100%); }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(22, 25, 34, .3); }
.toast.bad { background: var(--bad); }
/* ── 登录 ── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.login .brandline { display: flex; align-items: center; gap: 12px; }
.login .brandline img { width: 40px; height: 40px; border-radius: 10px; }
.login .brandline b { display: block; color: #fff; font-size: 16px; }
.login .brandline small { display: block; color: #8b91a3; font-size: 12px; }
.login .r { display: grid; place-items: center; padding: 40px; }
.login form { width: min(360px, 100%); }
.login form h2 { margin: 0 0 4px; font-size: 22px; }
.login form p { margin: 0 0 22px; color: var(--muted); }
.login .err { min-height: 22px; margin: 4px 0 10px; color: var(--bad); font-size: 13px; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; }
  .rail .shop { padding: 0 8px 0 4px; }
  .rail nav { flex-direction: row; flex-wrap: wrap; }
  .rail nav .sep, .rail .me { display: none; }
  main { padding: 20px 14px 50px; }
  .login { grid-template-columns: 1fr; }
  .search .input { width: 100%; }
}
