/* ═══════════════════════════════════════════════════════════════
   SnapNFC 全站样式 · 花瓣(huaban.com)风深色主题 v5（2026-10-14）
   ─ 依据 2026-10-14 真站实测：背景 #151719 / 主红 #e00038 /
     胶囊圆角 99px / 导航高 ~64-80px / 卡片圆角 ~12px / 深色 meta 条
   ─ 站点共性：NFC 卡片本体（.snap-card）保持白底（=花瓣的"图"，
     图是什么色由图决定），站点外壳一律深色
   ─ 选择器与 JS DOM 结构一一对应（app/templates/studio/creator/
     fulfill/visitor/auth/renderer/studio-visual），改 DOM 必同步本文件
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* 花瓣深色令牌（实测取样） */
  --hb-red: #e00038;             /* 花瓣红：主行动色 */
  --hb-red-deep: #c40031;
  --hb-red-soft: rgba(224, 0, 56, .14);
  --hb-bg: #151719;              /* 全站底色 */
  --hb-surface: #1e2124;         /* 面板 / meta 条 */
  --hb-surface2: #26292e;        /* 行 / 输入框 / 胶囊 */
  --hb-surface3: #2f3338;        /* hover 面 */
  --hb-line: #33383e;            /* 分隔线 / 边框 */
  --hb-text: #f2f3f5;
  --hb-sub: #9aa0a8;
  --hb-dim: #6f757e;
  /* 兼容旧令牌名（历史规则残留引用处逐步迁移） */
  --blue: var(--hb-red);
  --bg: var(--hb-bg);
  --card: var(--hb-surface);
  --text: var(--hb-text);
  --muted: var(--hb-sub);
  --line: var(--hb-line);
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--hb-bg); color: var(--hb-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Alibaba Sans", sans-serif; }
::selection { background: var(--hb-red); color: #fff; }
/* 深色滚动条（WebKit） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a3f45; border-radius: 99px; border: 2px solid var(--hb-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ── 顶栏（花瓣式：左 logo + 导航 + 大胶囊搜索） ── */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 64px; background: rgba(21, 23, 25, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hb-line); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px;
  color: var(--hb-text); text-decoration: none; letter-spacing: .3px; flex: 0 0 auto; }
.brand-logo { display: block; border-radius: 9px; }
.brand-sub { font-size: 12px; color: var(--hb-dim); flex: 0 0 auto; }
.topnav { display: flex; gap: 4px; flex: 0 0 auto; }
.topnav a { color: var(--hb-sub); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; transition: .15s; }
.topnav a:hover { color: var(--hb-text); background: var(--hb-surface2); }
.topbar-search { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 560px; margin: 0 auto;
  padding: 10px 18px; border-radius: 999px; background: var(--hb-surface2); color: var(--hb-dim);
  text-decoration: none; font-size: 14px; transition: .15s; min-width: 0; }
.topbar-search:hover { background: var(--hb-surface3); color: var(--hb-sub); }
.topbar-search .ts-ico { font-size: 13px; opacity: .8; }
.topbar-search .ts-ph { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .topbar-search { display: none; } .topbar { gap: 10px; padding: 0 14px; } }

/* #app 全屏（少爷指示：模板库等桌面端页面要全屏宽度）；
   仅访客卡片页（/c/）保留手机壳宽度——碰一碰场景 99% 是手机打开，桌面下保持卡片隐喻 */
#app { width: 100%; max-width: none; padding: 16px 24px; }
body[data-route="card"] #app { max-width: 480px; margin: 0 auto; padding: 16px; }

/* ── NFC 卡片本体（访客端与预览共用）：白底＝花瓣里的"图" ── */
.snap-card { background: #fff; color: #1a1a1a; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06); }
.card-header { padding: 16px; background: linear-gradient(135deg, #f6f7f8, #ffffff); }
.card-cover { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.card-identity { font-size: 18px; font-weight: 700; color: #1a1a1a; }
.card-body { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.f-text, .f-date, .f-select, .f-richtext { font-size: 15px; line-height: 1.5; }
.f-richtext { color: #333; }
.f-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px dashed #e5e7eb; }
.f-label { color: #6b7280; font-size: 13px; min-width: 64px; }
.f-value { flex: 1; font-size: 15px; word-break: break-all; }
.f-btn { border: none; background: var(--hb-red); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.f-image { width: 100%; border-radius: 10px; }
.f-missing, .render-warn { font-size: 12px; color: #b45309; }
.render-error { font-size: 13px; color: #d93636; padding: 8px; }

/* 音频（白卡内，暖色语义保留） */
.f-audio { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff7ed; border-radius: 10px; }
.audio-hint { flex: 1; font-size: 14px; }
.audio-btn { border: none; background: #e08600; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; cursor: pointer; }

/* 家庭留条 */
.f-note { display: flex; flex-direction: column; gap: 8px; }
.note-item { background: #f0f7ff; border-radius: 10px; padding: 10px 12px; }
.note-time { font-size: 12px; color: #6b7280; margin-bottom: 3px; }
.note-body { font-size: 15px; }

/* 快捷拨号（无障碍大字高对比；圈色由内容 inline 指定，默认花瓣红） */
.quickdial { padding: 12px; }
.qd-title { text-align: center; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.qd-grid { display: grid; gap: 12px; }
.layout-1 .qd-grid { grid-template-columns: 1fr; }
.layout-2 .qd-grid { grid-template-columns: 1fr 1fr; }
.layout-4 .qd-grid { grid-template-columns: 1fr 1fr; }
.qd-circle { border: none; border-radius: 18px; aspect-ratio: 1/1; color: #fff; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,.15); cursor: pointer; }
.qd-circle:active { transform: scale(.97); }
.qd-note { font-size: 12px; color: #6b7280; text-align: center; margin-top: 10px; }

/* 留资表单 */
.f-form { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.form-title { font-weight: 600; font-size: 15px; }
.form-label { font-size: 12px; color: #6b7280; }
.f-form input, .f-form textarea { padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 15px; }
.form-submit { border: none; background: var(--hb-red); color: #fff; padding: 12px; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; }

/* WebView 降级横幅（深色底上的琥珀警示） */
.webview-banner { background: rgba(224, 134, 0, .12); border: 1px solid rgba(224, 134, 0, .35); color: #f5b04d;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.webview-btn { border: none; background: #e08600; color: #fff; padding: 8px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.visitor-bar { position: sticky; bottom: 0; margin-top: 14px; display: flex; gap: 10px; }
.bar-btn { flex: 1; border: 1px solid var(--hb-line); background: var(--hb-surface2); color: var(--hb-text);
  padding: 12px; border-radius: 999px; font-size: 14px; cursor: pointer; font-family: inherit; transition: .15s; }
.bar-btn:hover { background: var(--hb-surface3); }
.bar-btn.primary { background: var(--hb-red); color: #fff; border-color: var(--hb-red); }
.bar-btn.primary:hover { background: var(--hb-red-deep); }

/* Toast */
.snap-toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  background: #2f3338; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.snap-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Studio / Creator / Fulfill 共用骨架（深色面板） ── */
.studio-head h1 { font-size: 22px; margin: 4px 0; }
.studio-head .sub { color: var(--hb-sub); font-size: 13px; margin: 0 0 12px; }
.tag { font-size: 11px; background: var(--hb-red); color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.studio-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.studio-toolbar select { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--hb-line);
  background: var(--hb-surface2); color: var(--hb-text); font-family: inherit; }
.studio-body { display: flex; flex-direction: column; gap: 12px; }
.editor-pane, .preview-pane { border: 1px solid var(--hb-line); border-radius: 12px; background: var(--hb-surface); overflow: hidden; }
.pane-title { background: var(--hb-surface2); padding: 8px 12px; font-size: 12px; color: var(--hb-sub); border-bottom: 1px solid var(--hb-line); }
#json-editor { width: 100%; min-height: 320px; border: none; padding: 12px; resize: vertical;
  background: #17191c; color: #d6e2ff; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; outline: none; }
#preview { padding: 12px; }

.loading, .error { text-align: center; color: var(--hb-sub); padding: 40px 0; }
.error a { color: var(--hb-red); }

/* ── 官网首页（花瓣着陆页风：深底大标题 + 白胶囊检索 + 精选瀑布流） ── */
.site-home { padding-bottom: 8px; }
.site-home .hero { text-align: center; padding: 56px 8px 30px; }
.site-home .hero h1 { font-size: 44px; line-height: 1.25; margin: 0 0 14px; color: var(--hb-text); letter-spacing: 1px; }
.site-home .hero h1 em { font-style: normal; color: var(--hb-red); }
.hero-sub { color: var(--hb-sub); font-size: 15px; margin: 0 0 24px; }
/* 花瓣式巨型白胶囊检索（点击进模板库检索） */
.hero-search { display: flex; align-items: center; gap: 12px; max-width: 640px; margin: 0 auto 22px;
  padding: 16px 24px; background: #fff; color: #9aa0a8; border-radius: 999px; text-decoration: none;
  font-size: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.35); transition: .15s; }
.hero-search:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(0,0,0,.45); }
.hero-search .hs-ico { font-size: 15px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.big-link { display: block; text-align: center; padding: 13px 26px; background: var(--hb-red); color: #fff;
  border-radius: 999px; text-decoration: none; font-weight: 600; transition: .15s; }
.big-link:hover { background: var(--hb-red-deep); }
.big-link.ghost { background: var(--hb-surface2); color: var(--hb-text); border: 1px solid var(--hb-line); }
.big-link.ghost:hover { background: var(--hb-surface3); }

.value { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.val { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--radius); padding: 14px; text-align: center; }
.val b { display: block; font-size: 15px; margin-bottom: 4px; }
.val span { font-size: 12px; color: var(--hb-sub); }
.lead { text-align: center; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--radius); padding: 18px; margin-top: 18px; }
.lead p { font-size: 14px; color: var(--hb-sub); line-height: 1.6; margin: 0 0 14px; }

.site-home .flow, .site-home .scene, .site-home .faq, .site-home .cta-final { margin-top: 20px; }
.site-home h2 { font-size: 17px; margin: 0 0 12px; }
.flow-row { display: flex; flex-direction: column; gap: 10px; }
.flow-step { position: relative; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--radius);
  padding: 14px 14px 14px 48px; }
.flow-step b { display: block; font-size: 15px; margin-bottom: 4px; }
.flow-step span:not(.flow-no) { font-size: 13px; color: var(--hb-sub); line-height: 1.5; }
.flow-no { position: absolute; left: 14px; top: 14px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--hb-red); color: #fff; font-size: 13px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.scene-item { display: block; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--radius);
  padding: 14px; text-decoration: none; color: inherit; transition: .15s; }
.scene-item:hover { background: var(--hb-surface2); border-color: var(--hb-red); }
.scene-item b { display: block; font-size: 15px; margin-bottom: 4px; color: var(--hb-red); }
.scene-item span { font-size: 12px; color: var(--hb-sub); line-height: 1.5; }
.faq details { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; }
.faq summary { font-size: 14px; font-weight: 600; cursor: pointer; }
.faq details p { font-size: 13px; color: var(--hb-sub); line-height: 1.7; margin: 8px 0 0; }
.cta-final { text-align: center; background: var(--hb-surface); border: 1px solid var(--hb-line);
  border-radius: var(--radius); padding: 18px; }
.cta-final p { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
.site-foot { text-align: center; font-size: 12px; color: var(--hb-dim); margin: 22px 0 8px; }

/* 首页精选瀑布流（复用模板站卡片类名；统计行省略） */
.home-tpl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.home-tpl-head h2 { margin: 0; }
.home-tpl-more { font-size: 13px; color: var(--hb-sub); text-decoration: none; }
.home-tpl-more:hover { color: var(--hb-red); }

/* ══════════ 模板交互站 · 花瓣深色风瀑布流 ══════════ */
/* 页面容器：全屏宽度（少爷指示：不要限宽），仅留舒适边距 */
.tpl-site { width: 100%; padding: 18px 24px 8px; }
/* 顶栏：左标题 + 右胶囊搜索（花瓣式） */
.tpl-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tpl-title h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; letter-spacing: .5px; }
.tpl-title .sub { color: var(--hb-sub); font-size: 13px; margin: 0; }
.tpl-searchbox { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.tpl-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .55; pointer-events: none; }
.tpl-search { width: 100%; box-sizing: border-box; padding: 10px 16px 10px 36px; font-size: 14px; font-family: inherit;
  border: 1px solid transparent; border-radius: 999px; background: var(--hb-surface2); color: var(--hb-text); outline: none; transition: .15s; }
.tpl-search::placeholder { color: var(--hb-dim); }
.tpl-search:focus { background: var(--hb-surface3); border-color: var(--hb-red); box-shadow: 0 0 0 3px var(--hb-red-soft); }
/* 筛选条：分类 pills 横向滚动 + 排序右置 */
.tpl-filterbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tpl-cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding-bottom: 2px; }
.tpl-cats::-webkit-scrollbar { display: none; }
.tpl-cat { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; border: 0; border-radius: 999px;
  background: var(--hb-surface2); color: var(--hb-sub); cursor: pointer; transition: .15s; font-family: inherit; }
.tpl-cat:hover { background: var(--hb-surface3); color: var(--hb-text); }
.tpl-cat.active { background: var(--hb-red); color: #fff; font-weight: 600; }
.tpl-sort { display: flex; gap: 6px; flex: 0 0 auto; }
.tpl-sort .tpl-cat { font-size: 12px; padding: 6px 10px; }
.tpl-sort .tpl-cat.active { background: var(--hb-surface3); color: var(--hb-text); font-weight: 600; }
/* 计数 + 创作者入口 */
.tpl-bar2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 2px 14px; }
.tpl-count { font-size: 13px; color: var(--hb-sub); }
.tpl-creator-cta { display: inline-block; padding: 8px 16px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--hb-red); border-radius: 999px; text-decoration: none; transition: .15s; }
.tpl-creator-cta:hover { background: var(--hb-red-deep); box-shadow: 0 4px 14px rgba(224,0,56,.35); }
/* 瀑布流：JS 分列（templates.js colCount 定列数），flex 列容器 */
.tpl-grid { display: flex; gap: 16px; align-items: flex-start; }
.tpl-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* 卡片：白预览块 + 深色 meta 条（=花瓣「图 + 深条」结构） */
.tpl-card { position: relative; border-radius: 12px; overflow: hidden; background: var(--hb-surface);
  transition: box-shadow .18s, transform .18s; }
.tpl-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.45); transform: translateY(-2px); }
/* 封面区：真实预览 + hover 遮罩（花瓣式采集）；浅渐变底 = Dribbble 单图质感 */
.tpl-cover { position: relative; overflow: hidden; cursor: zoom-in; background: linear-gradient(160deg, #f4f5f7, #e2e5e9); }
.tpl-preview { padding: 10px 10px 4px; }
.tpl-preview .snap-card { border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.tpl-cover-mask { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  align-items: flex-end; padding: 10px; background: rgba(21, 23, 25, .55); opacity: 0; transition: opacity .18s; pointer-events: none; }
.tpl-card:hover .tpl-cover-mask { opacity: 1; pointer-events: auto; }
.tpl-collect { display: inline-block; padding: 7px 14px; font-size: 13px; font-weight: 700; color: #fff;
  background: var(--hb-red); border-radius: 999px; text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: .15s; }
.tpl-collect:hover { background: var(--hb-red-deep); }
.tpl-cover-open { font-size: 12px; color: #fff; text-decoration: none; padding: 5px 10px;
  background: rgba(255,255,255,.16); border-radius: 999px; backdrop-filter: blur(2px); }
.tpl-cover-open:hover { background: rgba(255,255,255,.3); }
/* 触屏设备：无 hover 能力，遮罩常显保证可达 */
@media (hover: none) {
  .tpl-cover-mask { opacity: 1; pointer-events: auto; background: rgba(21, 23, 25, .4); }
}
/* meta 条：标题 + 分类 tag + 统计（花瓣深色条式） */
.tpl-meta { padding: 10px 12px 12px; background: var(--hb-surface); }
.tpl-name { font-size: 14px; font-weight: 700; color: var(--hb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: 11px; font-weight: 400; border-radius: 999px;
  background: var(--hb-surface2); color: var(--hb-sub); vertical-align: 1px; }
/* 作者署名（Figma Community 心智：模板是创作者的资产） */
.tpl-author { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; color: var(--hb-dim); }
.tpl-author-badge { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border-radius: 50%; background: var(--hb-red); color: #fff; font-size: 9px; flex: 0 0 auto; }
.tpl-modal-author { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--hb-sub); margin: 0 0 8px; }
.tpl-stats { display: flex; gap: 12px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--hb-sub);
  padding-right: 58px; /* 右下角悬浮「详情」fab 占位，避免挡住收藏心形（Playwright 实测遮挡） */ }
.tpl-stats span:first-child { color: var(--hb-red); font-weight: 600; }
/* 收藏心形（花瓣画板 MVP） */
.tpl-fav { margin-left: auto; border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--hb-dim); padding: 2px 5px; border-radius: 8px; transition: .15s; }
.tpl-fav:hover { background: var(--hb-red-soft); }
.tpl-fav.on { color: var(--hb-red); }
.tpl-favcat.active { background: var(--hb-red); color: #fff; font-weight: 600; }
.tpl-btn-fav.on { border-color: var(--hb-red); color: #ff5c82; background: var(--hb-red-soft); }
/* 相似模板推荐（花瓣详情页心智） */
.tpl-similar { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hb-line); }
.tpl-similar .pane-title { background: transparent; border: 0; padding: 0 0 4px; }
.tpl-similar-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.tpl-similar-item { text-align: left; border: 1px solid var(--hb-line); background: var(--hb-surface2); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; color: var(--hb-text); font-family: inherit; transition: .15s; min-width: 0; }
.tpl-similar-item:hover { border-color: var(--hb-red); background: var(--hb-surface3); }
.tpl-similar-item b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-similar-item span { font-size: 11px; color: var(--hb-sub); }
/* 详情小按钮（移动端主入口；桌面低调常显） */
.tpl-detail-fab { position: absolute; right: 10px; bottom: 10px; padding: 4px 12px; font-size: 12px; font-family: inherit;
  border: 0; border-radius: 999px; background: rgba(30, 33, 36, .92); color: var(--hb-text); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: .15s; }
.tpl-detail-fab:hover { background: var(--hb-red); color: #fff; }
/* 懒渲染骨架 / 空态 / 脚注 */
.tpl-skel { padding: 40px 0; text-align: center; font-size: 12px; color: var(--hb-dim); }
.tpl-skel-err { padding: 20px 0; text-align: center; font-size: 12px; color: #e05252; }
.tpl-empty { text-align: center; padding: 48px 0; color: var(--hb-sub); font-size: 14px; }
.tpl-foot { margin: 20px 2px 6px; font-size: 11px; color: var(--hb-dim); line-height: 1.6; }
/* 通用按钮（模态 / 绑定页复用） */
.tpl-btn { flex: 1; text-align: center; padding: 10px; border-radius: 999px; font-size: 14px; text-decoration: none;
  background: var(--hb-surface2); color: var(--hb-text); border: 1px solid var(--hb-line); transition: .15s; }
.tpl-btn:hover { background: var(--hb-surface3); }
.tpl-btn.primary { background: var(--hb-red); color: #fff; border-color: var(--hb-red); }
.tpl-btn.primary:hover { background: var(--hb-red-deep); }

/* ── 模板详情模态（花瓣详情风：深色大卡 + 桌面双栏 = 左大图右信息） ── */
.tpl-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; }
.tpl-modal[hidden] { display: none; }
.tpl-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.tpl-modal-box { position: relative; width: 100%; max-width: 980px; max-height: 92vh; overflow: auto;
  background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 14px 14px 0 0; padding: 20px; }
.tpl-modal-close { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--hb-surface2); font-size: 18px; line-height: 1; color: var(--hb-sub); cursor: pointer; z-index: 2; transition: .15s; }
.tpl-modal-close:hover { background: var(--hb-surface3); color: #fff; }
.tpl-modal-grid { display: flex; flex-direction: column; gap: 16px; }
.tpl-modal-media { border-radius: 12px; overflow: hidden; background: #fff; }
.tpl-modal-preview { padding: 10px; }
.tpl-modal-info { display: flex; flex-direction: column; min-width: 0; }
.tpl-modal-box h2 { font-size: 20px; margin: 0 40px 4px 0; }
.tpl-modal-sub { font-size: 12px; color: var(--hb-sub); margin: 0 0 8px; }
.tpl-modal-sub b { color: var(--hb-red); }
.tpl-modal-desc { font-size: 14px; color: var(--hb-sub); line-height: 1.7; margin: 0 0 14px; }
.tpl-modal-preview { margin-bottom: 0; }
.tpl-modal-comps { margin-bottom: 16px; }
.tpl-comp-list { list-style: none; margin: 8px 0 0; padding: 0; }
.tpl-comp-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--hb-surface2);
  border: 1px solid var(--hb-line); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 6px; }
.tpl-comp-type { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; background: var(--hb-red-soft);
  color: #ff5c82; border-radius: 6px; padding: 2px 7px; }
.tpl-comp-vis { font-size: 11px; border-radius: 6px; padding: 2px 7px; }
.tpl-comp-vis.v-public { background: rgba(16, 185, 129, .15); color: #34d399; }
.tpl-comp-vis.v-private { background: rgba(239, 68, 68, .15); color: #f87171; }
.tpl-comp-vis.v-authorized { background: rgba(245, 158, 11, .15); color: #fbbf24; }
.tpl-comp-req { font-size: 11px; color: #f87171; }
.tpl-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-actions .tpl-btn { cursor: pointer; font-family: inherit; }
@media (min-width: 860px) {
  .tpl-modal { align-items: center; }
  .tpl-modal-box { border-radius: 14px; }
  .tpl-modal-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .tpl-modal-media { position: sticky; top: 0; }
}

/* ── 首碰绑定（方案 a：手机号 + 短信验证码） ── */
.bind-box { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 14px; padding: 18px; margin-top: 12px; }
.bind-box h2 { font-size: 18px; margin: 0 0 6px; }
.bind-desc { font-size: 14px; color: var(--hb-sub); line-height: 1.6; margin: 0 0 14px; }
.bind-box label { display: block; font-size: 13px; color: var(--hb-sub); margin-bottom: 10px; }
.bind-box input, .login-box input { width: 100%; box-sizing: border-box; padding: 12px; font-size: 16px;
  border: 1px solid var(--hb-line); border-radius: 10px; margin-top: 6px;
  background: var(--hb-surface2); color: var(--hb-text); outline: none; }
.bind-box input:focus, .login-box input:focus { border-color: var(--hb-red); box-shadow: 0 0 0 3px var(--hb-red-soft); }
.bind-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.bind-row input { flex: 2; margin-top: 0; }
.bind-row .bar-btn { flex: 1; white-space: nowrap; margin: 0; }
.bind-box .tpl-btn { display: block; width: 100%; padding: 12px; font-size: 16px; border: 0; cursor: pointer; }
.bind-tip { min-height: 20px; font-size: 13px; color: #ff5c82; margin: 10px 0 0; }
.bind-foot { font-size: 12px; color: var(--hb-dim); margin: 8px 0 0; }

/* ── W2 登录 / 授权申请 ── */
.login-box { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 14px; }
.login-title { font-weight: 600; margin-bottom: 8px; }
.access-panel { margin-top: 14px; }
.access-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hb-line); font-size: 13px; flex-wrap: wrap; }
.access-row .reason { color: var(--hb-sub); flex: 1; min-width: 120px; }
.access-row .bar-btn { flex: 0 0 auto; padding: 8px 14px; font-size: 13px; }

/* ── W3 创作台 / W4 发货台杂项 ── */
.studio-links { display: flex; gap: 14px; margin-top: 12px; font-size: 14px; }
.studio-links a { color: var(--hb-red); text-decoration: none; }
.cr-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.cr-meta input, .cr-meta select { padding: 10px 12px; border: 1px solid var(--hb-line); border-radius: 10px; font-size: 14px;
  flex: 1; min-width: 120px; background: var(--hb-surface2); color: var(--hb-text); font-family: inherit; outline: none; }
.cr-meta input:focus, .cr-meta select:focus { border-color: var(--hb-red); }
.cr-field { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.cr-field input, .cr-field select { padding: 8px 10px; border: 1px solid var(--hb-line); border-radius: 8px; font-size: 13px;
  background: var(--hb-surface2); color: var(--hb-text); font-family: inherit; outline: none; }
.cr-field input:focus, .cr-field select:focus { border-color: var(--hb-red); }
.cr-json { background: #17191c; border: 1px solid var(--hb-line); border-radius: 8px; padding: 10px; font-size: 12px;
  color: #c9d4e3; overflow: auto; max-height: 280px; white-space: pre-wrap; word-break: break-all; }

/* ── 可视化字段编排引擎（studio-visual.js · Studio 与创作台共用） ── */
.mode-switch { display: inline-flex; gap: 6px; margin-left: auto; }
.mode-switch .bar-btn { flex: 0 0 auto; padding: 9px 16px; font-size: 13px; }
.mode-switch .bar-btn.active { border-color: var(--hb-red); color: var(--hb-red); background: var(--hb-red-soft); }
.ve-meta { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--hb-line); }
.ve-meta label { flex: 1; min-width: 140px; font-size: 12px; color: var(--hb-sub); }
.ve-meta input, .ve-meta select { display: block; width: 100%; box-sizing: border-box; margin-top: 4px;
  padding: 8px 10px; border: 1px solid var(--hb-line); border-radius: 8px; font-size: 14px;
  background: var(--hb-surface2); color: var(--hb-text); font-family: inherit; outline: none; }
.ve-meta input:focus, .ve-meta select:focus { border-color: var(--hb-red); }
.ve-cols { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
@media (min-width: 900px) { .ve-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } }
.ve-fieldcol { min-width: 0; }
.ve-inspector { min-width: 0; border: 1px solid var(--hb-line); border-radius: 10px; padding: 12px; background: var(--hb-surface2); }
.ve-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 10px; margin-bottom: 6px;
  background: var(--hb-surface2); border: 1px solid var(--hb-line); border-radius: 10px; cursor: pointer; font-size: 13px; transition: .15s; }
.ve-row:hover { background: var(--hb-surface3); }
.ve-row.sel { border-color: var(--hb-red); box-shadow: 0 0 0 2px var(--hb-red-soft); }
.ve-row.dragging { opacity: .45; }
.ve-drag { color: var(--hb-dim); cursor: grab; padding: 0 2px; }
.ve-fname { font-weight: 600; }
.ve-ftype { font-size: 11px; background: var(--hb-red-soft); color: #ff5c82; border-radius: 6px; padding: 2px 7px; }
.ve-fvis { font-size: 11px; border-radius: 6px; padding: 2px 7px; }
.ve-fvis.v-public { background: rgba(16, 185, 129, .15); color: #34d399; }
.ve-fvis.v-private { background: rgba(239, 68, 68, .15); color: #f87171; }
.ve-fvis.v-authorized { background: rgba(245, 158, 11, .15); color: #fbbf24; }
.ve-freq { font-size: 11px; color: #f87171; }
.ve-ops { margin-left: auto; display: inline-flex; gap: 4px; }
.ve-ops button { width: 26px; height: 26px; border: 1px solid var(--hb-line); background: var(--hb-surface3); border-radius: 7px;
  font-size: 12px; color: var(--hb-sub); cursor: pointer; line-height: 1; }
.ve-ops button:hover { background: var(--hb-red); color: #fff; border-color: var(--hb-red); }
.ve-empty { padding: 18px 0; text-align: center; font-size: 13px; color: var(--hb-sub); }
.ve-errors { margin-top: 8px; font-size: 12px; color: #f87171; line-height: 1.7; }
.ve-hint { font-size: 12px; color: var(--hb-sub); margin: 2px 0 10px; }
.ve-form label { display: block; font-size: 12px; color: var(--hb-sub); margin-bottom: 10px; }
.ve-form input[type="text"], .ve-form input:not([type]), .ve-form select, .ve-form textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--hb-line); border-radius: 8px; font-size: 14px; background: var(--hb-bg);
  color: var(--hb-text); font-family: inherit; outline: none; }
.ve-form input:focus, .ve-form select:focus, .ve-form textarea:focus { border-color: var(--hb-red); }
.ve-check { display: flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--hb-text) !important; }
.ve-check input { width: 16px; height: 16px; accent-color: var(--hb-red); }
.ve-typegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ve-typebtn { text-align: left; padding: 10px 12px; border: 1px solid var(--hb-line); border-radius: 10px;
  background: var(--hb-surface2); color: var(--hb-text); cursor: pointer; font-family: inherit; transition: .15s; }
.ve-typebtn b { display: block; font-size: 14px; }
.ve-typebtn span { font-size: 11px; color: var(--hb-sub); }
.ve-typebtn:hover { border-color: var(--hb-red); background: var(--hb-surface3); }
.ve-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ve-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--hb-red-soft); color: #ff5c82;
  border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 12px; }
.ve-tag button { border: 0; background: transparent; color: #ff5c82; cursor: pointer; font-size: 12px; padding: 0 2px; }
.ve-row2 { display: flex; gap: 6px; margin-bottom: 10px; }
.ve-row2 input { flex: 1; padding: 8px 10px; border: 1px solid var(--hb-line); border-radius: 8px; font-size: 13px;
  background: var(--hb-bg); color: var(--hb-text); outline: none; }
.ve-row2 input:focus { border-color: var(--hb-red); }
.ve-note, .ve-circle, .ve-ffield { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap;
  padding: 8px; border: 1px solid var(--hb-line); border-radius: 10px; margin-bottom: 6px; background: var(--hb-surface); }
.ve-note input, .ve-note textarea, .ve-circle input, .ve-ffield input, .ve-ffield select {
  padding: 7px 9px; border: 1px solid var(--hb-line); border-radius: 8px; font-size: 13px; font-family: inherit;
  background: var(--hb-bg); color: var(--hb-text); outline: none; }
.ve-note input:focus, .ve-note textarea:focus, .ve-circle input:focus, .ve-ffield input:focus, .ve-ffield select:focus { border-color: var(--hb-red); }
.ve-note input { flex: 0 0 110px; }
.ve-note textarea { flex: 1; min-width: 180px; min-height: 44px; }
.ve-circle input.c-phone { flex: 1; min-width: 120px; }
.ve-circle input.c-color { width: 38px; height: 32px; padding: 2px; }
.ve-ffield input.ff-key { flex: 0 0 90px; }
.ve-ffield input.ff-label { flex: 1; min-width: 100px; }
.ve-ffield label { font-size: 12px; color: var(--hb-sub); }
.ve-imgprev { border: 1px dashed var(--hb-line); border-radius: 8px; padding: 8px; text-align: center;
  font-size: 12px; color: var(--hb-sub); min-height: 40px; }
.ve-imgprev img { max-width: 100%; max-height: 180px; border-radius: 6px; }
.ve-schemaout { background: #17191c; border: 1px solid var(--hb-line); border-radius: 8px; padding: 10px; font-size: 12px;
  color: #c9d4e3; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }

/* ── 底部三站导航（互相引流；深色花瓣条） ── */
.site-nav { position: sticky; bottom: 0; display: flex; gap: 4px; margin: 20px -24px -16px;
  background: rgba(30, 33, 36, .95); backdrop-filter: blur(10px); border-top: 1px solid var(--hb-line); overflow: hidden; }
.site-nav a { flex: 1; text-align: center; padding: 13px 4px; font-size: 13px; color: var(--hb-sub); text-decoration: none; transition: .15s; }
.site-nav a:hover { background: var(--hb-surface2); color: var(--hb-red); }
@media (max-width: 640px) { .site-nav { margin: 20px -16px -16px; } }

/* 旧首页卡片列表（保留兼容，可能被外部引用） */
.card-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.demo-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--hb-surface);
  border: 1px solid var(--hb-line); border-radius: var(--radius); text-decoration: none; color: var(--hb-text); }
.demo-card strong { font-size: 15px; }
.demo-card span { font-size: 12px; color: var(--hb-sub); }

/* ═══ v6 社区化增量（2026-10-14：主色筛选 / 关注作者 / 评论区 / 审核面板） ═══ */
/* 主色筛选行（花瓣「按颜色找灵感」） */
.tpl-colors { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tpl-colors-label { font-size: 12px; color: var(--hb-dim); flex: 0 0 auto; }
.tpl-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--hb-bg); background: var(--dot);
  cursor: pointer; padding: 0; flex: 0 0 auto; outline: 2px solid transparent; outline-offset: 2px; transition: .15s; }
.tpl-dot:hover { transform: scale(1.15); }
.tpl-dot.active { outline-color: var(--hb-text); }
.tpl-dot-s { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot);
  border: 1px solid rgba(255, 255, 255, .28); vertical-align: -1px; flex: 0 0 auto; }

/* 关注作者（详情模态作者行） */
.tpl-follow { margin-left: auto; border: 1px solid var(--hb-line); background: var(--hb-surface2); color: var(--hb-text);
  padding: 4px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; transition: .15s; font-family: inherit; }
.tpl-follow:hover { background: var(--hb-surface3); border-color: var(--hb-red); color: var(--hb-red); }
.tpl-follow.on { background: var(--hb-surface2); color: var(--hb-sub); border-color: var(--hb-line); }
.tpl-followers { font-size: 12px; color: var(--hb-dim); }
#tpl-follow-login { margin: 6px 0 8px; }
#tpl-follow-login .login-box { margin-top: 0; }

/* 评论区（详情模态右栏底部） */
.tpl-comments { margin-top: 16px; border: 1px solid var(--hb-line); border-radius: 12px; overflow: hidden; }
.tpl-comments .pane-title { border-bottom: 1px solid var(--hb-line); }
.tpl-c-count { color: var(--hb-dim); }
.tpl-c-list { padding: 2px 12px; }
.tpl-c-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hb-line); }
.tpl-c-item:last-child { border-bottom: 0; }
.tpl-c-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--hb-red-soft);
  color: var(--hb-red); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.tpl-c-main { flex: 1; min-width: 0; }
.tpl-c-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.tpl-c-head b { color: var(--hb-text); font-weight: 600; }
.tpl-c-head time { font-size: 11px; color: var(--hb-dim); }
.tpl-c-body { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--hb-sub); word-break: break-word; }
.tpl-c-empty { padding: 16px 0; text-align: center; font-size: 13px; color: var(--hb-dim); }
.tpl-c-form { padding: 10px 12px 12px; border-top: 1px solid var(--hb-line); background: var(--hb-surface); }
.tpl-c-form textarea { width: 100%; min-height: 56px; resize: vertical; border: 1px solid var(--hb-line);
  border-radius: 10px; background: var(--hb-surface2); color: var(--hb-text); font-family: inherit; font-size: 13px;
  padding: 8px 10px; outline: none; }
.tpl-c-form textarea:focus { border-color: var(--hb-red); }
.tpl-c-send, .tpl-c-login { display: block; width: 100%; margin-top: 8px; cursor: pointer; }
.tpl-c-form .login-box { margin-top: 8px; }

/* 审核面板（发货台） */
.fl-review { display: flex; flex-direction: column; }
.fl-review .bind-tip { color: var(--hb-sub); }
.fl-review .bind-tip.rv-ok { color: #3ecf8e; }
.rv-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.rv-info b { font-size: 13px; color: var(--hb-text); }
.rv-acts { display: flex; gap: 8px; flex: 0 0 auto; }

/* ── v1.6 站内购买 /shop · /orders ── */
.shop-skus { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.sku-card { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 14px;
  padding: 16px 18px; width: 280px; max-width: 100%; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.sku-card:hover { border-color: var(--hb-sub); }
.sku-card.sel { border-color: var(--hb-red); box-shadow: 0 0 0 2px var(--hb-red-soft); }
.sku-name { font-size: 16px; font-weight: 700; color: var(--hb-text); }
.sku-desc { color: var(--hb-sub); font-size: 13px; margin-top: 6px; line-height: 1.55; min-height: 40px; }
.sku-price { color: var(--hb-red); font-size: 22px; font-weight: 800; margin-top: 10px; }
.sku-price small { font-size: 12px; color: var(--hb-sub); font-weight: 400; }
.pay-box { display: flex; gap: 24px; background: var(--hb-surface); border: 1px solid var(--hb-line);
  border-radius: 16px; padding: 20px; margin: 12px 0; flex-wrap: wrap; }
.pay-qr-wrap { flex: 0 0 auto; }
.pay-qr { width: 180px; height: 180px; background: #fff; border-radius: 12px; object-fit: contain; display: block; }
.pay-qr-empty { width: 180px; height: 180px; background: #fff; border-radius: 12px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; color: #9aa0a8; font-size: 14px; font-weight: 600;
  text-align: center; line-height: 1.6; }
.pay-qr-empty span { font-size: 12px; font-weight: 400; }
.pay-info { flex: 1; min-width: 260px; }
.pay-line { font-size: 14px; color: var(--hb-text); margin-bottom: 8px; }
.pay-amount { color: var(--hb-red); font-size: 22px; font-weight: 800; }
.pay-info .hero-cta { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pay-info .bar-btn { flex: 0 0 auto; }
.od-row { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 12px;
  padding: 12px 14px; margin: 10px 0; font-size: 14px; }
.od-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.od-sub { color: var(--hb-sub); font-size: 12px; margin-top: 6px; word-break: break-all; }
.od-sub code { color: #c9d4e3; }
.od-extra { margin-top: 8px; font-size: 13px; color: var(--hb-text); line-height: 1.6; }
.od-extra code { color: #c9d4e3; background: var(--hb-surface2); padding: 1px 6px; border-radius: 6px; }
.od-tip { color: var(--hb-sub); font-size: 12px; margin-left: 8px; }
.od-link { color: var(--hb-red); text-decoration: none; }
.od-st { font-size: 11px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.st-pay { background: var(--hb-surface2); color: var(--hb-sub); border: 1px solid var(--hb-line); }
.st-paid { background: var(--hb-red-soft); color: var(--hb-red); }
.st-done { background: rgba(62, 207, 142, .14); color: #3ecf8e; }
.st-closed { background: var(--hb-surface2); color: var(--hb-dim); }
.sh-st { font-size: 12px; color: var(--hb-sub); flex: 0 0 auto; min-width: 74px; text-align: right; }
