/* ==========================================================================
   盘搜 PanSou — 前端样式
   零依赖，纯 CSS 变量驱动，支持深色 / 浅色
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --topbar-h: 64px;
  --page-w: 960px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

html[data-theme="dark"] {
  --bg: #0b0c0e;
  --bg-soft: #101216;
  --surface: #16181d;
  --surface-2: #1d2027;
  --surface-3: #252932;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #e9ebef;
  --text-dim: #b6bcc5;
  --muted: #8d949e;
  --accent: #ffb427;
  --accent-ink: #1a1300;
  --accent-soft: rgba(255, 180, 39, .14);
  --ok: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --dot: rgba(255, 255, 255, .06);
  --shadow: 0 12px 32px rgba(0, 0, 0, .5);
}

html[data-theme="light"] {
  --bg: #f7f7f5;
  --bg-soft: #f1f1ee;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #eeece7;
  --border: rgba(18, 20, 24, .1);
  --border-strong: rgba(18, 20, 24, .2);
  --text: #16181d;
  --text-dim: #3b3f46;
  --muted: #6b7078;
  --accent: #e08700;
  --accent-ink: #ffffff;
  --accent-soft: rgba(224, 135, 0, .12);
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --dot: rgba(18, 20, 24, .07);
  --shadow: 0 12px 32px rgba(18, 20, 24, .12);
}

* { box-sizing: border-box; }

/* hidden 属性必须永远生效，防止被组件 display 覆盖 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

kbd.kbd, kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
}
.brand-mark svg { width: 19px; height: 19px; stroke-width: 2.2; }
.brand-text { font-weight: 600; font-size: 17px; letter-spacing: .2px; white-space: nowrap; }
.brand-text em {
  font-style: normal; font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); margin-left: 7px; letter-spacing: .5px;
}

.search {
  flex: 1 1 auto;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 6px 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-btn {
  flex: none;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .16s var(--ease);
}
.search-btn:hover { filter: brightness(1.08); }
.search-btn:active { transform: translateY(.5px); }

.topbar-right { display: flex; align-items: center; gap: 6px; flex: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--text-dim);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.status-btn { padding: 0 10px; }
.status-btn .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); flex: none;
  box-shadow: 0 0 0 0 transparent;
}
.status-btn .dot.is-ok { background: var(--ok); }
.status-btn .dot.is-warn { background: var(--warn); }
.status-btn .dot.is-bad { background: var(--bad); }
.status-text { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

#themeBtn .ico-sun { display: none; }
html[data-theme="light"] #themeBtn .ico-sun { display: block; }
html[data-theme="light"] #themeBtn .ico-moon { display: none; }

/* ---------- 页面 ---------- */

.page {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 18px 20px 48px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 12px;
  position: sticky;
  top: var(--topbar-h);
  z-index: 10;
  background: linear-gradient(to bottom, var(--bg) 72%, transparent);
}

.chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
  padding: 2px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 500;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip .num {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .7;
}
.chip[aria-selected="true"] .num { opacity: .8; }

.toolbar-end { display: flex; align-items: center; gap: 8px; flex: none; }

