/* ============================================================
   BOOTH 资产管理器 — 样式表
   ============================================================ */
:root {
  --bg: #e7ecf6;
  --surface: rgba(255, 255, 255, .62);
  --surface-strong: rgba(255, 255, 255, .78);
  --surface-soft: rgba(255, 255, 255, .4);
  --surface-2: rgba(255, 255, 255, .42);
  --surface-3: rgba(255, 255, 255, .3);
  --line: rgba(16, 24, 40, .085);
  --line-strong: rgba(16, 24, 40, .16);
  --glass-line: rgba(255, 255, 255, .72);
  --glass-line-strong: rgba(255, 255, 255, .9);
  /* thick material：抽屉与弹窗内容密集，透明度定在 87%——再低文字会跟背后内容打架，
     再高就看不到折射；靠高模糊与高饱和让残留的 13% 色彩只留下色晕，不出现可辨认的图像 */
  --material-thick: rgba(255, 255, 255, .87);
  --material-blur: blur(32px) saturate(180%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 24px rgba(16, 24, 40, .07), 0 1px 3px rgba(16, 24, 40, .04);
  /* 立体感靠两层阴影：贴地的接触阴影决定「厚度」，扩散的环境阴影决定「高度」 */
  --elev-card: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(16, 24, 40, .03),
               0 1px 2px rgba(16, 24, 40, .06), 0 12px 30px rgba(16, 24, 40, .09);
  --elev-card-hover: inset 0 1px 0 rgba(255, 255, 255, .98), inset 0 -1px 0 rgba(16, 24, 40, .02),
                     0 2px 6px rgba(16, 24, 40, .07), 0 24px 48px rgba(16, 24, 40, .17);
  --text: #16191f;
  --text-2: #465061;
  --muted: #67707f;
  --accent: #ff4d5e;
  --accent-dark: #e63549;
  --accent-soft: rgba(255, 77, 94, .1);
  --blue: #2f6fed;
  --green: #10a37f;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --sidebar-w: 236px;

  /* 流体动效：WWDC 弹簧规格（sheet ζ=0.8 / response 0.3s，普通 UI ζ=1.0 / 0.35s） */
  --spring-sheet: linear(0, 0.0588, 0.1912, 0.3497, 0.5054, 0.643, 0.7561, 0.8437, 0.9082, 0.953, 0.9825, 1.0004, 1.0101, 1.0144, 1.0151, 1.0139, 1.0118, 1.0094, 1.007, 1.005, 1.0034, 1.0021, 1.0012, 1.0006, 1.0002, 1.0, 0.9998, 0.9998, 0.9998, 0.9998, 0.9998, 0.9999, 1);
  --spring-soft: linear(0, 0.0327, 0.1092, 0.2062, 0.309, 0.409, 0.5015, 0.584, 0.656, 0.7177, 0.7698, 0.8133, 0.8493, 0.8788, 0.9029, 0.9225, 0.9383, 0.951, 0.9612, 0.9693, 0.9758, 0.9809, 0.985, 0.9882, 0.9908, 0.9928, 0.9944, 0.9956, 0.9966, 0.9973, 0.9979, 0.9984, 1);
  --dur-sheet: .58s;
  --dur-soft: .5s;
  --dur-quick: .26s;
}

* { box-sizing: border-box; }

/* hidden 属性必须优先于各处的 display 声明 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 毛玻璃需要可折射的内容：固定光斑在滚动时天然形成视差。
   光斑要保持低饱和——它们只负责让玻璃有厚度，不负责抢主体内容的注意力 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(72vw 62vw at 24% 4%, rgba(86, 140, 255, .46), transparent 70%),
    radial-gradient(62vw 56vw at 96% 0%, rgba(255, 100, 132, .36), transparent 68%),
    radial-gradient(66vw 60vw at 84% 102%, rgba(46, 190, 170, .34), transparent 70%),
    radial-gradient(56vw 52vw at 2% 100%, rgba(140, 108, 255, .28), transparent 68%);
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
/* 键盘导航需要比鼠标悬停更明确的焦点环；输入框已有自己的聚焦样式 */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible { outline: 2px solid rgba(47, 111, 237, .6); outline-offset: 2px; }
::selection { background: #ffd9dd; }

/* 滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(16, 24, 40, .16);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(16, 24, 40, .26); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ 布局 ============================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 8px;
  height: 100vh;
  padding: 8px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ============================ 侧边栏 ============================ */
/* 侧栏与主区各是一块浮在壁纸上的玻璃板：独立圆角、独立投影，板与板之间留缝 */
.sidebar {
  background: rgba(255, 255, 255, .34);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 24, 40, .05), 0 18px 40px rgba(16, 24, 40, .10);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 10px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 16px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ff5f6e, #f54657);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 4px 14px rgba(255, 77, 94, .3);
  letter-spacing: -.5px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 13.5px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  text-align: left;
  transition: background .14s, color .14s, transform var(--dur-quick) var(--spring-soft);
  position: relative;
}
.nav-item:active { transform: scale(.985); }
.nav-item svg { width: 16px; height: 16px; opacity: .75; }
.nav-item span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, .5);
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.nav-item:hover { background: rgba(255, 255, 255, .55); color: var(--text); }
.nav-item.is-active {
  background: rgba(255, 77, 94, .12);
  color: var(--accent-dark);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.nav-item.is-active svg { opacity: 1; }
.nav-item.is-active em { background: rgba(255, 77, 94, .16); color: var(--accent-dark); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex: 0 0 8px;
}

.nav-item .dot { flex: 0 0 8px; }

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 9px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.side-head-actions { display: flex; gap: 2px; }

.mini-btn {
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}
.mini-btn:hover { background: rgba(255, 255, 255, .6); color: var(--text); border-color: var(--glass-line); }

.nav-cats { flex: 1; }

.side-foot {
  margin-top: 12px;
  padding: 10px 9px 2px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}
.stat-row em { font-style: normal; color: var(--text-2); font-variant-numeric: tabular-nums; }
.side-settings {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.side-settings svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.side-settings:hover {
  background: rgba(255, 255, 255, .55);
  border-color: var(--glass-line);
  color: var(--text);
}

/* ============================ 主区域 ============================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .30);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 24, 40, .05), 0 18px 40px rgba(16, 24, 40, .10);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .6);
  /* 主区本身已是玻璃，顶栏只叠一层更亮的白；父级带滤镜时子级再 blur 只会采样父级内部，白费开销 */
  border-bottom: 1px solid rgba(16, 24, 40, .05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 0 rgba(16, 24, 40, .03);
  z-index: 5;
}

.search {
  position: relative;
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
  width: 16px;
  height: 16px;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 34px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .58);
  border-radius: var(--r-sm);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus {
  border-color: rgba(255, 143, 154, .9);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 0 0 3px rgba(255, 77, 94, .12), inset 0 1px 0 rgba(255, 255, 255, .85);
}
.search-clear {
  position: absolute;
  right: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 5px;
}
.search-clear:hover { background: rgba(255, 255, 255, .6); color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn.mobile-menu { display: none; }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 34;
  background: rgba(17, 22, 30, .3);
  opacity: 0;
  transition: opacity .2s ease;
}
.nav-scrim.is-open { opacity: 1; }

/* 角色徽标与按角色显隐；隐藏必须压过组件自身的 display */
.role-badge {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--glass-line);
  color: var(--muted);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.role-badge.is-admin {
  background: rgba(255, 77, 94, .1);
  border-color: rgba(255, 77, 94, .22);
  color: var(--accent-dark);
  font-weight: 600;
}
body.is-guest .admin-only { display: none !important; }
body:not(.is-guest) .guest-only { display: none !important; }

.select {
  height: 34px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .58) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237b8494' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none;
  outline: none;
  color: var(--text-2);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
.select:focus { border-color: rgba(255, 143, 154, .9); box-shadow: 0 0 0 3px rgba(255, 77, 94, .1); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .78);
  background: linear-gradient(180deg, rgba(255, 255, 255, .84), rgba(255, 255, 255, .62));
  color: #3c4658;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 24, 40, .05);
  transition: background .14s, border-color .14s, box-shadow .14s, transform var(--dur-quick) var(--spring-soft), color .14s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .98);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .98), 0 4px 12px rgba(16, 24, 40, .09);
}
.btn:active { transform: scale(.96); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.btn-primary {
  background: linear-gradient(180deg, #ff5f6e, #f54657);
  border-color: rgba(255, 120, 132, .9);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px rgba(255, 77, 94, .28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ff6b79, #e63549);
  border-color: rgba(255, 120, 132, .95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 18px rgba(255, 77, 94, .34);
}
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .55); border-color: var(--glass-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.btn-danger {
  color: #b42318;
  border-color: rgba(255, 178, 170, .72);
  background: linear-gradient(180deg, rgba(255, 246, 245, .92), rgba(255, 236, 235, .7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.btn-danger:hover { background: rgba(255, 236, 235, .95); border-color: rgba(238, 176, 170, .95); color: #b42318; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  color: var(--muted);
}
.icon-btn:hover { background: rgba(255, 255, 255, .6); color: var(--text); border-color: var(--glass-line); }
.icon-btn svg { width: 16px; height: 16px; }

.crumb {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 20px 4px;
}
.crumb h1 { font-size: 17px; margin: 0; letter-spacing: -.2px; }
.pill {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--glass-line);
  padding: 2px 8px;
  border-radius: 99px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 40px;
}

/* ============================ 卡片网格 ============================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 14px;
}

.card {
  /* 主区已是毛玻璃，卡片的层次靠白色渐变的明度差与双层阴影表达，不再叠第二层滤镜 */
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .66));
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--elev-card);
  transition: box-shadow .18s ease, transform var(--dur-quick) var(--spring-soft), border-color .16s, background .18s;
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.card:hover {
  box-shadow: var(--elev-card-hover);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .96);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .74));
}
/* 按下即反馈：抬起前就给出形变，不等 click */
.card.is-pressed {
  transform: scale(.972);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 24, 40, .06), 0 4px 10px rgba(16, 24, 40, .05);
  border-color: rgba(255, 255, 255, .9);
  transition-duration: .12s;
}
.card.is-pressed .card-thumb img { transform: scale(1.012); }

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--spring-soft);
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb .no-img {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b9c1cd;
}
.card-thumb .no-img svg { width: 34px; height: 34px; }

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(22, 25, 31, .72);
  color: #fff;
  backdrop-filter: blur(4px);
}
.badge.local { background: rgba(16, 163, 127, .85); }

