/* ==========================================================
   供应商管理系统 · 样式
   ========================================================== */
:root {
  --bg: #F6F7FA;
  --bg-elev: #FFFFFF;
  --bg-soft: #F1F3F8;
  --bg-soft2: #E9EDF4;

  --t1: #0C1220;
  --t2: #4B5768;
  --t3: #93A0B4;

  --border: #E4E8F0;
  --border2: #D3DAE6;

  --brand: #2D5BFF;
  --brand-soft: rgba(45, 91, 255, .08);
  --brand-soft2: rgba(45, 91, 255, .16);

  --ok: #0F9D6E;      --ok-soft: rgba(15, 157, 110, .10);
  --warn: #D97706;    --warn-soft: rgba(217, 119, 6, .10);
  --err: #DC2626;     --err-soft: rgba(220, 38, 38, .10);
  --info: #7C3AED;    --info-soft: rgba(124, 58, 237, .10);

  --sh-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --sh: 0 4px 14px rgba(16, 24, 40, .07);
  --sh-lg: 0 16px 48px rgba(16, 24, 40, .13);

  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
  --bg: #0A0E1A;
  --bg-elev: #111726;
  --bg-soft: #161D30;
  --bg-soft2: #1D2540;

  --t1: #EEF2FA;
  --t2: #A3AFC4;
  --t3: #66748E;

  --border: #1E2740;
  --border2: #2A3355;

  --brand: #6690FF;
  --brand-soft: rgba(102, 144, 255, .13);
  --brand-soft2: rgba(102, 144, 255, .22);

  --ok: #34D399;      --ok-soft: rgba(52, 211, 153, .13);
  --warn: #FBBF24;    --warn-soft: rgba(251, 191, 36, .13);
  --err: #F87171;     --err-soft: rgba(248, 113, 113, .13);
  --info: #A78BFA;    --info-soft: rgba(167, 139, 250, .13);

  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh: 0 4px 14px rgba(0,0,0,.45);
  --sh-lg: 0 16px 48px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--t3); font-size: 12.5px; }
.mono { font-family: 'JetBrains Mono', monospace; }
::selection { background: var(--brand-soft2); }

/* =================== 通用控件 =================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-size: 13.5px; font-weight: 500;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--t1);
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--border2); background: var(--bg-soft); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(45, 91, 255, .26);
}
.btn--primary:hover { background: var(--brand); filter: brightness(1.08); border-color: var(--brand); }
.btn--danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn--danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn--full { width: 100%; height: 40px; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }

.icon-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r); border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--t2);
  transition: all .2s var(--ease);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn .ic-moon { display: none; }
[data-theme="dark"] .icon-btn .ic-sun { display: none; }
[data-theme="dark"] .icon-btn .ic-moon { display: block; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--t2); }
.field--req .field__label::after { content: ' *'; color: var(--err); font-weight: 700; }

.input {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-elev);
  color: var(--t1);
  transition: all .2s var(--ease);
  width: 100%;
  font-size: 13.5px;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--t3); }
.input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input:disabled { background: var(--bg-soft); color: var(--t3); cursor: not-allowed; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* =================== 登录页 =================== */
.login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
}
.login__bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.blob.b1 {
  width: 460px; height: 460px; top: -140px; left: -80px;
  background: radial-gradient(circle, rgba(45,91,255,.55), transparent 62%);
  animation: drift 20s ease-in-out infinite;
}
.blob.b2 {
  width: 380px; height: 380px; bottom: -120px; right: -60px;
  background: radial-gradient(circle, rgba(124,58,237,.42), transparent 62%);
  animation: drift 20s ease-in-out infinite -10s;
}
[data-theme="dark"] .blob { opacity: .28; }
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(36px,-26px) scale(1.06); }
}

.login__card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  padding: 36px 32px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--sh-lg);
  animation: rise .6s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.login__logo {
  width: 48px; height: 48px; border-radius: 13px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(45,91,255,.35);
  margin-bottom: 18px;
}
.login__title { font-size: 21px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.login__sub { font-size: 12px; color: var(--t3); margin: 0 0 26px; font-family: 'JetBrains Mono', monospace; }
.login__err {
  padding: 9px 12px; margin-bottom: 14px;
  background: var(--err-soft); color: var(--err);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--r); font-size: 12.5px;
  animation: shake .35s;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); } 75% { transform: translateX(5px); }
}

.login__hint { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border2); }
.login__hint-title { font-size: 11px; font-weight: 600; color: var(--t3); letter-spacing: .06em; margin-bottom: 8px; text-transform: uppercase; }
.demo-acc {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  padding: 8px 10px; margin-bottom: 5px;
  border-radius: var(--r-sm); text-align: left;
  transition: all .18s var(--ease);
  border: 1px solid transparent;
}
.demo-acc:hover { background: var(--brand-soft); border-color: var(--brand-soft2); }
.demo-acc b { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--brand); }
.demo-acc span { font-size: 11.5px; color: var(--t3); }

