/* ============================================================================
   落难中转站 · Liquid Glass 2.0 设计系统
   —— 流动色彩 · 多层玻璃 · 指针高光 · 弹簧动效 · 桌面/iOS 全适配
   ============================================================================ */
:root {
  /* 主题色（由站点配置注入，JS 会覆盖以下派生值） */
  --accent: #0A84FF;
  --accent-2: #5856D6;
  --accent-3: #AF52DE;
  --accent-ink: #0055C4;
  --accent-soft: rgba(10, 132, 255, .12);
  --accent-line: rgba(10, 132, 255, .26);
  --accent-glow: rgba(10, 132, 255, .42);

  /* 系统色 */
  --green: #34C759;  --green-ink: #1E8E3E;  --green-soft: rgba(52, 199, 89, .13);
  --orange: #FF9500; --orange-ink: #A85F00; --orange-soft: rgba(255, 149, 0, .13);
  --red: #FF3B30;    --red-ink: #C42B21;    --red-soft: rgba(255, 59, 48, .11);
  --pink: #FF2D55;   --teal: #30B0C7;       --yellow: #FFCC00;

  /* 文本 */
  --ink: #12131A;
  --ink-2: #3C3F4A;
  --ink-3: #6A6E7C;
  --muted: #8B8F9C;
  --faint: #ADB1BC;

  /* 玻璃材质 */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-thin: rgba(255, 255, 255, .40);
  --glass-deep: rgba(255, 255, 255, .92);
  --edge-top: rgba(255, 255, 255, .95);
  --edge-bottom: rgba(120, 130, 160, .10);
  --hairline: rgba(60, 60, 67, .13);
  --hairline-soft: rgba(60, 60, 67, .075);
  --fill: rgba(120, 120, 128, .095);
  --fill-2: rgba(120, 120, 128, .16);

  --blur: saturate(190%) blur(34px);
  --blur-lg: saturate(200%) blur(56px);
  --blur-sm: saturate(180%) blur(18px);

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 4px 18px -8px rgba(16, 24, 40, .18);
  --shadow: 0 16px 44px -18px rgba(16, 24, 40, .30);
  --shadow-lg: 0 40px 88px -34px rgba(16, 24, 40, .42);

  --r-xs: 9px; --r-sm: 13px; --r: 20px; --r-lg: 28px; --r-xl: 36px;
  --spring: cubic-bezier(.34, 1.42, .48, 1);
  --ease: cubic-bezier(.22, .8, .32, 1);

  --rail-w: 264px;
  --tabbar-h: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* HTML5 的 hidden 属性必须稳赢：任何 display:flex/grid 都会覆盖浏览器默认的
   [hidden]{display:none}，导致「隐藏」的元素照样显示出来。 */
[hidden] { display: none !important; }

/* 站点图标：管理员上传后替换所有 .site-mark 内部内容 */
.site-mark { overflow: hidden; }
.site-mark.has-logo {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
}
.site-mark.has-logo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: inherit;
}
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: #EEF1F8;
  overflow-x: hidden;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -.022em; }
::selection { background: var(--accent-soft); }
.ico { display: inline-block; vertical-align: -.16em; flex: 0 0 auto; }

