@import url("./description.css");

/* 3D Tools —— 中性纯色 / 8px 卡片与间距 / 32px 控件 / 左导航 + 满高内部滚动
   Unity 工具感：无渐变、无模糊、无普通投影（仅主题扩散 overlay 与 modal scrim 例外） */
:root {
  --bg: oklch(0.205 0 0);
  --bg-elevated: oklch(0.19 0 0);
  --panel: oklch(0.205 0 0);
  --panel-hover: rgb(255 255 255 / 6%);
  --panel-strong: oklch(0.269 0 0);
  --text: oklch(0.985 0 0);
  --muted: oklch(0.708 0 0);
  --faint: oklch(0.65 0 0);
  --line: rgb(255 255 255 / 10%);
  --line-strong: rgb(255 255 255 / 20%);
  --accent: #5b9dff;
  --accent-hover: #78afff;
  --accent-soft: rgb(91 157 255 / 14%);
  --on-accent: #0c1117;
  --good: #22c55e;
  --warn: #eab308;
  --bad: #ef4444;
  /* 鼠标邻近按钮流光色板 */
  --flow-1: #4285f4;
  --flow-2: #9b72cb;
  --flow-3: #d96570;
  --flow-4: #f2a600;
  --flow-5: #34a853;
  --flow-6: #00a9bb;
  --hairline: 1px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 7px;
  --ctl-h: 32px;
  --gap: 8px;
  --font-ui: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: oklch(0.966 0 0);
  --bg-elevated: oklch(0.985 0 0);
  --panel: #fff;
  --panel-hover: oklch(0.94 0 0);
  --panel-strong: oklch(0.94 0 0);
  --text: oklch(0.145 0 0);
  --muted: oklch(0.44 0 0);
  --faint: oklch(0.5 0 0);
  --line: oklch(0.8 0 0);
  --line-strong: oklch(0.7 0 0);
  --accent: #5b9dff;
  --accent-hover: #3f86e8;
  --accent-soft: rgb(91 157 255 / 12%);
  --on-accent: #fff;
  --good: #15803d;
  --warn: #a16207;
  --bad: #b91c1c;
  --hairline: 1.5px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:disabled { opacity: 0.5; cursor: default; }

/* ---------- 应用骨架：左导航 / 满高内部滚动 ---------- */
.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  transition: grid-template-columns 280ms ease;
  grid-template-rows: minmax(0, 1fr) 26px;
}
.sidebar {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--bg-elevated);
  border-right: var(--hairline) solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 12px;
  border-bottom: var(--hairline) solid var(--line);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-mark { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; }
.brand-mark img { width: 26px; height: 26px; object-fit: contain; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy span { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.nav-heading { margin: 8px 8px; font-size: 11px; color: var(--muted); font-weight: 500; }
.filter-tabs { position: relative; display: flex; flex-direction: column; gap: 4px; }

/* 筛选 active 指示器：滑动高亮块 */
.filter-indicator {
  position: absolute;
  left: 0;
  top: 0;
  height: 32px;
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--panel-hover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease, width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.filter-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.filter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 150ms ease; }
.filter-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); transition: color 150ms ease; }
.filter-button:hover { color: var(--text); }
.filter-button.active { color: var(--text); font-weight: 600; }
.filter-button.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
}
.sidebar-foot { flex-shrink: 0; height: 26px; padding: 0 8px; display: flex; align-items: center; border-top: var(--hairline) solid var(--line); color: var(--muted); font-size: 11px; }

.workspace { min-width: 0; min-height: 0; padding: 8px; display: flex; }
.page-panel { flex: 1; min-width: 0; border: var(--hairline) solid var(--line); border-radius: var(--radius-lg); background: var(--bg); overflow-y: auto; overflow-x: hidden; }

.header-overlay { background: var(--bg); }
.header-overlay[data-enabled="true"] { position: sticky; top: 0; z-index: 20; border-bottom: var(--hairline) solid var(--line); }
#overlayButton[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; }
.page-heading { min-width: 0; }
.eyebrow { font-size: 11px; color: var(--muted); }
.page-heading h1 { margin: 3px 0 0; font-size: 18px; line-height: 1.3; font-weight: 650; }
.top-actions { display: flex; gap: 8px; flex-shrink: 0; }