/* =================== 顶栏 =================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 11px 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.brand__logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(45,91,255,.3);
}
.brand__title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.brand__sub { font-size: 11px; color: var(--t3); }

.topbar__tabs { display: flex; gap: 3px; }
.tab {
  padding: 7px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--t2); border-radius: 8px;
  transition: all .18s var(--ease);
}
.tab:hover { background: var(--bg-soft); color: var(--t1); }
.tab.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border); border-radius: 100px;
  background: var(--bg-elev); color: var(--t2);
  cursor: pointer; position: relative;
  transition: all .18s var(--ease);
}
.user-chip:hover { border-color: var(--border2); }
.user-chip__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7C3AED);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-chip__name { font-size: 12.5px; font-weight: 600; color: var(--t1); line-height: 1.3; }
.user-chip__role { font-size: 10.5px; color: var(--t3); line-height: 1.3; }

.user-menu {
  position: absolute; top: calc(100% + 7px); right: 0;
  min-width: 148px; padding: 5px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .2s var(--ease);
}
.user-chip.is-open .user-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 11px; font-size: 13px; border-radius: var(--r-sm);
  color: var(--t1); transition: background .15s;
}
.user-menu button:hover { background: var(--bg-soft); }
.user-menu button.danger { color: var(--err); }
.user-menu button.danger:hover { background: var(--err-soft); }

/* =================== 主内容 =================== */
.main { max-width: 1320px; margin: 0 auto; padding: 24px; }
.panel__title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

.stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin-bottom: 18px;
}
.stat {
  padding: 15px 17px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: all .25s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.stat__num { font-size: 25px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; color: var(--t3); margin-top: 2px; }

.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; flex: 1; min-width: 220px; max-width: 420px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--bg-elev); color: var(--t3);
  transition: all .2s var(--ease);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input {
  flex: 1; border: none; outline: none; background: none;
  color: var(--t1); font-size: 13.5px;
}
.search input::placeholder { color: var(--t3); }

.seg { display: flex; gap: 2px; padding: 3px; background: var(--bg-soft); border-radius: var(--r); }
.seg button {
  padding: 5px 11px; font-size: 12.5px; font-weight: 500;
  color: var(--t2); border-radius: 7px; transition: all .18s var(--ease);
}
.seg button:hover { color: var(--t1); }
.seg button.is-active { background: var(--bg-elev); color: var(--brand); font-weight: 600; box-shadow: var(--sh-sm); }

.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden;
}
.table-scroll { overflow-x: auto; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; padding: 11px 16px; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--t3); background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}
.tbl tbody tr { border-bottom: 1px solid var(--border); transition: background .16s; }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl td { padding: 13px 16px; vertical-align: middle; }

.sup-cell { display: flex; align-items: center; gap: 11px; }
.sup-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
}
.sup-name { font-weight: 600; font-size: 13.5px; }
.sup-meta { font-size: 11px; color: var(--t3); font-family: 'JetBrains Mono', monospace; }