.select-wrap { position: relative; display: inline-flex; }
.select-wrap select {
  appearance: none;
  height: 31px;
  padding: 0 26px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute; right: 11px; top: 50%;
  width: 5px; height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 31px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.ghost-btn:hover { border-color: var(--border-strong); color: var(--text); }
.ghost-btn svg { width: 15px; height: 15px; }
.badge {
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 10px; line-height: 16px;
  text-align: center;
}

.primary-btn {
  height: 36px; padding: 0 16px;
  border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.primary-btn:hover { filter: brightness(1.08); }

.result-line, .warn-line {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  display: flex; flex-wrap: wrap; gap: 6px 10px;
}
.warn-line {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--warn);
  padding: 9px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
}

/* ---------- 结果 ---------- */

.results { display: flex; flex-direction: column; gap: 6px; }

.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.card:hover { background: var(--surface-2); border-color: var(--border-strong); }

.card-thumb {
  width: 84px; height: 58px;
  border-radius: 8px;
  background: var(--surface-3);
  overflow: hidden;
  flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb.is-empty { width: 42px; height: 42px; border-radius: 10px; }
.card-thumb .type-initial {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .5px;
}

.card-main { min-width: 0; }

.card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-title mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 1px;
  border-radius: 3px;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 11.5px;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; }
.tag-pwd {
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  cursor: pointer;
  border: 0;
}
.tag-pwd:hover { filter: brightness(1.1); }
.meta-item { white-space: nowrap; }
.meta-src { font-family: var(--font-mono); font-size: 11px; opacity: .8; }

.card-actions { display: flex; align-items: center; gap: 6px; flex: none; padding-top: 2px; }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .14s var(--ease);
}
.act svg { width: 14px; height: 14px; }
.act:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.act-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.act-primary:hover { background: var(--accent); filter: brightness(1.08); color: var(--accent-ink); }
.act[disabled] { opacity: .5; cursor: default; }
.act .spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.check-out {
  margin-top: 6px;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 5px;
}
.check-out.ok { color: var(--ok); }
.check-out.bad { color: var(--bad); }
.check-out.warn { color: var(--warn); }

/* 骨架 */
.skeleton { display: flex; flex-direction: column; gap: 6px; }
.sk-card {
  height: 84px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: .95; } }

