/* ============================================================
   三端共用基础样式：设计变量 + 布局 + 组件 + 动效
   改配色 / 间距只需改 :root，三端同时生效
   ============================================================ */

:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-light: #818cf8;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;

  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --border: #e2e8f0;   /* 旧名别名：页面内联样式在用 */
  --danger: #ef4444;  /* 同上 */
  --bg: #f8fafc;
  --surface: #ffffff;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10), 0 4px 8px rgba(15, 23, 42, .04);
  --shadow-brand: 0 8px 24px rgba(79, 70, 229, .28);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 数字用等宽字形，表格里的金额列不会跳动 */
code, .money, .value, td, th { font-variant-numeric: tabular-nums; }

/* ---------- 动效基元 ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Vue 切页时重播动画：用 key 强制重建节点 */
.tab-enter-active { animation: fadeInUp .32s var(--ease-out) both; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1000px 600px at 15% 10%, rgba(129, 140, 248, .35), transparent 60%),
    radial-gradient(900px 700px at 85% 90%, rgba(56, 189, 248, .28), transparent 60%),
    linear-gradient(140deg, #4f46e5 0%, #4338ca 45%, #1e1b4b 100%);
}
.login-card {
  width: 396px;
  max-width: 100%;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp .5s var(--ease-out) both;
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -.02em;
}
.login-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 26px;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
/* 选填标记。跟在标签文字后面而不是放进括号：
   括号在 12.5px 下容易读成字段名的一部分。 */
.field label .opt {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  margin-left: 4px;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field input::placeholder { color: var(--muted); }
.field input:hover:not(:focus) { border-color: #cbd5e1; }
.field input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
}

/* 多行输入。与 .field input 同一套外观，
   额外支持纵向拖拽和自适应宽度，避免默认样式把框撑成固定像素宽。 */
.field textarea,
textarea.pds-textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.7;
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field textarea::placeholder,
textarea.pds-textarea::placeholder { color: var(--muted); }
.field textarea:hover:not(:focus),
textarea.pds-textarea:hover:not(:focus) { border-color: #cbd5e1; }
.field textarea:focus,
textarea.pds-textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
}

.btn {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), opacity .2s var(--ease);
  box-shadow: var(--shadow-brand);
}
.btn:hover:not(:disabled) {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, .34);
}
.btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.btn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.btn.ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.btn.ghost:hover:not(:disabled) {
  background: #fff;
  border-color: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: var(--shadow-sm);
}

/* 表格行内小按钮（审核通过 / 驳回） */
.mini {
  padding: 4px 11px;
  margin-right: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.mini:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: #eef2ff;
  transform: translateY(-1px);
}
.mini:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 提示条 ----------
   显隐由 v-if 控制，样式默认可见。
   不要改成 display:none + .show：Vue 侧只绑 type 类名，不会补 .show。 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  animation: fadeInUp .3s var(--ease-out) both;
}
.alert.err  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert.ok   { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert.info { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }

/* ---------- 管理端布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 216px;
  background: linear-gradient(180deg, #0f172a 0%, #111c34 100%);
  color: rgba(255, 255, 255, .62);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .logo {
  padding: 22px 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.side .nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

/* 导航项是 div 而非 a：不再作为链接，避免浏览器状态栏出现目标地址。
   同时兼容 a 标签，供退出登录等语义化链接复用同一套外观。 */
.side .nav > a,
.side .nav > div {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, .62);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.side .nav > a::before,
.side .nav > div::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--brand-light);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height .25s var(--ease);
}
.side .nav > a:hover,
.side .nav > div:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  transform: translateX(2px);
}
.side .nav > a.on,
.side .nav > div.on {
  color: #fff;
  background: linear-gradient(90deg, rgba(79, 70, 229, .28), rgba(79, 70, 229, .06));
  font-weight: 600;
}
.side .nav > a.on::before,
.side .nav > div.on::before { height: 20px; }
.side .foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px;
  color: rgba(255, 255, 255, .4);
}

.main { flex: 1; padding: 26px 30px; min-width: 0; }
.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -.02em;
  animation: fadeInUp .3s var(--ease-out) both;
}

