/* =========================================================================
   红河素材站 · 设计系统
   - 令牌（颜色/间距/圆角/阴影/动效）集中定义，浅色/深色两套
   - 组件均以 hh- 或语义类名提供，页面样式只做布局，不重复造组件
   ========================================================================= */

/* ---------- 令牌：浅色（默认） ---------- */
:root {
  color-scheme: light;

  --bg: #f5f6f3;
  --bg-subtle: #eceee9;
  --surface: #ffffff;
  --surface-2: #f8f9f6;
  --surface-3: #f0f2ed;
  --overlay: rgba(16, 20, 17, 0.48);
  --border: #e2e5df;
  --border-strong: #cdd2c9;

  --text: #1a1f1b;
  --text-2: #4b554d;
  --text-3: #646e66;
  --text-inverse: #ffffff;

  --accent: #22863a;
  --accent-hover: #1b7431;
  --accent-text: #1d7a35;
  --accent-fg: #ffffff;
  --accent-soft: #e6f3e9;
  --accent-ring: rgba(34, 134, 58, 0.28);

  --gold: #e8a900;
  --gold-text: #5c4300;
  --gold-soft: #fdf1c7;

  --danger: #c4321f;
  --danger-text: #b42318;
  --danger-soft: #fdecea;
  --warning-text: #8a5a00;
  --warning-soft: #fff4d6;
  --info-text: #1f5fbf;
  --info-soft: #e8f0fd;

  --checker-a: #ffffff;
  --checker-b: #eef0eb;

  --shadow-xs: 0 1px 2px rgba(20, 28, 22, 0.06);
  --shadow-sm: 0 1px 3px rgba(20, 28, 22, 0.08), 0 1px 2px rgba(20, 28, 22, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(20, 28, 22, 0.12), 0 2px 4px rgba(20, 28, 22, 0.05);
  --shadow-lg: 0 24px 48px -12px rgba(20, 28, 22, 0.22), 0 4px 10px rgba(20, 28, 22, 0.06);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  --header-h: 60px;
  --tabbar-h: 58px;
  --page-max: 1320px;
  --gutter: 24px;

  --z-sticky: 20;
  --z-header: 40;
  --z-tabbar: 45;
  --z-menu: 60;
  --z-overlay: 80;
  --z-toast: 100;
}

/* ---------- 令牌：深色 ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e110f;
  --bg-subtle: #131714;
  --surface: #171b18;
  --surface-2: #1c211d;
  --surface-3: #222823;
  --overlay: rgba(0, 0, 0, 0.6);
  --border: #283029;
  --border-strong: #3a453c;

  --text: #e7ebe7;
  --text-2: #a9b3ab;
  --text-3: #848f86;
  --text-inverse: #0e110f;

  --accent: #4cc46c;
  --accent-hover: #5fd17d;
  --accent-text: #5fd17d;
  --accent-fg: #0b1a0f;
  --accent-soft: #1b2a1f;
  --accent-ring: rgba(76, 196, 108, 0.32);

  --gold: #f5c518;
  --gold-text: #f5cf4d;
  --gold-soft: #2a2410;

  --danger: #f0574b;
  --danger-text: #ff7b72;
  --danger-soft: #2d1614;
  --warning-text: #f2c14e;
  --warning-soft: #2a2312;
  --info-text: #7fb0ff;
  --info-soft: #15203a;

  --checker-a: #1c211d;
  --checker-b: #232924;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 56px -12px rgba(0, 0, 0, 0.7);
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --header-h: 54px;
  }
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

[v-cloak] {
  display: none !important;
}

.hh-i {
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.pixelated {
  image-rendering: pixelated;
}

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

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

/* 细滚动条（仅桌面细指针设备） */
@media (hover: hover) and (pointer: fine) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
}

/* ---------- 页面骨架 ---------- */
.hh-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-12);
}

.hh-main--wide {
  max-width: none;
}

.hh-main--narrow {
  max-width: 880px;
}

.hh-main--flush {
  padding: 0;
  max-width: none;
}

