/*
 * style.css —— 万域聚合 · DSH 插件商店页面样式
 * ------------------------------------------------------------------
 * 设计依据：Apple 家族设计语言（留白、层级、圆角、克制的色彩、细腻阴影、流畅动效）。
 * 令牌说明：本文件只消费 tokens 变量，不另立颜色定义。
 */

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-tinted: #fafafc;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #76767d;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --divider: rgba(0, 0, 0, 0.08);
  --divider-strong: rgba(0, 0, 0, 0.14);
  --card-border: rgba(0, 0, 0, 0.055);
  --header-bg: rgba(251, 251, 253, 0.82);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.1);
  --success: #34c759;
  --success-soft: rgba(52, 199, 89, 0.12);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.035), 0 10px 28px rgba(0, 0, 0, 0.055);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.04), 0 18px 44px rgba(0, 0, 0, 0.1);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-tinted: #171719;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --divider: rgba(255, 255, 255, 0.1);
    --divider-strong: rgba(255, 255, 255, 0.18);
    --card-border: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(22, 22, 23, 0.78);
    --danger: #ff453a;
    --danger-soft: rgba(255, 69, 58, 0.16);
    --success: #30d158;
    --success-soft: rgba(48, 209, 88, 0.16);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.5);
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-tinted);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #fff;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- 按钮与控件 ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 20px;
  border: none; border-radius: 999px;
  background: none; color: var(--text-primary);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.22s var(--ease-out), color 0.22s var(--ease-out),
    transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}
.button:active { transform: scale(0.97); }

.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); text-decoration: none; }

.button-secondary { background: var(--bg-tinted); border: 1px solid var(--divider-strong); }
.button-secondary:hover { background: var(--divider); text-decoration: none; }

.button-ghost { color: var(--accent); }
.button-ghost:hover { background: var(--accent-soft); text-decoration: none; }

select,
input[type="search"] {
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
select:focus-visible,
input[type="search"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 头部导航 ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
}

.nav-shell {
  max-width: 1180px; height: 100%;
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 15px; font-weight: 700; }
.brand-copy small { font-size: 11px; color: var(--text-secondary); }

.site-nav { display: flex; gap: 26px; margin-left: auto; }
.site-nav a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--text-primary); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .button { min-height: 34px; padding: 6px 14px; font-size: 14px; }

.rate-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--success-soft); color: var(--success);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.rate-pill.warn { background: var(--danger-soft); color: var(--danger); }
.rate-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 首屏 ---------- */

.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 88px 24px 56px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--text-tertiary);
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(44px, 7vw, 64px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.hero-sub {
  max-width: 620px; margin: 0 auto 36px;
  color: var(--text-secondary);
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.search-zone { position: relative; max-width: 680px; margin: 0 auto; }

.search-form {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.search-form:focus-within { box-shadow: var(--shadow-hover); border-color: var(--accent); }

.search-icon { color: var(--text-tertiary); flex: none; }

#search-input {
  flex: 1; min-width: 0; border: none; background: none;
  height: 44px; font-size: 17px; box-shadow: none;
}
#search-input:focus-visible { outline: none; box-shadow: none; border: none; }

.search-clear {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--divider); color: var(--text-secondary);
  font-size: 17px; line-height: 1; cursor: pointer; flex: none;
}

.mode-tabs {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  margin-top: 18px;
}
.mode-label { color: var(--text-tertiary); font-size: 13px; margin-right: 4px; }

.mode-tab {
  padding: 7px 14px; border: 1px solid var(--divider-strong); border-radius: 999px;
  background: var(--bg-elevated); color: var(--text-secondary);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.22s var(--ease-out);
}
.mode-tab:hover { color: var(--text-primary); }
.mode-tab[aria-pressed="true"] { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg); }