.icon-button {
  position: relative;
  width: 32px; height: 32px; padding: 0;
  display: inline-grid; place-items: center;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.icon-button:hover { background: var(--panel-hover); color: var(--text); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms ease; }
.icon-button:active svg { transform: scale(0.9); }
.icon-button.busy svg { animation: spin 750ms linear infinite; }
#languageButton svg { translate: -3px -3px; }
.lang-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 0 1px;
  border-radius: 2px;
  background: var(--panel);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  pointer-events: none;
}

/* ---------- hero 主横幅：工具/线路选择 + 自动操作 ---------- */
.hero {
  margin: 0 12px 8px;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.hero-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}
.hero-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 180px; }
.field-label { font-size: 10px; color: var(--muted); letter-spacing: 0.3px; text-transform: uppercase; }
.hero-select {
  height: var(--ctl-h);
  width: 100%;
  min-width: 0;
  padding: 0 8px;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  appearance: none;
  background-image: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.hero-select:hover { border-color: var(--line-strong); }
.hero-select:focus-visible { border-color: var(--accent); }
.hero-select[data-warn="true"] { border-color: var(--warn); }

.hero-auto { display: flex; align-items: flex-end; gap: 8px; }
.auto-button {
  position: relative;
  height: var(--ctl-h);
  min-width: 128px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: var(--hairline) solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 150ms ease, transform 120ms ease, opacity 150ms ease;
}
.auto-button[data-mode="INFO"] .auto-icon { display: none; }
.auto-button:hover { background: var(--accent-hover); }
.auto-button:active { transform: translateY(1px); }
.auto-button:disabled { opacity: 0.72; cursor: default; }
.auto-button .auto-icon { display: inline-grid; place-items: center; width: 15px; height: 15px; position: relative; }
.auto-button .auto-icon svg {
  position: absolute;
  inset: 0;
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.auto-button .ico-copy, .auto-button .ico-jump, .auto-button .ico-auto { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.auto-button[data-mode="CP"] .ico-download, .auto-button[data-mode="JP"] .ico-download, .auto-button[data-mode="AUTO"] .ico-download { opacity: 0; transform: rotate(90deg) scale(0.6); }
.auto-button[data-mode="CP"] .ico-copy { opacity: 1; transform: none; }
.auto-button[data-mode="JP"] .ico-jump, .auto-button[data-mode="AUTO"] .ico-auto { opacity: 1; transform: none; }

/* 非线性旋转圆环（dasharray 脉动 + 缓动旋转，禁止 linear spin） */
.auto-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  opacity: 0;
  transition: opacity 180ms ease;
}
.auto-ring .ring-track { fill: none; stroke: currentColor; stroke-width: 2.4; opacity: 0.22; }
.auto-ring .ring-runner {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 16 41;
  transform-origin: 50% 50%;
  animation: ring-spin 1150ms cubic-bezier(0.62, 0.06, 0.34, 0.92) infinite, ring-dash 900ms cubic-bezier(0.45, 0, 0.35, 1) infinite alternate;
}
.auto-button.busy .auto-ring { opacity: 1; }
.auto-button.busy .auto-icon, .auto-button.busy #autoButtonLabel { opacity: 0.12; }
@keyframes ring-spin {
  0% { transform: rotate(0deg); }
  70% { transform: rotate(300deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ring-dash {
  from { stroke-dasharray: 8 49; }
  to { stroke-dasharray: 34 23; }
}

/* ---------- 工具栏 / 搜索 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px 12px; }
.search-field { width: 100%; height: var(--ctl-h); display: flex; align-items: center; gap: 8px; padding: 0 8px; border: var(--hairline) solid var(--line); border-radius: var(--radius-sm); background: var(--panel); transition: border-color 150ms ease; }
.search-field:focus-within { border-color: var(--accent); }
.search-field svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; transition: stroke 150ms ease, transform 200ms ease; }
.search-field:focus-within svg { stroke: var(--accent); transform: scale(1.06); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-field input::placeholder { color: var(--faint); }
.search-field:has(input.invalid) { border-color: var(--bad); }
.search-field input.invalid { color: var(--bad); }
.summary { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; transition: opacity 150ms ease; }

/* ---------- sections / 卡片 ---------- */
.section-list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.section-block {
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-bottom: var(--hairline) solid var(--line);
  background: var(--panel-strong);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.section-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 400; }
.section-body { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.section-block.empty { display: none; }

.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; }
.tool-card {
  min-width: 0;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}
.tool-card.filter-enter { animation: fade-rise 180ms ease-out; }
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(4px); }
}
.tool-card[open] { border-color: var(--line-strong); }

/* details 高度动画容器（Web Animations 测高；grid fallback 0fr/1fr） */
.card-body-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.card-body-clip { min-height: 0; overflow: hidden; }
.card-body { border-top: var(--hairline) solid var(--line); }

.card-summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto 16px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms ease;
}
.card-summary:has(> [data-action="item-jump"]) { grid-template-columns: 32px minmax(0, 1fr) auto auto auto 16px; }
.card-summary::-webkit-details-marker { display: none; }
.card-summary:hover { background: var(--panel-hover); }
.tool-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: var(--hairline) solid var(--line);
  border-radius: 15%;
  background: var(--panel-strong);
  overflow: hidden;
}
.tool-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 200ms ease;
}
.tool-icon img.icon-broken { display: none; }
.card-summary:hover .tool-icon img:not(.icon-broken) { transform: scale(1.06); }

