/* =========================================================
   candyreal.ai · 糖果色 · 深色卡片网格(对齐 vireels 登录态版式)
   版式/结构 1:1 还原对标,仅换肤:糖果色系 + candyreal Logo + 图标
   默认深色(像对标);另带糖果浅色主题可切换。全响应式。
   ========================================================= */

/* 默认 = 深色(主用),糖果粉 + 紫渐变 + 薄荷点缀 */
:root {
  --candy: #FF4E87;        /* 糖果粉(主色) */
  --candy-600: #F23A77;
  --candy-700: #D81E63;
  --candy-2: #A855F7;      /* 糖果紫(渐变副色) */
  --candy-soft: rgba(255, 78, 135, 0.16);
  --mint: #2DE0C0;         /* 薄荷(分类标题/激活点缀) */
  --grad: linear-gradient(120deg, #FF4E87, #A855F7);

  --bg: #0C0C12;
  --bg-2: #121219;
  --surface: #17171F;
  --surface-2: #20202B;
  --ink: #F4F2F8;
  --ink-2: #B7B4C6;
  --ink-3: #807D92;
  --line: #2A2A38;
  --line-2: #20202C;

  --gold: #FFC24B;
  --green: var(--mint);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.45), 0 14px 38px rgba(0,0,0,0.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,0.6);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --serif: 'Fraunces', 'Songti SC', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  --maxw: 1180px;
  --topbar-h: 64px;
  --sidebar-w: 88px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* 糖果浅色主题(可选切换) */
[data-theme="light"] {
  --candy: #F23A77;
  --candy-600: #E0306B;
  --candy-700: #C71F5B;
  --candy-2: #9333EA;
  --candy-soft: rgba(242, 58, 119, 0.10);
  --mint: #14B8A6;
  --grad: linear-gradient(120deg, #FF4E87, #9333EA);

  --bg: #FFF6FA;
  --bg-2: #FFFBFD;
  --surface: #FFFFFF;
  --surface-2: #FCEFF5;
  --ink: #1E1620;
  --ink-2: #5A4F58;
  --ink-3: #8E8593;
  --line: #F3DCE7;
  --line-2: #F8E9F0;

  --gold: #E0A11F;
  --green: #0E9488;

  --shadow-sm: 0 1px 2px rgba(120, 30, 70, 0.06), 0 2px 8px rgba(120, 30, 70, 0.05);
  --shadow-md: 0 6px 18px rgba(120, 30, 70, 0.08), 0 14px 34px rgba(120, 30, 70, 0.07);
  --shadow-lg: 0 18px 48px rgba(120, 30, 70, 0.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink);
  line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
input, textarea, select { font-family: inherit; color: inherit; }
::selection { background: var(--candy-soft); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; margin: 0; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; width: calc(var(--sidebar-w) + 60px); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--grad);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), var(--shadow-sm); position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.55), transparent 42%), radial-gradient(circle at 72% 78%, rgba(0,0,0,.18), transparent 50%);
}
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.brand-dot { color: var(--candy); }
.brand-sm .brand-name { font-size: 18px; }

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; min-width: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .16s, color .16s; position: relative;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { color: var(--ink); font-weight: 600; }
.nav-link .caret { width: 14px; height: 14px; opacity: .6; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background .16s, color .16s, transform .1s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }

.promo-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  border: 1.5px solid color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.promo-pill .ic { width: 15px; height: 15px; fill: var(--gold); stroke: none; }
.promo-pill:hover { background: color-mix(in srgb, var(--gold) 20%, transparent); }

.credits {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 7px 6px 11px; border-radius: 999px;
  font-size: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.credits:hover { border-color: var(--candy); }
.credits .coin { width: 17px; height: 17px; color: var(--gold); }
.credits-plus {
  width: 20px; height: 20px; border-radius: 50%; background: var(--candy); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; line-height: 1;
}
.credits-sm { padding: 5px 10px; font-size: 13px; box-shadow: none; }

.user-chip { display: inline-flex; align-items: center; gap: 0; position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad); color: #fff;
  font-weight: 600; font-size: 15px; display: grid; place-items: center; font-family: var(--serif);
}
.tier-badge {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  font-size: 8px; font-weight: 700; letter-spacing: .04em; color: #fff;
  background: var(--gold); padding: 1px 5px; border-radius: 999px; border: 1.5px solid var(--bg);
}