.cert-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.cert-dot {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.cert-dot i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.cert-dot.s-valid    { background: var(--ok-soft); color: var(--ok); }
.cert-dot.s-expiring { background: var(--warn-soft); color: var(--warn); }
.cert-dot.s-expired  { background: var(--err-soft); color: var(--err); }
.cert-dot.s-none     { background: var(--bg-soft2); color: var(--t3); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.v-passed     { background: var(--ok-soft); color: var(--ok); }
.badge.v-expiring   { background: var(--warn-soft); color: var(--warn); }
.badge.v-blocked    { background: var(--err-soft); color: var(--err); }
.badge.v-incomplete { background: var(--info-soft); color: var(--info); }
.badge.r-admin   { background: var(--err-soft); color: var(--err); }
.badge.r-editor  { background: var(--brand-soft); color: var(--brand); }
.badge.r-viewer  { background: var(--bg-soft2); color: var(--t2); }
.badge.r-pending { background: var(--warn-soft); color: var(--warn); }

.row-btns { display: flex; gap: 5px; }
.tbtn {
  padding: 4px 9px; font-size: 12px; font-weight: 500;
  border-radius: var(--r-sm); color: var(--t2); background: var(--bg-soft);
  transition: all .18s var(--ease); white-space: nowrap;
}
.tbtn:hover { background: var(--brand-soft); color: var(--brand); }
.tbtn.danger:hover { background: var(--err-soft); color: var(--err); }

.empty { padding: 56px 20px; text-align: center; }
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.empty__title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.empty__desc { font-size: 12.5px; color: var(--t3); }

/* =================== 抽屉 =================== */
.drawer {
  position: fixed; inset: 0; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.drawer[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.drawer__mask { position: absolute; inset: 0; background: rgba(9,14,26,.42); backdrop-filter: blur(3px); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(660px, 100%);
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  transform: translateX(100%);
  transition: transform .38s var(--ease);
}
.drawer[aria-hidden="false"] .drawer__panel { transform: translateX(0); }

.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer__head h2 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.drawer__foot { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg-soft); flex-shrink: 0; }
.drawer__actions { display: flex; gap: 9px; justify-content: flex-end; }
.drawer__err {
  padding: 9px 12px; margin-bottom: 11px;
  background: var(--err-soft); color: var(--err);
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--r); font-size: 12.5px; line-height: 1.55;
}

.form-sec { margin-bottom: 26px; }
.form-sec__title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 13px; padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}
.form-sec__hint { font-size: 12px; color: var(--t3); margin: -6px 0 14px; line-height: 1.6; }

/* 证书块 */
.cert-block {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  margin-bottom: 12px; overflow: hidden;
  transition: border-color .25s var(--ease);
}
.cert-block.is-on { border-color: var(--brand-soft2); }
.cert-block__head {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px; background: var(--bg-soft);
}
.cert-block__name { font-size: 13.5px; font-weight: 600; flex: 1; }
.cert-block__body { padding: 15px; border-top: 1px solid var(--border); }

.switch { display: flex; gap: 2px; padding: 3px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 100px; }
.switch button {
  padding: 3px 12px; font-size: 12px; font-weight: 500;
  color: var(--t2); border-radius: 100px; transition: all .2s var(--ease);
}
.switch button.is-on { background: var(--brand); color: #fff; font-weight: 600; }
.switch button.is-off { background: var(--bg-soft2); color: var(--t2); font-weight: 600; }

.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border: 1px dashed var(--border2);
  border-radius: var(--r); background: var(--bg-soft);
  transition: all .2s var(--ease);
}
.file-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.file-row input[type=file] { display: none; }
.file-pick {
  padding: 5px 11px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--border2); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--t1); white-space: nowrap;
}
.file-pick:hover { border-color: var(--brand); color: var(--brand); }
.file-name { font-size: 12.5px; color: var(--t2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-clear { color: var(--t3); font-size: 12px; padding: 3px 7px; border-radius: 5px; }
.file-clear:hover { color: var(--err); background: var(--err-soft); }

/* 详情视图 */
.v-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.v-avatar {
  width: 50px; height: 50px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.v-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.v-code { font-size: 11.5px; color: var(--t3); font-family: 'JetBrains Mono', monospace; }

.v-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 24px; }
.v-meta-item { padding: 11px 13px; background: var(--bg-soft); border-radius: var(--r); }
.v-meta-item dt { font-size: 11px; color: var(--t3); margin-bottom: 3px; }
.v-meta-item dd { margin: 0; font-size: 13px; font-weight: 500; }

.v-sec-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--t3); margin: 22px 0 11px;
  font-family: 'JetBrains Mono', monospace;
}

.v-cert {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 15px; margin-bottom: 9px;
}
.v-cert__top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.v-cert__name { font-size: 13.5px; font-weight: 600; flex: 1; }
.v-cert__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
.v-cert__f { font-size: 12.5px; display: flex; gap: 6px; }
.v-cert__f b { color: var(--t3); font-weight: 500; flex-shrink: 0; }
.v-cert__f span { color: var(--t1); word-break: break-all; }
.v-cert__f.full { grid-column: 1 / -1; }
.v-cert__file {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 5px 11px; font-size: 12.5px; font-weight: 500;
  background: var(--brand-soft); color: var(--brand);
  border-radius: var(--r-sm); transition: all .18s var(--ease);
}
.v-cert__file:hover { background: var(--brand-soft2); }
.v-cert__none { font-size: 12.5px; color: var(--t3); font-style: italic; }

/* =================== 弹窗 =================== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.modal[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.modal__mask { position: absolute; inset: 0; background: rgba(9,14,26,.48); backdrop-filter: blur(3px); }
.modal__box {
  position: relative; width:100%; max-width: 400px;
  padding: 24px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  transform: scale(.95); transition: transform .25s var(--ease);
}
.modal[aria-hidden="false"] .modal__box { transform: scale(1); }
.modal__box h3 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.modal__actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }

/* =================== Toast =================== */
.toasts {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 17px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 100px; box-shadow: var(--sh-lg);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  animation: toastIn .35s var(--ease);
}
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
.toast i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.toast.t-ok i { background: var(--ok); }
.toast.t-err i { background: var(--err); }
.toast.t-info i { background: var(--brand); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* =================== 响应式 =================== */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 11px 16px; }
  .topbar__tabs { order: 3; width: 100%; overflow-x: auto; }
  .topbar__right { margin-left: auto; }
  .main { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .v-meta { grid-template-columns: 1fr; }
  .v-cert__fields { grid-template-columns: 1fr; }
  .user-chip__info { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .search { max-width: none; }
  .seg { width: 100%; overflow-x: auto; }
  .drawer__panel { width: 100%; }
}