.star {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: rgba(255, 255, 255, .88);
  color: var(--muted);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  backdrop-filter: blur(4px);
}
.card:hover .star, .star.is-on { opacity: 1; }
.star:hover { background: rgba(255, 255, 255, .95); color: #f0a500; }
.star.is-on { color: #f0a500; }
.star.is-on svg { fill: #ffc02e; stroke: #f0a500; }
.star svg { width: 15px; height: 15px; }

.card-body {
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  /* 封面与文字区之间的一道高光，让玻璃在视觉上「压」在图片上 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}
.card-title {
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.84em;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  min-height: 17px;
}
.card-meta .shop {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.chip {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .5);
  color: var(--text-2);
  border: 1px solid var(--glass-line);
  white-space: nowrap;
  flex: none;
}
.chip.solid { border-color: transparent; font-weight: 600; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  border-top: 1px dashed rgba(16, 24, 40, .1);
  margin: auto 11px 0;
  padding: 7px 0 9px;
}
.card-foot .warn { color: #c77700; }
.card-foot .ok { color: var(--green); }

/* ============================ 空状态 ============================ */
.empty {
  margin-top: 6vh;
  text-align: center;
  padding: 40px 20px;
  border: 1.5px dashed rgba(16, 24, 40, .14);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .42);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}
.empty-icon { color: rgba(16, 24, 40, .2); display: grid; place-items: center; margin-bottom: 8px; }
.empty-icon svg { width: 60px; height: 60px; stroke-width: 1.2; }
.empty h3 { margin: 4px 0 6px; font-size: 15px; }
.empty p { margin: 0 auto 16px; color: var(--muted); max-width: 420px; line-height: 1.7; }
.empty-actions { display: flex; gap: 8px; justify-content: center; }

/* ============================ 抽屉 ============================ */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 22, 30, .28);
  backdrop-filter: blur(2.5px);
  z-index: 20;
  opacity: 0;
  transition: opacity .22s ease;
}
.scrim.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: min(600px, 92vw);
  background: var(--material-thick);
  backdrop-filter: var(--material-blur);
  -webkit-backdrop-filter: var(--material-blur);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 2px rgba(16, 24, 40, .06), 0 30px 80px rgba(16, 24, 40, .24);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(102%);
  transition: transform var(--dur-sheet) var(--spring-sheet), visibility 0s linear var(--dur-sheet);
  visibility: hidden;
  will-change: transform;
}
/* 打开时立刻可见，收起时保持可见到滑出结束（否则看不到出场动画） */
.drawer.is-open {
  transform: none;
  visibility: visible;
  transition: transform var(--dur-sheet) var(--spring-sheet);
}
/* 拖动关闭期间禁用过渡，1:1 跟手 */
.drawer.is-dragging { transition: none; }
.drawer.is-dragging .drawer-body { pointer-events: none; }