/* ---------- 卡片 / 统计 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  animation: fadeInUp .4s var(--ease-out) both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }
.card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.card:hover::after { opacity: 1; }
.card .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.card .value.money { color: var(--brand); }
.card .extra { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 推广面板（代理端） ---------- */
/* 链接只读但仍需可点可复制，所以不像禁用态那样灰掉 */
.link-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}
.link-input:focus { border-color: var(--brand-light); background: #fff; }
.copy-row { display: flex; gap: 10px; align-items: center; }
.copy-row .btn { width: auto; flex: none; margin: 0; padding: 9px 18px; }

/* 二维码与链接左右排布 */
.share-box {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 18px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.qr {
  flex: none;
  width: 148px;
  height: 148px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.qr svg { display: block; width: 100%; height: 100%; }
.share-side { flex: 1; min-width: 0; }
.share-side .field:last-child { margin-bottom: 0; }

/* 推广面板底部操作区 */
.share-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}
.share-cta .btn { width: auto; margin: 0; padding: 10px 22px; }

/* ---------- 邮件设置面板（管理端） ---------- */
/* 两列排布，窄屏回落单列 */
.mail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
@media (max-width: 720px) {
  .mail-grid { grid-template-columns: minmax(0, 1fr); }
}
/* 下拉框与输入框视觉统一：原样式只覆盖了 input */
.field select {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}
.field select:focus { border-color: var(--brand-light); }

/* 事件勾选项 */
.evt-list { display: flex; flex-wrap: wrap; gap: 10px; }
.evt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.evt:hover { border-color: #c7d2fe; background: #fbfcff; }
.evt input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.evt:has(input:checked) {
  border-color: var(--brand-light);
  background: rgba(79, 70, 229, .06);
}

/* ---------- 系统配置分组页签 ---------- */
/* 页签内滚动的是表格区域，页签本身吸顶，长列表切换分组时不会滚出去 */
.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  user-select: none;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.sub-tab:hover { border-color: #c7d2fe; background: #fbfcff; }
.sub-tab.on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
/* 页签右侧的参数数量，方便一眼看出哪组最重 */
.sub-tab em {
  font-style: normal;
  font-size: 11.5px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  color: var(--muted);
}
.sub-tab.on em { background: rgba(255, 255, 255, .22); color: #fff; }

/* 同一客户当天可能有多笔待支付任务，每笔独立成卡，避免凭证串填 */
.task-card { padding: 16px 0; border-bottom: 1px solid var(--line, #eef0f4); }
.task-card:last-child { border-bottom: 0; }
.task-card > .balance { margin-bottom: 12px; }
.done-box { margin-top: 12px; font-size: 13px; color: var(--muted); }
.done-box summary { cursor: pointer; padding: 6px 0; user-select: none; }
.done-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line, #eef0f4); }

.hint { margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- 冷却期对照表（系统配置 → 派单规则） ---------- */
.cd-box {
  margin-top: 18px;
  padding: 16px 18px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cd-title {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.cd-title span {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.cd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cd-table th {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.cd-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f1f4;
}
/* 「跑不起来」标红，其余按建议档位正常显示 */
.cd-tag {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11.5px;
  color: var(--muted);
  background: #eef0f3;
  border-radius: 999px;
}
.cd-tag.on {
  color: #047857;
  background: rgba(16, 185, 129, .12);
}
.cd-foot {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}
.cd-foot b { color: #b45309; font-weight: 600; }

/* 近 7 日柱状图。纯 CSS，不引图表库 */
.trend {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.trend-col { flex: 1; text-align: center; }
.bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  justify-content: center;
  height: 96px;
}
.bar {
  display: block;
  width: 9px;
  min-height: 0;
  border-radius: 3px 3px 0 0;
  transition: height .4s var(--ease-out);
}
.bar.v { background: var(--brand-light); }
.bar.r { background: #10b981; }
.trend-col .lb {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .share-box { flex-direction: column; align-items: center; }
  .share-side { width: 100%; }
}

/* ---------- 金额卡 ---------- */
.balance {
  position: relative;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp .4s var(--ease-out) both;
}
/* 高光层：斜向光带，悬停时缓慢移动 */
.balance::before {
  content: '';
  position: absolute;
  top: -60%; left: -40%;
  width: 60%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
  transform: rotate(18deg);
  transition: left .7s var(--ease);
}
.balance:hover::before { left: 120%; }
.balance::after {
  content: '';
  position: absolute;
  right: -30px; bottom: -50px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.balance > * { position: relative; z-index: 1; }
.balance .l { font-size: 13px; opacity: .9; font-weight: 500; }
.balance .v {
  font-size: 32px;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.balance .d { font-size: 12.5px; opacity: .88; margin-top: 8px; }

.balance.brand   { background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%); }
.balance.success { background: linear-gradient(135deg, #059669 0%, #10b981 55%, #34d399 100%); }
.balance.warn    { background: linear-gradient(135deg, #d97706 0%, #f59e0b 55%, #fbbf24 100%); }

/* ---------- 面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 22px;
  margin-bottom: 20px;
  animation: fadeInUp .35s var(--ease-out) both;
}
.panel h3 {
  margin: 0 0 16px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.panel h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* 面板内的信息块（余额 / 缴费单详情） */
.who {
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  animation: fadeInUp .3s var(--ease-out) both;
}
.who h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.who p { margin: 0 0 4px; color: var(--text-2); font-size: 13px; }

/* ---------- 顶部栏（用户端 / 代理端） ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .t { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.topbar a { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 13px; transition: color .2s var(--ease); }
.topbar a:hover { color: var(--err); }

/* ---------- 页签 ---------- */
.tabs {
  display: flex;
  /* 不用 stretch：会把页签拉到与容器同高，下划线(bottom:0)被推到远离文字的底部 */
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 53px;
  z-index: 19;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { height: 0; }

/* 不参与等分：flex 默认会把子项拉伸到等宽，
   导致选中底色和下划线随容器撑满，页签数量不同宽度就完全不一样 */
.tabs > div {
  flex: 0 0 auto;
  position: relative;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
/* 下划线画在页签内部（bottom: 0）。
   之前用 bottom:-11px 想落在分隔线上，但 .tabs 带 overflow-x:auto
   会形成裁剪区，超出容器的部分被切掉——客户端整条消失、代理端只剩半截。 */
.tabs > div::after {
  content: '';
  position: absolute;
  left: 18px; bottom: 0;
  width: 0; height: 3px;
  background: var(--brand);
  border-radius: 3px;
  transition: width .3s var(--ease-out);
}
.tabs > div:hover { color: var(--brand); background: #f1f5f9; }
.tabs > div.on { color: var(--brand); font-weight: 600; background: #eef2ff; }
.tabs > div.on::after { width: calc(100% - 36px); }

/* 内容容器 */
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  background: #f8fafc;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
tbody tr { transition: background .18s var(--ease); }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

/* ===== 自定义弹窗 ===== */
/* 替代 window.alert/confirm/prompt。遮罩居中、背景模糊，
   避免原生弹窗在移动端样式失控、且无法约束输入。 */
.pds-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 18, 34, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s var(--ease);
}
.pds-modal-mask.on { opacity: 1; visibility: visible; }

.pds-modal {
  width: 100%;
  max-width: 400px;
  padding: 22px 24px 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  transform: translateY(14px) scale(.97);
  transition: transform .26s var(--ease-out);
}
.pds-modal-mask.on .pds-modal { transform: translateY(0) scale(1); }

.pds-modal-title { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.pds-modal-text {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2, #4a4f5c);
  white-space: pre-wrap;
}
.pds-modal-field { margin-bottom: 12px; }
.pds-modal-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.pds-modal-input:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.pds-modal-err { margin: 0 0 6px; font-size: 12.5px; color: #cf1322; min-height: 0; }
.pds-modal-err:empty { display: none; }

.pds-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.pds-modal-actions .btn { width: auto; min-width: 84px; margin: 0; padding: 9px 18px; }

/* ===== 列表内搜索框 ===== */
/* 宽度固定 320px，聚焦时描边转品牌色；清除键靠右内嵌 */
.search-wrap { position: relative; width: 320px; max-width: 100%; margin-bottom: 12px; }
.search {
  display: block;
  width: 100%;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search.has-clear { padding-right: 30px; }
.search::placeholder { color: var(--muted); }
.search:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.search-clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  background: rgba(0, 0, 0, .06);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover { color: #fff; background: #cf1322; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 34px 20px;
  font-size: 13.5px;
  animation: fadeIn .3s var(--ease) both;
}
.empty::before {
  content: '';
  display: block;
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  opacity: .8;
}

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.tag.g { background: #ecfdf5; color: #047857; }
.tag.o { background: #fffbeb; color: #b45309; }
.tag.r { background: #fef2f2; color: #b91c1c; }
.tag.b { background: #eef2ff; color: #4338ca; }

/* ---------- 导航待办角标 ---------- */
.badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--err);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
  animation: fadeIn .25s var(--ease) both;
}
/* 审核主入口红色角标 */
.badge-red { background: #dc2626 !important; }
/* 审核子页签 */
.audit-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.audit-subnav button { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; font-family: inherit; transition: all .15s; }
.audit-subnav button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.audit-subnav button .badge { margin-left: 5px; }
/* 审核摘要卡 */
.audit-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; margin-bottom: 14px; }
.audit-summary .sc { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.audit-summary .sc .sv { font-size: 22px; font-weight: 700; color: var(--brand); }
.audit-summary .sc .sl { font-size: 12px; color: var(--muted); margin-top: 3px; }
.audit-summary .sc.red .sv { color: var(--err); }

/* ---------- 弹层（转移归属等） ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .2s var(--ease) both;
}
.modal {
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp .28s var(--ease-out) both;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 700; }
.modal-sub { margin: 0 0 18px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.modal-hint {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.modal .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
}

/* 申请条件与当前条件不一致时的提示（退出申请审核用） */
tr.changed { background: #fffbeb; }
tr.changed:hover { background: #fef3c7; }
.flag-drift {
  margin-top: 4px;
  padding: 2px 7px;
  display: inline-block;
  border-radius: 5px;
  background: #fef3c7;
  color: #b45309;
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------- 加载态 ---------- */
.loading {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .side .nav { display: flex; overflow-x: auto; padding: 8px 10px; }
  .side .nav > a,
  .side .nav > div { white-space: nowrap; margin-bottom: 0; }
  .side .nav > a::before,
  .side .nav > div::before { display: none; }
  .side .foot { display: none; }
  .main { padding: 18px 16px; }
  .wrap { padding: 16px; }
  .tabs { top: 0; padding: 8px 12px; }
  .topbar { padding: 12px 16px; }
  table { font-size: 12px; }
  th, td { padding: 9px 8px; }
}

/* ---------- 尊重系统「减弱动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