@media (max-width: 1024px) {
  body.has-tabbar .hh-main {
    padding-bottom: calc(var(--tabbar-h) + var(--s-8) + env(safe-area-inset-bottom));
  }
}

/* 页面标题区 */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}

.page-head__text {
  min-width: 0;
}

.page-head h1 {
  font-size: var(--fs-2xl);
}

.page-head p {
  margin-top: var(--s-1);
  color: var(--text-2);
  font-size: var(--fs-md);
}

.page-head__actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .page-head {
    margin-bottom: var(--s-4);
  }

  .page-head h1 {
    font-size: var(--fs-xl);
  }
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--s-3);
}

.section-title small {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-3);
}

/* ---------- 顶栏 ---------- */
site-header {
  display: contents;
}

.hh-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}

.hh-header__inner {
  height: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.hh-header--wide .hh-header__inner {
  max-width: none;
}

.hh-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-lg);
  letter-spacing: 0.02em;
}

.hh-brand:hover {
  text-decoration: none;
}

.hh-brand img {
  width: 30px;
  height: 37px;
  object-fit: contain;
}

.hh-brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.hh-brand span {
  line-height: 1.15;
}

.hh-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.hh-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.hh-nav__link:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}

.hh-nav__link[aria-current="page"] {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.hh-nav__link svg {
  flex: 0 0 auto;
}

.hh-nav__link--hot {
  margin-left: 6px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(100deg, #ff5f8f, #ffb02e 40%, #4fd18b 70%, #45a6ff) border-box;
  color: var(--text);
  font-weight: 800;
}

.hh-nav__link--hot:hover,
.hh-nav__link--hot[aria-current="page"] {
  background:
    linear-gradient(100deg, #fff1f5, #fff6e0 40%, #e9fbf0 70%, #e8f4ff) padding-box,
    linear-gradient(100deg, #ff5f8f, #ffb02e 40%, #4fd18b 70%, #45a6ff) border-box;
  color: var(--text);
}

[data-theme="dark"] .hh-nav__link--hot:hover,
[data-theme="dark"] .hh-nav__link--hot[aria-current="page"] {
  background:
    linear-gradient(100deg, #3a1f2a, #3a311c 40%, #1c3326 70%, #1c2a3a) padding-box,
    linear-gradient(100deg, #ff5f8f, #ffb02e 40%, #4fd18b 70%, #45a6ff) border-box;
}

.hh-nav__hot {
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: #ff5f8f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
}

.hh-nav__badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: linear-gradient(100deg, #ff5f8f, #ffb02e 40%, #4fd18b 70%, #45a6ff);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0.04em;
}

.hh-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
  flex: 0 0 auto;
}

.hh-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-width: 200px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}

.hh-search-trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.hh-search-trigger kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-3);
}

/* 顶栏在中等宽度时收起文字搜索框、菜单 */
@media (max-width: 1240px) {
  .hh-search-trigger {
    min-width: 0;
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .hh-search-trigger span,
  .hh-search-trigger kbd {
    display: none;
  }
}

@media (max-width: 1100px) {
  .hh-brand small {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hh-nav {
    display: none;
  }

  .hh-header__inner {
    gap: var(--s-2);
  }
}

.hh-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.hh-icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.hh-icon-btn--bordered {
  border-color: var(--border);
  background: var(--surface-2);
}

/* 账号 */
.hh-account {
  position: relative;
}

.hh-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.hh-account__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
}

.hh-account__btn:hover .hh-avatar {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.hh-points {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--gold-soft);
  color: var(--gold-text);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.hh-points:hover {
  border-color: var(--gold);
}

.hh-points small {
  font-weight: 500;
  opacity: 0.8;
}

@media (max-width: 520px) {
  .hh-points small {
    display: none;
  }
}

/* ---------- 下拉菜单 ---------- */
.hh-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-menu);
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: hh-pop var(--dur-2) var(--ease);
  transform-origin: top right;
}

.hh-menu--left {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.hh-menu__head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.hh-menu__head b {
  display: block;
  font-size: var(--fs-md);
}

.hh-menu__head small {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.hh-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font-size: var(--fs-md);
  text-align: left;
  white-space: nowrap;
}

.hh-menu__item:hover,
.hh-menu__item:focus-visible {
  background: var(--surface-3);
  text-decoration: none;
  outline: none;
}

.hh-menu__item svg {
  color: var(--text-3);
  flex: 0 0 auto;
}

.hh-menu__item small {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.hh-menu__item--danger {
  color: var(--danger-text);
}

.hh-menu__sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.hh-menu__label {
  padding: 6px 10px 4px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}

@keyframes hh-pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* ---------- 底部标签栏（移动端） ---------- */
.hh-tabbar {
  display: none;
}

@media (max-width: 1024px) {
  .hh-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-tabbar);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
  }
}

.hh-tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none !important;
}

.hh-tabbar__item svg {
  width: 20px;
  height: 20px;
}

.hh-tabbar__item[aria-current="page"] {
  color: var(--accent-text);
}

/* ---------- 页脚 ---------- */
.hh-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.hh-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-5) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-6);
  flex-wrap: wrap;
}