.drawer-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(16, 24, 40, .07);
  cursor: grab;
  touch-action: none;
}
.drawer-head .icon-btn { cursor: pointer; }
.drawer.is-dragging .drawer-head { cursor: grabbing; }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 {
  font-size: 15px;
  margin: 6px 0 0;
  line-height: 1.45;
  word-break: break-word;
}
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.tag.local { background: #e8f8f3; color: #0b7d61; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* 抽屉内容是纵向流，禁止子项被压缩（否则 overflow:hidden 的块会被挤扁） */
.drawer-body > * { flex: 0 0 auto; }

.gallery { display: flex; flex-direction: column; gap: 8px; }
.gallery-main {
  background: rgba(255, 255, 255, .34);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-main .placeholder { color: rgba(16, 24, 40, .24); text-align: center; font-size: 12px; }
.gallery-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.gallery-thumbs img {
  width: 62px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, .65);
  cursor: pointer;
  flex: none;
  background: rgba(255, 255, 255, .3);
}
.gallery-thumbs img.is-active { border-color: var(--accent); }

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(16, 24, 40, .07);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.kv > div { background: rgba(255, 255, 255, .52); padding: 9px 11px; }
.kv dt { font-size: 11.5px; color: #5f6977; margin-bottom: 3px; }
.kv dd { margin: 0; font-size: 12.8px; font-weight: 500; word-break: break-all; }

.actions { display: flex; flex-wrap: wrap; gap: 7px; }

.link-booth {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 9px 10px;
  background: rgba(255, 77, 94, .08);
  border: 1px solid rgba(255, 77, 94, .18);
  border-radius: var(--r-sm);
}
.link-booth input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--glass-line);
  border-radius: 9px;
  padding: 0 9px;
  outline: none;
  background: rgba(255, 255, 255, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.link-booth input:focus { border-color: rgba(255, 143, 154, .9); box-shadow: 0 0 0 3px rgba(255, 77, 94, .1); }
.link-booth .btn { height: 30px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .3px;
  margin-bottom: -6px;
}
.section-title .line { flex: 1; height: 1px; background: var(--line); }

.desc {
  font-size: 12.5px;
  line-height: 1.78;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 8.9em;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, .4);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.desc.is-open { max-height: none; }
/* 折叠时底部渐隐，暗示还有内容 */
.desc:not(.is-open)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .4));
  pointer-events: none;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.desc a { color: var(--blue); text-decoration: none; }
