/* ───────────────────────── 字体 ───────────────────────── */
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ───────────────────────── 变量 ───────────────────────── */
:root {
  --ink: #0a0908;
  --surface: #14110e;
  --surface-2: #1a1613;
  --line: rgba(237, 230, 217, .10);
  --line-strong: rgba(237, 230, 217, .17);
  --paper: #f0e9dc;
  --dim: #b5aa9a;
  --faint: #8b8173;
  --brass: #c9a15b;
  --brass-hi: #ebcb8b;
  --brass-soft: rgba(201, 161, 91, .12);
  --danger: #c25f46;
  --ok: #7fa98a;

  --serif: 'Instrument Serif', 'Songti SC', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', Georgia, serif;
  --sans: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Segoe UI', -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--paper);
  background:
    radial-gradient(1100px 780px at 88% -12%, #221b12 0%, rgba(34, 27, 18, 0) 62%),
    radial-gradient(820px 680px at -8% 108%, #17130f 0%, rgba(23, 19, 15, 0) 58%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(237, 230, 217, .022) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(90deg, rgba(237, 230, 217, .022) 0 1px, transparent 1px 72px);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 78%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
}

::selection { background: rgba(201, 161, 91, .3); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(237, 230, 217, .12); border: 3px solid transparent; background-clip: content-box; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 161, 91, .35); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

[hidden] { display: none !important; }

/* ───────────────────────── 通用文字 ───────────────────────── */
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--faint);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--brass);
}
.brand .mark { width: 28px; height: 28px; flex: 0 0 auto; }
.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  letter-spacing: .08em;
  color: var(--paper);
}
.brand-sub {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .34em;
  color: var(--faint);
}
.brand-lg .mark { width: 34px; height: 34px; }
.brand-lg .brand-name { font-size: 22px; }

/* ───────────────────────── 按钮 ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, box-shadow .2s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: rgba(201, 161, 91, .5); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }

.btn-primary {
  color: #1c1305;
  font-weight: 600;
  background: linear-gradient(180deg, #dcb976, #b98c42);
  border-color: #d8b473;
  box-shadow: 0 10px 26px -16px rgba(216, 180, 115, .95);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #eecf90, #c9a15b);
  box-shadow: 0 12px 30px -14px rgba(216, 180, 115, 1);
}

.btn-quiet { color: var(--dim); }
.btn-quiet:hover { color: var(--paper); background: rgba(237, 230, 217, .04); }
.btn-block { width: 100%; padding: 12px 18px; letter-spacing: .28em; font-size: 13px; }
.btn-wide { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--brass-hi); border-color: rgba(201, 161, 91, .45); background: var(--brass-soft); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }

/* ───────────────────────── 锁屏 ───────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(900px 650px at 50% 12%, #1d1811 0%, rgba(29, 24, 17, 0) 65%),
    var(--ink);
}

.gate-ring {
  position: absolute;
  width: min(86vmin, 700px);
  aspect-ratio: 1;
  opacity: .8;
  animation: spin 180s linear infinite;
  pointer-events: none;
}
.gate-ring svg { width: 100%; height: 100%; }

.gate-card {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  padding: 36px 34px 30px;
  background: linear-gradient(180deg, rgba(24, 20, 15, .96), rgba(11, 10, 8, .98));
  border: 1px solid var(--line);
  box-shadow: 0 50px 90px -50px #000, inset 0 1px 0 rgba(237, 230, 217, .04);
}
.gate-card::before,
.gate-card::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(201, 161, 91, .55);
}
.gate-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.gate-card::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

.gate-card .brand { margin-bottom: 30px; }
.gate-card h1 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: .015em;
  color: var(--paper);
}
.gate-sub {
  margin: 0 0 26px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--dim);
}
.gate-hint {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
}
.gate-err {
  margin: 12px 0 0;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #f0b7a5;
  background: rgba(194, 95, 70, .1);
  border-left: 2px solid var(--danger);
}
.gate-err.is-info {
  color: var(--dim);
  background: rgba(201, 161, 91, .06);
  border-left-color: var(--brass);
}
.gate-foot {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .32em;
  color: rgba(237, 230, 217, .22);
}

/* ───────────────────────── 表单元素 ───────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > .label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}
.field > .label i {
  font-family: var(--sans);
  font-style: normal;
  letter-spacing: .04em;
  font-size: 10.5px;
  text-transform: none;
  color: rgba(111, 102, 89, .85);
}

.input-wrap { position: relative; display: block; }

input[type='text'],
input[type='password'],
textarea {
  width: 100%;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--paper);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
input[type='text']::placeholder,
input[type='password']::placeholder,
textarea::placeholder { color: rgba(111, 102, 89, .75); }
input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(201, 161, 91, .6);
  background: rgba(201, 161, 91, .035);
  box-shadow: 0 0 0 3px rgba(201, 161, 91, .07);
}
textarea { resize: vertical; min-height: 74px; line-height: 1.65; }
input[type='password'] { font-family: var(--mono); letter-spacing: .18em; }

.eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color .2s;
}
.eye svg { width: 16px; height: 16px; }
.eye:hover { color: var(--brass-hi); }

/* ───────────────────────── 顶栏 ───────────────────────── */
.app { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'brand search actions';
  align-items: center;
  gap: 26px;
  padding: 13px 30px;
  background: rgba(10, 9, 8, .8);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { grid-area: brand; }

.search {
  grid-area: search;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  width: 100%;
  justify-self: center;
  padding: 0 4px 0 2px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .25s;
}
.search:focus-within { border-color: rgba(201, 161, 91, .65); }
.search-icon { width: 15px; height: 15px; color: var(--faint); flex: 0 0 auto; }
.search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-radius: 0;
}
.search input:focus { outline: none; box-shadow: none; background: transparent; border: 0; }
.search kbd {
  flex: 0 0 auto;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.top-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }
.top-actions .btn { padding: 8px 14px; }

.lock-group { position: relative; display: flex; align-items: center; gap: 4px; }
.lock-group .caret { width: 24px; }
.lock-group .caret svg { width: 13px; height: 13px; }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 208px;
  padding: 6px;
  background: #16120f;
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 44px -26px #000;
  animation: fade .16s ease both;
}
.menu-hint {
  margin: 0;
  padding: 6px 10px 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--faint);
}
.menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  text-align: left;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.menu button:hover { color: var(--paper); background: rgba(201, 161, 91, .09); }
.menu button.danger { color: #d99a86; }
.menu button.danger:hover { color: #f0b7a5; background: rgba(194, 95, 70, .12); }

/* ───────────────────────── 版面 ───────────────────────── */
main { flex: 1 1 auto; }

.layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 34px;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 36px 30px 100px;
}

/* ───────────────────────── 侧栏 ───────────────────────── */
.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-right: 20px;
  border-right: 1px solid var(--line);
}
.side-block { display: flex; flex-direction: column; gap: 8px; }
.side-block > .eyebrow { padding-left: 2px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--dim);
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 2px 2px 0;
  cursor: pointer;
  transition: color .18s, background .18s, border-color .18s;
}
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item em {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  color: var(--faint);
}
.nav-item:hover { color: var(--paper); background: rgba(237, 230, 217, .035); }
.nav-item.is-on {
  color: var(--brass-hi);
  background: var(--brass-soft);
  border-left-color: var(--brass);
}
.nav-item.is-on em { color: rgba(235, 203, 139, .7); }
.nav-item:focus-visible { outline: 1px solid var(--brass); outline-offset: 1px; }

.board {
  min-width: 0;
  padding: 8px 0 0;
}

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.board-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--faint);
  text-align: right;
}
.board-title h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--paper);
}

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { color: var(--paper); border-color: var(--line-strong); }
.chip.is-on {
  color: var(--brass-hi);
  border-color: rgba(201, 161, 91, .5);
  background: var(--brass-soft);
}
.chip:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }

/* ───────────────────────── 卡片 ───────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 19px 20px 17px;
  background: linear-gradient(168deg, #17130f 0%, #110f0c 58%, #0e0c0a 100%);
  border: 1px solid var(--line);
  border-radius: 3px;
  animation: rise .5s var(--ease) both;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.card::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 161, 91, .8), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.card:hover {
  border-color: rgba(201, 161, 91, .34);
  transform: translateY(-3px);
  box-shadow: 0 26px 50px -30px #000, 0 0 0 1px rgba(201, 161, 91, .05) inset;
}
.card:hover::after { opacity: 1; }

.card-top { display: flex; align-items: flex-start; gap: 12px; }

.mono-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--brass-hi);
  background: rgba(201, 161, 91, .09);
  border: 1px solid rgba(201, 161, 91, .35);
  border-radius: 2px;
}
.card[data-type='site'] .mono-tile {
  color: #a9c8bb;
  background: rgba(140, 180, 165, .08);
  border-color: rgba(140, 180, 165, .32);
}
.card[data-type='other'] .mono-tile {
  color: #c8bdae;
  background: rgba(237, 230, 217, .05);
  border-color: rgba(237, 230, 217, .18);
}

.card-id { flex: 1 1 auto; min-width: 0; }
.card-id h3 {
  margin: 2px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
  color: var(--paper);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tools { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.card:hover .card-tools,
.card:focus-within .card-tools { opacity: 1; }
.card-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.card-tools button svg { width: 14px; height: 14px; }
.card-tools button:hover { color: var(--brass-hi); background: rgba(237, 230, 217, .06); }
.card-tools button[data-act='del']:hover { color: #e8a08b; background: rgba(194, 95, 70, .1); }

.card-url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #9fb3a8;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.card-url:hover { color: #cfe3d8; border-color: rgba(159, 179, 168, .5); }
.card-url .ext { font-size: 10px; opacity: .6; }

.rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.row .k {
  flex: 0 0 auto;
  width: 30px;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--faint);
}
.row .v {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #c4b9a8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .v.pwd { letter-spacing: .16em; color: #d3c8b6; }
.row .v.pwd.is-open { letter-spacing: .02em; }
.dash { color: var(--faint); }

.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  color: rgba(167, 156, 140, .6);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.mini svg { width: 13.5px; height: 13.5px; }
.mini:hover { color: var(--brass-hi); background: rgba(201, 161, 91, .1); }

.card-note {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.card-tags span {
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 2px;
}

/* ───────────────────────── 空态 ───────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 68px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.8;
}
.empty-dial { width: 92px; height: 92px; opacity: .75; animation: spin 60s linear infinite; }
.empty p { margin: 0; max-width: 400px; }

/* ───────────────────────── 抽屉 ───────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 3, 3, .6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s;
}
.scrim.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(520px, 100%);
  padding: 26px 30px 34px;
  overflow-y: auto;
  background: linear-gradient(180deg, #14110e, #0b0a08);
  border-left: 1px solid rgba(201, 161, 91, .2);
  box-shadow: -40px 0 80px -50px #000;
  transform: translateX(102%);
  transition: transform .34s var(--ease);
}
.drawer.is-open { transform: none; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: .02em;
}

.seg {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.seg button {
  flex: 1 1 0;
  padding: 9px 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--paper); background: rgba(237, 230, 217, .03); }
.seg button.is-on { color: var(--brass-hi); background: var(--brass-soft); }

#btnGen { margin-top: 8px; font-size: 12px; letter-spacing: .04em; color: var(--faint); }
#btnGen:hover { color: var(--brass-hi); border-color: rgba(201, 161, 91, .35); background: var(--brass-soft); }

.drawer-foot {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.drawer-foot .btn-primary { flex: 1 1 auto; }

/* ───────────────────────── 确认框 ───────────────────────── */
.confirm {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 3, 3, .66);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade .18s ease both;
}
.confirm-card {
  width: min(400px, 100%);
  padding: 26px 26px 20px;
  background: linear-gradient(180deg, #16120f, #0d0b09);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 70px -40px #000;
  animation: rise .24s var(--ease) both;
}
.confirm-card.is-danger { border-color: rgba(194, 95, 70, .32); }

/* 智能识别 */
.import-card { width: min(580px, 100%); }
.import-card h4 { margin-bottom: 6px; }
#importText {
  width: 100%;
  min-height: 116px;
  margin-top: 6px;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--paper);
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line);
  border-radius: 2px;
  resize: vertical;
}
#importText:focus { border-color: rgba(201, 161, 91, .6); background: rgba(201, 161, 91, .035); }
.import-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  margin: 14px 0 6px;
  overflow-y: auto;
}
.imp-empty {
  margin: 0;
  padding: 14px 0;
  font-size: 12.5px;
  color: var(--faint);
}
.imp-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.imp-item:hover { border-color: rgba(201, 161, 91, .38); background: rgba(201, 161, 91, .04); }
.imp-item input { margin: 3px 0 0; accent-color: var(--brass); }
.imp-main { min-width: 0; flex: 1 1 auto; }
.imp-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.imp-type {
  flex: 0 0 auto;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--brass);
  border: 1px solid rgba(201, 161, 91, .35);
}
.imp-url,
.imp-cred {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  word-break: break-all;
}
.imp-url { color: #9fb3a8; }
.imp-item.is-dup .imp-name::after {
  content: '已存在';
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--danger);
  border: 1px solid rgba(194, 95, 70, .4);
  padding: 1px 5px;
}
.confirm-card h4 {
  margin: 10px 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--paper);
}
.confirm-sub {
  margin: 0 0 20px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--dim);
  word-break: break-all;
}
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1 1 0; }
.btn-danger { color: #eba792; border-color: rgba(194, 95, 70, .55); }
.btn-danger:hover { color: #ffcbb8; border-color: rgba(194, 95, 70, .85); background: rgba(194, 95, 70, .12); }

/* ───────────────────────── Toast ───────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 80;
  padding: 11px 20px 11px 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--paper);
  background: rgba(24, 20, 15, .97);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--brass);
  box-shadow: 0 24px 50px -28px #000;
  transform: translate(-50%, 18px);
  opacity: 0;
  transition: opacity .25s, transform .25s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { border-left-color: var(--danger); }

/* ───────────────────────── 动效 ───────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.shake { animation: shake .42s ease; }
body.is-locked { overflow: hidden; }

/* ───────────────────────── 响应式 ───────────────────────── */
@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas: 'brand actions' 'search search';
    gap: 12px;
    padding: 12px 18px;
  }
  .search { max-width: none; }
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 22px 18px 80px;
  }
  .sidebar {
    position: static;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 18px;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .side-block { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; }
  .side-block > .eyebrow { display: none; }
  .nav { flex-direction: row; gap: 6px; }
  .nav-item {
    padding: 6px 10px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 2px 2px 0 0;
    white-space: nowrap;
  }
  .nav-item.is-on { border-left: 0; border-bottom-color: var(--brass); }
  .board { padding: 0; }
  .board-title h2 { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .confirm { padding: 14px; }
  .confirm-card { padding: 20px 18px 16px; }
  .import-preview { max-height: 190px; }
  .gate-card { padding: 28px 22px 24px; }
  .gate-card h1 { font-size: 31px; }
  .board-head { margin-bottom: 22px; }
  .filters { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .chip { flex: 0 0 auto; }
  .drawer { padding: 20px 18px 28px; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 8px 10px; }
  .card-tools { opacity: 1; }
  .toast { bottom: 20px; }
}

@media (hover: none) {
  .card-tools { opacity: 1; }
  .mini { color: rgba(167, 156, 140, .8); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
