/* 租户后台 —— 白底、安静；两个产品各有一个固定颜色，只用在开关与权限标签上。 */
:root {
  --ink: #1D2330;
  --muted: #667085;
  --line: #E4E7EC;
  --surface: #F6F7F9;
  --paper: #FFFFFF;
  --focus: #1D4ED8;
  --danger: #B42318;
  --danger-bg: #FEF3F2;
  --ok: #067647;
  --ok-bg: #ECFDF3;
  --imagegen: #3B5BDB;
  --imagegen-bg: #EDF2FF;
  --recruiting: #0F7B5F;
  --recruiting-bg: #E6F4EF;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei",
          system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 14px/1.6 var(--font);
}
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── 顶栏 ── */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px; height: 56px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; text-decoration: none; }
.brand-mark { display: inline-flex; gap: 3px; }
.brand-mark i { width: 7px; height: 16px; border-radius: 2px; display: block; }
.brand-mark i:first-child { background: var(--imagegen); }
.brand-mark i:last-child { background: var(--recruiting); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: var(--radius-s);
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--surface); }

/* ── 版心 ── */
.page { max-width: 1120px; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 22px; line-height: 1.3; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

section.block { padding: 24px 0; border-top: 1px solid var(--line); }
section.block:first-of-type { border-top: 0; padding-top: 4px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.block-head p { margin: 0; }

/* ── 提示条 ── */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; border-radius: var(--radius-s); margin-bottom: 18px;
}
.notice svg { flex: none; margin-top: 3px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.err { background: var(--danger-bg); color: var(--danger); }

/* ── 表单控件 ── */
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=email], select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid #D0D5DD; border-radius: var(--radius-s);
  padding: 7px 10px; min-width: 0; width: 100%;
}
input:focus, select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > label.field { flex: 1 1 180px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: end; }

.btn {
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-s);
  border: 1px solid #D0D5DD; background: var(--paper); color: var(--ink);
  text-decoration: none;
}
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #333B4D; }
.btn.danger { color: var(--danger); border-color: #FDA29B; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.quiet { border-color: transparent; color: var(--muted); padding: 5px 8px; }
.btn.quiet:hover { color: var(--ink); background: var(--surface); }
.btn.small { padding: 4px 10px; font-size: 13px; }
form.inline { display: inline; margin: 0; }

.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.check {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; user-select: none;
}
.check input { accent-color: var(--ink); margin: 0; }

/* ── 产品色 ── */
.p-imagegen { --p: var(--imagegen); --p-bg: var(--imagegen-bg); }
.p-recruiting { --p: var(--recruiting); --p-bg: var(--recruiting-bg); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 999px; font-size: 12.5px;
  color: var(--p, var(--muted)); background: var(--p-bg, var(--surface));
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.plain::before { display: none; }

/* 开关：一个 POST 按钮，按下即切换 */
.switch {
  font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 10px 3px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
}
.switch .knob {
  width: 30px; height: 18px; border-radius: 999px; background: #D0D5DD; position: relative; flex: none;
  transition: background .15s;
}
.switch .knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; transition: transform .15s;
  box-shadow: 0 1px 2px rgba(16,24,40,.2);
}
.switch[aria-pressed="true"] { color: var(--p, var(--ink)); border-color: var(--p-bg, var(--line)); background: var(--p-bg, var(--surface)); }
.switch[aria-pressed="true"] .knob { background: var(--p, var(--ink)); }
.switch[aria-pressed="true"] .knob::after { transform: translateX(12px); }
.switch:disabled { cursor: not-allowed; opacity: .45; }
@media (prefers-reduced-motion: reduce) { .switch .knob, .switch .knob::after { transition: none; } }

/* ── 产品开通卡：详情页顶部，两块并排 ── */
.products { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.product {
  border: 1px solid var(--line); border-left: 4px solid var(--p); border-radius: var(--radius-m);
  padding: 14px 16px; display: grid; gap: 8px;
}
.product.off { border-left-color: var(--line); }
.product-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.product-name { font-weight: 600; }
.product .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.product .meta a { color: var(--p); text-decoration: none; }
.product .meta a:hover { text-decoration: underline; }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
table.t { width: 100%; border-collapse: collapse; min-width: 720px; }
table.t th, table.t td { padding: 11px 14px; text-align: left; vertical-align: top; }
table.t thead th { font-weight: 500; color: var(--muted); font-size: 13px; background: var(--surface); border-bottom: 1px solid var(--line); }
table.t tbody tr + tr td { border-top: 1px solid var(--line); }
table.t td.right, table.t th.right { text-align: right; }
table.t tr.dim td { color: var(--muted); }
table.t a.rowlink { font-weight: 600; text-decoration: none; }
table.t a.rowlink:hover { text-decoration: underline; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.status.off { color: var(--danger); }
.status.off::before { background: var(--danger); }

/* ── 席位行的展开区 ── */
details.more > summary { list-style: none; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .chev { transition: transform .15s; }
details.more[open] > summary svg { transform: rotate(180deg); }
.seat-panel {
  margin-top: 10px; padding: 14px; background: var(--surface); border-radius: var(--radius-s);
  display: grid; gap: 14px; min-width: 300px;
}
.seat-panel form { display: grid; gap: 8px; }
.seat-panel h3 { margin: 0; font-size: 13px; font-weight: 600; }

/* ── 新建折叠区 ── */
details.create { border: 1px dashed #D0D5DD; border-radius: var(--radius-m); margin-bottom: 14px; }
details.create > summary {
  cursor: pointer; list-style: none; padding: 10px 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
details.create > summary::-webkit-details-marker { display: none; }
details.create[open] > summary { border-bottom: 1px dashed #D0D5DD; }
details.create .create-body { padding: 14px; display: grid; gap: 14px; }

/* ── 凭据 ── */
.cred-group { display: grid; gap: 12px; }
.cred-group + .cred-group { margin-top: 20px; }
.cred-group > h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cred {
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: grid; gap: 10px;
}
.cred-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
@media (max-width: 640px) { .cred-list { grid-template-columns: 1fr; } }
details.cred-edit > summary { list-style: none; cursor: pointer; width: fit-content; }
details.cred-edit > summary::-webkit-details-marker { display: none; }
details.cred-edit[open] > summary .chev, details.cred-edit[open] > summary svg { transform: rotate(180deg); }
.cred-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.cred-current { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.cred-current span b { font-weight: 500; color: var(--muted); margin-right: 4px; }

/* ── 登录 ── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface); }
.login {
  width: 100%; max-width: 360px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 28px; display: grid; gap: 16px;
}
.login .brand { font-size: 17px; }

@media (max-width: 640px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .brand span.brand-text { display: none; }
  .page { padding: 20px 16px 48px; }
  h1 { font-size: 19px; }
}