.desc a:hover { text-decoration: underline; }
.desc-more {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  padding: 4px 0 0;
}

.tagcloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tagcloud span {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--glass-line);
  color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* 文件浏览器 */
.filebox {
  border: 1px solid var(--glass-line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(255, 255, 255, .36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
.filebox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .35);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.filebox-head strong { color: var(--text); font-size: 12px; }
.filebox-head input {
  margin-left: auto;
  height: 26px;
  width: 140px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  padding: 0 8px;
  background: rgba(255, 255, 255, .58);
  outline: none;
  font-size: 11.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.file-rows { max-height: 300px; overflow-y: auto; }
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: rgba(255, 255, 255, .45); }
.file-row-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.file-row-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row-meta {
  flex: none;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.file-row-actions { display: flex; align-items: center; gap: 2px; flex: none; }

.tree-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }

.preview-hint { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 10px; }

/* ============================ 模态框 ============================ */
.modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(58% 58% at 16% 6%, rgba(96, 148, 255, .18), transparent 64%),
    radial-gradient(48% 48% at 90% 10%, rgba(255, 126, 146, .16), transparent 62%),
    radial-gradient(60% 60% at 72% 98%, rgba(70, 196, 178, .13), transparent 66%),
    rgba(17, 22, 30, .28);
  /* 遮罩自身不做 backdrop-filter：父级带滤镜时，子级卡片的毛玻璃会被浏览器忽略 */
  /* 遮罩保持较浅的黑度，卡片才有内容可折射；再压暗就只剩实色面板的观感 */
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .18s ease;
}
.modal.is-open { opacity: 1; }
.modal.is-closing { opacity: 0; }
.modal-card {
  /* thick material：表单要在彩色封面之上保持可读，但面板仍需保留背后的折射 */
  background: var(--material-thick);
  backdrop-filter: var(--material-blur);
  -webkit-backdrop-filter: var(--material-blur);
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 24px 70px rgba(16, 24, 40, .2), 0 2px 6px rgba(16, 24, 40, .06);
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: scale(.94) translateY(12px);
  opacity: 0;
  transition: transform var(--dur-soft) var(--spring-soft), opacity .2s ease;
  will-change: transform;
}
.modal.is-open .modal-card { transform: none; opacity: 1; }
/* 出场比入场快，且可被重新打开打断 */
.modal.is-closing .modal-card {
  transform: scale(.96) translateY(8px);
  opacity: 0;
  transition: transform .16s ease-in, opacity .14s ease-in;
}
.modal-head {
  display: flex;
  align-items: center;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 14.5px; flex: 1; }
.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(16, 24, 40, .07);
  background: rgba(255, 255, 255, .34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* 未认证门禁：隐藏主界面，登录卡片不可关闭 */
body.is-locked { overflow: hidden; }
body.is-locked .app { visibility: hidden; }
#modalLogin.is-gate .modal-head .icon-btn,
#modalLogin.is-gate .modal-foot .btn-ghost { display: none; }
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 11px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
#guestAccessBox { display: flex; flex-direction: column; gap: 10px; }

@keyframes fade { from { opacity: 0; } }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.field input[type="text"], .field input[type="password"], .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  outline: none;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { resize: vertical; line-height: 1.6; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(255, 143, 154, .9);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 0 0 3px rgba(255, 77, 94, .12), inset 0 1px 0 rgba(255, 255, 255, .85);
}
.field-row { display: flex; gap: 10px; align-items: flex-start; }
.field-row .field { flex: 1; }
.inline-input { display: flex; gap: 8px; align-items: center; }
.inline-input input { flex: 1; min-width: 0; }
.inline-input .btn { flex: none; height: 34px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .55);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s;
}
.check:hover { background: rgba(255, 255, 255, .68); border-color: var(--glass-line-strong); }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin: 0; }
.hint.is-err { color: #b42318; }

.tabs { display: flex; gap: 4px; background: rgba(16, 24, 40, .06); padding: 3px; border-radius: 11px; }
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text-2);
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: rgba(255, 255, 255, .92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 3px rgba(16, 24, 40, .07);
  font-weight: 600;
  color: var(--text);
}

.dropzone {
  border: 1.5px dashed rgba(16, 24, 40, .14);
  border-radius: var(--r-md);
  padding: 22px 16px;
  text-align: center;
  color: var(--text-2);
  background: rgba(255, 255, 255, .34);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: rgba(255, 143, 154, .85); background: rgba(255, 77, 94, .08); }
.dropzone svg { width: 34px; height: 34px; color: rgba(16, 24, 40, .3); margin-bottom: 4px; }
.dropzone p { margin: 2px 0 4px; font-size: 13px; }
.dropzone small { color: var(--muted); font-size: 11px; }
.dropzone .link { color: var(--accent-dark); text-decoration: underline; }