.searchbar { border-top: 1px solid var(--line); background: var(--bg); }
.searchbar-inner { padding: 12px 22px; display: flex; align-items: center; gap: 12px; color: var(--ink-3); }
.searchbar-inner input { flex: 1; background: none; border: none; outline: none; font-size: 16px; color: var(--ink); padding: 6px 0; }

/* 下拉超级菜单 */
.megamenu {
  position: fixed; top: var(--topbar-h); z-index: 65;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 16px; width: min(560px, 92vw);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; animation: pop .16s ease;
}
.megamenu .mm-tool { display: flex; gap: 11px; padding: 10px; border-radius: var(--r-sm); transition: background .14s; }
.megamenu .mm-tool:hover { background: var(--surface-2); }
.megamenu .mm-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--candy-soft); color: var(--candy-700); display: grid; place-items: center; flex-shrink: 0; }
[data-theme="dark"] .megamenu .mm-ic { color: var(--candy); }
.megamenu .mm-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.megamenu .mm-t { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.megamenu .mm-d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.mm-models { grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.mm-models .mm-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 8px; }
.mm-models .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-models .mp { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }

/* ---------- 移动端顶部栏 ---------- */
.mobilebar {
  display: none; position: sticky; top: 0; z-index: 60;
  align-items: center; justify-content: space-between; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.mobilebar-actions { display: flex; align-items: center; gap: 8px; }
.mobilebar .avatar { width: 34px; height: 34px; font-size: 14px; }

/* ---------- 左侧边栏 ---------- */
.sidebar {
  position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: var(--sidebar-w); z-index: 55;
  background: var(--bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0;
}
.side-item {
  width: 64px; padding: 10px 0; border-radius: 14px; margin-bottom: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--ink-3); font-size: 11px; font-weight: 500; position: relative; transition: background .14s, color .14s;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.active { color: var(--candy-700); }
[data-theme="dark"] .side-item.active { color: var(--candy); }
.side-item.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--candy); }
.side-item .si-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; transition: background .14s; }
.side-item.active .si-ic { background: var(--candy-soft); }
.side-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-spacer { flex: 1; }
.side-app {
  width: 64px; padding: 12px 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #7FCf6e, #4F9F62); color: #fff; font-size: 11px; font-weight: 600; box-shadow: var(--shadow-sm);
}
.side-app svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- 主区 ---------- */
.app { min-height: 60vh; margin-left: var(--sidebar-w); padding-bottom: 40px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-title { font-size: 24px; color: var(--mint); }
.section-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.section-more { color: var(--candy); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.section-more:hover { gap: 8px; }

.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--candy-700); background: var(--candy-soft); padding: 6px 12px; border-radius: 999px; }
[data-theme="dark"] .eyebrow { color: var(--candy); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font-weight: 600; font-size: 15px; padding: 10px 20px; transition: transform .12s, box-shadow .16s, background .16s, opacity .16s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 16.5px; }
.btn-primary { background: var(--candy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--candy-600); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-block { width: 100%; }

/* ---------- 快捷入口卡片 ---------- */
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.quick-card {
  position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 18px; box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden;
  transition: transform .16s, box-shadow .16s; display: flex; flex-direction: column; gap: 10px; min-height: 124px;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quick-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 26px; background: linear-gradient(135deg, var(--candy-soft), transparent); transform: rotate(18deg); }
.quick-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--candy-soft); color: var(--candy-700); display: grid; place-items: center; }
[data-theme="dark"] .quick-ic { color: var(--candy); }
.quick-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-card .qt { font-size: 16px; font-weight: 600; font-family: var(--serif); }
.quick-card .qe { font-size: 12px; color: var(--ink-3); margin-top: -6px; }
.quick-try { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--candy-700); display: inline-flex; align-items: center; gap: 5px; }
[data-theme="dark"] .quick-try { color: var(--candy); }
.quick-card .qbadge { position: absolute; right: 12px; top: 12px; font-size: 10px; font-weight: 700; color: #fff; background: var(--candy); padding: 2px 7px; border-radius: 999px; z-index: 2; }

/* ---------- 轮播 Banner ---------- */
.carousel { margin-top: 22px; position: relative; }
.carousel-viewport { overflow: hidden; border-radius: var(--r-xl); }
.carousel-track { display: flex; transition: transform .5s cubic-bezier(.2,.8,.3,1); }
.carousel-slide { flex: 0 0 100%; min-height: 220px; padding: 38px 44px; color: #fff; position: relative; display: flex; flex-direction: column; justify-content: center; }
.carousel-slide::after { content: ""; position: absolute; right: -40px; top: -40px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }
.carousel-slide .cs-eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin-bottom: 10px; }
.carousel-slide h2 { color: #fff; font-size: clamp(26px, 3.4vw, 38px); max-width: 16em; }
.carousel-slide p { color: rgba(255,255,255,.92); margin: 10px 0 20px; font-size: 16px; max-width: 28em; }
.carousel-slide .btn-primary { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.35); }
.carousel-slide .btn-primary:hover { background: rgba(0,0,0,.42); }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.carousel-dots button { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: width .2s, background .2s; }
.carousel-dots button.on { width: 22px; background: var(--candy); }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.85); color: #1a1a18; display: grid; place-items: center; box-shadow: var(--shadow-md); z-index: 3; opacity: 0; transition: opacity .2s; }
.carousel:hover .carousel-arrow { opacity: 1; }
.carousel-arrow.prev { left: 14px; } .carousel-arrow.next { right: 14px; }
.carousel-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- 吸顶分类导航 ---------- */
.cat-nav {
  position: sticky; top: var(--topbar-h); z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); margin-top: 30px;
}
.cat-nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav-item { padding: 13px 14px; font-size: 14.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; border-bottom: 2px solid transparent; transition: color .14s; }
.cat-nav-item:hover { color: var(--ink); }
.cat-nav-item.active { color: var(--mint); border-bottom-color: var(--mint); font-weight: 600; }