.suggestions {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 50;
  padding: 8px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--divider);
  box-shadow: var(--shadow-hover); text-align: left;
}
.suggestion-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: none; border-radius: 10px;
  background: none; color: var(--text-primary);
  font: inherit; text-align: left; cursor: pointer;
}
.suggestion-item:hover, .suggestion-item[aria-selected="true"] { background: var(--accent-soft); }
.suggestion-avatar { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: var(--divider); flex: none; }
.suggestion-copy { min-width: 0; }
.suggestion-name { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-meta { display: block; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero-note { margin: 26px 0 0; color: var(--text-tertiary); font-size: 13px; }
.hero-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); margin-right: 6px; vertical-align: 1px;
}
.hero-sep { margin: 0 8px; color: var(--divider-strong); }

/* ---------- 商店主体 ---------- */

.store-layout {
  max-width: 1180px;
  margin: 0 auto; padding: 24px 24px 72px;
  display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 40px;
  align-items: start;
}

.filter-panel {
  position: sticky; top: calc(var(--header-h) + 24px);
  display: flex; flex-direction: column; gap: 20px;
  padding: 22px; border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
}

.filter-head { display: flex; align-items: center; justify-content: space-between; }
.filter-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.filter-close {
  display: none; border: none; background: none; color: var(--text-secondary);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px;
}

.filter-group { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.filter-group > label, .filter-group legend { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.filter-group select { width: 100%; min-height: 40px; padding: 8px 12px; font-size: 14px; }

.filter-checks { border: none; padding: 0; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary); font-size: 14px; cursor: pointer;
}
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

.filter-reset { width: 100%; border: 1px solid var(--divider-strong); }

.results { min-width: 0; }

.results-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.results-summary h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.results-summary p { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; }
.load-info { color: var(--text-tertiary) !important; font-size: 12px !important; }

.results-sort { display: flex; gap: 8px; }
.results-sort select { min-height: 40px; padding: 8px 34px 8px 12px; font-size: 14px; }
.order-btn {
  width: 40px; height: 40px; border: 1px solid var(--divider-strong); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-primary); font-size: 16px; cursor: pointer;
}
.order-btn:hover { background: var(--bg-tinted); }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
}
.filter-chip button {
  border: none; background: none; color: inherit; cursor: pointer;
  font: inherit; font-size: 15px; padding: 0; line-height: 1;
}

.repo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: 18px;
  margin: 0; padding: 0; list-style: none;
}

.repo-card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px; border-radius: var(--radius-lg);
  background: var(--bg-elevated); border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.28s var(--ease-out);
  animation: card-rise 0.5s var(--ease-out) both;
}
.repo-card:hover, .repo-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--divider-strong);
  text-decoration: none;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.card-author { margin: 3px 0 0; color: var(--text-secondary); font-size: 13px; }
.topic-badge {
  flex: none; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700;
}

.card-desc {
  margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}

.card-meta { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: 12.5px; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.language-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

.card-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.card-topic {
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg-tinted); border: 1px solid var(--divider);
  color: var(--text-secondary); font-size: 11px; font-weight: 600;
}

.card-footer { display: flex; align-items: center; gap: 9px; margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--divider); }
.card-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--divider); object-fit: cover; flex: none; }
.card-footer-copy { min-width: 0; }
.card-footer-copy strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-footer-copy span { display: block; color: var(--text-tertiary); font-size: 11.5px; }
.card-arrow { margin-left: auto; color: var(--text-tertiary); }

/* ---------- 骨架屏 ---------- */

.skeleton-card {
  height: 210px; border-radius: var(--radius-lg);
  background: var(--bg-elevated); border: 1px solid var(--card-border);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--divider) 25%, var(--bg-tinted) 50%, var(--divider) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-100 { width: 100%; }
.skeleton-line.h-lg { height: 18px; }

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 状态面板 ---------- */

.state-panel { text-align: center; padding: 72px 24px; }
.state-icon {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-tinted); border: 1px solid var(--divider);
  color: var(--text-tertiary); font-size: 22px; font-weight: 700;
}
.state-panel h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.state-panel p { margin: 0 0 20px; color: var(--text-secondary); font-size: 15px; }
.state-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.load-more-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.rate-note { margin: 16px 0 0; text-align: center; color: var(--text-tertiary); font-size: 12px; }

