/* =========================================================================
   爱码语 · 高保真复原版 样式表
   玻璃拟态（glassmorphism）设计系统 —— 左侧导航 / 半透明面板 / 彩色光斑底
   ========================================================================= */

/* ------------------------------- 1. 变量与重置 ------------------------------ */

:root {
  --brand:        #e64340;
  --brand-2:      #f2578f;
  --brand-soft:   rgba(230,67,64,.10);
  --brand-grad:   linear-gradient(135deg, #ff9e6b 0%, #f2578f 100%);
  --warn-grad:    linear-gradient(135deg, #ffc46b 0%, #ff9a3c 100%);
  --plum:         linear-gradient(135deg, #8e1d4e 0%, #b8356c 100%);

  --ink:    #2c2a33;
  --ink-2:  #6f6b78;
  --ink-3:  #a3a0ad;
  --line:   rgba(255,255,255,.62);
  --line-2: rgba(28,22,48,.085);

  --bg:     #f1eff7;
  --card:   rgba(255,255,255,.62);
  --danger: #e64340;

  /* 玻璃拟态三件套：底色 / 模糊 / 高光描边 */
  --glass:      rgba(255,255,255,.56);
  --glass-2:    rgba(255,255,255,.72);
  --glass-3:    rgba(255,255,255,.86);
  --glass-brd:  rgba(255,255,255,.72);
  --glass-blur: saturate(180%) blur(20px);
  --glass-blur-s: saturate(160%) blur(12px);

  --shadow-s: 0 1px 2px rgba(28,22,48,.04), 0 6px 18px rgba(28,22,48,.06);
  --shadow-m: 0 10px 34px rgba(28,22,48,.11);

  --nav-h: 52px;
  --rail-w: 132px;
  /* 底部 Tab 栏的高度（实测 69px，下面 .tabbar 用 min-height 钉住它）。
     左竖栏做 sticky + 内部滚动时要减掉它，否则分类多起来，
     最后几项会藏到 Tab 栏后面点不到。 */
  --tabbar-h: 69px;
  --radius: 14px;

  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* 背景彩色光斑：玻璃面板要靠它才透得出层次 */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 620px at 6% -12%, rgba(255,158,107,.30), transparent 62%),
    radial-gradient(820px 640px at 102% 2%, rgba(242,87,143,.24), transparent 64%),
    radial-gradient(760px 700px at 46% 112%, rgba(122,110,224,.26), transparent 62%),
    radial-gradient(600px 520px at 88% 96%, rgba(90,190,220,.18), transparent 62%);
  background-attachment: fixed;
}

button, input, textarea, select { font: inherit; color: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
/* 行内图标默认尺寸（各处可按需覆盖） */
svg { width: 18px; height: 18px; flex: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ------------------------------- 2. 应用外壳 ------------------------------- */
/*  单列手机壳：内容区可滚动 + 底部固定 Tab（首页 / 我的页面 / 我的）
    —— 左侧全局侧边栏已回退，导航仍旧走底部 */

.app {
  display: flex; flex-direction: column;
  height: 100dvh;
  min-height: 100%;
}

.view {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.view.dark, .view.dark .preview-stage { background: #14131f; }
.page-body { flex: 1 0 auto; display: flex; flex-direction: column; }

/* 内容列：宽屏居中，窄屏铺满 */
.view > .navbar,
.view > .page-body { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }

/* ---- 底部 Tab 栏 ---- */

.tabbar {
  flex: none; z-index: 40;
  min-height: var(--tabbar-h);
  display: flex; align-items: stretch; justify-content: center;
  gap: 4px; padding: 8px 12px calc(8px + var(--safe-b));
  background: var(--glass-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-brd);
  box-shadow: 0 -6px 26px rgba(28,22,48,.07);
}
.tabbar__item {
  flex: 1 1 0; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 7px 4px; border-radius: 15px;
  color: var(--ink-3); font-size: 11px; line-height: 1;
  transition: background .18s, color .18s, transform .12s, box-shadow .18s;
}
.tabbar__item svg { width: 21px; height: 21px; }
.tabbar__item:active { transform: scale(.94); }
.tabbar__item.is-on {
  color: var(--brand); font-weight: 600;
  background: linear-gradient(135deg, rgba(255,241,242,.98), rgba(255,231,238,.98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 4px 14px rgba(230,67,64,.14);
}

/* 窄屏：内容铺满 */
@media (max-width: 860px) {
  .view > .navbar,
  .view > .page-body { max-width: none; }
}

/* --------------------------------- 3. 导航栏 ------------------------------- */

/* ---------------------------------------------------------------------------
   v21：顶栏默认完全透明。
   用户反馈内页（如「制作页面」）顶上横着一条淡粉底色不好看 —— 那条底其实是
   给 sticky 顶栏垫的，只在内容滚到标题底下时才有存在的必要。现在改成：
   静止时透明，滚起来了由 router.js 挂 .is-stuck 再浮出毛玻璃底。
   --------------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  /* flex:none 不能省：#view 是纵向 flex 容器，内容一超长，可收缩的项会被压扁。
     顶栏原来没写它，实际只有 21px 高（--nav-h 是 52），返回键的热区也跟着缩水。 */
  flex: none;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .24s, border-color .24s, box-shadow .24s;
}
.navbar.is-stuck {
  background: rgba(255,255,255,.74);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border-bottom-color: var(--glass-brd);
  box-shadow: 0 5px 20px rgba(28,22,48,.055);
}
.navbar__back {
  width: 46px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  color: var(--ink-2);
  transition: color .15s;
}
.navbar__back:active { color: var(--brand); }
.navbar__back svg { width: 20px; height: 20px; }
.navbar__title {
  flex: 1; text-align: center;
  font-size: 15.5px; font-weight: 600; color: var(--ink);
  padding-right: 46px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* plain 页（素材库 / 作品 …）不出现整条底色，只给标题垫一层极淡的渐隐，
   长列表从标题底下滚过去时字还读得清 */
.navbar--plain, .navbar--plain.is-stuck {
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
}
.navbar--plain.is-stuck {
  background: linear-gradient(to bottom, rgba(255,255,255,.78), rgba(255,255,255,.34) 64%, rgba(255,255,255,0));
}

/* --------------------------------- 5. 通用组件 ----------------------------- */

.pad { padding: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }

.card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}

.section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  padding: 16px 14px 10px;
}
.section-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--brand-grad);
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; width: 100%;
  border-radius: 999px;
  font-size: 15px; font-weight: 600; color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 8px 22px rgba(242,87,143,.30);
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.985); opacity: .92; box-shadow: 0 4px 12px rgba(242,87,143,.24); }
.btn--warn { background: var(--warn-grad); box-shadow: 0 8px 22px rgba(255,154,60,.28); }
.btn--plain {
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--glass-brd);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  box-shadow: var(--shadow-s);
}
.btn--sm { height: 32px; width: auto; padding: 0 15px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* 表单 */
.field { padding: 14px 14px; }
.field__label {
  display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 8px;
}
.field__label .req { color: var(--danger); margin-right: 2px; }
.field__row { display: flex; align-items: center; gap: 8px; }
.field__hint { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

.input, .textarea {
  width: 100%;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(28,22,48,.07);
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--ink);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #b3b0bd; }
.input:focus, .textarea:focus {
  background: #fff;
  border-color: rgba(242,87,143,.42);
  box-shadow: 0 0 0 3px rgba(242,87,143,.12);
}
.textarea { min-height: 110px; resize: none; line-height: 1.6; }

.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 40px; }
.input-with-icon svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #b3b0bd;
}

.counter { text-align: right; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* 选择器行（点击弹出 sheet） */
.picker {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(28,22,48,.07);
  border-radius: 11px;
  padding: 11px 12px; min-height: 44px;
  font-size: 14px;
  transition: background .15s, border-color .15s;
}
.picker:active { background: rgba(255,255,255,.9); }
.picker__value { color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__value.is-empty { color: #b3b0bd; }
.picker__caret { flex: none; width: 16px; height: 16px; color: var(--ink-3); }

/* 列表单元格 */
.cells {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.cell {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 14px;
  border-bottom: 1px solid rgba(28,22,48,.055);
  font-size: 14.5px;
}
.cell:last-child { border-bottom: none; }
.cell__icon { width: 20px; height: 20px; color: var(--brand); flex: none; }
.cell__label { flex: 1; }
.cell__value { color: var(--ink-2); font-size: 13px; }
.cell__caret { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.cell--link { transition: background .15s; }
.cell--link:active { background: rgba(255,255,255,.75); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
  border-radius: 6px; font-size: 10px; line-height: 1;
  background: var(--brand); color: #fff;
}
.tag--ghost { background: var(--brand-soft); color: var(--brand); }

/* 空态 / 加载 */
.empty { padding: 70px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty svg { width: 64px; height: 64px; margin: 0 auto 12px; opacity: .35; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 10px;
  border: 2px solid rgba(28,22,48,.1); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 左分类竖栏 */
.rail-layout { display: flex; align-items: stretch; flex: 1 0 auto; }
.rail {
  flex: none; width: 78px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border-right: 1px solid var(--glass-brd);
  padding-bottom: 20px;
}
.rail__item {
  position: relative;
  min-height: 56px; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.rail__item svg { width: 20px; height: 20px; }
.rail__item.is-active {
  background: rgba(255,255,255,.72);
  color: var(--brand);
  font-weight: 500;
}
.rail__item.is-active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 2px 2px 0; background: var(--brand);
}
.rail-main { flex: 1; min-width: 0; }

/* ------------------------------- 6. 首页 --------------------------------- */

.banner {
  position: relative;
  margin: 10px 10px 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 700 / 280;
  background: #f2f2f2;
}
.banner img { width: 100%; height: 100%; object-fit: cover; }

/* 模板网格与卡片：完整样式在 5.1 节，这里只保留首页特有的边距 */

.home-notice {
  display: flex; align-items: center; gap: 6px;
  margin: 0 10px; padding: 9px 10px;
  background: var(--card); border-radius: 10px;
  font-size: 12px; color: var(--ink-2);
}
.home-notice b { color: var(--brand); font-weight: 500; flex: none; }
.home-notice span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- 7. 配置页 -------------------------------- */

.tabs {
  display: flex; gap: 4px;
  margin: 14px 14px 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  box-shadow: var(--shadow-s);
}
.tab {
  flex: 1; height: 36px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  border: 0; background: none;
  transition: background .18s, color .18s, box-shadow .18s, transform .12s;
}
.tab:active { transform: scale(.97); }
.tab.is-active {
  background: #fff; color: var(--brand); font-weight: 600;
  box-shadow: 0 2px 8px rgba(28,22,48,.10);
}

.config-body { background: var(--card); padding-bottom: 12px; }
.config-foot {
  padding: 12px;
  background: var(--bg);
}
.help-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 12px;
}

/* 预览 */
.preview-stage {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px;
  background: #111;
}
.preview-card {
  position: relative;
  width: 100%; max-width: 300px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.preview-card__bg { position: absolute; inset: 0; }
.preview-card__bg img { width: 100%; height: 100%; object-fit: cover; }
.preview-card__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.12); }
.preview-card__inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 22px 18px; text-align: center;
}
/* 文字底板：让用户文案与封面图案分离，保证可读性 */
.preview-card__panel {
  width: 100%;
  padding: 18px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}
.preview-card--plain .preview-card__panel { background: rgba(255, 255, 255, .6); }
.preview-card__title { font-size: 19px; font-weight: 500; line-height: 1.5; color: #8a2740; }
.preview-card__text {
  margin-top: 12px; font-size: 13px; line-height: 1.9; color: #8a2740;
  white-space: pre-wrap; max-height: 55%; overflow: hidden;
}
.preview-card__outro { margin-top: 14px; font-size: 12px; opacity: .8; color: #8a2740; }

.anim-fade   { animation: fadeIn 1s ease both; }
.anim-float  { animation: floatUp 1.2s cubic-bezier(.22,1,.36,1) both; }
.anim-zoom   { animation: zoomIn .9s cubic-bezier(.22,1,.36,1) both; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes floatUp { from { opacity: 0; transform: translateY(26px) } to { opacity: 1; transform: none } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.9) } to { opacity: 1; transform: none } }

.preview-foot {
  width: 100%; max-width: 300px; margin-top: 22px;
  display: flex; flex-direction: column; gap: 10px;
}

/* ------------------------------- 8. 素材库 -------------------------------- */

.clist { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.ccard {
  background: var(--card); border-radius: 10px;
  padding: 12px; font-size: 13px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
  position: relative;
}
.ccard__use {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; height: 26px; padding: 0 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 12px;
}

.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
.img-cell {
  position: relative;
  aspect-ratio: 2 / 3; border-radius: 9px; overflow: hidden; background: #eee;
}
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-cell__name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 6px 5px; font-size: 11px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.45));
}
.img-cell.is-active { outline: 2px solid var(--brand); outline-offset: -2px; }

.music-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--card); border-radius: 10px;
}
.music-item__play {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.music-item__play svg { width: 13px; height: 13px; }
.music-item__play.is-playing { background: var(--warn-grad); }
.music-item__name {
  flex: 1; min-width: 0; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.music-item__meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.poster-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; }
.poster-card { background: var(--card); border-radius: 10px; overflow: hidden; padding-bottom: 10px; }
.poster-card__img { width: 100%; aspect-ratio: 300 / 420; background: #f4f4f4; }
.poster-card__img img { width: 100%; height: 100%; object-fit: cover; }
.poster-card .btn { width: auto; margin: 10px auto 0; padding: 0 26px; }
.poster-card.is-active { outline: 2px solid var(--brand); }

.search-bar { display: block; padding: 10px 12px; background: var(--card); }

/* ------------------------------- 9. 用户 --------------------------------- */

.auth {
  flex: 1 0 auto;
  background: linear-gradient(180deg, #ffd6e4 0%, #ffc0d6 22%, #ffe9f0 55%, #ffffff 100%);
  padding-bottom: 30px;
}
.auth__notice { padding: 26px 24px 18px; text-align: center; }
.auth__notice h2 {
  font-size: 19px; font-weight: 500; letter-spacing: 4px; color: #2b2b2b;
  padding-bottom: 10px; border-bottom: 2px solid #2b2b2b; display: inline-block;
}
.auth__notice p {
  margin-top: 12px; font-size: 15px; font-weight: 500; color: #2b2b2b; line-height: 1.7;
}
.auth__card {
  margin: 8px 18px 0;
  background: var(--card); border-radius: 14px;
  padding: 22px 18px 24px;
  box-shadow: 0 8px 26px rgba(196, 88, 130, .16);
}
.auth__title { font-size: 17px; font-weight: 500; color: var(--brand); margin-bottom: 18px; }
.auth__foot { display: flex; justify-content: flex-end; margin: 10px 2px 16px; font-size: 13px; color: var(--brand); }

.mine-head { background: var(--plum); padding: 26px 16px 18px; color: #fff; }
.mine-head__row { display: flex; align-items: center; gap: 12px; }
.mine-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; flex: none; overflow: hidden;
}
.mine-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mine-name { font-size: 17px; font-weight: 500; }
.mine-sub { font-size: 12px; opacity: .8; margin-top: 4px; }
.mine-stats { display: flex; margin-top: 18px; }
.mine-stats__item { flex: 1; text-align: center; }
.mine-stats__num { font-size: 20px; font-weight: 500; }
.mine-stats__label { font-size: 12px; opacity: .82; margin-top: 2px; }
.mine-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.mine-body .cells { border-radius: var(--radius); overflow: hidden; }

/* ------------------------------- 10. 作品 -------------------------------- */

.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
.work-card { background: var(--card); border-radius: 10px; overflow: hidden; }
.work-card__img { width: 100%; aspect-ratio: 3 / 4; background: #f2f2f2; }
.work-card__img img { width: 100%; height: 100%; object-fit: cover; }
.work-card__body { padding: 8px 10px 10px; }
.work-card__title {
  font-size: 13px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.work-card__meta { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.work-card__acts { display: flex; gap: 6px; margin-top: 8px; }
.work-card__acts .btn { flex: 1; height: 28px; font-size: 12px; padding: 0; }

.show-stage {
  flex: 1 0 auto;
  background: #14131f;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 16px 30px;
}
.show-hint { color: rgba(255,255,255,.55); font-size: 12px; text-align: center; margin-top: 14px; line-height: 1.7; }
.show-btns { display: flex; gap: 10px; width: 100%; max-width: 300px; margin-top: 18px; }
.show-btns .btn { flex: 1; }

/* ------------------------------ 11. 系统页 ------------------------------- */

.rich { background: var(--card); padding: 16px 14px; }
.rich h1 { font-size: 17px; font-weight: 500; line-height: 1.5; }
.rich .meta { font-size: 12px; color: var(--ink-3); margin: 10px 0 16px; }
.rich .body { font-size: 14px; line-height: 1.85; color: #4a4a4a; white-space: pre-wrap; }

.price-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.price-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius); padding: 14px;
}
.price-card__name { font-size: 15px; font-weight: 500; }
.price-card__note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.price-card__price { font-size: 18px; font-weight: 500; color: var(--brand); }

/* --------------------------- 12. Toast / Dialog / Sheet ------------------ */

.toast {
  position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%);
  z-index: 3000;
  max-width: 76vw; padding: 10px 16px;
  background: rgba(0,0,0,.78); color: #fff;
  border-radius: 8px; font-size: 13px; line-height: 1.5;
  text-align: center; word-break: break-word;
  animation: fadeIn .16s ease both;
}
.toast__icon { width: 30px; height: 30px; margin: 0 auto 8px; }

.dialog-mask, .sheet-mask {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .16s ease both;
}
.dialog {
  width: 78%; max-width: 300px;
  background: var(--card); border-radius: 12px;
  overflow: hidden; text-align: center;
}
.dialog__title { padding: 20px 16px 0; font-size: 16px; font-weight: 500; }
.dialog__body { padding: 12px 18px 20px; font-size: 14px; color: var(--ink-2); line-height: 1.65; }
.dialog__foot { display: flex; border-top: 1px solid var(--line); }
.dialog__btn {
  flex: 1; height: 45px; font-size: 16px; color: var(--ink-2);
  border-right: 1px solid var(--line);
}
.dialog__btn:last-child { border-right: none; }
.dialog__btn--primary { color: #007aff; }

.sheet-mask { align-items: flex-end; }
.sheet {
  width: 100%; max-width: 480px;
  background: #f7f7f7;
  border-radius: 12px 12px 0 0;
  max-height: 68vh; display: flex; flex-direction: column;
  animation: sheetUp .22s cubic-bezier(.22,1,.36,1) both;
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: none } }
.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px; padding: 0 14px;
  background: var(--card); border-radius: 12px 12px 0 0;
  font-size: 14px;
}
.sheet__title { font-size: 15px; font-weight: 500; }
.sheet__cancel { color: var(--ink-2); }
.sheet__ok { color: var(--brand); font-weight: 500; }
.sheet__body { overflow-y: auto; padding: 8px 0 var(--safe-b); }
.sheet__item {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; padding: 0 16px;
  background: var(--card); border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.sheet__item.is-active { color: var(--brand); font-weight: 500; }
.sheet__item:active { background: #fafafa; }

/* =========================================================================
   3. 配置器扩展（主题大图选择 / 图文编辑 / 特效区块 / 预览浮层）
   ========================================================================= */

.field--row { display: flex; align-items: center; justify-content: space-between; }
.field--row .field__label { margin-bottom: 0; }

/* 主题大图选择器 */
.theme-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 12px; background: #f7f7f9;
}
.theme-pick__img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; flex: none; background: #eee; }
.theme-pick__meta { flex: 1 1 auto; min-width: 0; }
.theme-pick__name { font-size: 14px; font-weight: 500; }
.theme-pick__desc { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 主题选择弹层 */
.theme-sheet { position: fixed; inset: 0; z-index: 2500; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .16s ease both; }
.theme-sheet__panel { width: 100%; max-width: 480px; max-height: 84vh; background: #f8f8f8; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.theme-sheet__hd { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: #fff; font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--line); flex: none; }
.theme-sheet__cancel { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.theme-sheet__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: min-content;      /* 行高按内容撑开，避免被弹性容器压扁 */
  align-content: start;
  gap: 12px; padding: 14px;
  overflow-y: auto; flex: 1 1 auto; min-height: 0;
}
.theme-card { position: relative; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.07); transition: transform .15s; display: flex; flex-direction: column; }
.theme-card:active { transform: scale(.97); }
.theme-card.is-on { box-shadow: 0 0 0 2px var(--brand), 0 6px 18px rgba(230,67,64,.22); }
.theme-card img { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover; display: block; flex: none; border-radius: 12px 12px 0 0; }
.theme-card__name { font-size: 13px; font-weight: 500; padding: 8px 10px 2px; }
.theme-card__desc { font-size: 11px; color: var(--ink-2); padding: 0 10px 10px; line-height: 1.5; height: 44px; overflow: hidden; }
.theme-card__on { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* 图文编辑 */
.imgedit { display: flex; flex-direction: column; gap: 10px; }
.imgedit__row { display: flex; align-items: center; gap: 10px; }
.imgedit__thumb { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; flex: none; background: #eee; border: 1px dashed #d8d8d8; }
.imgedit__row .input { flex: 1 1 auto; }
.imgedit__del { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }

/* 颜色行 */
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-input { width: 40px; height: 34px; padding: 2px; border-radius: 8px; background: #f2f2f5; flex: none; }
.swatches { display: flex; gap: 7px; }
.swatches i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }

/* 开关 */
.switch { position: relative; width: 44px; height: 25px; border-radius: 999px; background: #dcdce2; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(19px); }

/* 特效区块 */
.fx-block { background: #fff; border-radius: 12px; padding: 4px 14px 12px; margin: 0 12px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.fx-block__hd { font-size: 13px; font-weight: 600; color: var(--brand); padding: 14px 0 4px; }
.fx-block .field:last-child { margin-bottom: 0; }
.range { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 2px; background: #ececf0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); box-shadow: 0 2px 6px rgba(230,67,64,.4); }

/* 预览浮层 */
.cfg-preview { position: fixed; inset: 0; z-index: 300; background: #14131f; display: flex; flex-direction: column; }
.cfg-preview__stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.cfg-preview__bar { display: flex; gap: 10px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: rgba(20,19,31,.92); border-top: 1px solid rgba(255,255,255,.08); }
.cfg-preview__bar .btn { flex: 1 1 auto; }
.cfg-preview__close { position: absolute; top: 14px; right: 14px; z-index: 10; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); }

/* =========================================================================
   4. 贺卡展示页（整屏）
   ========================================================================= */

.view--show { background: #14131f; overflow: hidden; }
.show-fullstage { position: absolute; inset: 0; overflow: hidden; }
.show-credit {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  font-size: 12px; color: rgba(255,255,255,.62);
  background: linear-gradient(transparent, rgba(0,0,0,.5));
  pointer-events: none;
}
.show-credit__btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 12px; border: 1px solid rgba(255,255,255,.28); }
/* 展示页里给底部操作条留出署名条的空间，避免叠在一起 */
.view--show .th-endbar { padding-bottom: 76px; }
.view--show .th-foot { bottom: 76px; }

/* =========================================================================
   5. HTML 模板体系（占位符 → 生成独立站点）
   ========================================================================= */

/* ------------------------------ 5.1 模板广场 ------------------------------ */
/*  首页直接是「模板网格」：左侧分类竖栏 + 右侧 banner → 公告 → 卡片。
   分类筛选从横排胶囊挪到首页左边，做成常驻的竖排列表。 */

.home-wrap {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 0 14px;
}
.home-main { flex: 1; min-width: 0; }

/* ---- 左侧分类竖栏 ----
   v21：每一项都是**各自独立的小卡**（用户给的效果图就是这个样子）——
   项与项之间留 9px，卡面淡白 + 一圈浅玫色描边，选中的整块换成品牌渐变。
   之前项间隔 6px、卡面几乎同色，摞在一起像一长条，看着是「连在一起的」。 */

.catrail {
  flex: none; width: var(--rail-w);
  position: sticky; top: 0; align-self: flex-start;
  max-height: calc(100dvh - var(--tabbar-h) - var(--safe-b) - 24px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 9px;
  padding: 14px 0 18px;
}
.catrail__item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; padding: 10px 11px; border-radius: 12px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(242,87,143,.20);
  font-size: 12.5px; color: var(--ink-2); text-align: left;
  box-shadow: 0 1px 2px rgba(28,22,48,.035);
  transition: background .18s, color .18s, border-color .18s,
              transform .12s, box-shadow .18s;
}
.catrail__item > span { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.catrail__item:active { transform: scale(.97); }
.catrail__item.is-on {
  background: linear-gradient(135deg, #ff8f6b 0%, #f2578f 100%);
  border-color: transparent; color: #fff; font-weight: 500;
  box-shadow: 0 7px 18px rgba(242,87,143,.32);
}
/* 还没有模板的分类：名字压灰。
   不给它挂「更新中」徽标 —— 一次补了十几个新分类，每个都挂一枚就会糊满整栏；
   用户点进去时网格里会给一句「这个分类还在更新中，先看看「全部」吧」。 */
.catrail__item.is-soon > span { color: var(--ink-3); }
.catrail__n {
  flex: none; font-style: normal;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.055); color: var(--ink-3);
  transition: background .18s, color .18s;
}
.catrail__item.is-on .catrail__n { background: rgba(255,255,255,.26); color: #fff; }

/* 竖栏里的 banner / 公告 / 网格：左右边距交给 .home-wrap 统一管 */
.home-main > .banner { margin: 12px 0 0; }
.home-main > .home-notice { margin: 10px 0 0; }
.home-main > .tpl-grid { padding: 12px 0 22px; }
.home-main > .tpl-foot { padding: 4px 0 24px; }

/* 更窄的屏（小屏手机）：竖栏再收 2px。
   分类卡的具体排布统一交给 16 节那份 700px 规则，这里不再重复写，
   免得两处分别调、越调越乱（历史上就是这么乱起来的）。 */
@media (max-width: 620px) {
  :root { --rail-w: 86px; }
}

.tpl-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px;
  padding: 6px 14px 22px;
}

/* 注：v14 去掉了「爆火推荐 / 其他模板」分区小标题（.tpl-sec）——
   卡片自己带火焰绶带，后端也按 hot 优先排序，标题纯属重复噪音。
   样式一并删掉，需要时看 git 历史。 */

.tpl-card {
  position: relative; display: block; text-align: left; padding: 0; overflow: hidden;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  box-shadow: var(--shadow-s);
  transition: transform .2s cubic-bezier(.2,.8,.3,1), box-shadow .2s, border-color .2s;
}
.tpl-card:active { transform: scale(.975); box-shadow: var(--shadow-m); }

/* 爆火：暖色描边 + 顶部一道渐变光带，在一屏卡片里先跳出来 */
.tpl-card.is-hot {
  border-color: rgba(239,91,77,.42);
  box-shadow: 0 0 0 1px rgba(239,91,77,.14), 0 10px 26px rgba(239,91,77,.20);
}
.tpl-card.is-hot::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 3;
  background: linear-gradient(90deg, #ff9e6b, #ef5b4d 55%, #e0455f);
}

.tpl-card__cover {
  position: relative; display: block; width: 100%;
  aspect-ratio: 3 / 4; overflow: hidden;
  background: linear-gradient(150deg, #ffd9c4 0%, #ffb9cc 48%, #c9b7f2 100%);
}
/* 顶部压一层极淡的暗调，让白色绶带/角标在任何封面上都立得住 */
.tpl-card__cover::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 36%;
  background: linear-gradient(180deg, rgba(20,14,30,.26), transparent);
  pointer-events: none; z-index: 2;
}
.tpl-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .34s ease; }
.tpl-card:active .tpl-card__cover img { transform: scale(1.045); }
.tpl-card__ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.92);
}
.tpl-card__ph svg { width: 34px; height: 34px; }

/* 气泡：四颗半透明圆，缓缓上下浮动 —— 没有封面时它就是主视觉 */
.tpl-card__bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.tpl-card__bubbles i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.56), rgba(255,255,255,.1) 60%, transparent 72%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.34);
  animation: bubbleUp 8s ease-in-out infinite;
}
.tpl-card__bubbles i:nth-child(1) { width: 38px; height: 38px; left: 9%;  bottom: 11%; animation-delay: 0s; }
.tpl-card__bubbles i:nth-child(2) { width: 22px; height: 22px; left: 55%; bottom: 27%; animation-delay: -2.2s; }
.tpl-card__bubbles i:nth-child(3) { width: 52px; height: 52px; right: -14%; bottom: 45%; animation-delay: -4.4s; }
.tpl-card__bubbles i:nth-child(4) { width: 16px; height: 16px; left: 33%; bottom: 5%;  animation-delay: -6.1s; }
@keyframes bubbleUp {
  0%, 100% { transform: translateY(0) scale(1); opacity: .68; }
  50%      { transform: translateY(-13px) scale(1.07); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .tpl-card__bubbles i { animation: none; } }

/* 爆火绶带 */
.tpl-card__fire {
  position: absolute; z-index: 3; top: 9px; left: 9px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #ff9e6b, #ef5b4d);
  box-shadow: 0 4px 14px rgba(239,91,77,.45);
}
.tpl-card__fire svg { width: 11px; height: 11px; }

/* 后台自己填的角标文案 */
.tpl-card__tag {
  position: absolute; z-index: 3; top: 9px; right: 9px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; color: #fff;
  background: rgba(24,18,34,.42);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.tpl-card__body { display: block; padding: 11px 12px 13px; }
.tpl-card__name {
  display: block; font-size: 14px; font-weight: 600; letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tpl-card__meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.tpl-card__cat {
  flex: none; font-style: normal; font-size: 10.5px; line-height: 1.7;
  padding: 0 7px; border-radius: 999px;
  color: var(--brand); background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(230,67,64,.14);
}
.tpl-card__intro {
  flex: 1 1 auto; min-width: 0;
  font-size: 11px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tpl-foot { padding: 4px 14px 24px; }

/* 模板卡片恒定「一行两个」：宽屏也不铺三列。
   内容列最宽 820、左侧分类栏 132，留给网格约 690，两张卡各 ~338 —— 3:4 封面
   在这个尺寸下封面细节看得清；再铺三列每张只剩 ~215，封面糊、标题也挤。
   手机端两列（~165）同样成立，一套规则通吃，不用分断点维护。 */
.tpl-foot .btn { width: 100%; }

/* ------------------------------ 5.2 使用模板 ------------------------------ */

.use-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin: 12px 14px 0;
  background: var(--card); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.use-head__cover { width: 52px; height: 66px; border-radius: 7px; object-fit: cover; flex: none; background: #f1efec; }
.use-head__name { font-size: 15px; font-weight: 600; }
.use-head__meta { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }

.use-form { padding: 14px 14px 104px; display: flex; flex-direction: column; gap: 14px; }

.fld { background: var(--card); border-radius: 12px; padding: 13px 14px; }
.fld__hd { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.fld__label { font-size: 13.5px; font-weight: 500; }
.fld__req { font-style: normal; font-size: 10px; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 999px; }
.fld__hint { margin-top: 7px; font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }
.fld__input {
  width: 100%; min-height: 40px; padding: 10px 12px;
  background: #fafafa; border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 14px; line-height: 1.55; transition: border-color .18s, background .18s;
}
.fld__input:focus { border-color: var(--brand); background: #fff; }
textarea.fld__input { resize: vertical; min-height: 96px; }
.fld__row { display: flex; gap: 8px; align-items: center; margin-top: 9px; }
.fld__row .btn { flex: none; }
.fld__input--url { flex: 1 1 auto; min-height: 34px; padding: 7px 10px; font-size: 12px; }
.fld__count { margin-top: 6px; text-align: right; font-size: 11px; color: var(--ink-3); }

.fld--img .imgbox {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 16 / 9;
  /* 空态：铺满一行。有图时由 JS（fitImgBox）按「原图比例 + 最大高度」算出确切
     width/height 写成行内样式，宽高都定死 → 这里的 aspect-ratio 自动让位。
     所以这里**不能**写 max-height：宽度被 100% 锁死时 max-height 压不动宽度，
     只会把比例拧坏（那正是之前竖图变成一条「又高又大」卡片的原因）。 */
  border-radius: 10px; overflow: hidden;
  background: #fafafa; border: 1px dashed var(--line-2); color: var(--ink-3); font-size: 12px;
}
/* 有图且比一行窄（超高竖图被限高后）：居中摆，别靠左留下大片空白 */
.fld--img .imgbox.has-img { border-style: solid; border-color: var(--line); cursor: pointer; margin-inline: auto; }
.fld--img .imgbox img { width: 100%; height: 100%; object-fit: cover; }
/* 原图比例超出 0.55~2.6 的极端长条：改用 contain，整张图都看得见，不裁 */
.fld--img .imgbox.imgbox--fit { background: #f2f0f7; }
.fld--img .imgbox.imgbox--fit img { object-fit: contain; }
.imgbox__ph { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.imgbox__ph svg { width: 28px; height: 28px; opacity: .4; }
/* 角上的「更换」胶囊：压图不抢主体，但一眼能看出这张图是可以换的 */
.imgbox__btn {
  position: absolute; right: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  background: rgba(28,22,48,.52); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
  box-shadow: 0 3px 10px rgba(28,22,48,.22);
}
.imgbox__btn svg { width: 13px; height: 13px; }
.imgbox__btn.is-loading { opacity: .82; }
.fld--img .imgbox:active .imgbox__btn { transform: scale(.96); }

.color-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.color-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s;
}
.color-dot.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 1px rgba(0,0,0,.08); transform: scale(1.06); }
.color-in { width: 34px; height: 30px; border-radius: 8px; padding: 0; background: none; border: 1px solid var(--line-2); }

/* ---- 5.2.1 滑块数值（字号 / 圆角 / 不透明度…）---- */

.fld--range .range-row { display: flex; align-items: center; gap: 13px; }

.range-in {
  flex: 1 1 auto; min-width: 0; height: 26px;
  -webkit-appearance: none; appearance: none;
  background: none; outline: none; cursor: pointer;
}
.range-in::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(90deg,
    var(--brand) 0 var(--pct, 50%),
    rgba(20,22,28,.09) var(--pct, 50%) 100%);
}
.range-in::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 21px; height: 21px; margin-top: -7.5px;
  border-radius: 50%; background: #fff;
  border: 2.5px solid var(--brand);
  box-shadow: 0 2px 8px rgba(230,67,64,.32);
  transition: transform .14s;
}
.range-in:active::-webkit-slider-thumb { transform: scale(1.14); }
.range-in::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(20,22,28,.09); }
.range-in::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--brand); }
.range-in::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 2.5px solid var(--brand);
  box-shadow: 0 2px 8px rgba(230,67,64,.3);
}

.range-val {
  flex: none; min-width: 62px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--brand);
  font-variant-numeric: tabular-nums;
  background: var(--brand-soft); border-radius: 9px; padding: 5px 9px;
}
.range-val i { font-style: normal; font-size: 10.5px; font-weight: 500; opacity: .72; margin-left: 1px; }

/* ---- 5.2.2 选项选择（后台给模板配的可选值）---- */

.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  flex: 1 1 118px; min-width: 0; padding: 10px 12px;
  border-radius: 11px; text-align: left; cursor: pointer;
  background: #f6f6f8; border: 1.5px solid transparent;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .12s;
}
.pick:active { transform: scale(.97); }
.pick__t { display: block; font-size: 13px; font-weight: 500; color: var(--ink); }
.pick__d { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.pick.is-on {
  background: linear-gradient(135deg, #fff1f2, #ffe9ee);
  border-color: #f0a9a5;
  box-shadow: 0 2px 10px rgba(230,67,64,.15);
}
.pick.is-on .pick__t { color: var(--brand); }

/* ---- 5.2.3 开关 ---- */

.fld--switch { padding: 14px; }
.sw-row { display: flex; align-items: center; gap: 14px; }
.sw-row__txt { flex: 1 1 auto; min-width: 0; }
.sw-row__txt .fld__hd { margin-bottom: 0; }
.sw {
  flex: none; width: 50px; height: 30px; border-radius: 999px;
  background: #e2e4ea; border: 0; position: relative; cursor: pointer;
  transition: background .22s;
}
.sw__dot {
  position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .24s cubic-bezier(.3,1.35,.5,1);
}
.sw.is-on { background: linear-gradient(135deg, #e64340, #ef7d92); }
.sw.is-on .sw__dot { transform: translateX(20px); }

/* ---- 5.2.4 音乐库选曲 ---- */

.music-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.music-row__pick { flex: none; }
.music-row__now {
  flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.music-row__now.has { color: var(--brand); font-weight: 500; }
.music-row__clear {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.music-row__clear:hover { color: #b8492f; border-color: #f0d4cd; }
.music-row__clear svg { width: 13px; height: 13px; }

/* 字段配置缺失时的醒目标注 */
.fld__hint--warn {
  display: flex; align-items: center; gap: 6px;
  margin-top: 0; padding: 9px 11px; border-radius: 10px;
  background: #fdf5e8; color: #a9741f; font-size: 12px; line-height: 1.5;
}
.fld__hint--warn svg { width: 14px; height: 14px; flex: none; }

.use-bar {
  position: sticky; bottom: 0; z-index: 15;
  display: flex; gap: 10px; padding: 10px 14px calc(12px + var(--safe-b));
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.use-bar .btn { flex: 1 1 auto; }
.use-bar .btn--plain { flex: 0 0 46%; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.use-bar .btn--plain svg { width: 15px; height: 15px; }

/* ------------------------------ 5.3 预览浮层 ------------------------------ */

.pv-mask {
  position: fixed; inset: 0; z-index: 400; background: rgba(18,16,24,.78);
  backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center;
}
.pv-mask__hd {
  flex: none; width: 100%; max-width: 430px; height: 46px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; color: #fff; font-size: 14px;
}
.pv-mask__close {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.14);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.pv-mask__body {
  flex: 1 1 auto; width: 100%; max-width: 430px; min-height: 0;
  padding: 0 10px 14px; display: flex;
}
.pv-mask__frame { flex: 1 1 auto; width: 100%; border: none; border-radius: 14px; background: #fff; }
.pv-mask__load { flex: 1; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); font-size: 13px; }

/* ------------------------- 5.2.5 音乐库选择浮层（底部抽屉）-------------------------
   类名统一用 mpick- 前缀，避免和通用「选择器行 .picker」撞车        */

.mpick-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(12,14,20,.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: pickerFade .18s ease;
}
@keyframes pickerFade { from { opacity: 0; } to { opacity: 1; } }

.mpick {
  width: 100%; max-width: 470px; max-height: 78vh;
  display: flex; flex-direction: column;
  background: var(--glass-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding-bottom: var(--safe-b);
  box-shadow: 0 -10px 44px rgba(28,22,48,.24);
  animation: pickerUp .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes pickerUp {
  from { transform: translateY(14%); opacity: .55; }
  to   { transform: none; opacity: 1; }
}

.mpick__hd {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 17px 16px 11px;
}
.mpick__title { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; }
.mpick__title svg { width: 17px; height: 17px; color: var(--brand); }
.mpick__close {
  width: 30px; height: 30px; border-radius: 50%; border: 0; flex: none;
  background: rgba(28,22,48,.06); color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mpick__close svg { width: 15px; height: 15px; }

.mpick__search { flex: none; padding: 0 16px 11px; }
.mpick__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 0 10px 10px; -webkit-overflow-scrolling: touch;
}
.mpick__load, .mpick__empty { padding: 34px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

.pitem {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 12px;
  transition: background .14s;
}
.pitem:active { background: rgba(255,255,255,.8); }
.pitem__play {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--brand-soft); color: var(--brand); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pitem__play svg { width: 15px; height: 15px; }
.pitem__info { flex: 1 1 auto; min-width: 0; }
.pitem__name {
  font-size: 13.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pitem__meta { margin-top: 2px; font-size: 11px; color: var(--ink-3); }
.pitem .btn { flex: none; }

.pv-mask--prompt { justify-content: center; }
.prompt-card {
  width: calc(100% - 60px); max-width: 340px; background: #fff; border-radius: 14px; padding: 20px 18px 14px;
}
.prompt-card__title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.prompt-card__acts { display: flex; gap: 10px; margin-top: 16px; }
.prompt-card__acts .btn { flex: 1; }

.pv-mask--result { justify-content: center; }
.res-card {
  width: calc(100% - 52px); max-width: 360px; background: #fff; border-radius: 18px;
  padding: 26px 22px 18px; text-align: center;
  /* 加了「分享文案」之后内容会变长，手机上要能自己滚，别把按钮顶出屏幕 */
  max-height: 82vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.res-card__ok {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.res-card__ok svg { width: 30px; height: 30px; }
.res-card__title { font-size: 17px; font-weight: 600; }
.res-card__sub { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.res-card__link {
  margin: 16px 0; padding: 11px 12px; border-radius: 9px;
  background: #fafafa; border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--ink-2); word-break: break-all; line-height: 1.5;
}
.res-card__acts { display: flex; gap: 10px; }
.res-card__acts .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; }
.res-card__foot { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); }
.res-card__foot a { color: var(--brand); }

/* ---- 结果弹层 · 一键复制分享文案 ----
   生成成功后给几条现成话术，点一下 = 文案 + 链接一起进剪贴板。
   话术由后台维护（/admin → 分享文案），支持 {link} / {title} 占位符和颜文字。 */

.res-share {
  margin-top: 16px; padding-top: 14px; text-align: left;
  border-top: 1px dashed var(--line-2);
}
.res-share__hd { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.res-share__hd span {
  display: block; margin-top: 3px; font-size: 11px; font-weight: 400;
  color: var(--ink-3); line-height: 1.5;
}
.res-share__hd b { color: var(--brand); font-weight: 600; }
.res-share__list {
  margin-top: 9px; display: flex; flex-direction: column; gap: 7px;
  max-height: 168px; overflow-y: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.res-share__list::-webkit-scrollbar { display: none; }
.res-share__chip {
  display: block; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  background: #fafafa; border: 1px solid var(--line-2);
  color: var(--ink-2); font-size: 12px; line-height: 1.55;
  word-break: break-word;
  transition: background .16s, border-color .16s, transform .12s;
}
.res-share__chip:active { transform: scale(.985); background: rgba(230,67,64,.07); border-color: rgba(230,67,64,.28); }

/* 结果弹层里的次级入口（分享海报） */
.res-card__more {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 12px; height: 38px;
  border: 1px dashed rgba(230,67,64,.4); border-radius: 10px;
  background: rgba(230,67,64,.05); color: var(--brand);
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  transition: background .16s, transform .12s;
}
.res-card__more svg { width: 16px; height: 16px; }
.res-card__more:active { transform: scale(.98); background: rgba(230,67,64,.11); }
.res-card__more:disabled { opacity: .55; }

/* ---- 分享海报浮层 ---- */

.share-poster {
  width: calc(100% - 52px); max-width: 330px; background: #fff;
  border-radius: 18px; padding: 18px 16px 16px; text-align: center;
  max-height: 88vh; overflow-y: auto;
}
.share-poster__hd { font-size: 14.5px; font-weight: 600; margin-bottom: 12px; }
.share-poster__hd span {
  display: block; margin-top: 4px;
  font-size: 11.5px; font-weight: 400; color: var(--ink-3);
}
.share-poster__body {
  border-radius: 12px; overflow: hidden; background: #f4f2f8;
  display: flex; align-items: center; justify-content: center; min-height: 180px;
}
.share-poster__img { display: block; width: 100%; height: auto; }
.share-poster__fallback { position: relative; width: 100%; }
.share-poster__fallback img { display: block; width: 100%; height: auto; }
/* 兜底版：二维码用内联 SVG 直接压在底图那块预留框上（位置由 JS 按模板坐标写进 style） */
.share-poster__qrbox {
  position: absolute;
  aspect-ratio: 1 / 1;
  box-sizing: border-box; padding: 3%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.share-poster__qrbox svg { display: block; width: 100%; height: auto; }
.share-poster__warn {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: rgba(201, 138, 46, .13); color: #8a5a10;
  font-size: 11px; line-height: 1.55; text-align: left;
}
.share-poster__tip { margin-top: 11px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.share-poster__acts { display: flex; gap: 10px; margin-top: 13px; }
.share-poster__acts .btn { flex: 1; }

/* ---------------------------- 5.4 我的作品 ---------------------------- */

.site-list { padding: 12px 14px 24px; display: flex; flex-direction: column; gap: 10px; }
.site-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 12px; padding: 12px 13px;
}
.site-item__body { flex: 1 1 auto; min-width: 0; }
.site-item__title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-item__meta { margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.site-item__acts { display: flex; align-items: center; gap: 8px; flex: none; }
/* 两个按钮同高同宽（统一 min-width 兜住）：否则「复制」宽 47、「打开」宽 45，
   再加上主按钮自带的大投影，看着就像一个高一个矮、没对齐 */
.site-item__acts .btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; min-width: 64px; padding: 0 12px; font-size: 12.5px;
  box-shadow: 0 2px 8px rgba(28,22,48,.06);
}
.site-item__acts .btn:active { transform: scale(.96); }

/* ------------------------------- 5.5 后台 ------------------------------- */

.ad-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); margin: 12px 14px 0; border-radius: 12px; overflow: hidden; }
.ad-stat { background: #fff; padding: 14px 4px; text-align: center; }
.ad-stat b { display: block; font-size: 19px; font-weight: 600; color: var(--brand); }
.ad-stat span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-3); }

.ad-tabs { display: flex; gap: 8px; padding: 14px 14px 0; }
.ad-tab {
  height: 30px; padding: 0 15px; border-radius: 999px; font-size: 12.5px;
  background: var(--card); border: 1px solid var(--line-2); color: var(--ink-2);
}
.ad-tab.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.ad-pane { padding: 12px 14px 24px; }
.ad-pane__hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-3); margin-bottom: 10px;
}
.ad-pane__hd .btn { display: inline-flex; align-items: center; gap: 4px; }
.ad-pane__hd .btn svg { width: 13px; height: 13px; }

.ad-list { display: flex; flex-direction: column; gap: 10px; }
.ad-tpl { display: flex; gap: 11px; background: #fff; border-radius: 12px; padding: 11px; align-items: center; }
.ad-tpl__cover { width: 46px; height: 58px; border-radius: 7px; object-fit: cover; flex: none; background: #f1efec; }
.ad-tpl__body { flex: 1 1 auto; min-width: 0; }
.ad-tpl__name { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ad-tpl__meta { margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.ad-tpl__slug { margin-top: 3px; font-size: 10.5px; color: #b9b3ab; font-family: ui-monospace, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-tpl__acts { display: flex; flex-direction: column; gap: 6px; flex: none; }
.ad-tpl__acts .btn { padding: 0 10px; font-size: 11px; height: 26px; }

.ad-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 400; }
.ad-badge--on { background: #e7f6ec; color: #2f8f52; }
.ad-badge--off { background: #f2f2f2; color: #999; }

.ad-cat { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-radius: 12px; padding: 13px; }
.ad-cat__name { font-size: 13.5px; font-weight: 500; }
.ad-cat__meta { margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.ad-cat .ad-tpl__acts { flex-direction: row; }

.ad-site { display: flex; align-items: center; gap: 11px; background: #fff; border-radius: 12px; padding: 11px 13px; }
.ad-site__seq { flex: none; font-size: 13px; font-weight: 600; color: var(--brand); min-width: 46px; }
.ad-site__body { flex: 1 1 auto; min-width: 0; }
.ad-site__title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-site__meta { margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.ad-site .btn { flex: none; display: inline-flex; align-items: center; }

/* 模板编辑器 */
.ad-edit { padding: 14px 14px 30px; display: flex; flex-direction: column; gap: 14px; }
.ad-edit__sec { background: #fff; border-radius: 12px; padding: 13px 14px; }
.ad-edit__row { display: flex; gap: 12px; }
.ad-edit__row .ad-edit__sec { flex: 1 1 0; min-width: 0; }
.ad-edit__label { font-size: 13px; font-weight: 500; margin-bottom: 9px; }
.ad-edit__tip { display: block; margin-top: 5px; font-size: 11px; font-weight: 400; color: var(--ink-3); line-height: 1.65; }
.ad-edit__tip code { background: #f4f2ef; padding: 1px 4px; border-radius: 4px; font-size: 10.5px; }
.ad-edit__acts { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ad-edit__acts .btn { display: inline-flex; align-items: center; gap: 4px; }
.ad-edit__count { font-size: 11.5px; color: var(--ink-3); }
.ad-edit__foot { display: flex; gap: 10px; padding-top: 4px; }
.ad-edit__foot .btn { flex: 1; }

.ad-code {
  width: 100%; min-height: 220px; padding: 11px;
  background: #1e1c26; color: #d6d3e6; border-radius: 9px;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
  font-size: 11.5px; line-height: 1.65; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}

.ad-fields { display: flex; flex-direction: column; gap: 9px; }
.ad-fields__empty { font-size: 12px; color: var(--ink-3); text-align: center; padding: 16px 0; }
.ad-field {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
  padding: 10px; border-radius: 10px; background: #fafafa; border: 1px solid var(--line);
}
.ad-field__key {
  grid-column: 1 / -1; font-size: 11px; color: var(--brand);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.ad-field .fld__input { min-height: 34px; padding: 7px 9px; font-size: 12.5px; background: #fff; }
.ad-field__req { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
.ad-field__req input { width: 14px; height: 14px; }

/* 首页 · HTML 模板工作室入口 */
.home-entry {
  display: flex; align-items: center; gap: 11px;
  margin: 10px 0 12px; padding: 13px 14px; border-radius: 12px;
  background: linear-gradient(120deg, #2f2a3d 0%, #5b3a58 58%, #8e4a63 100%);
  color: #fff; box-shadow: 0 8px 22px rgba(74,53,87,.28);
}
.home-entry:active { opacity: .92; }
.home-entry__ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center;
}
.home-entry__ico svg { width: 18px; height: 18px; }
.home-entry__body { flex: 1 1 auto; min-width: 0; }
.home-entry__body b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; }
.home-entry__body i { display: block; margin-top: 3px; font-style: normal; font-size: 11px; opacity: .72; }
.home-entry__caret { width: 16px; height: 16px; opacity: .6; }

/* =========================================================================
   13. 玻璃拟态统一层（放在最后，覆盖前面各章节的实心填充）
   -------------------------------------------------------------------------
   规律很简单，所有「面」都套同一套：
     background: var(--glass*)     半透明底
     backdrop-filter: var(--glass-blur)  背景模糊
     border: 1px solid var(--glass-brd)  内侧高光描边
     box-shadow: var(--shadow-*)        轻投影
   新增组件时照这个来，就不会跑偏。
   ========================================================================= */

/* ---- 首页 ---- */

.banner {
  margin: 12px 14px 0;
  border-radius: 16px;
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-m);
}
.home-notice {
  margin: 10px 14px 0;
  background: var(--glass);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border: 1px solid var(--glass-brd);
  border-radius: 13px;
  box-shadow: var(--shadow-s);
  padding: 10px 12px;
}
.home-notice:active { background: var(--glass-2); }

/* 分类竖栏的卡面样式统一在 5.x 那份（每项一张独立小卡），这里不再覆盖 */

.tpl-grid { padding: 10px 14px 22px; gap: 13px; }
/* 模板卡片的玻璃填充已在 5.1 节直接写好（含爆火描边 / 气泡），这里不再重复覆盖，
   否则会把它压回去 */

/* ---- 填表页 ---- */

.use-head {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-s);
  margin: 14px 14px 0; border-radius: 15px;
}
.fld {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  border-radius: 15px;
  box-shadow: var(--shadow-s);
  padding: 14px 15px;
}
.fld__input {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(28,22,48,.08);
  border-radius: 11px;
}
.fld__input:focus {
  background: #fff;
  border-color: rgba(242,87,143,.45);
  box-shadow: 0 0 0 3px rgba(242,87,143,.12);
}
.fld--img .imgbox {
  background: rgba(255,255,255,.55);
  border: 1px dashed rgba(28,22,48,.16);
  border-radius: 12px;
}
.fld--img .imgbox.has-img { border-style: solid; border-color: var(--glass-brd); }
.pick {
  background: rgba(255,255,255,.66);
  border: 1.5px solid rgba(255,255,255,.8);
  border-radius: 13px;
  box-shadow: var(--shadow-s);
}
.pick.is-on {
  background: linear-gradient(135deg, rgba(255,241,242,.95), rgba(255,233,238,.95));
  border-color: #f0a9a5;
}
.sw { background: rgba(28,22,48,.13); }
.range-val { background: rgba(230,67,64,.10); border-radius: 10px; }
.color-in { background: rgba(255,255,255,.7); border-color: rgba(28,22,48,.1); border-radius: 9px; }

/* ---- 我的 ---- */

.mine-head {
  margin: 14px 14px 0;
  padding: 16px 16px 14px;
  border-radius: 18px;
  /* 底色是浅玻璃，字必须走深色 token。
     早期版本这里是 var(--plum) 深紫渐变 + color:#fff，后来底色被改成玻璃，
     白字却留在原规则里没跟着改 —— 结果整个头部「白字压浅底」看不清。 */
  color: var(--ink);
  background: linear-gradient(140deg, rgba(255,255,255,.78), rgba(255,255,255,.52));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-s);
}
.mine-badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  margin-left: 8px; border-radius: 999px;
  font-size: 10px; font-weight: 500; vertical-align: middle;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid rgba(230,67,64,.18);
}
.mine-name { color: var(--ink); }
/* 副标题 / 统计：改用实色灰，别再靠 opacity 把白字压淡 */
.mine-sub { color: var(--ink-2); opacity: 1; }
.mine-stats__num { color: var(--ink); }
.mine-stats__label { color: var(--ink-3); opacity: 1; }
/* 头像与两个统计之间加一道细分割，卡片不那么散 */
.mine-avatar {
  border-color: rgba(230,67,64,.24);
  background: var(--brand-soft);
  color: var(--brand);
}
.mine-stats__item + .mine-stats__item { box-shadow: inset 1px 0 0 var(--line-2); }
.mine-stats { margin-top: 16px; }
.mine-body { padding: 4px 14px 26px; }
.mine-group { margin-top: 16px; }
.mine-group__title {
  padding: 0 4px 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em;
  color: var(--ink-3);
}
.mine-group .cells { border-radius: 16px; }

/* ---- 列表 / 卡片类 —— */

.clist { padding: 14px; gap: 12px; }
.ccard,
.poster-card,
.work-card,
.price-card,
.site-item,
.rich {
  background: var(--glass);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border: 1px solid var(--glass-brd);
  border-radius: 15px;
  box-shadow: var(--shadow-s);
}
.search-bar {
  background: transparent;
  padding: 12px 14px 4px;
}
/* 搜索框：整条毛玻璃胶囊，放大镜 + 输入 + 一枚「文字按钮」。
   v21 去掉了原来「大白输入框 + 一整块粉色搜索按钮」的拼色块 —— 两个实心色块
   并排在小屏上很吵，现在只剩一个胶囊，动作按钮只在按压时浮现淡底。 */
.search-field {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 5px 0 14px;
  border-radius: 999px;
  background: var(--glass-2);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-s);
  transition: border-color .18s, box-shadow .18s;
}
.search-field:focus-within {
  border-color: rgba(242,87,143,.34);
  box-shadow: var(--shadow-s), 0 0 0 3px rgba(242,87,143,.10);
}
.search-field > svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.search-field__input {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; background: none; color: var(--ink);
}
.search-field__input::placeholder { color: var(--ink-3); }
.search-field__go {
  flex: none; height: 36px; padding: 0 15px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--brand);
  background: none;
  transition: background .16s, transform .12s;
}
.search-field__go:active { transform: scale(.95); background: var(--brand-soft); }

/* 内页「小标题 + 计数」一行：不占壳、不用色块，只做分组与交代数量 */
.lib-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 16px 16px 0;
}
.lib-head__k {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.lib-head__k svg { width: 15px; height: 15px; color: var(--brand); }
.lib-head__n { font-size: 11.5px; color: var(--ink-3); }

/* ---- 配置页（老一代主题，保留但已无入口）---- */

/* 分段控件的样式统一到 7 节那份（轨道 + 白胶囊），这里不再重复覆盖。
   v21 之前是「白胶囊 + 粉描边 / 选中粉渐变」，两个实心色块并排在小屏上很吵，
   音乐库页把「我的音乐」也去掉了，索性整条换成 iOS 那种轻轨道。 */
.config-body { background: transparent; }
.config-foot { background: transparent; }
.fx-block {
  background: var(--glass);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border: 1px solid var(--glass-brd);
  border-radius: 15px;
  box-shadow: var(--shadow-s);
}
.theme-card {
  background: var(--glass-2);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-s);
}
.theme-sheet__hd {
  background: rgba(255,255,255,.78);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border-bottom: 1px solid var(--glass-brd);
}
.theme-sheet, .theme-sheet__body { background: transparent; }

/* ---- 弹层：Toast / Dialog / Sheet / 预览 ---- */

.toast {
  background: rgba(32,28,44,.86);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 12px 34px rgba(20,16,34,.34);
}
.dialog {
  background: var(--glass-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  box-shadow: var(--shadow-m);
}
.sheet {
  background: var(--glass-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 44px rgba(28,22,48,.24);
}
.dialog-mask,
.sheet-mask,
.pv-mask {
  background: rgba(18,14,32,.42);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.prompt-card,
.res-card {
  background: var(--glass-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-m);
}
.res-card__link {
  background: rgba(255,255,255,.66);
  border: 1px dashed rgba(28,22,48,.16);
  border-radius: 11px;
}

/* ---- 收尾：给内容列留点边距，别贴着导航栏 ---- */

@media (min-width: 861px) {
  .page-body > .pad:first-child,
  .page-body > .use-head:first-child { margin-top: 4px; }
  .config-foot { padding-bottom: 24px; }
}

/* =========================================================================
   14. 效果预览页（点模板先进这里，看完再决定做不做）
   -------------------------------------------------------------------------
   整页盖住外壳（含底部 Tab），只留：手机画布 + 三枚悬浮动作。
   之所以用 position:fixed，是因为 #view 高度随内容涨，靠 flex 撑不出满屏。
   v21：顶部那条「返回 / 标题 / 分享」整行删掉（返回与分享底部都有，重复），
        模板名改成压在画布上沿的一枚小胶囊，不占排版；底部三个按钮从
        「一整条按钮栏」改成悬浮胶囊，画布因此向上多长出 ~90px。
   ========================================================================= */

.pvp {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 0;
  background-color: #eceaf3;
  background-image:
    radial-gradient(760px 520px at 8% -10%, rgba(255,158,107,.26), transparent 62%),
    radial-gradient(700px 560px at 100% 4%, rgba(242,87,143,.20), transparent 64%),
    radial-gradient(660px 600px at 50% 116%, rgba(122,110,224,.22), transparent 62%);
  animation: pvpIn .22s ease both;
}
@keyframes pvpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 模板名胶囊：压在画布上沿，纯信息不接收点击 */
.pvp__chip {
  position: absolute; z-index: 3;
  top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  max-width: calc(100% - 44px);
  padding: 6px 13px; border-radius: 999px;
  /* 胶囊压在画布上，底图什么颜色都有可能（深色模板居多）——
     白底要够实，字才立得住 */
  background: rgba(255,255,255,.82);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-s);
  pointer-events: none;
}
.pvp__chip b {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pvp__chip i {
  flex: none; font-style: normal; font-size: 11.5px; color: var(--ink-3);
  padding-left: 7px; border-left: 1px solid rgba(28,22,48,.12);
}

/* 手机画布：宽屏居中成一屏手机，窄屏铺满；顶到安全区、底留给悬浮胶囊 */
.pvp__stage {
  flex: 1 1 auto; min-height: 0;
  width: 100%; max-width: 440px; align-self: center;
  margin-bottom: calc(72px + var(--safe-b));
  display: flex; border-radius: 22px; overflow: hidden;
  background: #fff;
  border: 1px solid var(--glass-brd);
  box-shadow: 0 18px 46px rgba(28,22,48,.20);
}
.pvp__frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; display: block; }
.pvp__load {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  color: var(--ink-3); font-size: 13px;
}
.pvp__load svg { width: 18px; height: 18px; }
.pvp__load .spinner { margin: 0; width: 17px; height: 17px; }

/* 底部三个动作：一条悬浮胶囊（返回 / 分享圆形图标 + 制作我的主按钮） */
.pvp__bar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-b));
  width: calc(100% - 32px); max-width: 408px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  box-shadow: 0 14px 38px rgba(28,22,48,.20);
}
.pvp__ib {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); background: rgba(255,255,255,.9);
  box-shadow: inset 0 0 0 1px rgba(28,22,48,.06);
  transition: transform .12s, color .16s, background .16s;
}
.pvp__ib:active { transform: scale(.92); color: var(--brand); }
.pvp__ib svg { width: 19px; height: 19px; }
.pvp__make {
  flex: 1 1 auto; width: auto; height: 44px; border-radius: 999px;
  font-size: 14.5px;
  box-shadow: 0 8px 20px rgba(242,87,143,.30);
}

/* ---- 顺手把首页的 banner / 公告也提一提质感 ---- */

.banner::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.34);
  pointer-events: none;
}
.home-notice { gap: 8px; }
.home-notice b {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  border-radius: 999px; font-size: 10.5px; letter-spacing: .04em;
  background: var(--brand-soft); color: var(--brand);
}

/* =========================================================================
   15. 内页统一层（素材库 / 作品 / 价格 / 公告 / 我的作品）
   -------------------------------------------------------------------------
   首页卡片在 5.1 节里用了一套语言：
     封面 / 内容两张皮 + 圆角 16~18 + 毛玻璃 + 描边 + 轻投影 + 按压回弹。
   内页这些列表页当初是各写各的（9px 方角、纯白底、图上压字），
   跟首页一对比就"不是一个产品"。本节把它们统一到同一套语言上，
   数值都取自首页卡片，改的时候两边一起改。
   ========================================================================= */

/* ---- 15.1 图片库 ---- */

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  padding: 12px 14px 24px;
}
.img-cell {
  position: relative; aspect-ratio: auto;
  display: flex; flex-direction: column;
  padding: 5px 5px 0;
  border-radius: 16px; overflow: hidden;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  box-shadow: var(--shadow-s);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.img-cell:active { transform: scale(.975); box-shadow: var(--shadow-m); }
.img-cell img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; flex: none;
  border-radius: 12px; background: rgba(255,255,255,.5);
}
/* 小图库：贴纸本身是正方形的透明底小图，格子小而密，整图显示不裁 */
.img-grid--small { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.img-grid--small .img-cell { padding: 4px 4px 0; }
.img-grid--small .img-cell img { aspect-ratio: 1 / 1; object-fit: contain; padding: 7px; }
/* 名字从「压在图片上的白字渐变条」挪进卡内一行 —— 浅色图上也读得清 */
.img-cell__name {
  position: static; left: auto; right: auto; bottom: auto;
  padding: 7px 2px 7px; background: none;
  font-size: 12px; font-weight: 500; color: var(--ink); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.img-cell.is-active {
  outline: none;
  border-color: rgba(230,67,64,.5);  box-shadow: 0 0 0 2px rgba(230,67,64,.18), var(--shadow-m);
}

/* ---- 15.2 音乐库 ---- */

.clist { padding: 12px 14px 24px; gap: 10px; }
.music-item {
  gap: 11px; padding: 11px 13px;
  border-radius: 15px;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  backdrop-filter: var(--glass-blur-s);
  -webkit-backdrop-filter: var(--glass-blur-s);
  box-shadow: var(--shadow-s);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.music-item:active { transform: scale(.99); }
.music-item.is-playing {
  border-color: rgba(230,67,64,.42);
  box-shadow: 0 0 0 1px rgba(230,67,64,.14), 0 10px 26px rgba(230,67,64,.16);
}
.music-item__play {
  width: 34px; height: 34px;
  background: var(--brand-grad);
  box-shadow: 0 5px 14px rgba(242,87,143,.34);
  transition: transform .12s, box-shadow .18s, background .18s;
}
.music-item__play:active { transform: scale(.92); }
.music-item__play.is-playing {
  background: var(--warn-grad);
  box-shadow: 0 5px 14px rgba(255,154,60,.36);
}
.music-item__name { font-size: 13.5px; }
.music-item__meta { margin-top: 3px; }

/* ---- 15.3 文案库 / 站内信（共用 .ccard）---- */

.ccard {
  padding: 13px 14px 12px;
  border-radius: 15px;
  font-size: 13.5px; line-height: 1.8;
  /* 卡片自身走普通流：否则模板字符串里的缩进会被 pre-wrap 渲染成空行，
     文案和「复制」胶囊之间会凭空多出一大段空白 */
  white-space: normal;
}
.ccard__body { white-space: pre-wrap; word-break: break-word; }
.ccard__use {
  height: 28px; padding: 0 13px; margin-top: 10px;
  background: var(--brand-soft); color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(230,67,64,.14);
  transition: transform .12s, background .16s;
}
.ccard__use:active { transform: scale(.96); background: rgba(230,67,64,.16); }

/* ---- 15.4 海报列表 ---- */

.poster-hint {
  margin: 12px 14px 0; padding: 10px 12px;
  border-radius: 12px; background: rgba(230,67,64,.06);
  border: 1px dashed rgba(230,67,64,.28);
  font-size: 12px; line-height: 1.55; color: var(--ink-2);
}
.poster-grid { gap: 12px; padding: 12px 14px 24px; }
.poster-card {
  padding: 6px 6px 10px;
  border-radius: 16px;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.poster-card:active { transform: scale(.98); }
.poster-card__img { position: relative; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.5); }
/* 海报卡上标出「二维码会画在这」的虚线小框 */
.poster-card__qr {
  position: absolute; box-sizing: border-box; pointer-events: none;
  border: 1.5px dashed rgba(255,255,255,.95);
  border-radius: 3px;
  background: rgba(255,255,255,.3);
  box-shadow: 0 0 0 1px rgba(230,67,64,.45);
}
.poster-card .btn { height: 34px; font-size: 13px; margin: 9px auto 0; padding: 0 24px; }
.poster-card.is-active {
  outline: none;
  border-color: rgba(230,67,64,.5);
  box-shadow: 0 0 0 2px rgba(230,67,64,.18), var(--shadow-m);
}

/* ---- 15.5 价格清单 ---- */

.price-list { gap: 10px; padding: 12px 14px 4px; }
.price-card {
  padding: 15px 16px;
  border-radius: 16px;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.price-card:active { transform: scale(.985); box-shadow: var(--shadow-m); }
.price-card__name { font-size: 15px; font-weight: 600; }
.price-card__note { margin-top: 5px; font-size: 12px; }
.price-card__price { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }

/* ---- 15.6 公告 ---- */

.notice-cells { margin: 12px 14px 24px; border-radius: 16px; }

/* ---- 15.7 作品列表 ---- */

.work-grid { gap: 11px; padding: 12px 14px 24px; }
.work-card {
  padding: 5px 5px 0;
  border-radius: 16px;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.work-card:active { transform: scale(.98); }
.work-card__img { border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.5); }
.work-card__body { padding: 9px 6px 10px; }
.work-card__title { font-size: 13.5px; font-weight: 500; }
.work-card__acts .btn { height: 30px; font-size: 12px; }

/* ---- 15.8 我的作品（原「我生成的页面」）---- */

.site-list { padding: 12px 14px 24px; gap: 10px; }
.site-item {
  padding: 12px 13px; border-radius: 15px;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
}
.site-item:active { transform: scale(.99); }
.site-item__title { font-size: 13.5px; font-weight: 600; }

/* 副行三段：模板 · 2026-10-12 16:10 · 3 次浏览
   窄屏允许换行，时间用等宽数字，免得数字跳动时整行在抖 */
.site-item__meta {
  display: flex; flex-wrap: wrap; align-items: center;
  margin-top: 5px; font-size: 11px; color: var(--ink-3);
}
.site-item__meta span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.site-item__meta i { font-style: normal; margin: 0 6px; color: rgba(28,22,48,.22); }
.site-item__meta span:last-child { color: var(--ink-2); }

/* =========================================================================
   16. 移动端适配层
   -------------------------------------------------------------------------
   1) 竖栏：手机上也**留在左侧**，只是收窄。
      v12 一度把分类竖栏折成顶部横滑胶囊条 —— 内容能多出 60~80px，但位置
      和桌面端不一致，用户要在"上面"和"左面"之间来回找。v13 按反馈改回
      左侧常驻：首页竖栏 132 → 84px、素材库 78 → 70px，字号与内边距各收
      一档，位置不动、宽度让一点。
      v14 再收一层：首页竖栏从「8 个独立玻璃小卡」改成**一整块玻璃面板 +
      扁平行**（见 16.1），头图提到第一行**通栏占满**。
   2) 真机细节：输入框 16px（否则 iOS 聚焦时会自动放大整页）、
      惯性滚动、去掉横滑条的滚动条、触摸热区。
   断点用 700px：覆盖 360~430 的主流手机，平板与桌面不受影响。
   ========================================================================= */

@media (max-width: 700px) {

  /* ---------------- 16.1 首页：头图通栏 + 左竖栏「每项一张小卡」 ----------------
     v13 把竖栏收窄、位置留在左侧；
     v14 把竖栏收成**一整块玻璃面板**（扁平行、项间只剩 2px），整列 482 → 360；
     v21 按反馈改回来：面板里每一行几乎同色、间隙只有 2px，用户看着是「分类
        连在一起」。现在每项自己一张小卡（淡白卡面 + 浅玫描边），项间 7px，
        卡内边距比桌面收一档，整列高度仍在 400px 上下，不抢右侧内容。
     实现：靠 .home-main{display:contents} 把它的子元素提升为网格项，
     这样不用改 JS 里的 DOM 结构就能让头图与公告跨列。 */

  .home-wrap {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas:
      "banner banner"
      "notice notice"
      "rail   grid"
      "rail   foot";
    column-gap: 10px;
    row-gap: 10px;
    padding: 0 12px;
  }
  /* 让 banner / 公告 / 网格 / 页脚直接成为 .home-wrap 的网格项 */
  .home-main { display: contents; }
  .home-main > .banner { grid-area: banner; margin: 10px 0 0; }
  .home-main > .home-notice { grid-area: notice; margin: 10px 0 0; }
  /* 顶边距清零：竖栏与模板网格同一条起跑线 */
  .home-main > .tpl-grid { grid-area: grid; padding-top: 0; }
  .home-main > .tpl-foot { grid-area: foot; }

  .catrail {
    grid-area: rail;
    align-self: start;
    /* 分类变多时要能自己在栏内滚，别把整页顶长；
       减掉底部 Tab 栏，否则最后几项会藏到它后面 */
    position: sticky; top: 8px; z-index: 15;
    width: auto;
    max-height: calc(100dvh - var(--tabbar-h) - var(--safe-b) - 16px); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0; gap: 7px;
    background: none; border: 0; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .catrail::-webkit-scrollbar { display: none; }
  .catrail__item {
    flex-direction: row; flex-wrap: nowrap;
    align-items: center; justify-content: center; text-align: center;
    gap: 4px; padding: 9px 5px; border-radius: 11px;
    font-size: 11.5px; line-height: 1.3;
  }
  /* ⚠️ 620 断点里有 `flex-wrap:wrap` + `> span{flex:1 1 100%}`，
     会把数量挤到第二行 —— 必须在这里显式改回来 */
  .catrail__item > span { flex: 0 0 auto; min-width: 0; overflow-wrap: normal; }
  /* 数量跟在分类名旁边（小号灰数字），不再自己占一行 */
  .catrail__n {
    min-width: 0; height: auto; padding: 0 5px;
    font-size: 10px; font-weight: 400; border-radius: 0;
    background: none; color: var(--ink-3);
  }
  /* 「更新中」的分类没有数量徽标，名字自己就是一行 */
  .catrail__item.is-soon { flex-direction: column; gap: 2px; padding: 9px 4px; }
  .catrail__item.is-on .catrail__n { background: none; color: rgba(255,255,255,.88); }

  /* ---------------- 16.2 素材库左竖栏：同样收窄常驻 ---------------- */

  .rail {
    width: 70px;
    /* 素材库页面顶部有 sticky 导航栏（z-index 20），竖栏要停在它下沿；
       底部同样要避开 Tab 栏 */
    align-self: flex-start;
    position: sticky; top: var(--nav-h); z-index: 10;
    max-height: calc(100dvh - var(--nav-h) - var(--tabbar-h) - var(--safe-b) - 8px); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail__item { min-height: 52px; padding: 7px 3px; gap: 3px; font-size: 11.5px; }
  .rail__item svg { width: 18px; height: 18px; }

  /* ---------------- 16.3 网格列数 ---------------- */

  /* 图片库：3 列在 360~430 上每格只剩 ~100px，名称基本读不了，改两列。
     首页模板网格已经是恒定两列（见 15.x），这里不用再管。 */
  .img-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .img-cell__name { font-size: 12px; }

  /* ---------------- 16.4 触摸与表单 ---------------- */

  /* 16px 是 iOS 的阈值：小于它，聚焦输入框时整页会被自动放大并留在放大态。
     填表页用的是 .fld__input（不是 .input），两套都要盖住 */
  .input, .textarea, .fld__input, .fld__input--url { font-size: 16px; }
  .field { padding: 13px 14px; }
  .field__label { font-size: 13.5px; }

  /* 图片的「还没选图」占位框：手机上满宽 16:9 有 200px 高，占掉大半屏，
     改成一条扁的投放区（图标与文字并排），200 → 116。
     ⚠ 只作用于空态：原来这条也套在有图的框上，把宽高钉死成 116px，
     竖图被压成一条横切片 —— 用户看到的「比例不对」就是这儿来的。 */
  .fld--img .imgbox:not(.has-img) { aspect-ratio: auto; max-height: none; height: 116px; }
  .imgbox__ph { flex-direction: row; gap: 7px; }
  .imgbox__ph svg { width: 22px; height: 22px; }

  /* 列表项 / 按钮热区不小于 44px */
  .cell { min-height: 52px; }
  .tabbar__item { padding: 8px 4px; }

  /* 横向可滑的容器都开惯性滚动 */
  .img-grid, .poster-grid, .work-grid, .clist, .site-list { -webkit-overflow-scrolling: touch; }

  /* 长标题（模板名 / 作品名）在小屏允许折两行，别一律截断 */
  .tpl-card__intro { display: none; }
  .tpl-card__body { padding: 10px 11px 12px; }
  .use-head { padding: 12px; margin: 10px 12px 0; }
  .use-head__name { font-size: 14.5px; }

  /* 我的作品：小屏把「复制 / 打开」整行顺到第二行右对齐，
     否则序号(52) + 正文 + 两个按钮(114) 挤在一起，正文只剩几十像素 */
  /* 我的作品：序号徽标已去掉（看着像文件夹路径），正文直接顶到左边 */
  .site-item { align-items: center; padding: 11px 12px; }
  .site-item__body { flex: 1 1 auto; min-width: 0; }
  .site-item__acts { margin-left: 0; gap: 6px; }
  .site-item__acts .btn { height: 30px; min-width: 58px; padding: 0 10px; font-size: 12px; }
}


/* =========================================================================
   17. 填表页小助手（v17）
   -------------------------------------------------------------------------
   · 图片框按原图比例（JS 写 aspect-ratio），这里只管样式
   · 文本/多行文本右上角的「×」一键清空
   · 多行文本下面的「帮写 · 文案库」「插入 · 表情包」
   · 三个底部抽屉浮层（文案库 / 表情包 / 图片库）—— 是模态框，不占整页
   ========================================================================= */

/* ---- 17.1 一键清空 ---- */

.fld__wrap { position: relative; }
.fld__clear {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(28,22,48,.10); color: var(--ink-2); cursor: pointer;
  transition: transform .14s, background .14s;
}
.fld__clear.is-on { display: inline-flex; }
.fld__clear:hover { background: rgba(28,22,48,.16); }
.fld__clear:active { transform: scale(.9); }
.fld__clear svg { width: 13px; height: 13px; }
/* 多行文本的 × 别压住正文，textarea 右侧留出位置 */
.fld--area .fld__input { padding-right: 38px; }
.fld:not(.fld--area) .fld__input { padding-right: 38px; }

/* ---- 17.2 帮写 / 插入 两个入口 ---- */

.fld__assist {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px;
}
.assist {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px 11px; border-radius: 14px; text-align: left;
  border: 1px solid var(--glass-brd);
  background: linear-gradient(160deg, rgba(255,241,242,.92), rgba(255,232,239,.72));
  box-shadow: var(--shadow-s); color: var(--ink); cursor: pointer;
  transition: transform .14s, box-shadow .14s;
}
.assist:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(28,22,48,.06); }
.assist__k { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }
.assist__t {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 1px; font-size: 14.5px; font-weight: 600; letter-spacing: .01em;
}
.assist__t svg { width: 15px; height: 15px; color: var(--brand); }
.assist__d { font-size: 11px; color: var(--ink-3); }
.assist[data-lib="emoji"] { background: linear-gradient(160deg, rgba(255,248,234,.94), rgba(255,240,219,.74)); }
.assist[data-lib="emoji"] .assist__t svg { color: #d9922f; }

/* ---- 17.3 底部抽屉里的 tab 条 ---- */

.libtabs {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 11px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.libtabs::-webkit-scrollbar { display: none; }
.libtab {
  flex: none; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(28,22,48,.10); background: rgba(255,255,255,.66);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .14s, border-color .14s, color .14s;
}
.libtab.is-on { background: var(--brand-soft); border-color: #f0a9a5; color: var(--brand); font-weight: 600; }
.libtab em { font-style: normal; font-size: 11px; opacity: .72; }
.libtab--up { margin-left: auto; background: linear-gradient(135deg,#ff9e6b,#f2578f); border-color: transparent; color: #fff; font-weight: 600; }
.libtabs.imgtabs { padding-right: 16px; }

/* ---- 17.4 文案库列表 ---- */

.libitem {
  padding: 12px 13px; margin-bottom: 9px;
  border-radius: 13px; border: 1px solid rgba(28,22,48,.08);
  background: rgba(255,255,255,.66);
  box-shadow: 0 1px 2px rgba(28,22,48,.03);
}
.libitem__txt {
  font-size: 13.5px; line-height: 1.68; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.libitem__acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.libitem__acts .btn svg { width: 13px; height: 13px; }

/* ---- 17.5 表情包网格 ---- */

.emogrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 9px; padding: 2px 6px 12px;
}
.emo {
  height: 44px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(28,22,48,.08); background: rgba(255,255,255,.68);
  font-size: 14px; color: var(--ink); letter-spacing: .01em;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 0 4px;
  transition: transform .14s, background .14s;
}
.emo:active { transform: scale(.94); background: rgba(255,241,242,.9); }

/* ---- 17.6 图片库网格（小图库 / 背景库 / 我的上传） ---- */

.imgpick-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 9px; padding: 2px 6px 12px;
}
.imgpick-cell {
  position: relative;
  height: 104px; padding: 0; cursor: pointer; overflow: hidden;
  border: 1px solid rgba(28,22,48,.08); border-radius: 12px; background: #f2f0f7;
  transition: transform .14s, box-shadow .14s;
}
.imgpick-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgpick-cell:active { transform: scale(.96); box-shadow: 0 0 0 2px rgba(242,87,143,.5); }

/* 小图库：贴纸本身就是正方形小图，格子做小一点、一排多塞几个，整图看得见不裁 */
.imgpick-grid--small { grid-template-columns: repeat(4, 1fr); }
.imgpick-grid--small .imgpick-cell { height: auto; aspect-ratio: 1 / 1; background: #fff; }
.imgpick-grid--small .imgpick-cell img { object-fit: contain; }

/* 「我的上传」是混着的：给每张图角上标一下当初归哪个库 */
.imgpick-cell__tag {
  position: absolute; left: 5px; top: 5px;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(28,22,48,.55); color: #fff; font-size: 10px; letter-spacing: .02em;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
