/* ============================================================
 * 每日好运符 v2 —— 现代韩风简约移动端样式
 * 低饱和马卡龙渐变（淡紫 / 浅蓝 / 蜜桃粉）· 大圆角 · 轻阴影 · 留白
 * 浅色/深色：data-theme="light" | "dark"（store 解析 auto 后写入）
 * ============================================================ */

:root {
  /* 主色板 */
  --lav: #8b7cf6;
  --lav-soft: #efe7ff;
  --lav-deep: #6f5ce0;
  --sky: #5b9bd5;
  --sky-soft: #e3f1ff;
  --peach: #ef8f96;
  --peach-soft: #ffe9ec;
  --mint: #4fae83;
  --mint-soft: #e2f6ec;
  --butter: #e0a93e;
  --butter-soft: #fff5da;

  /* 表面 */
  --bg: #f5f4fb;
  --bg-grad-a: #efe7fb;
  --bg-grad-b: #e8f1fc;
  --bg-grad-c: #fdeef0;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --card-2: #f4f2fb;
  --ink: #2f2d3d;
  --ink-2: #6f6b82;
  --ink-3: #9d99b0;
  --line: rgba(92, 78, 140, 0.1);
  --shadow: 0 12px 32px rgba(99, 86, 160, 0.1);
  --shadow-sm: 0 6px 18px rgba(99, 86, 160, 0.08);
  --track: rgba(130, 110, 190, 0.12);

  --hero-grad: linear-gradient(150deg, #e7dcff 0%, #d7e8ff 55%, #ffe1e3 100%);
  --radius: 22px;
  --radius-lg: 28px;
  --tabbar-h: 64px;
}

[data-theme='dark'] {
  --bg: #14141c;
  --bg-grad-a: #211e33;
  --bg-grad-b: #1b2336;
  --bg-grad-c: #2b1d28;
  --card: rgba(40, 40, 54, 0.78);
  --card-solid: #262633;
  --card-2: #30303f;
  --ink: #eceaf5;
  --ink-2: #aaa6bd;
  --ink-3: #7d7990;
  --line: rgba(190, 180, 230, 0.12);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.28);
  --track: rgba(190, 180, 230, 0.16);
  --hero-grad: linear-gradient(150deg, #2c2745 0%, #232e47 55%, #3c2733 100%);
  --lav-soft: #2e2947;
  --sky-soft: #21303f;
  --peach-soft: #3d2830;
  --mint-soft: #1f352c;
  --butter-soft: #38301f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Noto Sans CJK SC', 'Noto Sans JP', 'Malgun Gothic', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
input, select { font-family: inherit; font-size: 15px; color: var(--ink); }

/* ---------- 背景氛围 ---------- */
.app-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(420px 300px at 110% -40px, var(--bg-grad-c), transparent 70%),
    radial-gradient(420px 320px at -20% 80px, var(--bg-grad-a), transparent 70%),
    linear-gradient(180deg, var(--bg-grad-b) 0%, var(--bg) 46%, var(--bg) 100%);
  transition: background 0.3s ease;
}

.app-shell {
  /* z-index 保持 auto：不建立层叠上下文，确保顶栏语言菜单(40)能盖在关闭遮罩(30)之上；
     同为定位元素时按 DOM 顺序，app-shell 在 app-bg 之后，依然绘制在背景之上 */
  position: relative; z-index: auto;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 18px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}

/* ---------- 顶部若隐若现的工作室署名（所有页面固定显示） ---------- */
.studio-mark {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 3px); left: 50%;
  transform: translateX(-50%);
  z-index: 41; pointer-events: none; white-space: nowrap;
  font-family: 'Snell Roundhand', 'Bradley Hand', 'Segoe Script', Georgia, 'Times New Roman', serif;
  font-style: italic; font-weight: 600;
  font-size: 10px; letter-spacing: 0.24em;
  color: var(--ink-3); opacity: 0.5;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
[data-theme='dark'] .studio-mark { opacity: 0.3; text-shadow: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 2px 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar .title {
  flex: 1;
  font-size: 17px; font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  transition: background 0.2s, transform 0.15s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 21px; height: 21px; }

.brand-mark {
  width: 40px; height: 40px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hero-grad);
  box-shadow: var(--shadow-sm);
  font-size: 20px;
}

/* 语言下拉 */
.lang-wrap { position: relative; }
.lang-btn {
  height: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 19px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.lang-btn svg { width: 16px; height: 16px; }
.lang-btn .chev { transition: transform 0.2s; }
.lang-btn.open .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: 46px;
  min-width: 150px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 6px;
  overflow: hidden;
  animation: pop 0.18s ease;
}
.lang-menu button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.lang-menu button:active { background: var(--card-2); }
.lang-menu button.active { color: var(--lav); }
.lang-menu .tick { font-size: 13px; }

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- 卡片基础 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 800; margin-bottom: 12px;
}
.card-title .more { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.ti-svg { width: 18px; height: 18px; color: var(--lav); flex: none; }

/* ---------- 首屏 Hero ---------- */
.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--hero-grad);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  margin-bottom: 14px;
  overflow: hidden;
}
.hero-card::after {
  content: ''; position: absolute; right: -50px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
[data-theme='dark'] .hero-card::after { background: rgba(255, 255, 255, 0.06); }
.hero-top { position: relative; z-index: 1; }
.hero-greet { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.hero-date-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.hero-date { font-size: 20px; font-weight: 800; }
.hero-clock {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(139, 124, 246, 0.12);
  color: var(--lav-deep);
}
.hc-ic { display: inline-flex; }
.hc-ic svg { width: 13px; height: 13px; }
.hc-time { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
[data-theme='dark'] .hero-clock { background: rgba(157, 140, 255, 0.18); color: #b8a8ff; }
.hero-lunar { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.meta-chip {
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
[data-theme='dark'] .meta-chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }

.hero-score {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 20px;
  margin-top: 18px;
}
.ring-wrap { position: relative; width: 128px; height: 128px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); width: 128px; height: 128px; }
.ring-track { stroke: var(--track); }
.ring-val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.9s cubic-bezier(.22,.8,.3,1); }
.ring-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-num b { font-size: 38px; font-weight: 900; line-height: 1; color: var(--ink); }
.ring-num small { font-size: 10.5px; color: var(--ink-3); font-weight: 700; margin-top: 2px; }
.hero-side { flex: 1; min-width: 0; }
.tier-pill {
  display: inline-block;
  font-size: 12px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.7); color: var(--lav-deep);
  margin-bottom: 8px;
}
[data-theme='dark'] .tier-pill { background: rgba(139,124,246,.22); color: #c8b9ff; }
.hero-summary { font-size: 14px; line-height: 1.65; color: var(--ink); font-weight: 600; }
.hero-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

/* ---------- 横向滑动：分项运势 ---------- */
.hscroll {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 8px;
  margin: 0 -18px;
  padding-left: 18px; padding-right: 18px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.dim-card {
  scroll-snap-align: start;
  flex: 0 0 140px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 14px;
  text-align: center;
}
.dim-ring { position: relative; width: 84px; height: 84px; margin: 0 auto 10px; }
.dim-ring svg { transform: rotate(-90deg); width: 84px; height: 84px; }
.dim-ring .ring-track { stroke: var(--track); }
.dim-ring .ring-val { transition: stroke-dashoffset 0.9s ease; }
.dim-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 900;
}
.dim-name { font-size: 13.5px; font-weight: 800; }
.dim-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
.dim-tip { font-size: 11.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; text-align: left; }

/* 分数颜色（环 & 数字） */
.sc-high { color: var(--lav-deep); }
.sc-mid { color: var(--sky); }
.sc-low { color: var(--peach); }
[data-theme='dark'] .sc-high { color: #b8a8ff; }
.ring-high { stroke: var(--lav); }
.ring-mid { stroke: var(--sky); }
.ring-low { stroke: var(--peach); }

/* ---------- 黄历宜忌 ---------- */
/* 两列宽度随各自文案长度自适应（多语言长短差异大），等高拉伸保持视觉平衡 */
.yj-row { display: flex; gap: 10px; align-items: stretch; }
/* basis 取内容宽度：文案长的一侧自动变宽，剩余空间等分填满整行；过窄时正常折行 */
.yj-col {
  flex: 1 1 auto; min-width: 0;
  border-radius: 18px; padding: 14px;
}
.yj-col.yi { background: var(--mint-soft); }
.yj-col.ji { background: var(--peach-soft); }
.yj-head {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 28px; padding: 0 11px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 900; margin-bottom: 10px;
  white-space: nowrap; line-height: 1;
}
.yj-col.yi .yj-head { background: var(--mint); color: #fff; }
.yj-col.ji .yj-head { background: var(--peach); color: #fff; }
.yj-list { display: flex; flex-direction: column; gap: 7px; }
.yj-item { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.almanac-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px;
}
.almanac-meta .meta-chip { background: var(--card-2); border-color: var(--line); }

/* ---------- 天气卡 ---------- */
.weather-main { display: flex; align-items: center; gap: 14px; }
.weather-icon {
  width: 52px; height: 52px; border-radius: 18px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--sky-soft); color: var(--sky);
}
.weather-icon svg { width: 28px; height: 28px; }
.weather-temp { font-size: 26px; font-weight: 900; line-height: 1; }
.weather-city { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-top: 3px; }
.weather-desc { font-size: 13px; font-weight: 700; }
.weather-stats { display: flex; gap: 14px; margin-left: auto; }
.ws { text-align: right; }
.ws b { display: block; font-size: 13px; font-weight: 800; }
.ws small { font-size: 10.5px; color: var(--ink-3); }
.weather-advice {
  margin-top: 12px; padding: 11px 14px;
  border-radius: 16px; font-size: 12.5px; font-weight: 600;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.55;
}
.weather-advice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.wa-good { background: var(--mint-soft); color: #2f7d5c; }
.wa-careful { background: var(--butter-soft); color: #9a6f1e; }
.wa-bad { background: var(--peach-soft); color: #c15f68; }
[data-theme='dark'] .wa-good { color: #8edcb8; }
[data-theme='dark'] .wa-careful { color: #e9c878; }
[data-theme='dark'] .wa-bad { color: #f2a7ad; }

.carwash-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 12.5px; font-weight: 700;
}
.carwash-row.ok { color: var(--mint); }
.carwash-row.no { color: var(--peach); }
.carwash-row svg { width: 16px; height: 16px; }

.weather-off {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 10px 4px 4px; text-align: center;
}
.weather-off p { font-size: 12.5px; color: var(--ink-2); max-width: 260px; }
.weather-error { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.weather-error svg { width: 18px; height: 18px; color: var(--peach); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px;
  border-radius: 999px;
  font-size: 15px; font-weight: 800;
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #9d8cff, #7c6cf0);
  color: #fff;
  box-shadow: 0 10px 24px rgba(124, 108, 240, 0.32);
}
.btn-peach {
  background: linear-gradient(135deg, #ffb3a7, #f58fa0);
  color: #fff;
  box-shadow: 0 10px 24px rgba(245, 143, 160, 0.3);
}
.btn-soft {
  background: var(--card-solid);
  color: var(--lav-deep);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }

.cta-row { display: flex; gap: 12px; margin: 6px 0 4px; }
.cta-row .btn { flex: 1; white-space: nowrap; font-size: 13.5px; padding-left: 12px; padding-right: 12px; gap: 6px; }
html[lang="ja"] .cta-row .btn,
html[lang="ko"] .cta-row .btn { font-size: 13px; }
html[lang="en"] .cta-row .btn { font-size: 12.5px; padding-left: 10px; padding-right: 10px; gap: 5px; }

.text3 { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex;
  max-width: 480px; margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  padding-top: 6px;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--lav); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.field .req { color: var(--peach); margin-left: 2px; }
.input, select.input {
  width: 100%; min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  padding: 0 16px;
  font-size: 15px; font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--lav); box-shadow: 0 0 0 3px rgba(139, 124, 246, 0.16); }
textarea.input { padding: 12px 16px; min-height: 92px; resize: vertical; }

.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--card-2);
  border-radius: 16px;
}
.segmented button {
  flex: 1; min-height: 42px;
  border-radius: 13px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  transition: all 0.2s;
}
.segmented button.active {
  background: var(--card-solid);
  color: var(--lav-deep);
  box-shadow: var(--shadow-sm);
}
[data-theme='dark'] .segmented button.active { color: #b8a8ff; }

.option-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-pill {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  transition: all 0.18s;
}
.opt-pill.active {
  background: var(--lav);
  border-color: var(--lav);
  color: #fff;
  box-shadow: 0 6px 16px rgba(139, 124, 246, 0.3);
}

/* 素材选择（形象/配色/图案） */
.swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.swatch {
  aspect-ratio: 1; border-radius: 18px;
  border: 2px solid transparent;
  background: var(--card-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  position: relative;
  transition: transform 0.15s, border-color 0.18s;
  padding: 4px;
  text-align: center;
}
.swatch:active { transform: scale(0.94); }
.swatch.active { border-color: var(--lav); box-shadow: 0 0 0 3px rgba(139,124,246,.15); }
.swatch .dot { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.swatch .mini { font-size: 20px; line-height: 1; }
.swatch .vip-dot {
  position: absolute; top: 5px; right: 5px;
  font-size: 8.5px; font-weight: 900;
  background: linear-gradient(135deg, #ffd88a, #f0a93e);
  color: #fff; border-radius: 8px; padding: 1px 5px;
}
.swatch.locked { opacity: 0.65; }

/* 表单两列 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 好运符预览 ---------- */
.charm-preview-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card-2);
  position: relative;
}
.charm-preview-wrap canvas, .charm-preview-wrap img { width: 100%; display: block; }
.charm-badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 800;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.88); color: var(--ink-2);
  backdrop-filter: blur(6px);
}
.charm-actions { display: flex; gap: 10px; margin-top: 14px; }
.charm-actions .btn { flex: 1; }

.custom-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--hero-grad);
  box-shadow: var(--shadow-sm);
  margin-top: 14px;
}
.custom-entry .ce-ic {
  width: 44px; height: 44px; border-radius: 15px; flex: none;
  background: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.custom-entry .ce-t { font-size: 14px; font-weight: 800; }
.custom-entry .ce-d { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.custom-entry .go-arrow { margin-left: auto; color: var(--ink-3); font-size: 18px; }

/* ---------- 会员 ---------- */
.member-hero {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #3f3756, #5b4b86);
  color: #fff;
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.member-hero .plan-name { font-size: 19px; font-weight: 900; }
.member-hero .plan-sub { font-size: 12px; opacity: 0.75; margin-top: 4px; }
.plan-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--card);
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.2s, transform 0.15s;
}
.plan-card:active { transform: scale(0.99); }
.plan-card.active { border-color: var(--lav); }
.plan-card.recommend { border-color: var(--peach); }
.plan-emoji {
  width: 48px; height: 48px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--card-2);
}
.plan-info { flex: 1; min-width: 0; }
.plan-info .pn { font-size: 15px; font-weight: 800; }
.plan-info .pd { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.plan-price b { font-size: 20px; font-weight: 900; }
.plan-price small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.plan-flag {
  position: absolute; top: -9px; right: 14px;
  font-size: 10.5px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #ffb3a7, #f58fa0);
  color: #fff;
}
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery-grid img { aspect-ratio: 9/16; object-fit: cover; border-radius: 12px; background: var(--card-2); }
.gallery-empty {
  text-align: center; color: var(--ink-3); font-size: 12.5px;
  padding: 24px 0;
}

/* 列表行 */
.list-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  text-align: left;
  transition: transform 0.15s;
}
.list-row:active { transform: scale(0.99); }
.list-row .lr-ic {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--lav-soft); color: var(--lav);
}
.list-row .lr-ic svg { width: 19px; height: 19px; }
.list-row .lr-t { font-size: 14.5px; font-weight: 700; }
.list-row .lr-d { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.list-row .chev { margin-left: auto; color: var(--ink-3); }
.list-row .chev svg { width: 17px; height: 17px; }
.list-row.danger .lr-ic { background: var(--peach-soft); color: var(--peach); }

/* 状态胶囊 */
.tag {
  font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
}
.tag-paid { background: var(--mint-soft); color: var(--mint); }
.tag-pending { background: var(--butter-soft); color: var(--butter); }
.tag-free { background: var(--lav-soft); color: var(--lav); }

/* 历史 */
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px;
  background: var(--card-solid); border: 1px solid var(--line);
  margin-bottom: 8px;
}
.history-score {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900;
}
.hs-high { background: var(--lav-soft); color: var(--lav-deep); }
.hs-mid { background: var(--sky-soft); color: var(--sky); }
.hs-low { background: var(--peach-soft); color: var(--peach); }
.history-meta { flex: 1; min-width: 0; }
.history-meta .hm1 { font-size: 13.5px; font-weight: 700; }
.history-meta .hm2 { font-size: 11px; color: var(--ink-3); }

/* ---------- 法律文本 ---------- */
.legal-prose {
  font-size: 13.5px; line-height: 1.9; color: var(--ink-2);
  white-space: pre-wrap;
}
.legal-prose h3 { color: var(--ink); margin: 18px 0 8px; font-size: 15px; }

/* ---------- 免责声明 ---------- */
.disclaimer {
  font-size: 11px; line-height: 1.7; color: var(--ink-3);
  text-align: center;
  padding: 18px 20px 8px;
}

/* ---------- 弹窗（底部抽屉） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(40, 34, 60, 0.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.2s ease;
}
.modal-mask.center { align-items: center; padding: 24px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  background: var(--card-solid);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheet 0.26s cubic-bezier(.2,.8,.25,1);
}
.modal-mask.center .modal { border-radius: 28px; }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--ink-3); opacity: 0.4;
  margin: 6px auto 14px;
}
.modal h3 { font-size: 19px; text-align: center; }
.m-desc { font-size: 12.5px; color: var(--ink-2); text-align: center; margin: 8px 0 16px; line-height: 1.7; }
.modal-img-wrap { border-radius: 20px; overflow: hidden; max-height: 52vh; overflow-y: auto; background: var(--card-2); }
.modal-img-wrap img { width: 100%; }

/* 支付渠道 */
.pay-channels { display: flex; gap: 8px; margin-top: 14px; }
.pay-ch {
  flex: 1; padding: 12px 4px;
  border-radius: 16px; border: 1.5px solid var(--line);
  text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.pay-ch .emoji { font-size: 20px; }
.pay-ch.active { border-color: var(--lav); color: var(--lav-deep); background: var(--lav-soft); }
.pay-ch.disabled { opacity: 0.5; }
[data-theme='dark'] .pay-ch.active { color: #c8b9ff; }

.success-box { text-align: center; padding: 22px 0; }
.success-box .big { font-size: 56px; }

/* ---------- Toast ---------- */
.toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
  z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 28px;
}
.toast {
  max-width: 100%;
  background: rgba(47, 45, 61, 0.94);
  color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}
.toast.success { background: rgba(55, 140, 105, 0.95); }
.toast.error { background: rgba(214, 102, 112, 0.95); }
.toast.leaving { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Loading ---------- */
.loading-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(30, 26, 48, 0.32);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.loading-card {
  background: var(--card-solid);
  border-radius: 22px;
  padding: 22px 28px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow);
}
.loading-cat { font-size: 22px; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页面过渡 ---------- */
.view-enter-active, .view-leave-active { transition: opacity 0.22s ease, transform 0.22s ease; }
.view-enter-from { opacity: 0; transform: translateY(10px); }
.view-leave-to { opacity: 0; transform: translateY(-8px); }

/* ---------- 开关 ---------- */
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track-sw {
  position: absolute; inset: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s;
}
.switch .track-sw::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.switch input:checked + .track-sw { background: var(--lav); border-color: var(--lav); }
.switch input:checked + .track-sw::after { transform: translateX(20px); }

/* 段内说明 */
.section-label {
  font-size: 12px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 18px 4px 10px;
}

.empty-state {
  text-align: center; padding: 28px 16px; color: var(--ink-3); font-size: 12.5px;
}

/* 头像/角色预览图占位 */
.char-preview {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: var(--hero-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  overflow: hidden;
}
.char-preview canvas { width: 100%; height: 100%; }

/* ============================================================
   v2 视图补充样式（新结构类名）
   ============================================================ */

/* 非 Tab 页不需要底部 tab 占位 */
.app-shell { padding-bottom: 30px; }
.app-shell.with-tab { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }

/* 按钮内联 svg 对齐 */
.btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.btn .spinner { vertical-align: -3px; border-width: 2px; border-color: rgba(255,255,255,.45); border-top-color: #fff; }
.btn.ghost-danger { color: var(--peach); }
.btn.danger { color: var(--peach); }

/* 语言下拉细节 */
.lang-caret { display: inline-flex; transition: transform 0.2s; }
.lang-caret svg { width: 13px; height: 13px; }
.lang-caret.open { transform: rotate(180deg); }
.lm-check { display: inline-flex; }
.lm-check svg { width: 15px; height: 15px; color: var(--lav); }
.lang-dismiss { position: fixed; inset: 0; z-index: 30; }

/* 天气小统计 */
.ws b { display: block; font-size: 16px; font-weight: 900; text-align: right; }
.ws b i { font-style: normal; font-size: 10px; font-weight: 700; margin-left: 1px; }
.ws small { font-size: 10px; color: var(--ink-3); font-weight: 600; }
.weather-off { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; text-align: center; }
.weather-off .spinner { border-color: rgba(139,124,246,.25); border-top-color: var(--lav); width: 22px; height: 22px; }
.weather-advice { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; font-weight: 600; line-height: 1.6; }

/* 符咒角标 */
.charm-badge-free, .charm-badge-hd {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 800;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.88); color: var(--ink-2);
  backdrop-filter: blur(6px);
}
.charm-badge-hd { background: linear-gradient(135deg, #ffd88a, #f0a93e); color: #fff; }

/* 定制入口（首页符咒页底部） */
.custom-entry-icon {
  width: 46px; height: 46px; border-radius: 15px; flex: none;
  background: rgba(255,255,255,.65);
  display: flex; align-items: center; justify-content: center; color: var(--lav-deep);
}
.custom-entry-icon svg { width: 23px; height: 23px; }
.custom-entry-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.custom-entry-text b { font-size: 14px; font-weight: 800; }
.custom-entry-text small { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.custom-entry-vip {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800; color: var(--lav-deep);
  background: rgba(255,255,255,.7); padding: 5px 10px; border-radius: 999px;
}
.custom-entry-vip svg { width: 12px; height: 12px; }
.custom-entry-vip.on { color: #b07f1e; background: rgba(255,236,190,.9); }

/* 会员 */
.member-hero { text-align: center; }
.mh-icon {
  width: 58px; height: 58px; border-radius: 20px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16);
}
.mh-icon svg { width: 28px; height: 28px; color: #ffd88a; }
.member-hero h2 { font-size: 20px; font-weight: 900; }
.member-hero p { font-size: 12.5px; opacity: .8; margin: 6px 0 16px; }
.credit-tag {
  display: inline-block; margin: 0 0 10px 2px;
  font-size: 11.5px; font-weight: 800; color: var(--lav-deep);
  background: var(--lav-soft); padding: 6px 13px; border-radius: 999px;
}
.member-lock { text-align: center; padding: 34px 22px; }
.lock-icon {
  width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--lav-soft); color: var(--lav);
}
.lock-icon svg { width: 30px; height: 30px; }
.member-lock h3 { font-size: 17px; font-weight: 900; margin-bottom: 8px; }

/* 素材 emoji 块 */
.swatch-emoji span { font-size: 24px; line-height: 1; }
.swatch .vip-dot { content: ''; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #ffd88a, #f0a93e); padding: 0; }

/* 订单行 */
.order-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.order-row:last-child { border-bottom: none; }
.or-plan { font-size: 14px; font-weight: 800; }
.or-date { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.tag-green { background: var(--mint-soft); color: var(--mint); }
.tag-gray { background: var(--card-2); color: var(--ink-3); }

/* 列表行文字变体 */
.list-row .ti-svg { color: var(--lav); }
.lr-label { font-size: 14.5px; font-weight: 700; flex: 1; }
.lr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-text b { font-size: 14.5px; font-weight: 800; }
.lr-text small { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.list-row .switch { margin-left: auto; }

/* 法律页 */
.legal-title { font-size: 18px; font-weight: 900; margin-bottom: 12px; }

/* 设置页 */
.settings-label { font-size: 12.5px; font-weight: 800; color: var(--ink-3); margin-bottom: 10px; }
.lang-options { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-ic { display: inline-flex; vertical-align: -3px; margin-right: 2px; }
.theme-ic svg { width: 15px; height: 15px; }
.version-line { text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px 0 2px; }
.center { text-align: center; }
.pad-h { padding-left: 18px; padding-right: 18px; }

/* 套餐弹窗新结构 */
.plan-card { flex-direction: column; align-items: stretch; gap: 8px; }
.pc-top { display: flex; align-items: center; justify-content: space-between; }
.pc-top b { font-size: 15.5px; font-weight: 900; }
.pc-price { font-size: 22px; font-weight: 900; color: var(--lav-deep); }
.pc-price small { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.pc-desc { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.pay-agree { font-size: 11px; color: var(--ink-3); line-height: 1.7; text-align: center; margin-top: 12px; }

/* 支付弹窗 */
.pay-summary {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-2); border-radius: 18px; padding: 16px 18px; margin-bottom: 4px;
}
.pay-summary b { font-size: 15px; font-weight: 900; }
.pay-amount { font-size: 24px; font-weight: 900; color: var(--lav-deep); }
.pay-note { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 10px; line-height: 1.6; }
.pay-success { text-align: center; padding: 26px 0 14px; }
.ps-ic {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint-soft); color: var(--mint);
  animation: pop 0.3s ease;
}
.ps-ic svg { width: 36px; height: 36px; }
.pay-success h3 { margin-bottom: 6px; }

/* 保存图片弹窗 */
.save-img-box {
  border-radius: 20px; overflow: hidden; max-height: 54vh; overflow-y: auto;
  background: var(--card-2); margin-bottom: 4px;
}
.save-img-box img { width: 100%; display: block; }

/* 分页容器小尾巴 */
.view-profile .field:last-child, .view-custom .card:last-of-type { margin-bottom: 14px; }

/* ============================================================
 * v3 国风红金增量样式
 * AI 生成核心区块 / 红色专区 / 壁纸库 / 登录 / 个人中心 / 充值
 * 复用原有 .card .btn .input .modal 体系，仅新增区块级样式
 * ============================================================ */
:root {
  --cn-red: #c8342a;
  --cn-red-deep: #9e211a;
  --cn-red-soft: #fbeae6;
  --cn-gold: #d4a24c;
  --cn-gold-2: #e8c078;
  --cn-gold-deep: #b4832f;
  --cn-gold-soft: #f9efdb;
  --cn-ink: #3a2a22;
  --grad-gold: linear-gradient(135deg, #e8c078 0%, #d4a24c 55%, #b8862f 100%);
  --grad-red: linear-gradient(160deg, #d8493a 0%, #c8342a 45%, #a02318 100%);
}
[data-theme='dark'] {
  --cn-red-soft: #3c1a16;
  --cn-gold-soft: #3a2f1c;
  --cn-gold: #e0b264;
  --cn-gold-deep: #c99945;
}

/* ---------- 通用小组件 ---------- */
.btn-gold { background: var(--grad-gold); color: #4a2f10; font-weight: 800; box-shadow: 0 8px 20px rgba(196, 148, 60, 0.35); }
.btn-gold:active { transform: scale(0.97); }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.empty-box { text-align: center; color: var(--ink-3); font-size: 13px; padding: 34px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.sec-head { text-align: center; margin: 30px 0 16px; }
.sec-title { font-size: 20px; color: var(--cn-ink); letter-spacing: 0.04em; }
[data-theme='dark'] .sec-title { color: var(--ink); }
.sec-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.load-more { text-align: center; margin: 18px 0 6px; }
.save-img-box { border-radius: 20px; overflow: hidden; max-height: 56vh; overflow-y: auto; background: var(--card-2); margin-top: 10px; }
.save-img-box img { width: 100%; display: block; }
.modal-card { position: relative; background: var(--card-solid); border-radius: var(--radius-lg); padding: 26px 22px 22px; width: min(92vw, 420px); box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 10px; right: 14px; font-size: 22px; line-height: 1; color: var(--ink-3); padding: 4px; }

/* ---------- ① AI 生成核心区块（视觉权重最高） ---------- */
.ai-hero { position: relative; margin: 14px 4px 6px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 16px 40px rgba(158, 33, 26, 0.22); }
.ai-hero-bg { position: absolute; inset: 0; background: var(--grad-red); }
.ai-hero-bg::before { content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 82% 12%, rgba(232, 192, 120, 0.5), transparent 42%),
              radial-gradient(circle at 8% 88%, rgba(232, 192, 120, 0.28), transparent 46%); }
.ai-hero-bg::after { content: '福'; position: absolute; right: -18px; bottom: -46px; font-size: 150px; font-weight: 900; color: rgba(255, 235, 200, 0.12); font-family: 'Songti SC', serif; }
.ai-hero-inner { position: relative; padding: 26px 20px 22px; }
.ai-title { color: #fff8ec; font-size: 24px; text-align: center; letter-spacing: 0.08em; text-shadow: 0 2px 10px rgba(90, 15, 8, 0.4); }
.ai-sub { color: rgba(255, 240, 214, 0.85); font-size: 12.5px; text-align: center; margin: 6px 0 16px; }
.ai-input-wrap { position: relative; background: rgba(255, 251, 242, 0.96); border-radius: 18px; border: 1px solid rgba(212, 162, 76, 0.55); box-shadow: inset 0 2px 8px rgba(120, 60, 20, 0.06); }
.ai-input { width: 100%; border: none; outline: none; background: transparent; resize: none; padding: 14px 16px 22px; font-size: 14.5px; line-height: 1.65; color: var(--cn-ink); font-family: inherit; }
.ai-input::placeholder { color: #b09880; }
.ai-count { position: absolute; right: 14px; bottom: 8px; font-size: 11px; color: #b09880; }
.ai-styles { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.ai-style-chip { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: #ffe9c4; background: rgba(255, 240, 214, 0.14); border: 1px solid rgba(232, 192, 120, 0.45); transition: all 0.18s ease; }
.ai-style-chip.on { background: var(--grad-gold); color: #4a2f10; font-weight: 700; border-color: transparent; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.ai-stage { margin-top: 16px; }
.ai-loading { text-align: center; padding: 26px 0 18px; }
.ai-spinner { border-color: rgba(255, 236, 200, 0.35); border-top-color: #ffe9c4; width: 34px; height: 34px; border-width: 3px; }
.ai-stage-text { color: #fff3dd; font-size: 14px; font-weight: 700; margin-top: 12px; }
.ai-stage-hint { color: rgba(255, 240, 214, 0.7); font-size: 11.5px; margin-top: 4px; }
.ai-preview { border-radius: 18px; overflow: hidden; border: 2px solid rgba(232, 192, 120, 0.7); box-shadow: 0 10px 28px rgba(60, 12, 6, 0.45); cursor: zoom-in; max-width: 300px; margin: 0 auto; }
.ai-preview img { width: 100%; display: block; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.ai-error { text-align: center; color: #ffe9c4; padding: 20px 0 10px; font-size: 13.5px; }
.ai-error .btn { margin-top: 10px; }
.ai-go { width: 100%; margin-top: 16px; min-height: 50px; font-size: 16px; border-radius: 999px; }

/* ---------- 额度不足弹窗（突出单次点卡） ---------- */
.quota-modal { text-align: center; }
.quota-title { font-size: 19px; color: var(--cn-red-deep); }
[data-theme='dark'] .quota-title { color: var(--cn-gold-2); }
.quota-desc { font-size: 12.5px; color: var(--ink-2); margin: 8px 0 16px; line-height: 1.7; }
.quota-options { display: flex; gap: 10px; }
.quota-opt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card-2); transition: transform 0.15s ease; }
.quota-opt:active { transform: scale(0.97); }
.quota-opt b { font-size: 15px; color: var(--ink); }
.quota-opt .quota-price { font-size: 18px; font-weight: 900; color: var(--cn-red); }
.quota-opt small { font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.quota-opt.primary { background: var(--grad-red); border-color: transparent; box-shadow: 0 10px 24px rgba(200, 52, 42, 0.35); }
.quota-opt.primary b, .quota-opt.primary .quota-price { color: #fff4e0; }
.quota-opt.primary small { color: rgba(255, 236, 200, 0.8); }

/* ---------- ② 红色专区 / ③ 壁纸库 ---------- */
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 10px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip { flex-shrink: 0; padding: 8px 16px; border-radius: 999px; font-size: 13px; color: var(--cn-red-deep); background: var(--cn-red-soft); border: 1px solid rgba(200, 52, 42, 0.2); transition: all 0.18s ease; }
[data-theme='dark'] .cat-chip { color: var(--cn-gold-2); }
.cat-chip.on { background: var(--cn-red); color: #fff4e0; font-weight: 700; border-color: transparent; box-shadow: 0 6px 14px rgba(200, 52, 42, 0.3); }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tpl-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 10px; box-shadow: var(--shadow-sm); transition: transform 0.22s ease, box-shadow 0.22s ease; }
.tpl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tpl-thumb { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 9/16; background: var(--card-2); cursor: zoom-in; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-badge { position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.tpl-badge.free { background: rgba(79, 174, 131, 0.92); color: #fff; }
.tpl-badge.vip { background: var(--grad-gold); color: #4a2f10; }
.tpl-name { font-size: 13.5px; font-weight: 800; margin: 10px 2px 2px; }
.tpl-desc { font-size: 11.5px; color: var(--ink-3); margin: 0 2px 10px; line-height: 1.55; }
.tpl-card .btn { margin-top: 4px; }

/* ---------- 登录 / 注册 ---------- */
.view-login { padding-top: 8vh; }
.auth-card { text-align: center; padding: 34px 26px 26px; }
.auth-logo { font-size: 46px; }
.auth-title { margin-top: 10px; font-size: 22px; color: var(--cn-red-deep); }
[data-theme='dark'] .auth-title { color: var(--cn-gold-2); }
.auth-sub { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 20px; line-height: 1.7; }
.auth-card .input { margin-bottom: 12px; text-align: left; }
.auth-switch { margin-top: 16px; font-size: 13px; color: var(--cn-gold-deep); }
[data-theme='dark'] .auth-switch { color: var(--cn-gold-2); }

/* ---------- 个人中心 ---------- */
.center-guest { text-align: center; padding: 36px 24px 28px; }
.center-guest h2 { font-size: 19px; margin: 12px 0 4px; }
.center-guest-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 20px; }
.center-user { display: flex; align-items: center; gap: 14px; }
.center-avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: #fff4e0; background: var(--grad-red); box-shadow: 0 8px 18px rgba(200, 52, 42, 0.3); }
.center-avatar.guest { margin: 0 auto; font-size: 30px; background: var(--grad-gold); }
.center-user-meta { flex: 1; min-width: 0; }
.center-name { font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.center-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.member-badge { font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.member-badge.free { background: var(--card-2); color: var(--ink-3); }
.member-badge.basic { background: var(--cn-red-soft); color: var(--cn-red-deep); }
.member-badge.pro { background: var(--grad-gold); color: #4a2f10; }
[data-theme='dark'] .member-badge.basic { color: var(--cn-gold-2); }
.quota-panel { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 8px; margin-top: 14px; }
.quota-cell { flex: 1; text-align: center; }
.quota-num { font-size: 26px; font-weight: 900; color: var(--cn-red); }
.quota-num.gold { color: var(--cn-gold-deep); }
[data-theme='dark'] .quota-num.gold { color: var(--cn-gold-2); }
.quota-label { font-size: 13px; font-weight: 700; margin-top: 2px; }
.quota-hint { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.quota-divider { width: 1px; background: var(--line); margin: 4px 0; }
.recharge-btn { margin-top: 14px; min-height: 48px; font-size: 15px; border-radius: 999px; }
.center-tabs { display: flex; gap: 8px; margin: 20px 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.center-tab { flex: 1; padding: 9px 0; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); transition: all 0.18s ease; }
.center-tab.on { background: var(--cn-red); color: #fff4e0; font-weight: 700; box-shadow: 0 4px 12px rgba(200, 52, 42, 0.3); }
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.work-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.work-card img { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; cursor: zoom-in; }
.work-ops { display: flex; }
.work-ops button { flex: 1; font-size: 11px; padding: 8px 0; color: var(--ink-2); }
.work-ops button.danger { color: var(--cn-red); }
.work-ops button:active { background: var(--card-2); }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-item { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.order-main { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.order-plan { font-size: 12px; color: var(--ink-2); }
.order-side { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.order-amount { font-size: 17px; font-weight: 900; color: var(--cn-red); }
.order-status { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.order-status.pending { background: var(--butter-soft); color: var(--butter); }
.order-status.paid { background: var(--mint-soft); color: var(--mint); }
.order-status.closed { background: var(--card-2); color: var(--ink-3); }
.order-status.refunded { background: var(--peach-soft); color: var(--peach); }
.order-no { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; word-break: break-all; }

/* ---------- 充值页（会员套餐 + 单次点卡） ---------- */
.member-status { text-align: center; padding: 22px 18px; }
.ms-badge { display: inline-block; font-size: 13px; font-weight: 800; padding: 6px 18px; border-radius: 999px; }
.ms-badge.free { background: var(--card-2); color: var(--ink-3); }
.ms-badge.basic { background: var(--cn-red-soft); color: var(--cn-red-deep); }
.ms-badge.pro { background: var(--grad-gold); color: #4a2f10; }
.ms-line { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.ms-credits { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.ms-credits b { color: var(--cn-gold-deep); font-size: 16px; }
[data-theme='dark'] .ms-credits b { color: var(--cn-gold-2); }
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.plan-card2 { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 18px 16px 16px; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; }
.plan-card2:active { transform: scale(0.98); }
.plan-card2.highlight { border-color: var(--cn-gold); background: linear-gradient(170deg, var(--cn-gold-soft) 0%, var(--card-solid) 60%); box-shadow: 0 12px 28px rgba(196, 148, 60, 0.22); }
.plan-card2.credit-card { border-color: rgba(200, 52, 42, 0.4); background: linear-gradient(170deg, var(--cn-red-soft) 0%, var(--card-solid) 60%); }
.plan-tag { position: absolute; top: -9px; right: 12px; font-size: 10px; font-weight: 800; color: #fff4e0; background: var(--cn-red); padding: 3px 10px; border-radius: 999px; box-shadow: 0 4px 10px rgba(200, 52, 42, 0.35); }
.pc2-name { font-size: 15px; font-weight: 900; }
.pc2-cycle { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.pc2-price { font-size: 24px; font-weight: 900; color: var(--cn-red); margin: 8px 0; }
.pc2-price::first-letter { font-size: 14px; }
.pc2-perks { list-style: none; margin: 0 0 14px; padding: 0; min-height: 84px; }
.pc2-perks li { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; padding-left: 14px; position: relative; margin-bottom: 5px; }
.pc2-perks li::before { content: '✦'; position: absolute; left: 0; color: var(--cn-gold); font-size: 10px; }

/* ---------- 桌面端自适应 ---------- */
@media (min-width: 900px) {
  .tpl-grid { grid-template-columns: repeat(4, 1fr); }
  .works-grid { grid-template-columns: repeat(5, 1fr); }
  .plan-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-hero { margin: 18px 0 10px; }
  .ai-hero-inner { padding: 38px 44px 32px; }
  .ai-title { font-size: 30px; }
  .ai-preview { max-width: 340px; }
  .sec-title { font-size: 24px; }
  .view-login { padding-top: 10vh; }
  .auth-card { max-width: 420px; margin: 0 auto; }
}