/* ---------- 子筛选 chips ---------- */
.chips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; margin-bottom: 12px; }
.chips-row::-webkit-scrollbar { display: none; }
.subchip { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; transition: all .14s; flex-shrink: 0; }
.subchip:hover { border-color: var(--candy); color: var(--ink); }
.subchip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- 卡片网格 / 横滚 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 26px 6px; margin: 0 -26px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: 0 0 auto; width: 186px; }

.card { background: var(--surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line-2); cursor: pointer; transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.7,.3,1); }
.card:hover .card-media img { transform: scale(1.06); }
.card-media.r-16-9 { aspect-ratio: 16 / 9; } .card-media.r-1-1 { aspect-ratio: 1 / 1; } .card-media.r-9-16 { aspect-ratio: 9 / 16; }
.media-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.42) 0%, transparent 42%); opacity: 0; transition: opacity .2s; }
.card:hover .media-overlay { opacity: 1; }
.play-badge { position: absolute; left: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.9); color: #1a1a18; display: grid; place-items: center; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.card:hover .play-badge { opacity: 1; transform: translateY(0); }
.play-badge svg { width: 14px; height: 14px; fill: currentColor; margin-left: 2px; }
.dur-badge, .kind-badge { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(20,16,12,.55); backdrop-filter: blur(6px); padding: 3px 8px; border-radius: 999px; }
.tag-badge { position: absolute; left: 8px; top: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; color: #fff; background: var(--candy); box-shadow: var(--shadow-sm); }
.tag-badge.new { background: var(--green); } .tag-badge.trend { background: #7A4A5C; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--ink-3); font-size: 12px; }
.card-meta .uses { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .uses svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- 工具卡(频道页) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tool-card { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .16s, box-shadow .16s, border-color .16s; overflow: hidden; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--candy-soft); }
.tool-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--candy-soft); color: var(--candy-700); margin-bottom: 14px; }
[data-theme="dark"] .tool-ic { color: var(--candy); }
.tool-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-card h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.tool-card p { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 0; }
.tool-card .en { color: var(--ink-3); font-size: 12px; font-weight: 500; margin-top: 2px; }
.mini-badge { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--candy); color: #fff; letter-spacing: .03em; }
.mini-badge.new { background: var(--green); }