.hh-footer__links {
  display: flex;
  gap: var(--s-2) var(--s-5);
  flex-wrap: wrap;
}

.hh-footer a,
.hh-footer button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: inherit;
}

.hh-footer a:hover,
.hh-footer button:hover {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 1024px) {
  body.has-tabbar .hh-footer {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }
}

/* ---------- 按钮 ---------- */
.btn {
  --btn-h: 38px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none !important;
  user-select: none;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.btn:hover {
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: var(--shadow-xs);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--gold {
  border-color: transparent;
  background: var(--gold);
  color: #2b1f00;
}

.btn--gold:hover {
  filter: brightness(1.05);
  background: var(--gold);
}

.btn--soft {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.btn--soft:hover {
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent) 20%);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn--danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger-text);
}

.btn--danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn--sm {
  --btn-h: 32px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}

.btn--lg {
  --btn-h: 46px;
  padding: 0 22px;
  font-size: var(--fs-base);
  border-radius: var(--r-lg);
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: var(--btn-h);
  padding: 0;
}

.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-color: var(--text-3) var(--text-3) var(--text-3) transparent;
  animation: hh-spin 0.7s linear infinite;
}

.btn--primary.is-loading::after {
  border-color: var(--accent-fg) var(--accent-fg) var(--accent-fg) transparent;
}

.btn-group {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* 收藏按钮（像素爱心） */
.fav-btn {
  color: var(--text-3);
}

.fav-btn.is-on {
  color: #e5484d;
  border-color: color-mix(in srgb, #e5484d 35%, transparent);
  background: color-mix(in srgb, #e5484d 10%, var(--surface));
}

.fav-btn.is-on svg {
  animation: hh-heart var(--dur-3) var(--ease);
}

@keyframes hh-heart {
  40% {
    transform: scale(1.3);
  }
}

/* ---------- 表单 ---------- */
.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.5;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--text-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23889188' stroke-width='1.6' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.input--lg {
  min-height: 48px;
  font-size: var(--fs-base);
  border-radius: var(--r-lg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field + .field {
  margin-top: var(--s-4);
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.field__label .opt {
  font-weight: 400;
  color: var(--text-3);
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
}

.field-row .field + .field {
  margin-top: 0;
}

/* 搜索框（带图标/清除按钮） */
.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search > svg,
.search > .hh-i {
  position: absolute;
  left: 13px;
  color: var(--text-3);
  pointer-events: none;
}

.search .input {
  padding-left: 40px;
  padding-right: 40px;
}

.search .input::-webkit-search-cancel-button {
  display: none;
}

.search__clear {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-3);
}

.search__clear:hover {
  background: var(--surface-3);
  color: var(--text);
}

.search kbd {
  position: absolute;
  right: 10px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-3);
  font-family: var(--font);
  font-size: 11px;
  pointer-events: none;
}

/* 分段控件 */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: calc(var(--r-md) - 3px);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed="true"],
.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented--block {
  display: flex;
}

.segmented--block button {
  flex: 1;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-md);
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background var(--dur-2) var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--accent);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 滑块 */
.range {
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  --pct: 50%;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--border-strong) var(--pct));
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}

