:root {
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .48), rgba(255, 255, 255, .22));
  --glass-border: rgba(255, 255, 255, .65);
  --glass-shadow: 0 8px 32px rgba(50, 60, 160, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
  --text: #1d2333;
  --muted: #5b6478;
  --primary: #5b5bd6;
  --primary-strong: #4338ca;
  --primary-soft: rgba(91, 91, 214, .12);
  --danger: #e5484d;
  --ok: #30a46c;
  --warn: #c98912;
  --radius: 22px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(129, 140, 248, .45), transparent 60%),
    radial-gradient(900px 560px at -12% 28%, rgba(192, 132, 252, .38), transparent 58%),
    radial-gradient(1000px 640px at 55% 118%, rgba(244, 114, 182, .30), transparent 60%),
    linear-gradient(160deg, #eef1ff 0%, #f3efff 45%, #fdf2fb 100%);
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 液态玻璃基础 ===== */
.glass,
.card,
.topbar,
.table-wrap,
.tabs,
.filter-bar,
.modal,
.flash,
.panel,
.stat {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ===== 顶栏 ===== */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 18px 0;
  padding: 10px 18px;
  border-radius: 20px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
  background: linear-gradient(120deg, #4f46e5, #9333ea 70%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.brand-logo { width: 28px; height: 28px; flex: none; border-radius: 6px; box-shadow: 0 2px 8px rgba(60, 70, 160, .18); }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.topbar nav a {
  color: #4b5563;
  padding: 7px 13px;
  border-radius: 11px;
  font-weight: 500;
  transition: background .18s, color .18s;
}
.topbar nav a:hover {
  background: rgba(255, 255, 255, .92);
  color: var(--primary-strong);
  box-shadow: 0 4px 14px rgba(60, 70, 160, .18);
  text-decoration: none;
}
.topbar .userbox {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  color: #4b5563;
  white-space: nowrap;
}
.topbar .userbox .user-name { font-weight: 600; margin-right: 8px; }
.topbar .userbox a { color: #6b7280; padding: 6px 10px; border-radius: 9px; }
.topbar .userbox a:hover { background: rgba(255, 255, 255, .7); color: var(--text); text-decoration: none; }

/* ===== 手机端抽屉菜单 ===== */
.menu-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 13px;
  background: rgba(255, 255, 255, .42);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 2px 10px rgba(60, 70, 160, .12), inset 0 1px 0 rgba(255, 255, 255, .85);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #4338ca;
  transition: transform .25s ease, opacity .2s ease;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(30, 35, 80, .38);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  width: min(132px, 40vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.46));
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  backdrop-filter: blur(40px) saturate(200%);
  border-left: 1px solid rgba(255, 255, 255, .75);
  box-shadow: -18px 0 50px rgba(50, 60, 160, .22), inset 1px 0 0 rgba(255, 255, 255, .9);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .38s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .38s;
}
.drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .38s cubic-bezier(.2, .8, .3, 1);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .75);
}
.drawer-head .brand { font-size: 0; }
.drawer-head .brand { display: flex; align-items: center; gap: 10px; line-height: 1; }
.drawer-head .brand .brand-logo { margin: 0; }
.drawer-head .brand .brand-logo { width: 20px; height: 20px; }
.drawer-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .6);
  color: #4b5563;
  font-size: 13px;
  cursor: pointer;
}
.drawer nav { display: flex; flex-direction: column; gap: 2px; }
.drawer nav a {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 4px 12px rgba(60, 70, 160, .08);
  color: #3f4756;
  font-weight: 600;
  transition: background .18s;
}
.drawer nav a:hover {
  background: rgba(255, 255, 255, .92);
  color: var(--primary-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 14px rgba(60, 70, 160, .16);
  text-decoration: none;
}
.drawer-user {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(255, 255, 255, .8);
}
.drawer-user .drawer-user-name { font-weight: 700; color: var(--text); font-size: 12px; }
.drawer-user a { color: #6b7280; font-size: 12px; }

.container { max-width: 1280px; margin: 20px auto 56px; padding: 0 18px; }
.app-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 34px; }

/* ===== 卡片 ===== */
.card {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card.narrow { max-width: 460px; margin: 48px auto; }
.card.narrow.wide { max-width: 900px; }
.card h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: .2px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.card-sub { margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* ===== 提示条 ===== */
.flash {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  margin-bottom: 14px;
  font-size: 14px;
  animation: flash-in .3s cubic-bezier(.2, .8, .3, 1);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.flash.success { color: #0d6b45; background: rgba(48, 164, 108, .18); }
.flash.danger { color: #b42325; background: rgba(229, 72, 77, .16); }
.flash.info { color: #2540b8; background: rgba(91, 91, 214, .16); }
.flash .flash-close {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: .55;
  padding: 2px 4px;
}
.flash .flash-close:hover { opacity: 1; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 10px rgba(60, 70, 160, .08);
  transition: transform .12s, box-shadow .18s, background .18s;
}
.btn:hover {
  background: rgba(255, 255, 255, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 6px 18px rgba(60, 70, 160, .14);
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, .95), rgba(124, 58, 237, .95));
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 20px rgba(99, 102, 241, .35);
}
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, rgba(99, 102, 241, .95), rgba(124, 58, 237, .95)); }
.btn.danger {
  background: linear-gradient(135deg, rgba(229, 72, 77, .92), rgba(220, 38, 38, .92));
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px rgba(229, 72, 77, .3);
}
.btn.danger:hover { filter: brightness(1.06); background: linear-gradient(135deg, rgba(229, 72, 77, .92), rgba(220, 38, 38, .92)); }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { width: 16px; height: 16px; margin-right: 7px; vertical-align: -2px; }

/* ===== 按钮流光效果 ===== */
.btn,
.topbar nav a,
.drawer nav a {
  position: relative;
  overflow: hidden;
}
.btn::after,
.topbar nav a::after,
.drawer nav a::after {
  content: "";
  position: absolute;
  top: 0;
  left: -85%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .62), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
.btn:hover::after,
.topbar nav a:hover::after,
.drawer nav a:hover::after {
  animation: btn-shine 1.1s ease;
}
.btn.primary:hover::after {
  animation: btn-shine 1.5s ease infinite;
}
@keyframes btn-shine {
  from { left: -85%; }
  to { left: 135%; }
}

/* ===== 统计卡片 ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.list-head h2 { margin: 0; font-size: 18px; }
.text-ok { color: var(--ok); font-weight: 600; }
.text-fail { color: var(--danger); font-weight: 600; }
.stat {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stat::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  filter: blur(2px);
}
.stat span { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat strong { font-size: 28px; line-height: 1; color: var(--text); }
.stat.total strong { background: linear-gradient(120deg, #4f46e5, #9333ea); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== 状态页签（分段控件） ===== */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  border-radius: 18px;
  padding: 6px;
  margin-bottom: 14px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 13px;
  color: #4b5563;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .18s, color .18s, box-shadow .18s;
}
.tab:hover { background: rgba(255, 255, 255, .55); text-decoration: none; color: var(--text); }
.tab.active {
  background: rgba(255, 255, 255, .9);
  color: var(--primary-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 4px 14px rgba(60, 70, 160, .12);
}
.tab .count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: #6b7280;
  font-size: 12px;
  text-align: center;
}
.tab.active .count { background: var(--primary); color: #fff; }
.tab-spacer { flex: 1; }

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 14px;
}
.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar select {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, .68);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.filter-bar input[type="text"] { min-width: 230px; }
.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .18);
}
.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ===== 页签 + 搜索栏并排 ===== */
.toolbar-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.toolbar-card .tabs {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 0;
  margin: 0;
}
.toolbar-card .filter-bar {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 0;
  margin: 0;
}
.new-invoice-btn { margin-left: auto; }

/* ===== 表单 ===== */
input, select, textarea { font: inherit; color: var(--text); }
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 12px;
  background: rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .18);
}
label { display: block; margin-bottom: 14px; font-size: 13px; color: #374151; font-weight: 500; }
label input, label select, label textarea { margin-top: 5px; font-weight: 400; }
.checkbox { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.checkbox input { width: auto; margin: 0; accent-color: var(--primary); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0 18px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 980px; }
.table th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .8);
  white-space: nowrap;
  font-weight: 600;
  color: #4b5563;
  font-size: 12.5px;
  letter-spacing: .3px;
  background: rgba(255, 255, 255, .28);
}
.table td { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .65); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .5); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-pending { background: linear-gradient(90deg, rgba(245, 158, 11, .10), transparent 55%); }
.table tbody tr.row-invoiced { background: linear-gradient(90deg, rgba(34, 197, 94, .10), transparent 55%); }
.table tbody tr.row-voided { background: linear-gradient(90deg, rgba(156, 163, 175, .08), transparent 55%); }
.table tbody tr.row-pending:hover { background: linear-gradient(90deg, rgba(245, 158, 11, .16), rgba(255, 255, 255, .5)); }
.table tbody tr.row-invoiced:hover { background: linear-gradient(90deg, rgba(34, 197, 94, .16), rgba(255, 255, 255, .5)); }
.table tbody tr.row-voided:hover { background: linear-gradient(90deg, rgba(156, 163, 175, .14), rgba(255, 255, 255, .5)); }
.table tbody tr.row-pending td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.table tbody tr.row-invoiced td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.table tbody tr.row-voided td:first-child { box-shadow: inset 3px 0 0 #9ca3af; }
.table td.seq a { font-weight: 700; color: var(--primary-strong); }
.table td.title { font-weight: 600; }
.table td.amount { color: var(--primary-strong); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.table .nowrap { white-space: nowrap; }
.table .empty { text-align: center; color: var(--muted); padding: 44px 0; }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin-right: 5px; margin-bottom: 3px; }
.log-detail { max-width: 480px; word-break: break-all; color: #4b5563; }

/* ===== 状态徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: rgba(255, 193, 7, .22); color: #8a6100; }
.badge.invoiced { background: rgba(48, 164, 108, .2); color: #0d6b45; }
.badge.voided { background: rgba(107, 114, 128, .18); color: #4b5563; }
.badge.ok { background: rgba(48, 164, 108, .2); color: #0d6b45; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

/* ===== 详情页 ===== */
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .8);
}
.detail-head h2 { margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

dl.detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0 26px;
  margin: 18px 0 0;
}
dl.detail > div { border-bottom: 1px dashed rgba(255, 255, 255, .9); padding: 9px 0; }
dl.detail dt { color: var(--muted); font-size: 12px; }
dl.detail dd { margin: 2px 0 0; font-size: 14px; word-break: break-all; }