/* ============================================================ 流动色彩背景 */
.aurora {
  position: fixed; inset: -12% -12% -12% -12%;
  z-index: -2; pointer-events: none; overflow: hidden; contain: strict;
}
/* 性能关键：大尺寸层的 filter:blur() 是 GPU 杀手，这里的色彩球
   改用「提前渐隐的径向渐变」模拟弥散，不再叠加模糊滤镜。 */
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  opacity: .55; will-change: transform;
}
.aurora i:nth-child(1) {
  width: 46vw; height: 46vw; left: -6vw; top: -8vw;
  background: radial-gradient(circle at 40% 40%, var(--accent) 0%, var(--accent-soft) 34%, transparent 58%);
  animation: drift1 34s ease-in-out infinite;
}
.aurora i:nth-child(2) {
  width: 42vw; height: 42vw; right: -8vw; top: -4vw;
  background: radial-gradient(circle at 55% 45%, var(--accent-3) 0%, var(--accent-soft) 30%, transparent 56%);
  animation: drift2 42s ease-in-out infinite;
}
.aurora i:nth-child(3) {
  width: 40vw; height: 40vw; left: 22vw; bottom: -14vw;
  background: radial-gradient(circle at 50% 50%, var(--accent-2) 0%, var(--accent-soft) 32%, transparent 58%);
  animation: drift3 38s ease-in-out infinite;
}
.aurora i:nth-child(4) {
  width: 34vw; height: 34vw; right: 6vw; bottom: -10vw;
  background: radial-gradient(circle at 50% 50%, rgba(52,199,89,.9) 0%, rgba(52,199,89,.16) 32%, transparent 58%);
  animation: drift4 50s ease-in-out infinite; opacity: .34;
}
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(238,241,248,.86) 62%, #EEF1F8);
}
@keyframes drift1 {
  0%, 100% { transform: translate3d(0,0,0) scale(1) }
  33%      { transform: translate3d(8vw, 6vh, 0) scale(1.16) }
  66%      { transform: translate3d(-4vw, 10vh, 0) scale(.94) }
}
@keyframes drift2 {
  0%, 100% { transform: translate3d(0,0,0) scale(1.05) }
  40%      { transform: translate3d(-9vw, 9vh, 0) scale(.92) }
  70%      { transform: translate3d(-3vw, -5vh, 0) scale(1.2) }
}
@keyframes drift3 {
  0%, 100% { transform: translate3d(0,0,0) scale(1) }
  45%      { transform: translate3d(10vw, -8vh, 0) scale(1.18) }
}
@keyframes drift4 {
  0%, 100% { transform: translate3d(0,0,0) scale(1) }
  50%      { transform: translate3d(-8vw, -9vh, 0) scale(1.22) }
}

/* 细颗粒噪点，避免渐变色带；触屏 / 移动端设备上合 成成本高，直接隐藏 */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .26;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
@media (hover: none), (max-width: 700px) { .grain { display: none; } }

/* ============================================================ 玻璃基元 */
/* 性能分层：内容卡片数量多、随滚动频繁重绘，走「实色半透明」，
   只有顶栏 / 底栏 / 抽屉 / 弹窗 / 提示这类悬浮层才保留毛玻璃模糊。 */
.glass,
.card, .stat, .rail {
  position: relative;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, .58);
  box-shadow: var(--shadow), inset 0 1px 0 var(--edge-top), inset 0 -1px 0 var(--edge-bottom);
}
.tabbar, .topbar, .sheet, .modal .box, .toast {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255, 255, 255, .58);
  box-shadow: var(--shadow), inset 0 1px 0 var(--edge-top), inset 0 -1px 0 var(--edge-bottom);
}
/* 镜面高光层：跟随指针 */
.spec::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%),
              rgba(255,255,255,.55), rgba(255,255,255,0) 62%);
  opacity: 0; transition: opacity .4s var(--ease);
  mix-blend-mode: screen;
}
.spec:hover::before { opacity: 1; }

/* ============================================================ 排版工具 */
.h1 { font-size: 26px; font-weight: 690; letter-spacing: -.03em; }
.h2 { font-size: 17px; font-weight: 640; }
.sub { color: var(--muted); font-size: 13.5px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.hr { height: 1px; border: 0; background: var(--hairline-soft); margin: 16px 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================ 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(60,60,67,.20); border-radius: 10px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(60,60,67,.34); background-clip: content-box; }

/* ============================================================ 卡片 */
.card {
  border-radius: var(--r); padding: 20px; margin-bottom: 16px; min-width: 0;
}
@media (max-width: 720px) { .card { padding: 16px; } }
.card.tight { padding: 14px; }
.card.plain { background: rgba(255,255,255,.5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.card-head h2 .ico { color: var(--accent); }
.card-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }

.grid { display: grid; gap: 16px; }
/* 必须用 minmax(0,1fr)：裸 1fr 的最小值是 min-content，窄屏会被长文本撑破视口 */
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================ 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-grid > * { min-width: 0; }
.stat { border-radius: var(--r); padding: 16px 17px; overflow: hidden; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 560; display: flex; align-items: center; gap: 7px; }
.stat .k .ico { color: var(--accent); }
.stat .v { font-size: 27px; font-weight: 700; letter-spacing: -.045em; margin-top: 6px;
           font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .s { font-size: 12px; color: var(--faint); margin-top: 3px; }
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3) 60%, transparent);
  opacity: .75;
}