.range::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.range-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
}

.range-field + .range-field {
  margin-top: var(--s-3);
}

.range-field label {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.range-field output {
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.range-field .range {
  grid-column: 1 / -1;
}

/* 上传区域 */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  padding: var(--s-5);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone b {
  color: var(--text);
  font-size: var(--fs-md);
}

.dropzone small {
  color: var(--text-3);
}

/* ---------- 筛选胶囊 / 标签页 ---------- */
.chips {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  scroll-padding: 0 var(--gutter);
  mask-image: linear-gradient(to right, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}

.chips--scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip[aria-pressed="true"],
.chip.is-active {
  border-color: transparent;
  background: var(--text);
  color: var(--surface);
}

.chip__count {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
}

.chip img {
  width: 20px;
  height: 20px;
  margin-left: -6px;
  border-radius: 50%;
  object-fit: cover;
}

.tabs {
  display: flex;
  gap: var(--s-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button,
.tabs a {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
}

.tabs button:hover,
.tabs a:hover {
  color: var(--text);
}

.tabs [aria-selected="true"],
.tabs .is-active {
  color: var(--text);
}

.tabs [aria-selected="true"]::after,
.tabs .is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.tabs small {
  margin-left: 4px;
  color: var(--text-3);
  font-weight: 500;
}

/* ---------- 卡片 ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.card--pad {
  padding: var(--s-5);
}

.card--interactive {
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.card--interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__title {
  font-size: var(--fs-base);
  font-weight: 700;
}

.card__meta {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* 透明底展示（棋盘格） */
.checker {
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* 媒体卡片（封面 + 文案） */
.media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: inherit;
  text-align: left;
  text-decoration: none !important;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

button.media-card {
  padding: 0;
}

.media-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.media-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-3);
}

.media-card__media > img,
.media-card__media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
  min-width: 0;
}

.media-card__title {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.media-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  min-width: 0;
}

.media-card__corner {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}

.media-card__corner--right {
  left: auto;
  right: 8px;
}

/* 网格 */
.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(var(--min, 240px), 1fr));
}

.grid--tight {
  gap: var(--s-3);
}

@media (max-width: 720px) {
  .grid {
    gap: var(--s-3);
    grid-template-columns: repeat(auto-fill, minmax(var(--min-sm, 160px), 1fr));
  }
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge--gold {
  background: var(--gold-soft);
  color: var(--gold-text);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.badge--warning {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.badge--info {
  background: var(--info-soft);
  color: var(--info-text);
}

.badge--solid {
  background: rgba(10, 14, 11, 0.72);
  color: #fff;
  backdrop-filter: blur(6px);
}

.badge--new {
  background: var(--gold);
  color: #2b1f00;
}

/* ---------- 提示条 ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.notice > svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.notice b {
  color: var(--text);
}

.notice__body {
  flex: 1;
  min-width: 0;
}

.notice--accent {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-soft);
  color: var(--text);
}

.notice--accent > svg {
  color: var(--accent-text);
}

.notice--gold {
  border-color: color-mix(in srgb, var(--gold) 40%, transparent);
  background: var(--gold-soft);
  color: var(--gold-text);
}

.notice--danger {
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.notice--info {
  border-color: color-mix(in srgb, var(--info-text) 25%, transparent);
  background: var(--info-soft);
  color: var(--info-text);
}

.notice__close {
  flex: 0 0 auto;
  margin: -4px -4px -4px 0;
}

.form-error {
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: var(--fs-sm);
}

/* ---------- 空状态 / 加载 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--s-12) var(--s-5);
  color: var(--text-2);
  text-align: center;
}

.empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
  border-radius: var(--r-xl);
  background: var(--surface-3);
  color: var(--text-3);
}

.empty b {
  color: var(--text);
  font-size: var(--fs-base);
}

.empty p {
  max-width: 420px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.empty .btn {
  margin-top: 8px;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: hh-spin 0.75s linear infinite;
}

.spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner--lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

@keyframes hh-spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  animation: hh-shimmer 1.4s infinite;
}

@keyframes hh-shimmer {
  to {
    transform: translateX(100%);
  }
}

.progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-3);
}

.progress > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur-2) var(--ease);
}

.progress--indeterminate > i {
  width: 36%;
  animation: hh-indeterminate 1.2s var(--ease) infinite;
}

@keyframes hh-indeterminate {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(300%);
  }
}

/* ---------- 弹窗 / 底部抽屉 ---------- */
.hh-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  background: var(--overlay);
  animation: hh-fade var(--dur-2) var(--ease);
  overscroll-behavior: contain;
}

.hh-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--dialog-w, 440px));
  max-height: min(calc(100dvh - 48px), 880px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: hh-rise var(--dur-3) var(--ease);
}

.hh-dialog--sm {
  --dialog-w: 380px;
}

.hh-dialog--md {
  --dialog-w: 560px;
}

.hh-dialog--lg {
  --dialog-w: 820px;
}

.hh-dialog--xl {
  --dialog-w: 1040px;
}

.hh-dialog__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) 0;
}