/* ---------- 社群区与页脚 ---------- */

.community {
  max-width: 760px; margin: 0 auto; padding: 72px 24px 88px;
  text-align: center; border-top: 1px solid var(--divider);
}
.community h2 {
  margin: 0 0 14px; font-size: clamp(32px, 5vw, 44px);
  font-weight: 700; letter-spacing: -0.03em;
}
.community p { margin: 0 auto 26px; max-width: 560px; color: var(--text-secondary); font-size: 17px; line-height: 1.6; }
.community-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.site-footer { background: var(--bg-tinted); border-top: 1px solid var(--divider); }
.footer-shell {
  max-width: 1180px; margin: 0 auto; padding: 40px 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-brand strong { font-size: 16px; }
.footer-brand p, .footer-meta p { margin: 6px 0 0; color: var(--text-secondary); font-size: 12.5px; }
.footer-meta { text-align: right; }

/* ---------- 详情面板 ---------- */

.detail-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.25s var(--ease-out) both;
}

.detail-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(560px, 92vw);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sheet);
  overflow-y: auto;
  animation: sheet-in 0.36s var(--ease-out) both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.detail-close {
  position: sticky; top: 16px; margin-left: calc(100% - 58px); z-index: 5;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: var(--bg-tinted); color: var(--text-secondary);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.detail-close:hover { background: var(--divider); color: var(--text-primary); }

.detail-content { padding: 0 34px 48px; }

.detail-head { display: flex; gap: 16px; align-items: center; }
.detail-avatar { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--divider); }
.detail-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.detail-owner { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; }
.detail-actions { display: flex; gap: 10px; margin: 22px 0; flex-wrap: wrap; }

.detail-desc { margin: 0 0 24px; color: var(--text-secondary); font-size: 16px; line-height: 1.6; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 18px 0; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
}
.detail-fact { margin: 0; }
.detail-fact dt { color: var(--text-tertiary); font-size: 12px; }
.detail-fact dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; }

.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.detail-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-topic {
  padding: 5px 12px; border-radius: 999px; background: var(--bg-tinted);
  border: 1px solid var(--divider); color: var(--text-secondary); font-size: 13px; font-weight: 600;
}

.detail-readme {
  margin-top: 24px; padding: 20px; border-radius: var(--radius-md);
  background: var(--bg-tinted); border: 1px solid var(--divider);
  font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 320px; overflow-y: auto;
}
.detail-readme-note { color: var(--text-tertiary); font-size: 12px; }

/* ---------- 移动筛选 ---------- */

.filter-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: none; align-items: center; gap: 8px;
  padding: 13px 20px; border: none; border-radius: 999px;
  background: var(--text-primary); color: var(--bg);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-hover);
}
.filter-backdrop {
  position: fixed; inset: 0; z-index: 105;
  background: rgba(0, 0, 0, 0.38);
  animation: fade-in 0.2s var(--ease-out) both;
}

.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 220;
  transform: translateX(-50%);
  padding: 11px 22px; border-radius: 999px;
  background: var(--text-primary); color: var(--bg);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-hover);
  animation: toast-in 0.3s var(--ease-out) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .site-nav { display: none; }
  .store-layout { grid-template-columns: 1fr; gap: 24px; }
  .filter-panel {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 110;
    width: min(320px, 86vw); border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease-out);
  }
  body.filters-open .filter-panel { transform: none; }
  .filter-close { display: block; }
  .filter-toggle { display: inline-flex; }
  .detail-panel { width: 100%; }
  .footer-shell { flex-direction: column; }
  .footer-meta { text-align: left; }
}

@media (max-width: 560px) {
  .hero { padding-top: 56px; }
  .search-form { padding-left: 16px; }
  #search-input { font-size: 15px; }
  .mode-label { width: 100%; text-align: center; }
  .results-sort { width: 100%; }
  .results-sort select { flex: 1; }
  .nav-actions .rate-pill { display: none; }
  .detail-content { padding: 0 22px 40px; }
}

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