/* ==========================================================================
   聚售台 · 授权管理后台  —  纯静态样式，零依赖
   ========================================================================== */

:root {
  --primary: #2f6bff;
  --primary-dark: #1f52d0;
  --primary-soft: #eef3ff;
  --primary-line: #c9d9ff;

  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e6eaf2;
  --line-strong: #d5dbe8;

  /* 后台是浅色界面：显式声明，避免浏览器处于深色模式时
     把输入框、复选框、日期选择器等原生控件渲染成深色而显得"显示异常" */
  color-scheme: light;

  --text: #1f2430;
  --text-2: #5a6478;
  --text-3: #8b94a8;

  --green: #17a673;
  --green-soft: #e8f7f0;
  --green-line: #b7e6d3;

  --red: #e2453c;
  --red-soft: #fdeceb;
  --red-line: #f6c5c1;

  --amber: #d98a00;
  --amber-soft: #fdf3e2;
  --amber-line: #f2dcaa;

  --gray: #6b7688;
  --gray-soft: #f0f2f7;
  --gray-line: #dfe3ec;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 14px;

  --shadow: 0 1px 2px rgba(23, 32, 56, .05), 0 6px 18px rgba(23, 32, 56, .06);
  --shadow-lg: 0 10px 40px rgba(23, 32, 56, .18);
  --ring: 0 0 0 3px rgba(47, 107, 255, .16);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
}
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ------------------------------ 通用控件 ------------------------------ */

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #f7f9fd; border-color: #c2cadb; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after { border-color: rgba(47, 107, 255, .3); border-top-color: var(--primary); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(47, 107, 255, .3);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-danger { background: #fff; border-color: var(--red-line); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); }