.hh-dialog__title {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
}

.hh-dialog__sub {
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 400;
}

.hh-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--s-5);
  overscroll-behavior: contain;
}

.hh-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: 0 var(--s-5) var(--s-5);
}

.hh-dialog__close {
  margin: -6px -8px 0 0;
}

.hh-dialog__close--float {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  margin: 0;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px);
}

/* 手机：弹窗变底部抽屉 */
@media (max-width: 640px) {
  .hh-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .hh-dialog {
    width: 100%;
    max-height: calc(100dvh - 40px);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: hh-sheet var(--dur-3) var(--ease);
  }

  .hh-dialog::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--border-strong);
    z-index: 3;
  }

  .hh-dialog__foot {
    flex-wrap: wrap;
  }

  .hh-dialog__foot .btn {
    flex: 1;
  }
}

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

@keyframes hh-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes hh-sheet {
  from {
    transform: translateY(100%);
  }
}

body.hh-scroll-lock {
  overflow: hidden;
}

/* ---------- 轻提示 ---------- */
.hh-toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

@media (max-width: 1024px) {
  body.has-tabbar .hh-toasts {
    bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  }
}

.hh-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--surface);
  font-size: var(--fs-md);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: hh-toast-in var(--dur-3) var(--ease);
}

.hh-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.hh-toast--success svg {
  color: var(--accent);
}

.hh-toast--error {
  background: var(--danger);
  color: #fff;
}

@keyframes hh-toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

/* ---------- 登录 ---------- */
.hh-login__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
}

.hh-login__qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 196px;
  height: 196px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #fff;
}

.hh-login__qr-box img,
.hh-login__qr-box canvas {
  width: 180px !important;
  height: 180px !important;
}

.hh-login__qr-status {
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
}

.hh-login__switch {
  margin-top: var(--s-4);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.hh-login__switch button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-weight: 600;
}

/* ---------- 全站搜索面板 ---------- */
.hh-palette {
  align-items: flex-start;
  padding-top: min(12vh, 120px);
}

.hh-palette .hh-dialog {
  --dialog-w: 720px;
  max-height: min(76vh, 720px);
}

.hh-palette__input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--s-4);
  border-bottom: 1px solid var(--border);
}

.hh-palette__input svg {
  color: var(--text-3);
  flex: 0 0 auto;
}

.hh-palette__input input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  outline: none;
  background: none;
  font-size: var(--fs-lg);
}

.hh-palette__input input::-webkit-search-cancel-button {
  display: none;
}

.hh-palette__types {
  padding: var(--s-3) var(--s-4) 0;
}

.hh-palette__results {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  padding: var(--s-3) var(--s-4) var(--s-4);
}

.hh-palette__group + .hh-palette__group {
  margin-top: var(--s-4);
}