/* 过滤 chips(模板库) */
.chips { display: flex; gap: 9px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); transition: all .14s; }
.chip:hover { border-color: var(--candy); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- 页头(频道页) ---------- */
.page-head { padding: 34px 0 8px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); }
.page-head p { color: var(--ink-2); font-size: 16px; margin-top: 10px; max-width: 40em; }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 60px 24px; color: var(--ink-3); border: 1.5px dashed var(--line); border-radius: var(--r-lg); background: var(--bg-2); }
.empty .ic-wrap { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.empty .ic-wrap svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.empty h3 { font-size: 20px; color: var(--ink); }
.empty p { margin: 8px 0 20px; }

/* ---------- 模态框 ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20,15,10,.5); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: var(--r-xl); width: min(960px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); position: relative; animation: pop .24s cubic-bezier(.2,.8,.3,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; right: 14px; top: 14px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; font-size: 18px; }
.modal-close:hover { background: var(--line); }
.detail { display: grid; grid-template-columns: 0.85fr 1fr; }
.detail-media { background: var(--surface-2); position: relative; min-height: 360px; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media .play-big { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.92); color: #1a1a18; display: grid; place-items: center; box-shadow: var(--shadow-md); }
.detail-media .play-big svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.detail-body { padding: 30px; }
.detail-body h2 { font-size: 26px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.pill { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.detail-row { display: flex; gap: 24px; margin: 18px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-row .k { color: var(--ink-3); font-size: 12px; }
.detail-row .v { font-family: var(--serif); font-size: 18px; font-weight: 600; }

/* 生成面板 */
.gen { padding: 30px; }
.gen h2 { font-size: 24px; margin-bottom: 4px; }
.gen .lede { color: var(--ink-2); margin-bottom: 22px; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.prompt-box { width: 100%; min-height: 96px; resize: vertical; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; font-size: 15px; outline: none; transition: border-color .14s, box-shadow .14s; }
.prompt-box:focus { border-color: var(--candy); box-shadow: 0 0 0 3px var(--candy-soft); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2); }
.seg button.on { background: var(--candy-soft); border-color: var(--candy); color: var(--candy-700); font-weight: 600; }
[data-theme="dark"] .seg button.on { color: var(--candy); }
.gen-result { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }
.gen-canvas { aspect-ratio: 9/16; max-height: 360px; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); position: relative; display: grid; place-items: center; margin: 0 auto; width: fit-content; }
.gen-canvas img { height: 100%; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--candy); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-progress { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 5px 12px; border-radius: 999px; }
.proto-note { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 10px 14px; text-align: center; }