/* 状态 / 空态 */
.state { padding: 64px 12px 32px; text-align: center; }
.state[hidden] { display: none; }
.state-inner { max-width: 460px; margin: 0 auto; }
.state-icon {
  width: 46px; height: 46px; margin: 0 auto 14px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.state-icon svg { width: 21px; height: 21px; }
.state h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.state p { margin: 0; color: var(--muted); font-size: 13.5px; }

.hot { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hot button {
  height: 29px; padding: 0 12px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: none;
  color: var(--muted);
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.hot button:hover { color: var(--text); border-color: var(--muted); border-style: solid; }

.more-wrap { display: flex; justify-content: center; padding: 18px 0 0; }
.more-btn {
  height: 38px; padding: 0 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit; font-size: 13.5px;
  cursor: pointer;
}
.more-btn:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------- 页脚 ---------- */

.foot {
  position: relative; z-index: 1;
  flex: none;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.foot-sep { opacity: .5; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 弹层 ---------- */

.sheet {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 8px;
}
.sheet-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sheet-body { padding: 8px 18px 20px; }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.field-hint code {
  font-family: var(--font-mono); font-size: 11.5px;
  background: var(--surface-3); padding: 1px 5px; border-radius: 4px;
}
.field input[type="text"], .field select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-dim); margin-bottom: 18px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.row-actions { display: flex; gap: 8px; }
.test-out {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-all;
}
.hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-mono); }

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

@media (max-width: 860px) {
  .brand-text em { display: none; }
  .search { max-width: none; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 108px; }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px 12px;
    gap: 10px;
  }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; }
  .search { order: 3; flex-basis: 100%; height: 42px; }
  .search kbd { display: none; }
  .status-text { display: none; }
  .page { padding: 12px 14px 36px; }
  .toolbar {
    top: var(--topbar-h);
    flex-wrap: wrap;
    padding-bottom: 8px;
  }
  .chips { order: 2; flex-basis: 100%; }
  .toolbar-end { order: 1; margin-left: auto; }
  .card {
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    padding: 11px 12px;
  }
  .card-thumb { width: 64px; height: 46px; }
  .card-thumb.is-empty { width: 36px; height: 36px; }
  .card-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 0;
  }
  .act { height: 28px; font-size: 12px; }
  .card-title { font-size: 14.5px; }
  .foot { flex-wrap: wrap; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   双视图：home（搜索框屏幕居中，百度式） / search（搜索框收进顶栏）
   ========================================================================== */

.hero-extra { display: none; }

/* 搜索框与品牌做位置+尺寸的形变过渡 */
.brand { view-transition-name: ps-brand; }
.search { view-transition-name: ps-search; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(ps-brand), ::view-transition-group(ps-search) {
  animation-duration: .42s;
  animation-timing-function: cubic-bezier(.22, .68, .16, 1);
}

html[data-view="home"] body::before {
  mask-image: radial-gradient(ellipse 70% 55% at 50% 44%, #000 15%, transparent 78%);
}

html[data-view="home"] .topbar {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 0 20px 9vh;
  background: none;
  backdrop-filter: none;
  border-bottom: 0;
}

/* 品牌放大 */
html[data-view="home"] .brand { gap: 15px; }
html[data-view="home"] .brand-mark {
  width: 56px; height: 56px; border-radius: 16px;
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
html[data-view="home"] .brand-mark svg { width: 30px; height: 30px; }
html[data-view="home"] .brand-text { font-size: 30px; letter-spacing: .5px; }
html[data-view="home"] .brand-text em { font-size: 12px; margin-left: 9px; }

/* 搜索框放大 */
html[data-view="home"] .search {
  flex: 0 1 auto;
  width: 100%;
  max-width: 680px;
  height: 58px;
  padding: 0 8px 0 18px;
  border-radius: 16px;
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 18px 48px -22px rgba(0, 0, 0, .55);
}
html[data-view="home"] .search:focus-within {
  box-shadow: 0 0 0 4px var(--accent-soft), 0 18px 48px -22px rgba(0, 0, 0, .55);
}
html[data-view="home"] .search-ico { width: 20px; height: 20px; }
html[data-view="home"] .search input { font-size: 16px; }
html[data-view="home"] .search-btn { height: 42px; padding: 0 24px; font-size: 15px; border-radius: 12px; }

/* 品牌与搜索框下方的热词区 */
html[data-view="home"] .hero-extra {
  display: block;
  width: 100%;
  max-width: 680px;
}
.hero-hot {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.hero-hot button {
  height: 30px; padding: 0 13px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: none;
  color: var(--muted);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.hero-hot button:hover { color: var(--text); border-color: var(--muted); border-style: solid; }
.hero-note {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* 首页态：结果区收起，功能按钮浮到右上角 */
html[data-view="home"] .page { display: none; }
html[data-view="home"] .topbar-right {
  position: absolute;
  top: 16px; right: 20px;
}
html[data-view="home"] .foot {
  border-top: 0;
  padding: 16px 20px 22px;
}

@media (max-width: 640px) {
  html[data-view="home"] .topbar {
    /* 固定定位 + 跟随可视视口高度：软键盘弹起时整组内容自动上移，不会被挡住 */
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--vvh, 100svh);
    min-height: 0;
    justify-content: center;
    padding: 0 16px 9vh;
    gap: 18px;
  }
  html.kb-open[data-view="home"] .topbar { padding-bottom: 2vh; }
  html[data-view="home"] .foot { display: none; }
  html[data-view="home"] .brand { order: 0; gap: 12px; }
  html[data-view="home"] .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
  html[data-view="home"] .brand-mark svg { width: 26px; height: 26px; }
  html[data-view="home"] .brand-text { font-size: 24px; }
  html[data-view="home"] .search {
    order: 0;
    flex-basis: auto;
    height: 52px;
    padding: 0 6px 0 14px;
    border-radius: 14px;
  }
  /* 16px 是 iOS 不触发自动放大的下限 */
  html[data-view="home"] .search input { font-size: 16px; }
  html[data-view="home"] .search-btn { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 11px; }
  html[data-view="home"] .topbar-right { top: 12px; right: 12px; }
  .hero-note { display: none; }
  .hero-extra { padding-top: 2px; }
}