.tool-heading { min-width: 0; }
.tool-name { display: block; margin: 0; font-size: 13.5px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; transition: color 180ms ease; }
.tool-name.status-idle { color: var(--text); }
.tool-name.status-testing { color: var(--warn); }
.tool-name.status-ok { color: var(--good); }
.tool-name.status-bad { color: var(--bad); }
.tool-name.status-partial { color: var(--accent); }
.tool-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; color: var(--muted); font-size: 11px; }
[hidden] { display: none !important; }
select { display: none !important; }
.tag { display: inline-flex; align-items: center; min-height: 18px; padding: 0 5px; border: var(--hairline) solid var(--line); border-radius: 4px; color: var(--muted); background: var(--panel-strong); font-size: 10px; overflow-wrap: anywhere; }
.item-actions { display: inline-flex; align-items: center; gap: 0; padding: 0; border: var(--hairline) solid var(--accent); border-radius: var(--radius-sm); cursor: default; }
.item-actions .combo { flex: 0 0 32px; width: 32px; }
.item-actions .auto-button { min-width: 0; height: calc(var(--ctl-h) - 2 * var(--hairline)); flex: 0 0 auto; padding: 0 10px; border: 0; border-radius: calc(var(--radius-sm) - var(--hairline)) 0 0 calc(var(--radius-sm) - var(--hairline)); }
.item-actions.single-route .auto-button { border-radius: calc(var(--radius-sm) - var(--hairline)); }
.item-actions .auto-button:active { transform: none; }
.item-actions .combo-trigger { justify-content: center; width: 32px; height: calc(var(--ctl-h) - 2 * var(--hairline)); padding: 0; border: 0; border-left: var(--hairline) solid var(--accent); border-radius: 0 calc(var(--radius-sm) - var(--hairline)) calc(var(--radius-sm) - var(--hairline)) 0; }
.item-actions .auto-button, .item-actions .combo-trigger { background: var(--accent); color: var(--on-accent); transition: background-color 150ms ease, color 150ms ease; }
.item-actions .combo-trigger { border-left-color: color-mix(in srgb, var(--on-accent) 30%, transparent); }
.item-actions .combo-trigger > .chevron { stroke: currentColor; }
.item-actions:hover .auto-button, .item-actions:hover .combo-trigger { background: var(--accent-hover); }
.combo { display: block; min-width: 0; width: 100%; }
.combo-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: var(--ctl-h); padding: 0 8px; border: var(--hairline) solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elevated); cursor: pointer; text-align: left; }
.combo-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-trigger svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; }
.combo-trigger[aria-expanded="true"] > .chevron { transform: rotate(180deg); }
.combo-menu { position: fixed; z-index: 100; display: grid; grid-auto-flow: column; gap: 3px; padding: 6px; overflow: auto; scrollbar-gutter: stable; border: var(--hairline) solid var(--line-strong); border-radius: var(--radius-md); background: var(--panel-strong); }
.combo-option { display: block; width: 100%; height: 36px; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.combo-option.active, .combo-option:hover { background: var(--panel-hover); color: var(--accent); }
.auto-button.busy .action-label { opacity: 0.12; }
.link-result:empty { display: none; }
@media (max-width: 520px) { .topbar { flex-wrap: wrap; } .status-item { max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .status-right { width: 100%; } }
.platform-tag, .group-tag {
  display: inline-flex; align-items: center;
  min-height: 18px; padding: 0 5px;
  border: var(--hairline) solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  transition: border-color 150ms ease, color 150ms ease;
}
.group-tag { background: var(--panel-strong); }
.item-tip { display: inline-flex; align-items: center; min-height: 18px; padding: 0 5px; border: var(--hairline) solid var(--line); border-radius: 4px; color: var(--muted); background: var(--panel-strong); font-size: 10px; white-space: nowrap; }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
  transition: background-color 220ms ease, transform 220ms ease;
}
.status-dot.ok { background: var(--good); }
.status-dot.bad { background: var(--bad); }
.status-dot.partial { background: var(--accent); }
.chevron {
  width: 16px; height: 16px;
  fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), stroke 150ms ease;
}
.card-summary:hover .chevron { stroke: var(--text); }
.tool-card[data-expanded="true"] .card-summary > .chevron { transform: rotate(180deg); }
.card-summary > .item-tips { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.card-summary > .item-actions { grid-column: 4; grid-row: 1; }
.card-summary > .chevron { grid-column: -2; grid-row: 1; }
.card-summary > [data-action="item-jump"] { grid-column: 4; grid-row: 1; }
.card-summary:has(> [data-action="item-jump"]) > .item-actions { grid-column: 5; }
.card-summary > .item-actions { min-width: 126px; justify-self: end; }
.card-summary > .item-actions .item-action { flex: 1; justify-content: center; }
.card-summary > .item-actions.single-route .item-action { border-radius: calc(var(--radius-sm) - var(--hairline)); }

.description { margin: 0; padding: 10px 12px; border-bottom: var(--hairline) solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.route-pending { padding: 5px 8px; color: var(--muted); border-color: var(--line); font-size: 11px; }
.pending-route { color: var(--muted); }
.link-list { display: flex; flex-direction: column; }
.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: var(--hairline) solid var(--line);
  transition: background-color 150ms ease;
}
.link-row:last-child { border-bottom: 0; }
.link-row:hover { background: var(--panel-hover); }
.link-row.warn-region { border-left: 2px solid var(--warn); }
.link-main { min-width: 0; }
.link-route-header { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.link-route-content { min-width: 0; flex: 1 1 auto; }
.link-logo { width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain; border-radius: 15%; }
.link-logo.icon-broken { display: none; }
.link-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.link-route-label { color: var(--text); }
.link-file-name { color: var(--muted); font-weight: 400; }
.link-title .combo { width: auto; max-width: min(320px, 100%); }
.link-title .combo-trigger { width: auto; max-width: min(320px, 60vw); height: 24px; padding: 0 6px; font-size: 11px; font-weight: 400; }
.region-label {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 5px;
  border: var(--hairline) solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px; font-weight: 400;
  transition: color 150ms ease, border-color 150ms ease;
}
.link-row.warn-region .region-label { color: var(--warn); border-color: var(--warn); }
.link-result { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; min-height: 15px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.link-result > span { transition: color 180ms ease, opacity 180ms ease; }
.result-ok { color: var(--good); }
.result-bad { color: var(--bad); }
.result-testing { color: var(--accent); }
.link-actions { display: flex; align-items: center; gap: 8px; }
.link-split { display: inline-flex; align-items: stretch; }
.link-split > .action-button { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.link-split > .split-toggle { width: 26px; padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; }
.link-split > .split-toggle.is-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.link-split > .split-toggle.is-primary:hover { background: var(--accent-hover); }
.link-split > .split-toggle svg { width: 14px; height: 14px; }
.link-file-picker { margin-top: 8px; max-width: min(420px, 100%); }
.link-file-meta { margin-top: 6px; }
.file-meta { display: grid; gap: 2px; margin: 0; font-size: 11px; }
.file-meta > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.file-meta dt { color: var(--muted); }
.file-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 10px; }

/* 按钮（32px、8px 圆角、线性 150ms 过渡） */
.primary-button, .secondary-button {
  height: var(--ctl-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: background-color 150ms linear, border-color 150ms linear, color 150ms linear, opacity 150ms linear;
}
.primary-button { border: var(--hairline) solid transparent; background: var(--accent); color: var(--on-accent); }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { border: var(--hairline) solid var(--line); background: var(--panel); color: var(--text); }
.secondary-button:hover { background: var(--panel-hover); }
.primary-button svg, .secondary-button svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.primary-button:active svg, .secondary-button:active svg { transform: translateY(1px) scale(0.92); }
/* 高亮主行为按钮（item.action DL/CP）— 呼吸由 JS Web Animations 驱动 */
.action-button.is-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.action-button.is-primary:hover { background: var(--accent-hover); }
/* 按钮 loading 反馈：图标旋转 + 文案淡入 */
.primary-button.busy, .secondary-button.busy, .auto-button.busy { pointer-events: none; }
.primary-button.busy svg, .secondary-button.busy svg { animation: spin 750ms linear infinite; }
button.loading-flash > span { animation: text-blink 600ms ease-in-out infinite alternate; }
@keyframes text-blink { from { opacity: 1; } to { opacity: 0.55; } }

.empty-state { min-height: 240px; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.empty-state:not([hidden]) { display: grid; }
.empty-mark { width: 40px; height: 40px; display: grid; place-items: center; border: var(--hairline) solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.empty-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--faint); stroke-width: 1.6; }

/* ---------- 状态栏与最近提示 ---------- */
.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 8px;
  border-top: var(--hairline) solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
}
.status-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: opacity 200ms ease, color 200ms ease; }
.status-item.dim { opacity: 0.65; }
.status-right { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; min-width: 0; flex: 0 1 auto; }
/* 桌面宽度：底栏单行，右侧统计按需收缩并以省略号收尾，避免 ES 长文案撑出横向滚动 */
@media (min-width: 861px) {
  .status-right .status-item { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .status-right .status-item:first-child { flex: 0 1 auto; }
  .status-right .status-item:last-child { flex: 0 0 auto; }
}
.status-spacer { display: none; }
.status-notice { min-width: 0; max-width: min(45vw, 560px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-notice:not(:empty) { color: var(--warn); }
.status-notice:not(:empty)::before { content: "•"; margin-right: 2px; }
.mono { font-family: var(--font-mono); }

/* ---------- 顶部横幅通知（关键帧驱动，杜绝入场动效丢失） ---------- */
.toast-region { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.toast.toast-top-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1001;
  width: 100%;
  max-width: 100%;
  padding: 10px 25px 14px;
  border: 0;
  border-radius: 0;
  background: var(--toast-bg, color-mix(in srgb, var(--panel-strong) 86%, var(--accent)));
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}
.toast.toast-top-banner.show { pointer-events: auto; animation: banner-in 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.toast.toast-out { pointer-events: none; animation: banner-out 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.toast.toast-top-banner::after { content: ""; position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; transform-origin: center; background: var(--accent); animation: top-banner-progress var(--toast-duration, 5000ms) linear forwards; }
.toast.toast-top-banner[data-loading]::after { display: none; }
.toast.toast-top-banner.ok { --toast-bg: color-mix(in srgb, var(--panel-strong) 82%, var(--good)); }
.toast.toast-top-banner.bad { --toast-bg: color-mix(in srgb, var(--panel-strong) 82%, var(--bad)); }
.toast.toast-top-banner.warn { --toast-bg: color-mix(in srgb, var(--panel-strong) 82%, var(--warn)); }
@keyframes banner-in { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes banner-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-100%); } }
.sidebar { overflow: hidden; transition: opacity 220ms ease, transform 280ms ease; }
.sidebar-regions { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)) minmax(240px, 1fr); }
.sidebar-region { min-height: 0; overflow: auto; padding: 8px 12px; border-top: var(--hairline) solid var(--line); }
.sidebar-regions > .sidebar-region:first-child { border-top: 0; }
.sidebar-nav.sidebar-region { padding: 6px 8px; }
.sidebar-hidden .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-hidden .sidebar { opacity: 0; transform: translateX(-100%); pointer-events: none; visibility: hidden; transition: opacity 220ms ease, transform 280ms ease, visibility 0s 280ms; }
#requestDetails { display: flex; flex-direction: column; margin: 0; font-size: 11px; }
#requestDetails .info-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 3px 0; border-bottom: var(--hairline) solid var(--line); }
#requestDetails .info-row:last-child { border-bottom: 0; }
#requestDetails dt { color: var(--muted); white-space: nowrap; }
#requestDetails dd { margin: 0; min-width: 0; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#requestDetails dd.upper { text-transform: uppercase; }

/* 中下：测试器（R2 节点 + 第三方站点可达性） */
.health-list { display: flex; flex-direction: column; gap: 3px; }
.health-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 6px; min-height: 24px; font-size: 11px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: background-color 220ms ease; }
.health-dot.ok { background: var(--good); }
.health-dot.bad { background: var(--bad); }
.health-dot.checking { animation: pulse 900ms ease-in-out infinite alternate; }
.health-name { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-code { color: var(--muted); font-size: 10px; white-space: nowrap; }
.health-code.ok { color: var(--good); }
.health-code.bad { color: var(--bad); }
.health-latency { color: var(--muted); font-size: 10px; white-space: nowrap; }
.health-latency.ok { color: var(--good); }
.health-latency.bad { color: var(--bad); }
.health-action { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: var(--hairline) solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; transition: color 150ms ease, border-color 150ms ease; }
.health-action:hover { color: var(--text); border-color: var(--line-strong); }
.health-action svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 底部：本地 SHA-256 校验器 */
.sidebar-checker { display: flex; flex-direction: column; }
.sidebar-checker:has(.hash-drop[data-layout="default"]) .hash-drop { width: min(100%, 170px); flex: 0 0 auto; margin: auto; }
.sidebar-checker:has(#hashClear[hidden]):has(.hash-drop[data-layout="default"]) > :not(.hash-drop) { display: none; }
.hash-drop { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; width: 100%; flex: 0 0 auto; aspect-ratio: 4 / 5; padding: 20px; border: var(--hairline) dashed var(--line-strong); border-radius: 15px; color: var(--muted); cursor: pointer; overflow: hidden; }
.hash-drop[data-layout="compact"] { aspect-ratio: 5 / 1; flex-direction: row; gap: 10px; padding: 8px 12px; }
.hash-drop[data-layout="hidden"] { display: none; }
.hash-drop-icon { display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 64px; color: var(--muted); }
.hash-drop-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-dasharray: 2 2; stroke-linecap: round; stroke-linejoin: round; animation: none; }
.hash-drop[data-layout="compact"] .hash-drop-icon { width: 30px; height: 30px; }
.hash-drop-copy { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.hash-drop[data-layout="compact"] .hash-drop-copy { align-items: flex-start; gap: 2px; }
.hash-drop-title { color: var(--text); font: 600 14px var(--font-mono); letter-spacing: 1px; }
.hash-drop-label { color: var(--muted); font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.hash-drop[data-layout="compact"] .hash-drop-label { text-align: left; font-size: 10px; }
.hash-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.hash-drop input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; }
.maintenance-notice { color: var(--warn); margin-top: 10px; }
.sensitive-value { filter: blur(5px); transition: filter 150ms ease; }
.sensitive-value.revealed { filter: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 1; }
.hash-progress { position: relative; height: 26px; margin-top: 8px; border-radius: 6px; background: var(--panel-strong); overflow: hidden; }
.hash-progress-percent { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px var(--font-mono); color: var(--text); text-shadow: 0 1px 3px var(--bg); }
.hash-controls { display: flex; gap: 8px; }
.hash-controls > button { flex: 1; margin-top: 8px; }
.hash-progress-meta > span { display: block; text-align: center; }
@media (prefers-reduced-motion: reduce) { .hash-drop-icon svg { animation: none; } }
.hash-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--flow-1), var(--flow-2), var(--flow-3), var(--flow-4), var(--flow-5), var(--flow-6), var(--flow-1));
  background-size: 200% 100%;
  animation: hash-flow 1400ms linear infinite;
  transition: width 140ms linear;
}
@keyframes hash-flow { to { background-position: -200% 0; } }
.hash-progress-meta { margin-top: 4px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; overflow-wrap: anywhere; }
.hash-cancel { margin-top: 8px; }
.choice-options { display: grid; gap: 6px; max-height: 55vh; overflow: auto; padding: 3px; }
.choice-option { width: 100%; text-align: left; overflow-wrap: anywhere; }
.sidebar-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px; color: var(--muted); font-size: 10px; }
.sidebar-contact a, .sidebar-contact button { color: inherit; background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.item-actions { flex-shrink: 0; }
.card-summary > [data-action="item-jump"] { display: inline-flex; align-items: center; gap: 5px; }
.card-summary > [data-action="item-jump"] svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.hash-empty { margin-top: 8px; color: var(--faint); font-size: 10px; }
.hash-block { margin-top: 8px; }
.hash-block-title { margin-bottom: 4px; color: var(--muted); font-size: 10px; letter-spacing: 0.3px; text-transform: uppercase; }
.hash-field { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 3px 0; border-bottom: var(--hairline) solid var(--line); }
.hash-field:last-child { border-bottom: 0; }
.hash-field-key { color: var(--muted); font-size: 10px; white-space: nowrap; }
.hash-field-value { min-width: 0; color: var(--text); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.hash-field-value.ok { color: var(--good); }
.hash-field-value.bad { color: var(--bad); }
.hash-field-value.warn { color: var(--warn); }
.hash-copy { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--faint); cursor: pointer; transition: color 150ms ease, background-color 150ms ease; }
.hash-copy:hover { color: var(--text); background: var(--panel-hover); }
.hash-copy.copy-success { color: var(--good); }
.hash-copy svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hash-result { display: block; margin-top: 8px; }
#lockButton[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

.sidebar-scrim { position: fixed; inset: 0; z-index: 35; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(0 0 0 / 45%); animation: scrim-in 180ms ease-out; }
@media (max-width: 860px) {
  .app-shell, .sidebar-hidden .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; }
  .workspace { grid-row: 1; grid-column: 1; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40;
    border-right: 1px solid var(--line);
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0%);
  }
  .sidebar-hidden .sidebar { transform: translateX(-100%); }
  .top-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .toast.toast-top-banner.show { opacity: 1; transform: translateY(0); }
  .toast.toast-out { opacity: 0; transform: translateY(-100%); }
}
@keyframes top-banner-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- 鼠标邻近按钮流光：独立绘制层，不参与按钮布局 ---------- */
@property --aura-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.button-aura {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  -webkit-mask-image: radial-gradient(circle 100px at var(--aura-x) var(--aura-y), #000 15%, transparent 100%);
  mask-image: radial-gradient(circle 100px at var(--aura-x) var(--aura-y), #000 15%, transparent 100%);
}
.button-aura-edge {
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--aura-angle), var(--flow-1), var(--flow-2), var(--flow-3), var(--flow-4), var(--flow-5), var(--flow-6), var(--flow-1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: button-aura-turn 4s linear infinite;
}
.button-aura-halo { filter: blur(2.5px); opacity: 0.7; }
@keyframes button-aura-turn { to { --aura-angle: 360deg; } }


/* ---------- 语言菜单 ---------- */
.lang-menu {
  position: fixed;
  z-index: 70;
  width: 264px;
  max-width: calc(100vw - 16px);
  padding: 4px;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
}
.lang-menu:not([hidden]) { animation: menu-pop 160ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes menu-pop {
  from { opacity: 0; transform: scale(0.94) translateY(-4px); }
}
.lang-menu button {
  min-height: 30px;
  padding: 6px 10px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 130ms ease;
}
.lang-menu button:hover { background: var(--panel-hover); }
.lang-menu button.active { color: var(--accent); font-weight: 600; }

/* ---------- 警告 modal（居中、焦点锁定、scrim） ---------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
}
.modal-layer[hidden] { display: none; }
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 45%);
  animation: scrim-in 180ms ease-out;
}
.modal-box {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  text-align: center;
  animation: modal-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-layer.modal-out .modal-scrim, .modal-layer.modal-out .modal-box { animation: modal-out 160ms ease-in forwards; }
@keyframes scrim-in { from { opacity: 0; } }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
}
@keyframes modal-out {
  to { opacity: 0; transform: scale(0.95) translateY(6px); }
}
.modal-icon { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border: var(--hairline) solid var(--warn); border-radius: var(--radius-lg); }
.modal-icon svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--warn); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.modal-icon svg .bang { animation: bang-pop 260ms cubic-bezier(0.22, 1, 0.36, 1) 120ms backwards; transform-origin: 12px 12px; }
@keyframes bang-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}
.modal-title { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.modal-layer.modal-emphasis .modal-title { font-size: 20px; font-weight: 750; letter-spacing: .01em; }
.modal-text { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.65; text-align: center; font-weight: 700; overflow-wrap: anywhere; }
.modal-text em, .warning-check-text em { font-style: italic; }
.warning-checks { display: grid; gap: 14px; margin: 0 0 16px; }
.warning-check { display: grid; gap: 8px; }
.warning-check-text { margin: 0; color: var(--text); font-size: 13px; line-height: 1.7; text-align: center; font-weight: 700; overflow-wrap: anywhere; }
.warning-check-label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.5; text-align: left; cursor: pointer; }
.warning-check-label input { margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.warning-check-text .combo { margin: 12px 0 2px; }
.warning-code {
  display: block;
  margin: 12px 0;
  padding: 10px 12px;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  overflow-x: auto;
  text-align: left;
}
.warning-code code { font-family: var(--font-mono); font-size: 12px; font-weight: 500; white-space: pre; }
#warningModal .modal-title { color: var(--warn); }
.modal-actions .theme-button { border-color: var(--line-strong); background: var(--panel-strong); color: var(--text); }
.modal-actions .theme-button:hover { background: var(--panel-hover); }
.modal-actions .warn-button { border-color: transparent; background: var(--warn); color: var(--bg); }
.modal-actions .warn-button:hover { background: color-mix(in srgb, var(--warn) 86%, var(--text)); }
.modal-actions .danger-button { border-color: transparent; background: var(--bad); color: var(--bg); }
.modal-actions .danger-button:hover { background: color-mix(in srgb, var(--bad) 86%, var(--text)); }
.modal-actions.modal-actions-stack { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
.modal-actions.modal-actions-stack > button { width: 100%; }
.modal-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

/* ---------- 主题扩散 overlay（圆形 clip-path，从按钮坐标向外） ---------- */
#themeOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  pointer-events: none;
  clip-path: circle(0px at var(--tx, 50%) var(--ty, 50%));
}
/* 主题切换期间冻结原生 view-transition 覆盖（避免与 modal 层冲突） */
html.vt-disabled::view-transition-old(root),
html.vt-disabled::view-transition-new(root) { animation: none; }

/* 404 页面 */
.error-page { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.error-code { color: var(--text); font-family: var(--font-mono); font-size: 52px; font-weight: 650; }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- 浏览器适配 ---------- */
@media (max-width: 860px) {
  .brand { min-height: 46px; padding: 8px 12px; }
  .brand-copy { flex-direction: row; align-items: center; gap: 8px; }
  .sidebar-foot { display: none; }
  .filter-tabs { flex-direction: row; flex-wrap: wrap; }
  .filter-indicator { display: none; }
  .filter-button { gap: 8px; padding: 0 10px; }
  .filter-button.active { background: var(--panel-hover); }
  .filter-button.active::after { display: none; }
  .filter-count { margin-left: 0; }
  .hero { margin: 0 8px 8px; }
  .hero-field { flex: 1 1 140px; }
  .hero-auto { flex: 1 1 100%; }
  .auto-button { flex: 1; }
  .link-row { grid-template-columns: minmax(0, 1fr); }
  .link-actions { justify-content: flex-end; }
  .statusbar { min-height: 26px; flex-wrap: wrap; row-gap: 2px; padding-block: 3px; }
  .status-right { margin-left: 0; }
}
@media (max-width: 520px) {
  .brand-copy span { font-size: 9px; }
  .topbar { padding: 10px 8px 8px; }
  .top-actions { gap: 8px; }
  .page-heading h1 { font-size: 16px; }
  .toolbar { flex-wrap: wrap; padding: 0 8px 8px; }
  .search-field { width: 100%; }
  .summary { margin-left: 0; }
  .section-list { padding: 0 8px 8px; }
  .hero-row { padding: 8px; }
  .hero-field { flex: 1 1 100%; }
  .card-summary { grid-template-columns: 28px minmax(0, 1fr) auto auto 16px; gap: 6px; padding: 8px; }
  .card-summary > .item-tips { grid-column: 3; }
  .card-summary > .item-actions { grid-column: 4; }
  .card-summary > .chevron { grid-column: 5; }
  .item-actions .auto-button { padding-inline: 6px; gap: 4px; }
  .tool-icon { width: 28px; height: 28px; }
  .tool-meta { gap: 4px 6px; font-size: 10px; }
  .description, .link-row { padding: 10px 12px; }
  .link-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .primary-button, .secondary-button { width: 100%; padding: 0 6px; }
  .statusbar { gap: 4px 8px; font-size: 10px; }
  .status-spacer { display: none; }
  .status-right { flex-wrap: wrap; row-gap: 2px; }
  html[lang="es"] .status-item { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .status-notice { max-width: 100%; }
  .toast { padding-inline: 12px; }
  .modal-actions .primary-button, .modal-actions .secondary-button { width: auto; min-width: 96px; }
}

@media (max-width: 360px) {
  .item-actions .action-label { display: none; }
  .item-actions .auto-button { width: 30px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .card-body-wrap { transition: none !important; }
  .button-aura-edge { animation: none !important; }
  .button-aura-halo { display: none; }
  .hash-progress-fill { animation: none !important; }
}