/* ============================================================ 表单 */
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 12.5px; font-weight: 580; color: var(--ink-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.55; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 13px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--hairline); border-radius: 12px; outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.7; font-family: var(--mono); font-size: 13px; }
select {
  cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238B8F9C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.2 12 15l6-5.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=range] { accent-color: var(--accent); }
.input-row { display: flex; gap: 9px; align-items: center; }
.input-row input { flex: 1; min-width: 0; }

/* iOS 开关 */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 31px;
  background: rgba(120,120,128,.24); transition: background .26s var(--ease);
}
.switch .slider::before {
  content: ""; position: absolute; height: 27px; width: 27px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0,0,0,.22), 0 0 0 .5px rgba(0,0,0,.04);
  transition: transform .26s var(--spring);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ============================================================ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; font-size: 14px; font-weight: 570; font-family: inherit;
  color: var(--ink); background: var(--glass-strong);
  border: 1px solid var(--hairline); border-radius: 12px;
  cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.9);
  transition: transform .14s var(--spring), background .18s, box-shadow .18s, opacity .18s;
  min-height: 38px;
}
.btn:hover:not(:disabled) { background: #fff; box-shadow: var(--shadow-sm), inset 0 1px 0 #fff; }
.btn:active:not(:disabled) { transform: scale(.965); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-ink));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 24px -12px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.34);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); background: linear-gradient(180deg, var(--accent), var(--accent-ink)); }
.btn.danger { color: var(--red-ink); background: var(--red-soft); border-color: rgba(255,59,48,.2); }
.btn.danger:hover:not(:disabled) { background: rgba(255,59,48,.17); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-3); }
.btn.ghost:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; min-height: 32px; gap: 5px; }
.btn.lg { padding: 12px 23px; font-size: 15px; border-radius: 14px; min-height: 46px; }
.btn.full { width: 100%; }
.btn.icon { padding: 8px; min-height: 34px; min-width: 34px; border-radius: 10px; }

/* 分段控件 */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--fill); border-radius: 12px; }
.segmented .seg {
  padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 550;
  color: var(--ink-3); cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.segmented .seg.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }

/* ============================================================ 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 580; white-space: nowrap;
  background: var(--fill); color: var(--ink-3);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-soft); color: var(--green-ink); }
.badge.off { background: var(--fill); color: var(--muted); }
.badge.warn { background: var(--orange-soft); color: var(--orange-ink); }
.badge.err { background: var(--red-soft); color: var(--red-ink); }
.badge.info { background: var(--accent-soft); color: var(--accent-ink); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 540;
  background: var(--glass-strong); border: 1px solid var(--hairline-soft);
  cursor: pointer; user-select: none; transition: all .18s var(--ease);
}
.chip:hover { background: #fff; box-shadow: var(--shadow-xs); }
.chip.on { background: var(--accent); color: #fff; border-color: transparent; }
.chip.flat { cursor: default; }

/* ============================================================ 表格 */
.table-wrap {
  overflow-x: auto; border-radius: var(--r-sm);
  border: 1px solid var(--hairline-soft); background: rgba(255,255,255,.44);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--hairline-soft); white-space: nowrap; }
th { background: rgba(120,120,128,.055); font-size: 11.5px; font-weight: 620; color: var(--muted);
     letter-spacing: .04em; text-transform: uppercase; position: sticky; top: 0; backdrop-filter: blur(10px); }
tbody tr { transition: background .16s; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ============================================================ 代码 */
.code {
  background: rgba(22,24,32,.95); color: #E6E9F2; border-radius: var(--r-sm);
  padding: 14px 16px; font-family: var(--mono); font-size: 12.6px; line-height: 1.75;
  overflow-x: auto; white-space: pre; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07); -webkit-overflow-scrolling: touch;
}
.code .s { color: #9CE8B4; } .code .k { color: #8FB6FF; } .code .c { color: #7D8699; font-style: italic; }

.keybox {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: rgba(120,120,128,.07); border: 1px solid var(--hairline-soft);
  border-radius: 13px; padding: 10px 11px 10px 14px;
  font-family: var(--mono); font-size: 13px;
}
.keybox .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================ 提示条 */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: 13px; font-size: 13.2px; line-height: 1.6; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line);
}
.alert .ico { margin-top: 1px; flex: 0 0 auto; }
.alert.warn { background: var(--orange-soft); color: var(--orange-ink); border-color: rgba(255,149,0,.2); }
.alert.err  { background: var(--red-soft);   color: var(--red-ink);   border-color: rgba(255,59,48,.2); }
.alert.ok   { background: var(--green-soft); color: var(--green-ink); border-color: rgba(52,199,89,.2); }