/* 导入进度 */
.progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.progress-head .lbl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-head #progPct { font-variant-numeric: tabular-nums; color: var(--muted); }
.progress-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(16, 24, 40, .08);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff7b86, #e0283c);
  transition: width .18s ease;
}
.progress.is-indeterminate .progress-bar {
  width: 38%;
  animation: indet 1.05s ease-in-out infinite;
}
@keyframes indet {
  0% { margin-left: -38%; }
  100% { margin-left: 100%; }
}
.progress.done .progress-bar { background: linear-gradient(90deg, #34d399, #10a37f); }
.progress.error .progress-bar { background: linear-gradient(90deg, #f87171, #d92d20); }

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 92px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
  padding-top: 2px;
  border-top: 1px dashed var(--line);
  margin-top: 1px;
}
.progress-steps:empty { display: none; }
.progress-steps > div { display: flex; gap: 6px; align-items: flex-start; }
.progress-steps .dot { flex: none; width: 10px; text-align: center; font-size: 9px; line-height: 1.9; }
.progress-steps .dot.ok { color: var(--green); }
.progress-steps .dot.now { color: var(--accent); animation: pulse 1s ease-in-out infinite; }
.progress-steps > div:last-child { color: var(--text-2); }
@keyframes pulse { 50% { opacity: .25; } }

.file-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; min-width: 0; }.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .46);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 9px;
  padding: 5px 9px;
  /* 文件名很长时（尤其是归档/文件夹的多文件行）不设 min-width 会把整行撑出弹窗 */
  min-width: 0;
}
.file-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { color: var(--muted); font-size: 11px; flex: none; white-space: nowrap; }
.file-item .rm { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.file-item .badge {
  /* .badge 本体是给卡片角标用的 position:absolute，文件行里必须改回常规流 */
  position: static;
  top: auto;
  left: auto;
  flex: none;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.file-item.is-err { background: rgba(217, 45, 32, .07); color: #b42318; }
.file-item.is-err .name { color: #b42318; }
.file-item .sub { color: var(--muted); font-size: 11px; }
/* 多文件归档：左「2 个文件」，右边灰字列出文件名（超长省略） */
.file-item.is-multi { align-items: baseline; }
.file-item.is-multi .name { display: flex; gap: 8px; align-items: baseline; }
/* primary 不收缩（"6 个文件" 必须完整），让文件名那一截先让位 */
.file-item .name .primary {
  flex: 0 0 auto;
  white-space: nowrap;
}
.file-item .sub-inline {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}
.file-item .sub-inline {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.url-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

.engine-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 9px;
  padding: 6px 9px;
  margin-top: 8px;
}
.engine-line .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.engine-line.is-warn .dot { background: #f59e0b; }
.engine-line .grow { flex: 1; min-width: 0; }
.engine-line .proxy-ok { color: var(--green); font-weight: 600; }
.engine-line .proxy-warn { color: #c77700; font-weight: 600; }

.preview-box {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px;
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.preview-box img { width: 108px; height: 76px; object-fit: cover; border-radius: 7px; background: var(--surface-3); flex: none; }
.preview-box .info { min-width: 0; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.preview-box .info strong { display: block; color: var(--text); font-size: 12.8px; margin-bottom: 2px; }

.result-list { display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow-y: auto; }
.result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .44);
  border: 1px solid rgba(255, 255, 255, .55);
  color: var(--text-2);
}
.result-item .st { font-weight: 700; font-size: 11px; }
.result-item.ok .st { color: var(--green); }
.result-item.err .st { color: #d92d20; }
.result-item.warn .st { color: #c77700; }
.result-item .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cat-editor { display: flex; flex-direction: column; gap: 6px; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.cat-row input[type="color"] {
  width: 22px;
  height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 5px;
  flex: none;
}
.cat-row input[type="text"] {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  outline: none;
  font-size: 12.5px;
}
.cat-row input[type="text"]:focus { border-color: var(--glass-line-strong); background: rgba(255, 255, 255, .6); }
.cat-row .cnt { font-size: 11px; color: var(--muted); }
.cat-add { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.cat-add input[type="color"] {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 2px;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
}
.cat-add input[type="text"] {
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  outline: none;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* ============================ 图片放大查看 ============================ */
/* 可放大的图片统一给放大光标 + hover 放大镜角标 */
.card-thumb img,
.gallery-main img,
.preview-body img,
.preview-box img { cursor: zoom-in; }

.zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(16, 20, 28, .58);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.zoom-hint svg { width: 12px; height: 12px; }
.card:hover .zoom-hint { opacity: 1; transform: none; }

body.lb-lock { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  background: rgba(9, 12, 17, .93);
  backdrop-filter: blur(3px);
  animation: fade .15s ease;
  user-select: none;
}
.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 72px;
  overflow: hidden;
  touch-action: none;
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: #0b0e13;
  box-shadow: 0 20px 64px rgba(0, 0, 0, .55);
  will-change: transform;
  transition: transform .14s ease-out;
  cursor: zoom-in;
}
.lb-img.is-zoomed { cursor: grab; transition: none; }
.lightbox.is-dragging .lb-img { cursor: grabbing; transition: none; }

.lb-top {
  position: relative;
  flex: none;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #e8edf5;
  background: rgba(11, 15, 21, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
}
.lb-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .88;
}
.lb-actions { display: flex; align-items: center; gap: 6px; }
.lb-zoomval {
  min-width: 46px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: .72;
}
.lb-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #eef2f8;
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .32); }
.lb-btn:active { transform: translateY(1px); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(12, 16, 22, .55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s ease;
}
.lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }

.lb-counter {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(10, 13, 18, .62);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #dfe6f0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .lb-stage { padding: 10px; }
  .lb-nav { width: 32px; height: 50px; font-size: 21px; }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }
  .lb-zoomval, #lbFit, #lbActual { display: none; }
}

/* ============================ Toast ============================ */
.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  background: rgba(28, 34, 48, .82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 12.5px;
  padding: 9px 15px;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 32px rgba(16, 24, 40, .22);
  animation: toastIn .42s var(--spring-soft);
  max-width: 78vw;
}
.toast.ok { background: rgba(15, 123, 96, .88); }
.toast.err { background: rgba(180, 35, 24, .9); }
@keyframes toastIn {
  from { transform: translateY(16px) scale(.94); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.skeleton { background: linear-gradient(90deg, rgba(255, 255, 255, .4), rgba(255, 255, 255, .7), rgba(255, 255, 255, .4)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* 中等宽度下搜索框会被右侧按钮挤扁：让搜索独占一行，操作区换行 */
@media (max-width: 1120px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .search { flex: 1 1 100%; max-width: none; }
  .topbar-right { flex: 1 1 100%; margin-left: 0; overflow-x: auto; }
  .topbar-right > * { flex: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 190px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ============================ 光学字号微调 ============================ */
/* 字号越大视觉越松，按 Apple 的光学字号思路逐级收紧字距 */
.drawer-title h2 { letter-spacing: -.012em; }
.modal-head h3 { letter-spacing: -.008em; }
.card-title { letter-spacing: -.006em; }
.lb-title { letter-spacing: -.004em; }

/* ============================ 分享弹窗玻璃材质 ============================ */
/* 作用域限定在三个分享弹窗，避免改动资产编辑等其他弹窗的观感 */
.modal--glass {
  background:
    radial-gradient(58% 58% at 16% 6%, rgba(96, 148, 255, .16), transparent 64%),
    radial-gradient(48% 48% at 90% 10%, rgba(255, 126, 146, .14), transparent 62%),
    radial-gradient(60% 60% at 72% 98%, rgba(70, 196, 178, .11), transparent 66%),
    rgba(17, 22, 30, .28);
}
.modal--glass .modal-card {
  background: var(--material-thick);
  backdrop-filter: var(--material-blur);
  -webkit-backdrop-filter: var(--material-blur);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9),
              0 24px 70px rgba(16, 24, 40, .18),
              0 2px 6px rgba(16, 24, 40, .06);
  overflow: hidden;
}
.modal--glass .modal-head { border-bottom: 1px solid rgba(16, 24, 40, .07); }
.modal--glass .modal-foot {
  border-top: 1px solid rgba(16, 24, 40, .06);
  background: rgba(255, 255, 255, .34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal--glass .btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow-sm);
}
.modal--glass .btn:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 12px rgba(16, 24, 40, .08);
}
.modal--glass .btn-primary {
  background: linear-gradient(180deg, #ff5f6e, #f54657);
  border-color: rgba(255, 120, 132, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px rgba(255, 77, 94, .28);
}
.modal--glass .btn-primary:hover {
  background: linear-gradient(180deg, #ff6b79, #e63549);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 18px rgba(255, 77, 94, .34);
}
/* 玻璃内嵌玻璃：用更浅的白色叠层拉开层次，不再用实色 surface */
.modal--glass .hub-stat {
  background: rgba(255, 255, 255, .55);
  border-color: rgba(16, 24, 40, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.modal--glass .field input {
  background: rgba(255, 255, 255, .62);
  border-color: rgba(16, 24, 40, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.modal--glass .field input:focus { background: rgba(255, 255, 255, .9); }
.modal--glass .share-link input { background: rgba(255, 255, 255, .62); border-color: rgba(16, 24, 40, .12); }
.modal--glass .share-link input:focus { background: rgba(255, 255, 255, .9); }
.modal--glass .share-link input[readonly] { background: rgba(255, 255, 255, .5); }
.modal--glass .hub-list,
.modal--glass .log-list {
  background: rgba(255, 255, 255, .5);
  border-color: rgba(16, 24, 40, .08);
}
.modal--glass .hub-row { background: transparent; border-bottom-color: rgba(16, 24, 40, .06); }
.modal--glass .hub-row:hover { background: rgba(255, 255, 255, .5); }
.modal--glass .log-row { border-bottom-color: rgba(16, 24, 40, .06); }
.modal--glass .log-row:hover { background: rgba(255, 255, 255, .5); }
.modal--glass .log-row.is-bad { background: rgba(255, 247, 245, .72); }
.modal--glass .hub-tab { border-color: rgba(16, 24, 40, .08); background: rgba(255, 255, 255, .55); }
.modal--glass .hub-tab:hover { background: rgba(255, 255, 255, .8); border-color: rgba(16, 24, 40, .12); }
.modal--glass .hub-tab.is-on {
  background: rgba(255, 77, 94, .14);
  border-color: rgba(255, 77, 94, .3);
  color: var(--accent-dark);
}
.modal--glass .log-chip { background: rgba(255, 255, 255, .6); border-color: rgba(16, 24, 40, .1); }
.modal--glass .log-chip:hover { background: rgba(255, 255, 255, .85); border-color: rgba(16, 24, 40, .14); }
.modal--glass .log-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal--glass .hub-base code,
.modal--glass .share-tip code {
  background: rgba(255, 255, 255, .48);
  border-color: rgba(255, 255, 255, .64);
}
.modal--glass .share-warn {
  background: rgba(255, 250, 235, .82);
  border-color: rgba(254, 223, 137, .9);
}
.modal--glass .log-scope {
  background: rgba(255, 77, 94, .1);
  border-color: rgba(255, 77, 94, .26);
}

/* 浏览器不支持 backdrop-filter、或系统开启「降低透明度」时回退实色 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal--glass { background: rgba(17, 22, 30, .42); backdrop-filter: none; }
  .modal--glass .modal-card { background: rgba(255, 255, 255, .98); backdrop-filter: none; }
  .modal--glass .modal-foot { background: rgba(251, 252, 253, .95); backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .modal--glass { background: rgba(17, 22, 30, .42); backdrop-filter: none; }
  .modal--glass .modal-card { background: rgba(255, 255, 255, .98); backdrop-filter: none; }
  .modal--glass .modal-foot { background: rgba(251, 252, 253, .95); backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .modal--glass .modal-card { background: rgba(255, 255, 255, .99); border-color: rgba(16, 24, 40, .24); }
  .modal--glass .modal-head,
  .modal--glass .modal-foot { border-color: rgba(16, 24, 40, .2); }
}

/* ============================ 分享下载 ============================ */
.share-link { display: flex; gap: 6px; }
.share-link input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .6);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.share-link input:focus { border-color: rgba(255, 143, 154, .9); background: rgba(255, 255, 255, .86); box-shadow: 0 0 0 3px rgba(255, 77, 94, .12); }
.share-link input[readonly] { color: var(--text-2); background: rgba(255, 255, 255, .38); }
.share-tip { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.share-tip code {
  background: rgba(255, 255, 255, .48);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11.5px;
  color: var(--text-2);
}
.share-actions { display: flex; gap: 8px; }
.share-warn {
  padding: 8px 10px;
  border: 1px solid rgba(254, 223, 137, .9);
  background: rgba(255, 250, 235, .82);
  color: #b54708;
  border-radius: var(--r-sm);
  font-size: 12px;
}

.link-src {
  font-style: normal;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(16, 163, 127, .1);
  color: #0b7d61;
  font-size: 10.5px;
  font-weight: 600;
}

/* ---- 分享总览 ---- */
.hub-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 10px;
  border-bottom: 1px solid var(--line);
}
.hub-tab {
  height: 28px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.hub-tab:hover { background: var(--surface-2); color: var(--text); }
.hub-tab.is-on {
  background: var(--accent-soft);
  border-color: rgba(255, 77, 94, .22);
  color: var(--accent-dark);
  font-weight: 600;
}
.hub-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 11px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  font-size: 11.5px;
  color: var(--text-2);
}
.hub-stat b { color: var(--text); font-weight: 650; }
.hub-stat .hub-spacer { flex: 1; }
.hub-bad b { color: #b42318; }
.hub-base { color: var(--muted); }
.hub-base code {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--glass-line);
}
.hub-list {
  max-height: min(50vh, 400px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .5);
}
.hub-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.hub-row:last-child { border-bottom: 0; }
.hub-row:hover { background: rgba(255, 255, 255, .62); }
.hub-main { flex: 1; min-width: 0; }
.hub-line1,
.hub-line2 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hub-line2 { margin-top: 3px; }
.hub-badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
.hub-badge.is-single { background: #eaf1ff; color: #1f5fbf; }
.hub-title {
  flex: 0 1 auto;
  font-size: 13px;
  font-weight: 570;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-count {
  flex: 0 1 auto;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-spacer { flex: 1; }
.hub-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  max-width: 46%;
}
.hub-metric {
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hub-actions { display: flex; gap: 4px; }
.hub-url {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-last {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hub-actions .btn { flex: none; height: 25px; padding: 0 9px; font-size: 11.5px; }
.hub-revoke { color: #b42318; }
.hub-revoke:hover { color: #912018; border-color: rgba(180, 35, 24, .3); }

@media (max-width: 720px) {
  .hub-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .hub-title { max-width: 100%; }
  .hub-count { display: none; }
  .hub-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: none;
  }
  .hub-stat .hub-base { display: none; }
}

/* ---- 分享日志 ---- */
.log-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 77, 94, .22);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
}
.log-scope .log-chip {
  margin-left: auto;
  background: var(--surface);
  border-color: rgba(255, 77, 94, .28);
  color: var(--accent-dark);
}
.log-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.log-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.log-chip {
  height: 25px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .46);
  color: var(--text-2);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s, transform .1s;
}
.log-chip:hover { border-color: var(--glass-line-strong); background: rgba(255, 255, 255, .66); color: var(--text); }
.log-chip:active { transform: scale(.96); }
.log-chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.log-meta { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.log-list {
  max-height: min(54vh, 440px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .5);
}
.log-head {
  display: grid;
  grid-template-columns: 62px 84px 132px minmax(0, 1fr) 44px 32px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(252, 253, 255, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--muted);
}
.log-head .log-ms,
.log-head .log-status { text-align: right; color: inherit; font-weight: 600; }
.log-row {
  display: grid;
  grid-template-columns: 62px 84px 132px minmax(0, 1fr) 44px 32px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-bottom: 1px solid var(--line);
}
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: var(--surface-2); }
.log-row.is-bad { background: rgba(255, 247, 245, .7); }
.log-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.log-act { font-weight: 560; color: var(--text); }
.log-row.k-download .log-act { color: #0b7d61; }
.log-row.k-admin .log-act { color: var(--blue); }
.log-who,
.log-target {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-dim { color: var(--muted); }
.log-ms,
.log-status {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.log-status { color: #b42318; font-weight: 600; }
.log-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

@media (max-width: 760px) {
  .log-row, .log-head { grid-template-columns: 54px 88px minmax(0, 1fr); }
  .log-who, .log-ms, .log-status { display: none; }
}
/* ============================ 无障碍：减弱动效 ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .card:hover,
  .card.is-pressed { transform: none; }
  .card:hover .card-thumb img { transform: none; }
}

/* ============================ 玻璃材质降级 ============================ */
/* 不支持 backdrop-filter、或系统开启降低透明度时，退回接近实色的面板，保证可读性 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --surface: rgba(255, 255, 255, .96);
    --surface-strong: rgba(255, 255, 255, .99);
    --surface-2: rgba(255, 255, 255, .92);
    --surface-3: rgba(255, 255, 255, .88);
  }
  body::before { display: none; }
  .sidebar, .main { background: rgba(255, 255, 255, .96); }
  .topbar, .drawer, .modal-card { background: rgba(255, 255, 255, .98); }
  .modal-foot { background: rgba(255, 255, 255, .9); }
  .sidebar, .main, .topbar, .drawer, .modal-card, .modal-foot, .empty, .toast {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --surface: rgba(255, 255, 255, .97);
    --surface-strong: rgba(255, 255, 255, .99);
    --surface-2: rgba(255, 255, 255, .94);
    --surface-3: rgba(255, 255, 255, .9);
  }
  body::before { display: none; }
  .sidebar, .main { background: rgba(255, 255, 255, .97); }
  .topbar, .drawer, .modal-card { background: rgba(255, 255, 255, .99); }
  .modal-foot { background: rgba(255, 255, 255, .92); }
  .sidebar, .main, .topbar, .drawer, .modal-card, .modal-foot, .empty, .toast {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --glass-line: rgba(16, 24, 40, .28);
    --glass-line-strong: rgba(16, 24, 40, .42);
    --line: rgba(16, 24, 40, .2);
  }
  body::before { display: none; }
  .modal-card, .drawer, .main { background: rgba(255, 255, 255, .99); }
}

/* ============================ 移动端管理端 ============================ */
/* 侧栏改为抽屉，顶栏两行：搜索独占一行，操作按钮横向滚动 */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 84vw);
    z-index: 35;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 0;
    border-right: 1px solid var(--glass-line);
    border-radius: 0 18px 18px 0;
    box-shadow: 24px 0 60px rgba(16, 24, 40, .18);
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform var(--dur-sheet) var(--spring-sheet), visibility 0s linear var(--dur-sheet);
  }
  .sidebar.is-open {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-sheet) var(--spring-sheet);
  }

  .topbar .mobile-menu { display: inline-flex; }

  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .search {
    flex: 1 1 auto;
    order: 2;
    max-width: none;
    min-width: 0;
  }
  .topbar-right {
    order: 3;
    flex: 1 1 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  .topbar-right > * { flex: none; }

  .crumb { padding: 12px 12px 2px; }
  .content { padding: 10px 12px 32px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

  .drawer { width: min(600px, 100vw); }
  .modal { padding: 12px; }
  .modal-card { max-height: 92vh; }
  .modal-body { padding: 14px; }
}

/* ============================ 系统设置 ============================ */
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-section {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(16, 24, 40, .07);
}
.settings-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.settings-section h4 {
  margin: 0 0 11px;
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: -.005em;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.settings-grid .field.full { grid-column: 1 / -1; }
.settings-check {
  align-self: flex-end;
  padding-bottom: 8px;
}
.settings-test {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  align-self: flex-end;
  padding-bottom: 3px;
}
.settings-readonly input[readonly] {
  color: var(--muted);
  background: rgba(255, 255, 255, .45);
}
.settings-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-foot .hint {
  margin-right: auto;
  text-align: left;
}
@media (max-width: 640px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-check { align-self: auto; padding-bottom: 0; }
  .settings-test { align-self: auto; }
  .settings-foot { flex-wrap: wrap; }
  .settings-foot .hint { flex: 1 1 100%; }
}