.btn-ghost { background: #fff; }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; padding: 10px 14px; font-size: 15px; }

.icon-btn {
  appearance: none; border: none; background: transparent;
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--text-3); font-size: 15px; cursor: pointer; line-height: 1;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

.input {
  appearance: none;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #6e7686; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input.narrow { max-width: 240px; }
.input.select { padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #8590a6 50%), linear-gradient(135deg, #8590a6 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.input.textarea { resize: vertical; min-height: 84px; line-height: 1.6; max-width: 620px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }

.inline-label { font-size: 12.5px; color: var(--text-3); margin: 0 2px 0 6px; white-space: nowrap; }

.req { color: var(--red); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; flex: none;
  width: 42px; height: 24px; border-radius: 999px;
  background: #cfd6e4; transition: background .18s;
}
.switch-dot {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-text { font-size: 13.5px; color: var(--text-2); }

/* ------------------------------ 登录页 ------------------------------ */

.login-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(900px 420px at 12% -10%, #e8efff 0%, rgba(232, 239, 255, 0) 62%),
    radial-gradient(760px 380px at 92% 0%, #eef6ff 0%, rgba(238, 246, 255, 0) 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 396px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px 24px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark {
  flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--primary) 0%, #5b8bff 100%);
  color: #fff; font-size: 20px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(47, 107, 255, .32);
}
.brand-mark.small { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 10px rgba(47, 107, 255, .28); }
.brand-title { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--text-3); letter-spacing: .4px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.6; }

/* 登录框里的输入框：即使哪次改版又忘了写 class="input"，也不能再退化成
   浏览器原生的小方框（2026-09 就是这样漏了，输入区显示异常）。 */
.login-card input:not([type="checkbox"]):not([type="radio"]) {
  appearance: none;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input::placeholder { color: #6e7686; }
.login-card input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.alert {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-error { background: var(--red-soft); border-color: var(--red-line); color: #b3322a; }
.alert-ok { background: var(--green-soft); border-color: var(--green-line); color: #0f7a55; }
.alert-warn { background: var(--amber-soft); border-color: var(--amber-line); color: #8f5c00; }

/* ------------------------------ 框架布局 ------------------------------ */

.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 15.5px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 10px;
  background: var(--gray-soft);
  border-radius: 999px;
  font-size: 13px; color: var(--text-2);
}
.user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.layout { flex: 1; display: flex; align-items: flex-start; min-height: 0; }

.sidebar {
  width: 200px; flex: none;
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  border-right: 1px solid var(--line);
  background: #fff;
  display: flex; flex-direction: column;
  padding: 14px 10px;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  appearance: none; border: none; background: transparent;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; color: var(--text-2);
  cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--gray-soft); color: var(--text); }
.nav-item:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--primary); }
.nav-ico { width: 18px; text-align: center; font-size: 14px; color: var(--text-3); }
.sidebar-foot { margin-top: auto; padding: 12px 12px 4px; border-top: 1px solid var(--line); }
.sidebar-foot-line { font-size: 11.5px; color: var(--text-3); }
.sidebar-foot-path { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-2); }

.main { flex: 1; min-width: 0; padding: 20px 22px 40px; }

/* ------------------------------ 视图通用 ------------------------------ */

.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.view-title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.view-actions { display: flex; align-items: center; gap: 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.card-title { margin: 0; font-size: 15px; font-weight: 600; }
.card-sub { margin: 4px 0 6px; font-size: 12.5px; color: var(--text-3); }

.toolbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-group.grow { flex: 1; min-width: 260px; }
.toolbar-group.grow .input[type="search"] { max-width: 380px; }

.loading-block { padding: 34px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.loading-block::before {
  content: ""; display: inline-block;
  width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--primary-line); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ 统计卡片 ------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 17px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary); opacity: .9;
}
.stat-card.tone-green::before { background: var(--green); }
.stat-card.tone-red::before { background: var(--red); }
.stat-card.tone-amber::before { background: var(--amber); }
.stat-card.tone-gray::before { background: var(--gray); }
.stat-label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 25px; font-weight: 600; letter-spacing: .3px; margin-top: 4px; line-height: 1.25; }
.stat-value.text { font-size: 16px; font-weight: 600; }
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.stat-card.slim .stat-value { font-size: 17px; }
.stat-split { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.stat-split-item { font-size: 12.5px; color: var(--text-2); }
.stat-split-item b { font-weight: 600; color: var(--text); }

.section-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin: 22px 2px 10px; }

/* ------------------------------ 表格 ------------------------------ */

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 10px 14px; text-align: left; vertical-align: middle; }
table.tbl thead th {
  background: #fafbfe;
  color: var(--text-2);
  font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.tbl tbody tr { border-bottom: 1px solid #f1f3f9; transition: background .12s; }
table.tbl tbody tr:last-child { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--primary-soft); }
table.tbl td.actions { white-space: nowrap; }
table.tbl .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.tbl td.empty {
  text-align: center; color: var(--text-3); padding: 40px 14px; font-size: 13.5px;
  background: #fff;
}
table.tbl.compact th, table.tbl.compact td { padding: 8px 11px; font-size: 13px; }

.mini-btn {
  appearance: none; border: 1px solid var(--line-strong); background: #fff;
  padding: 3px 9px; border-radius: 6px; font: inherit; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.mini-btn:hover:not(:disabled) { border-color: var(--primary-line); color: var(--primary); background: #f6f9ff; }
.mini-btn:disabled { opacity: .5; cursor: not-allowed; }
.mini-btn.danger { color: var(--red); border-color: var(--red-line); }
.mini-btn.danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.mini-btn.is-loading { color: transparent !important; position: relative; }
.mini-btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 10px; height: 10px; border: 2px solid var(--primary-line);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.7; white-space: nowrap;
  background: var(--gray-soft); color: var(--gray); border: 1px solid var(--gray-line);
}
.badge-ok { background: var(--green-soft); color: #0f7a55; border-color: var(--green-line); }
.badge-off { background: var(--gray-soft); color: var(--gray); border-color: var(--gray-line); }
.badge-danger { background: var(--red-soft); color: #b3322a; border-color: var(--red-line); }
.badge-warn { background: var(--amber-soft); color: #8f5c00; border-color: var(--amber-line); }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary-line); }

.key-cell { display: flex; align-items: center; gap: 8px; }
.key-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--text); }
.copy-mini {
  appearance: none; border: none; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 13px; padding: 2px; border-radius: 5px;
}
.copy-mini:hover { color: var(--primary); background: var(--primary-soft); }

/* 行内「更多」菜单 */
.row-menu {
  position: fixed; z-index: 150;
  min-width: 216px; padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: pop .13s ease-out;
}
.row-menu-item {
  display: block; width: 100%; text-align: left;
  appearance: none; border: none; background: transparent;
  padding: 8px 11px; border-radius: 6px;
  font: inherit; font-size: 13.5px; color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.row-menu-item:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary-dark); }
.row-menu-item:disabled { color: var(--text-3); cursor: not-allowed; }
.row-menu-item.danger { color: var(--red); }
.row-menu-item.danger:hover:not(:disabled) { background: var(--red-soft); color: var(--red); }
.row-menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ------------------------------ 分页 ------------------------------ */

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line);
  flex-wrap: wrap; background: #fcfdff;
}
.pager-info { font-size: 13px; color: var(--text-2); }
.pager-info b { font-weight: 600; color: var(--text); }
.pager-ctrl { display: flex; align-items: center; gap: 8px; }

/* ------------------------------ 设置表单 ------------------------------ */

.form-grid { padding: 6px 18px 18px; }
.form-row {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.form-row:last-child { border-bottom: none; }
.form-row > label {
  flex: none; width: 190px; padding-top: 8px;
  font-size: 13.5px; color: var(--text-2); text-align: right;
}
.form-ctrl { flex: 1; min-width: 0; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.65; }
.form-actions { border-bottom: none; padding-top: 16px; }

/* ------------------------------ 弹窗 / 抽屉 ------------------------------ */

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 26, 40, .42);
  backdrop-filter: blur(1px);
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

.modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; overflow: auto; }
.modal-dialog {
  width: 100%; max-width: 520px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
  display: flex; flex-direction: column;
  max-height: 88vh;
}
.modal-dialog.wide { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.modal-title { margin: 0; font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 13px 18px; border-top: 1px solid var(--line);
  background: #fbfcff;
}
.modal-foot:empty { display: none; }

.drawer { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: flex-end; }
.drawer-panel {
  width: 100%; max-width: 880px; height: 100%;
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slide-in .2s ease-out;
}
.drawer-body { flex: 1; overflow: auto; padding: 18px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcff; display: flex; justify-content: flex-end; gap: 10px; }
.drawer-foot:empty { display: none; }

.dlg-text { font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.dlg-text b { color: var(--text); }
.dlg-text code { font-family: ui-monospace, Consolas, monospace; background: var(--gray-soft); padding: 1px 6px; border-radius: 5px; }

.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; min-width: 0; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }

.radio-line { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-line label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.radio-line input[type="radio"] { accent-color: var(--primary); }

/* 生成结果 */
.plain-box {
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px; color: #8f5c00;
  margin-bottom: 14px;
}
.plain-list {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcff; max-height: 300px; overflow: auto; margin-bottom: 14px;
}
.plain-list .plain-head {
  position: sticky; top: 0; background: #fafbfe; border-bottom: 1px solid var(--line);
  padding: 7px 12px; font-size: 12px; color: var(--text-3);
}
.plain-list ol { margin: 0; padding: 8px 0; list-style: none; }
.plain-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px;
}
.plain-list li:hover { background: var(--primary-soft); }
.plain-list .idx { color: var(--text-3); font-size: 12px; min-width: 26px; text-align: right; font-family: inherit; }

/* 详情 */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 2px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 20px;
}
.detail-item { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.detail-item .k { font-size: 12px; color: var(--text-3); }
.detail-item .v { font-size: 13.5px; color: var(--text); word-break: break-all; margin-top: 2px; }
.detail-item .v.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.sub-title { font-size: 14px; font-weight: 600; }
.sub-title .count { font-weight: 400; color: var(--text-3); font-size: 12.5px; margin-left: 6px; }
.log-action { font-size: 12.5px; }
.log-detail { color: var(--text-2); max-width: 320px; word-break: break-all; }
.log-detail.empty-detail { color: var(--text-3); }

/* ------------------------------ toast ------------------------------ */

.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 220px; max-width: 380px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gray);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px; color: var(--text);
  display: flex; align-items: flex-start; gap: 9px;
  animation: pop .18s ease-out;
  transition: opacity .25s, transform .25s;
}
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-ok { border-left-color: var(--green); }
.toast-err { border-left-color: var(--red); }
.toast-ico { flex: none; font-size: 13px; line-height: 1.5; }
.toast-ok .toast-ico { color: var(--green); }
.toast-err .toast-ico { color: var(--red); }
.toast-msg { word-break: break-word; }

/* ------------------------------ 窄屏适配 ------------------------------ */

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; flex: 1 1 auto; justify-content: center; }
  .sidebar-foot { display: none; }
  .main { padding: 16px 14px 36px; }
  .form-row { flex-direction: column; gap: 6px; }
  .form-row > label { width: auto; text-align: left; padding-top: 0; }
  .input.narrow { max-width: 100%; }
  .drawer-panel { max-width: 100%; }
  .toast-wrap { left: 14px; right: 14px; align-items: stretch; }
}

/* ---------------------------------------------------------------- 套餐快捷选择 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  border: 1px solid #d8e0ee;
  border-radius: 999px;
  background: #fff;
  color: #33415c;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: #2f6bff; color: #2f6bff; }
.chip.active { background: #2f6bff; border-color: #2f6bff; color: #fff; }