/* ============================================================ Toast */
#toasts {
  position: fixed; z-index: 9200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  right: calc(20px + var(--safe-r)); bottom: calc(20px + var(--safe-b));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 210px; max-width: min(380px, 84vw);
  padding: 12px 16px; border-radius: 16px; font-size: 13.5px; font-weight: 520;
  background: var(--glass-deep); box-shadow: var(--shadow-lg);
  animation: toastIn .36s var(--spring); pointer-events: auto;
}
.toast .ico { color: var(--accent); }
.toast.ok .ico { color: var(--green); }
.toast.err .ico { color: var(--red); }
.toast.warn .ico { color: var(--orange); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }

/* ============================================================ 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 8100; padding: 20px;
  display: none; place-items: center;
  background: rgba(24,28,40,.30);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.modal.show { display: grid; }
.modal .box {
  width: 100%; max-width: 540px; max-height: min(88dvh, 88vh); overflow-y: auto;
  padding: 24px; border-radius: var(--r-lg); background: var(--glass-deep);
  animation: modalIn .38s var(--spring); -webkit-overflow-scrolling: touch;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.modal .box h3 { font-size: 18px; }
.modal .box .sub { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

.empty { text-align: center; padding: 38px 20px; color: var(--faint); font-size: 13.5px; }
.empty .ico { color: var(--faint); margin-bottom: 10px; }

.tint { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.18); }

/* ============================================================ 头像 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-weight: 640; font-size: 13.5px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 10px -4px var(--accent-glow);
  object-fit: cover; overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 72px; height: 72px; font-size: 27px; }
.avatar.xl { width: 96px; height: 96px; font-size: 36px; }

/* ============================================================ 动效工具 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.fade-up { animation: fadeUp .34s var(--ease) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } }
.pop-in { animation: popIn .3s var(--spring) both; }
@keyframes shimmer { 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, rgba(120,120,128,.10), rgba(120,120,128,.20), rgba(120,120,128,.10));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
  border-radius: 8px; color: transparent !important;
}

/* 视图过渡 */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .22s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .30s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-5px) scale(.995); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(7px) scale(.995); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
                            transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .aurora i { animation: none !important; }
  .spec::before { display: none; }
}

/* ============================================================================
   交互打磨：弹窗出场 / 按压反馈 / 焦点环 / 滚动条
   ============================================================================ */

/* 遮罩淡入 */
.modal { animation: fadeIn .22s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }

/* 关闭时的出场动画（由 closeModal() 触发的 .closing） */
.modal.closing { animation: fadeOut .18s var(--ease) forwards; pointer-events: none; }
.modal.closing .box { animation: modalOut .18s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal .box { animation-duration: .34s; }

/* 按钮按压反馈 */
.btn { transition: transform .14s var(--spring), background .18s var(--ease), color .18s, box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.955); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary:active:not(:disabled) { box-shadow: 0 4px 12px -6px var(--accent-glow); }

/* 键盘可达性：只在键盘导航时显示焦点环 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(120,130,160,.34) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(120,130,160,.30); border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(120,130,160,.5); background-clip: content-box; }

/* 开关按压反馈 */
.switch:active .slider::before { transform: scale(.92); }
.switch input:checked:active + .slider::before { transform: translateX(20px) scale(.92); }

/* Toast 堆叠：新消息从下方滑入，整体上移更顺 */
#toasts > .toast + .toast { margin-top: 10px; }

/* 卡片悬浮微反馈 */
.card.spec { transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.stat.spec:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* 骨架微光统一到主题色 */
.skeleton {
  background: linear-gradient(100deg, var(--fill) 30%, rgba(255,255,255,.68) 50%, var(--fill) 70%);
  background-size: 220% 100%; animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