dl.kv { margin: 0 0 16px; }
dl.kv > div { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(255, 255, 255, .9); }
dl.kv dt { width: 118px; color: var(--muted); flex-shrink: 0; }
dl.kv dd { margin: 0; word-break: break-all; }

/* ===== 登录页 ===== */
.login-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  overflow: hidden;
}
.login-card {
  max-width: 960px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  padding: 0;
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(60, 70, 160, .22), inset 0 1px 0 rgba(255, 255, 255, .95);
}
.login-card, .login-form, .login-brand { min-width: 0; }
.login-brand {
  background: linear-gradient(150deg, rgba(99, 102, 241, .92), rgba(124, 58, 237, .92) 60%, rgba(192, 38, 211, .88));
  color: #fff;
  padding: 46px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, .35);
}
.login-brand h1 { margin: 0 0 12px; font-size: 30px; letter-spacing: .3px; }
.login-brand h1 .login-logo { width: 44px; height: 44px; vertical-align: -10px; margin-right: 10px; border-radius: 10px; box-shadow: 0 4px 14px rgba(60, 70, 160, .22); }
.login-brand p { margin: 0 0 28px; opacity: .88; line-height: 1.7; }
.login-brand .feature {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 13px;
  opacity: .94;
  font-size: 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 12px;
  padding: 9px 13px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.login-form { padding: 42px 40px; }
.login-form h2 { margin: 0 0 6px; font-size: 21px; }
.login-form .btn.primary { width: 100%; margin-top: 6px; padding: 11px; font-size: 15px; }
.login-form .divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 20px 0 12px;
}
.login-form .divider::before,
.login-form .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .9); }
.wecom-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .95);
  color: #111827;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 13px;
  text-decoration: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 4px 16px rgba(60, 70, 160, .12);
  transition: transform .12s, box-shadow .18s;
}
.wecom-btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 8px 22px rgba(60, 70, 160, .18); text-decoration: none; }
.wecom-btn svg { width: 20px; height: 20px; }

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 45, 90, .32);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  border-radius: 26px;
  padding: 26px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(60, 70, 160, .25), inset 0 1px 0 rgba(255, 255, 255, .95);
  animation: pop-in .25s cubic-bezier(.2, .8, .3, 1);
}
.modal.wide { max-width: 720px; }
.modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(90vh - 56px);
  padding-right: 2px;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to { opacity: 1; transform: none; }
}
.modal h3 { margin-top: 0; }
.modal-summary {
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.7;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions .btn,
.form-actions .btn {
  min-width: 108px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-form label:last-of-type { margin-bottom: 0; }

/* ===== 折叠面板 ===== */
.panel {
  border-radius: 16px;
  padding: 13px 17px;
  margin-bottom: 16px;
}
.panel summary { cursor: pointer; font-weight: 600; color: var(--primary-strong); }
.panel form { margin-top: 14px; }
.panel.tips summary { color: var(--text); }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.tips-grid > div {
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 13px;
  padding: 12px 14px;
}
.tips-grid strong { color: var(--primary-strong); }
.tips-grid p { margin: 4px 0 0; font-size: 13px; color: #4b5563; line-height: 1.7; }

/* ===== 布局工具 ===== */
.cards-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 18px; align-items: start; }
.suggest { position: relative; }
#customer_suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(60, 70, 160, .18);
  max-height: 240px;
  overflow: auto;
}
.suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}
.suggest-item:hover { background: rgba(99, 102, 241, .12); }
.inline-form { display: inline; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon {
  font-size: 46px;
  margin-bottom: 10px;
  display: inline-block;
  filter: drop-shadow(0 8px 18px rgba(99, 102, 241, .25));
}
.empty-state h3 { color: var(--text); margin: 0 0 4px; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(100, 110, 200, .28); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  input, select, textarea { font-size: 16px !important; }
  .modal { padding: 22px 18px; transform: translateZ(0); -webkit-transform: translateZ(0); }
  .topbar .main-nav { display: none; }
  .topbar .userbox { display: none; }
  .menu-toggle { display: flex; }
  .login-card { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form { padding: 32px 24px; }
  .login-wrap { padding: 16px; }
  .login-card { max-width: 100%; }
  .login-wrap { overflow: hidden; }
  .topbar { margin: 10px 10px 0; padding: 8px 14px; }
  .topbar .userbox { margin-left: 0; }
  .filter-bar input[type="text"] { min-width: 100%; }
  .container { padding: 0 12px; }
}

@media (max-width: 480px) {
  .login-form { padding: 26px 18px; }
  .login-card { border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