.hh-palette__group-title {
  margin-bottom: var(--s-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.hh-palette__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: var(--s-2);
}

.hh-palette__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none !important;
}

.hh-palette__item:hover,
.hh-palette__item:focus-visible {
  border-color: var(--border);
  background: var(--surface-2);
  outline: none;
}

.hh-palette__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-sm);
}

.hh-palette__thumb img,
.hh-palette__thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hh-palette__cap {
  overflow: hidden;
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hh-palette__links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-2);
}

.hh-palette__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  text-decoration: none !important;
}

.hh-palette__link:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.hh-palette__link svg {
  color: var(--accent-text);
}

.hh-palette__link small {
  display: block;
  color: var(--text-3);
  font-weight: 400;
  font-size: var(--fs-xs);
}

/* 全部功能抽屉（移动端"更多"） */
.hh-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
}

.hh-apps a,
.hh-apps button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none !important;
}

.hh-apps a:hover,
.hh-apps button:hover,
.hh-apps [aria-current="page"] {
  background: var(--surface-3);
}

.hh-apps__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.hh-apps [aria-current="page"] .hh-apps__icon {
  background: var(--accent);
  color: var(--accent-fg);
}

/* ---------- 内嵌（iframe）模式：隐藏外壳 ---------- */
html.embed .hh-header,
html.embed .hh-tabbar,
html.embed .hh-footer {
  display: none !important;
}

/* ---------- 表格（后台用） ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th,
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 通用辅助 ---------- */
.muted {
  color: var(--text-3);
}

.text-2 {
  color: var(--text-2);
}

.small {
  font-size: var(--fs-sm);
}

.xsmall {
  font-size: var(--fs-xs);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nums {
  font-variant-numeric: tabular-nums;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap, var(--s-3));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, var(--s-2));
}

.spacer {
  flex: 1;
}

.divider {
  height: 1px;
  border: 0;
  margin: var(--s-5) 0;
  background: var(--border);
}

kbd {
  font-family: var(--font);
}

/* 侧栏列表（分类导航） */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav__label {
  padding: 12px 10px 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.side-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 500;
  text-align: left;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.side-nav__item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.side-nav__item[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

.side-nav__item svg {
  flex: 0 0 auto;
  opacity: 0.85;
}

.side-nav__item > span:not(.hh-i):not(.side-nav__count) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav__item .side-nav__count {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.side-nav__item[aria-current="true"] .side-nav__count {
  color: inherit;
  opacity: 0.8;
}

/* 统计卡（后台） */
.stat {
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.stat__label {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.stat__value {
  margin-top: 4px;
  font-size: var(--fs-2xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat__hint {
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* 加载更多哨兵 */
.load-more {
  display: flex;
  justify-content: center;
  padding: var(--s-6) 0 var(--s-2);
}

/* 返回链接 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--s-4);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* ---------- 全站公告条 ---------- */
.hh-announce {
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  background: var(--gold-soft);
  color: var(--gold-text);
  font-size: var(--fs-sm);
}

.hh-announce__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--page-max);
  min-height: 40px;
  margin: 0 auto;
  padding: 4px var(--gutter);
}

.hh-announce__text {
  flex: 1;
  min-width: 0;
}

.hh-announce__text b {
  margin-right: 8px;
}

.hh-announce a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  color: inherit;
  font-weight: 700;
}

.hh-announce .hh-icon-btn {
  width: 28px;
  height: 28px;
  color: inherit;
}

.hh-header--wide + .hh-announce .hh-announce__inner {
  max-width: none;
}

/* ---------- 附魔台 ---------- */
.enchant {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
}

.enchant__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.enchant__stage canvas {
  max-width: 88%;
  max-height: 88%;
  image-rendering: pixelated;
}

@media (max-width: 720px) {
  .enchant {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }

  .enchant__stage {
    aspect-ratio: 4 / 3;
  }
}

/* 邮箱未读 */
.hh-account__btn {
  position: relative;
}

.hh-account__dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #ff3b5c;
}

.hh-menu__count {
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: #ff3b5c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
}