/* 登录 / 语言 / 充值 sheet */
.sheet { width: min(440px, 100%); padding: 30px; }
.sheet h2 { font-size: 24px; text-align: center; }
.sheet .sub { text-align: center; color: var(--ink-2); margin: 8px 0 24px; }
.oauth { display: grid; gap: 10px; }
.oauth button { justify-content: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-item { padding: 10px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; text-align: left; }
.lang-item:hover { border-color: var(--candy); }
.lang-item.on { background: var(--candy-soft); border-color: var(--candy); color: var(--candy-700); font-weight: 600; }
.credit-packs { display: grid; gap: 10px; }
.credit-pack { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; transition: border-color .14s, transform .12s; }
.credit-pack:hover { border-color: var(--candy); transform: translateY(-2px); }
.credit-pack .cp-amt { font-family: var(--serif); font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.credit-pack .cp-amt svg { width: 20px; height: 20px; color: var(--gold); fill: none; stroke: currentColor; stroke-width: 1.8; }
.credit-pack .cp-price { font-weight: 700; color: var(--candy-700); }
[data-theme="dark"] .credit-pack .cp-price { color: var(--candy); }
.credit-pack .cp-tag { font-size: 10px; font-weight: 700; color: #fff; background: var(--candy); padding: 2px 7px; border-radius: 999px; margin-left: 8px; }

/* 账户菜单 */
.menu-pop { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); width: 240px; padding: 8px; animation: pop .16s ease; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .avatar { width: 42px; height: 42px; font-size: 17px; }
.menu-head .mh-name { font-weight: 600; }
.menu-head .mh-tier { font-size: 12px; color: var(--gold); font-weight: 600; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2); width: 100%; }
.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.menu-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- App 下载横幅 ---------- */
.app-banner { margin-top: 50px; background: var(--grad); border-radius: var(--r-xl); padding: 38px; color: #fff; position: relative; overflow: hidden; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px; }
.app-banner::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); border-radius: 50%; }
.app-banner h2 { color: #fff; font-size: 28px; }
.app-banner p { color: rgba(255,255,255,.9); margin: 12px 0 22px; max-width: 26em; }
.store-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.25); padding: 10px 18px; border-radius: 14px; color: #fff; transition: background .16s; }
.store-btn:hover { background: rgba(0,0,0,.42); }
.store-btn svg { width: 24px; height: 24px; fill: #fff; }
.store-btn .small { font-size: 10px; opacity: .85; line-height: 1; }
.store-btn .big { font-size: 16px; font-weight: 600; line-height: 1.2; }
.app-phone { justify-self: center; }
.phone-frame { width: 196px; height: 392px; border-radius: 34px; background: #14110e; border: 7px solid #14110e; box-shadow: var(--shadow-lg); overflow: hidden; position: relative; }
.phone-frame img { width: 100%; height: 100%; object-fit: cover; }
.phone-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 90px; height: 20px; background: #14110e; border-radius: 0 0 14px 14px; z-index: 2; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 56px; background: var(--bg-2); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 44px 26px 28px; display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; }
.footer h4 { font-size: 13px; color: var(--green); margin-bottom: 14px; font-family: var(--sans); font-weight: 600; }
.footer a { display: block; color: var(--ink-2); font-size: 13.5px; padding: 5px 0; }
.footer a:hover { color: var(--candy-700); }
.footer-brand p { color: var(--ink-2); font-size: 13.5px; margin: 12px 0; max-width: 24em; }
.footer-lang { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; margin-bottom: 14px; }
.footer-lang svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.footer-store { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-store .store-btn { background: var(--ink); color: var(--bg); border: none; padding: 8px 14px; }
.footer-store .store-btn svg { fill: var(--bg); }
.footer-co { color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 26px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 浮动社区按钮 ---------- */
.community-fab { position: fixed; right: 22px; bottom: 26px; z-index: 80; width: 58px; height: 58px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform .16s; }
.community-fab:hover { transform: translateY(-3px) scale(1.04); }
.community-fab svg { width: 30px; height: 30px; }
.community-badge { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--candy), var(--candy-700)); padding: 2px 8px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow-sm); }

/* ---------- 底部 Tab(移动端) ---------- */
.tabbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar-inner { display: flex; justify-content: space-around; align-items: stretch; height: 58px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 500; position: relative; }
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--candy); }
.tab.fab .fab-circle { width: 46px; height: 46px; border-radius: 16px; margin-top: -18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-md); }
.tab.fab .fab-circle svg { width: 24px; height: 24px; stroke-width: 2; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 200; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .nav-links { gap: 0; }
  .nav-link { padding: 8px 11px; font-size: 14px; }
  .promo-pill { display: none; }
  .brand { width: auto; }
}
@media (max-width: 920px) {
  .app-banner { grid-template-columns: 1fr; }
  .app-phone { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: 1fr; }
  .detail-media { min-height: 280px; }
  .quick-row { grid-template-columns: repeat(2, 1fr); }
}

/* 移动端:左边栏 → 底部 Tab */
@media (max-width: 720px) {
  .topbar, .sidebar { display: none; }
  .mobilebar { display: flex; }
  .tabbar { display: block; }
  .app { margin-left: 0; padding-bottom: calc(72px + var(--safe-b)); }
  .cat-nav { top: 0; }
  .container { padding: 0 16px; }
  .cat-nav-inner { padding: 0 16px; }
  .rail { padding: 2px 16px 6px; margin: 0 -16px; }
  .rail > * { width: 144px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .quick-row { gap: 10px; }
  .quick-card { min-height: 108px; padding: 14px; }
  .quick-card .qt { font-size: 15px; }
  .section { margin-top: 32px; }
  .section-title { font-size: 21px; }
  .carousel-slide { padding: 26px 24px; min-height: 180px; }
  .app-banner { padding: 26px 22px; margin-top: 36px; }
  .app-banner h2 { font-size: 23px; }
  .gen, .detail-body, .sheet { padding: 22px; }
  .modal { border-radius: var(--r-lg); max-height: 94vh; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; animation: sheetUp .26s cubic-bezier(.2,.8,.3,1); }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .footer { margin-bottom: calc(58px + var(--safe-b)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .community-fab { bottom: calc(70px + var(--safe-b)); right: 16px; width: 50px; height: 50px; }
  .community-fab svg { width: 26px; height: 26px; }
}
@media (max-width: 420px) {
  .grid { gap: 10px; }
  .rail > * { width: 132px; }
  .footer-inner { grid-template-columns: 1fr; }
}

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