/* 潮影 CYDOLL —— 整站模板样式
   配色变量由 templates.js 按模板写入 <html> 的行内 CSS 变量，
   本文件只负责版式结构：顶栏 / 首屏 / 卡片 / 区块 / 页脚 / 手机端。
   版式家族：luxe 暗色高奢 · gallery 浅色画廊 · editorial 杂志大片
            modern 现代潮流 · zen 东方侘寂 · retro 复古经典 */

/* ============================================================
   一、通用层：把所有硬编码的浅色值换成模板变量
   ============================================================ */
html[data-tpl] body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}
html[data-tpl] h1, html[data-tpl] h2, html[data-tpl] h3, html[data-tpl] h4,
html[data-tpl] .section-head h2, html[data-tpl] .card h3, html[data-tpl] .logo .name,
html[data-tpl] .price, html[data-tpl] .post-title, html[data-tpl] .detail-info h1 {
  font-family: var(--font-head, var(--font));
}

/* 顶栏 */
html[data-tpl] .site-header {
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--hdr-line);
  backdrop-filter: none;
}
html[data-tpl] .logo .name { color: var(--hdr-ink); }
html[data-tpl] .logo img { filter: var(--logo-filter, none); }
html[data-tpl] .nav a { color: var(--hdr-dim); }
html[data-tpl] .nav a:hover { color: var(--hdr-ink); background: var(--gold-soft); }
html[data-tpl] .nav a.active { color: var(--hdr-ink); background: transparent; border-bottom: 2px solid var(--gold); border-radius: 0; }
html[data-tpl] .header-actions .btn-ghost { background: transparent; border-color: var(--hdr-line); color: var(--hdr-ink); }
html[data-tpl] .header-actions .btn-ghost:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--hdr-ink); }
html[data-tpl] .menu-toggle { color: var(--hdr-ink); border-color: var(--hdr-line); background: transparent; }

/* 页脚 */
html[data-tpl] .site-footer {
  background: var(--foot-bg);
  border-top-color: var(--foot-line);
  color: var(--foot-ink);
}
html[data-tpl] .site-footer::before { background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent); }
html[data-tpl] .site-footer a { color: var(--foot-ink); }
html[data-tpl] .site-footer a:hover { color: var(--foot-strong); }
html[data-tpl] .site-footer h4, html[data-tpl] .site-footer .f-brand { color: var(--foot-strong); }
html[data-tpl] .site-footer .logo img { filter: var(--logo-filter, none); }
html[data-tpl] .foot-slogan { color: var(--foot-ink); }
html[data-tpl] .foot-col a, html[data-tpl] .foot-col p { color: var(--foot-ink); }

/* 卡片 / 表单 / 面板：底与线跟随模板 */
html[data-tpl] .card,
html[data-tpl] .sec-figure,
html[data-tpl] .sec-single,
html[data-tpl] .news-item,
html[data-tpl] .qr-card,
html[data-tpl] .guide-list,
html[data-tpl] .config-area,
html[data-tpl] .comment-board,
html[data-tpl] .filter-bar,
html[data-tpl] .param-table,
html[data-tpl] .modal {
  background: var(--card);
  border-color: var(--line-soft);
}
html[data-tpl] .card h3,
html[data-tpl] .news-item h3,
html[data-tpl] .qr-card.direct h3,
html[data-tpl] .detail-info h1,
html[data-tpl] .section-head h2,
html[data-tpl] .param-block h3,
html[data-tpl] .config-area h2,
html[data-tpl] .cfg-group .g-name,
html[data-tpl] .opt .n,
html[data-tpl] .modal-head h3,
html[data-tpl] .comment-head h2,
html[data-tpl] .post-title,
html[data-tpl] .sheet .prod .nm { color: var(--ink); }

html[data-tpl] .card .thumb { background: var(--bg-soft); }
html[data-tpl] .opt { background: var(--card); border-color: var(--line); }
html[data-tpl] .param-table tr:nth-child(odd) td { background: var(--bg-soft); }
html[data-tpl] .qr-card.direct { background: var(--card); }
html[data-tpl] input[type="text"], html[data-tpl] input[type="password"],
html[data-tpl] input[type="number"], html[data-tpl] input[type="email"],
html[data-tpl] textarea, html[data-tpl] select {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
html[data-tpl] .btn-primary:hover, html[data-tpl] a.btn-primary:hover {
  background: var(--gold);
  color: var(--on-gold);
  filter: brightness(0.9);
  box-shadow: 0 8px 22px var(--gold-line);
}
html[data-tpl] .hero .btn-primary { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25); }
html[data-tpl] .hero::after {
  background: linear-gradient(90deg, transparent, var(--gold-line) 22%, var(--gold-line) 78%, transparent);
}
html[data-tpl] .hero .btn-ghost { background: #fff; border-color: #fff; color: var(--gold); }
html[data-tpl] .hero .btn-ghost:hover { background: #fff; border-color: #fff; color: var(--gold-dark); }
html[data-tpl] .opt .pick-dot { border-color: var(--ink-3); background: var(--card); }
html[data-tpl] .opt.active .pick-dot { background: var(--gold); border-color: var(--gold); }

/* 手机端底栏 / 抽屉 */
html[data-tpl] .tabbar { background: var(--tabbar-bg); border-top-color: var(--line); }
html[data-tpl] .tabbar a { color: var(--ink-3); }
html[data-tpl] .tabbar a.active { color: var(--gold); background: var(--gold-soft); }
html[data-tpl] .tabbar a.active svg { stroke: var(--gold); }
html[data-tpl] .m-drawer-panel { background: var(--bg); border-right-color: var(--line); }
html[data-tpl] .m-drawer-head { border-bottom-color: var(--line); }
html[data-tpl] .m-drawer-nav a { color: var(--ink-2); border-bottom-color: var(--line-soft); }
html[data-tpl] .m-drawer-nav a.active { color: var(--gold); }
html[data-tpl] .m-drawer-close { color: var(--ink-2); }

/* ============================================================
   二、版式家族
   ============================================================ */

/* ---------- luxe：暗色高奢，深色展厅 ---------- */
html[data-tpl-family="luxe"] .site-header .inner { height: 92px; }
html[data-tpl-family="luxe"] .hero { background: radial-gradient(760px 360px at 14% -14%, var(--gold-soft), transparent 66%); }
html[data-tpl-family="luxe"] .hero.hero-bg { min-height: 640px; align-items: flex-end; padding: 0 0 74px; }
html[data-tpl-family="luxe"] .hero-actions .btn { border-radius: 0; letter-spacing: 0.14em; padding: 13px 30px; }
html[data-tpl-family="luxe"] .hero .btn-ghost { background: rgba(0, 0, 0, 0.34); border-color: rgba(255, 255, 255, 0.42); color: #fff; }
html[data-tpl-family="luxe"] .section { padding: 84px 0; }
html[data-tpl-family="luxe"] .section-head .kicker { color: var(--gold); letter-spacing: 0.3em; }
html[data-tpl-family="luxe"] .section-head h2 { font-size: 30px; letter-spacing: 0.05em; }
html[data-tpl-family="luxe"] .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
html[data-tpl-family="luxe"] .card:hover { border-color: var(--gold-line); box-shadow: var(--shadow-hover); transform: translateY(-4px); }
html[data-tpl-family="luxe"] .card .thumb { border-bottom: 1px solid var(--line-soft); }
html[data-tpl-family="luxe"] .card .body { padding: 18px 18px 20px; }
html[data-tpl-family="luxe"] .opt { background: var(--card-2); }
html[data-tpl-family="luxe"] .btn { border-radius: 0; }
html[data-tpl-family="luxe"] .site-footer { border-top: 1px solid var(--foot-line); }

/* ---------- gallery：浅色画廊，细线 + 留白 ---------- */
html[data-tpl-family="gallery"] .site-header .inner { height: 84px; }
html[data-tpl-family="gallery"] .nav a { padding: 8px 13px; border-radius: 0; letter-spacing: 0.04em; }
html[data-tpl-family="gallery"] .nav a:hover { background: transparent; color: var(--gold); }
html[data-tpl-family="gallery"] .nav a.active { color: var(--gold); border-bottom: 1px solid var(--gold); }
html[data-tpl-family="gallery"] .hero { background: var(--bg); }
html[data-tpl-family="gallery"] .hero.hero-bg { min-height: 600px; }
html[data-tpl-family="gallery"] .hero-actions .btn { border-radius: 0; letter-spacing: 0.16em; padding: 13px 30px; }
html[data-tpl-family="gallery"] .section { padding: 92px 0; }
html[data-tpl-family="gallery"] .section-head { margin-bottom: 34px; }
html[data-tpl-family="gallery"] .section-head h2 { font-size: 30px; font-weight: 500; letter-spacing: 0.02em; }
html[data-tpl-family="gallery"] .section-head .kicker { letter-spacing: 0.3em; }
html[data-tpl-family="gallery"] .card,
html[data-tpl-family="gallery"] .sec-figure,
html[data-tpl-family="gallery"] .sec-single {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
html[data-tpl-family="gallery"] .card:hover { transform: none; box-shadow: none; }
html[data-tpl-family="gallery"] .card .thumb { border: 1px solid var(--line); border-radius: 0; aspect-ratio: 4 / 5; }
html[data-tpl-family="gallery"] .card .thumb img { transition: transform 0.7s ease, opacity 0.3s ease; }
html[data-tpl-family="gallery"] .card:hover .thumb img { transform: scale(1.03); }
html[data-tpl-family="gallery"] .card .body { padding: 15px 2px 24px; gap: 7px; }
html[data-tpl-family="gallery"] .card h3 { font-weight: 500; letter-spacing: 0.02em; }
html[data-tpl-family="gallery"] .card .actions { padding: 0 2px 8px; }
html[data-tpl-family="gallery"] .card .price { font-weight: 600; }
html[data-tpl-family="gallery"] .btn { border-radius: 0; }
html[data-tpl-family="gallery"] .home-ad { border-radius: 0; }
html[data-tpl-family="gallery"] .sec-single img, html[data-tpl-family="gallery"] .sec-figure img { border-radius: 0; }

/* ---------- editorial：杂志大片，衬线 + 巨字 ---------- */
html[data-tpl-family="editorial"] .site-header { border-bottom: 1px solid var(--hdr-ink); }
html[data-tpl-family="editorial"] .site-header .inner { height: 78px; }
html[data-tpl-family="editorial"] .nav a { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.2em; padding: 8px 12px; }
html[data-tpl-family="editorial"] .nav a:hover { background: transparent; color: var(--gold); }
html[data-tpl-family="editorial"] .nav a.active { background: transparent; color: var(--gold); border-bottom: 0; }
html[data-tpl-family="editorial"] .hero.hero-bg { min-height: 720px; align-items: flex-end; padding: 0 0 92px; }
html[data-tpl-family="editorial"] .hero-actions .btn {
  border-radius: 0; background: #fff; color: #111; border-color: #fff;
  text-transform: uppercase; letter-spacing: 0.2em; font-size: 11px; padding: 14px 30px; box-shadow: none;
}
html[data-tpl-family="editorial"] .hero-actions .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
html[data-tpl-family="editorial"] .section { padding: 108px 0; }
html[data-tpl-family="editorial"] .section-head { margin-bottom: 42px; align-items: flex-end; }
html[data-tpl-family="editorial"] .section-head h2 {
  font-size: clamp(34px, 4.4vw, 54px); font-weight: 400; letter-spacing: -0.01em; line-height: 1.08;
}
html[data-tpl-family="editorial"] .section-head .kicker { letter-spacing: 0.4em; font-weight: 600; }
html[data-tpl-family="editorial"] .section-head .kicker::after { width: 44px; height: 1px; }
html[data-tpl-family="editorial"] .grid { gap: 38px; }
html[data-tpl-family="editorial"] .card { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
html[data-tpl-family="editorial"] .card:hover { transform: none; box-shadow: none; }
html[data-tpl-family="editorial"] .card .thumb { aspect-ratio: 4 / 5; background: var(--bg-soft); }
html[data-tpl-family="editorial"] .card .body { padding: 18px 0 8px; }
html[data-tpl-family="editorial"] .card h3 { font-size: 19px; font-weight: 400; letter-spacing: 0.01em; }
html[data-tpl-family="editorial"] .card .meta { text-transform: uppercase; letter-spacing: 0.12em; font-size: 10.5px; }
html[data-tpl-family="editorial"] .card .actions { padding: 0 0 8px; }
html[data-tpl-family="editorial"] .btn { border-radius: 0; }
html[data-tpl-family="editorial"] .price { letter-spacing: 0.04em; }
html[data-tpl-family="editorial"] .sec-figure img, html[data-tpl-family="editorial"] .sec-single img { border-radius: 0; }
html[data-tpl-family="editorial"] .btn-ghost { border-color: var(--line); }

/* ---------- modern：现代潮流，圆角 + 浮层 ---------- */
html[data-tpl-family="modern"] .site-header {
  top: 10px;
  margin: 10px auto 0;
  width: calc(100% - 24px);
  max-width: 1180px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}
html[data-tpl-family="modern"] .site-header .inner { height: 70px; }
html[data-tpl-family="modern"] .nav a { border-radius: 999px; padding: 7px 14px; }
html[data-tpl-family="modern"] .nav a.active { border-bottom: 0; background: var(--gold-soft); color: var(--gold); }
html[data-tpl-family="modern"] .hero.hero-bg { min-height: 640px; border-radius: 0 0 34px 34px; overflow: hidden; }
html[data-tpl-family="modern"] .hero-actions { justify-content: center; }
html[data-tpl-family="modern"] .hero-actions .btn { border-radius: 999px; padding: 14px 32px; font-weight: 700; }
html[data-tpl-family="modern"] .btn { border-radius: 999px; }
html[data-tpl-family="modern"] .btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); }
html[data-tpl-family="modern"] .section { padding: 86px 0; }
html[data-tpl-family="modern"] .section-head h2 { font-size: 32px; font-weight: 700; }
html[data-tpl-family="modern"] .section-head .kicker {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold);
  letter-spacing: 0.12em;
}
html[data-tpl-family="modern"] .section-head .kicker::after { display: none; }
html[data-tpl-family="modern"] .card {
  background: var(--card); border: 0; border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 12px 34px var(--line-soft);
}
html[data-tpl-family="modern"] .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 56px var(--line);
}
html[data-tpl-family="modern"] .card .thumb { border-radius: 0; }
html[data-tpl-family="modern"] .card .body { padding: 16px 16px 18px; }
html[data-tpl-family="modern"] .sec-figure, html[data-tpl-family="modern"] .sec-single { border: 0; border-radius: calc(var(--radius) + 4px); }
html[data-tpl-family="modern"] .home-ad { border-radius: calc(var(--radius) + 4px); }
html[data-tpl-family="modern"] .tabbar { border-radius: 18px 18px 0 0; }

/* ---------- zen：东方侘寂，居中 + 素雅 ---------- */
html[data-tpl-family="zen"] body { letter-spacing: 0.02em; }
html[data-tpl-family="zen"] .site-header .inner { height: 78px; }
html[data-tpl-family="zen"] .nav a { letter-spacing: 0.14em; font-size: 13.5px; border-radius: 0; }
html[data-tpl-family="zen"] .nav a:hover { background: transparent; color: var(--gold); }
html[data-tpl-family="zen"] .nav a.active { background: transparent; color: var(--gold); border-bottom: 1px solid var(--gold); }
html[data-tpl-family="zen"] .hero.hero-bg { min-height: 580px; align-items: center; padding: 0 0 40px; }
html[data-tpl-family="zen"] .hero-actions { justify-content: center; }
html[data-tpl-family="zen"] .section { padding: 100px 0; }
html[data-tpl-family="zen"] .section-head {
  flex-direction: column; align-items: center; text-align: center;
  gap: 8px; margin-bottom: 48px;
}
html[data-tpl-family="zen"] .section-head .more { margin-left: 0; }
html[data-tpl-family="zen"] .section-head h2 { font-size: 28px; font-weight: 400; letter-spacing: 0.14em; }
html[data-tpl-family="zen"] .section-head .kicker { letter-spacing: 0.44em; }
html[data-tpl-family="zen"] .section-head .kicker::after { margin: 8px auto 0; }
html[data-tpl-family="zen"] .grid { gap: 26px; }
html[data-tpl-family="zen"] .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
html[data-tpl-family="zen"] .card:hover { transform: none; box-shadow: var(--shadow); border-color: var(--gold-line); }
html[data-tpl-family="zen"] .card .thumb { aspect-ratio: 4 / 5; }
html[data-tpl-family="zen"] .card .body { padding: 20px 16px 24px; text-align: center; align-items: center; }
html[data-tpl-family="zen"] .card .tags { justify-content: center; }
html[data-tpl-family="zen"] .card .actions { justify-content: center; padding: 0 16px 18px; }
html[data-tpl-family="zen"] .btn { border-radius: 4px; letter-spacing: 0.1em; }
html[data-tpl-family="zen"] .hero-actions .btn { padding: 12px 28px; }
html[data-tpl-family="zen"] .home-ad, html[data-tpl-family="zen"] .sec-single img, html[data-tpl-family="zen"] .sec-figure img { border-radius: 2px; }
html[data-tpl-family="zen"] .site-footer { border-top: 1px solid var(--foot-line); }

/* ---------- retro：复古经典，双线边框 + 对称 ---------- */
html[data-tpl-family="retro"] .site-header { border-bottom: 3px double var(--hdr-line); }
html[data-tpl-family="retro"] .site-header .inner { height: 88px; }
html[data-tpl-family="retro"] .nav a {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 11.5px;
  border-radius: 0; padding: 8px 12px;
}
html[data-tpl-family="retro"] .nav a:hover { background: transparent; color: var(--gold); }
html[data-tpl-family="retro"] .nav a.active { background: transparent; color: var(--gold); border-bottom: 0; }
html[data-tpl-family="retro"] .hero.hero-bg { min-height: 640px; align-items: center; padding: 0 0 30px; }
html[data-tpl-family="retro"] .hero-actions { justify-content: center; }
html[data-tpl-family="retro"] .hero-actions .btn {
  border-radius: 0; border: 1px solid var(--gold); letter-spacing: 0.2em;
  text-transform: uppercase; font-size: 11.5px; padding: 14px 30px;
}
html[data-tpl-family="retro"] .hero .btn-ghost { background: transparent; color: #fff; border-color: var(--gold); }
html[data-tpl-family="retro"] .section { padding: 96px 0; }
html[data-tpl-family="retro"] .section-head {
  flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 46px;
}
html[data-tpl-family="retro"] .section-head .more { margin-left: 0; }
html[data-tpl-family="retro"] .section-head h2 {
  font-size: 26px; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase;
}
html[data-tpl-family="retro"] .section-head .kicker { letter-spacing: 0.46em; }
html[data-tpl-family="retro"] .section-head .kicker::after { margin: 8px auto 0; }
html[data-tpl-family="retro"] .grid { gap: 28px; }
html[data-tpl-family="retro"] .card {
  background: var(--card); border: 1px solid var(--line); border-radius: 0;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line);
}
html[data-tpl-family="retro"] .card:hover {
  transform: none;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--gold);
}
html[data-tpl-family="retro"] .card .thumb { border-bottom: 1px solid var(--line); }
html[data-tpl-family="retro"] .card .body { padding: 18px 16px 22px; text-align: center; align-items: center; }
html[data-tpl-family="retro"] .card .tags { justify-content: center; }
html[data-tpl-family="retro"] .card .actions { justify-content: center; padding: 0 16px 18px; }
html[data-tpl-family="retro"] .btn { border-radius: 0; letter-spacing: 0.1em; }
html[data-tpl-family="retro"] .home-ad, html[data-tpl-family="retro"] .sec-single img, html[data-tpl-family="retro"] .sec-figure img { border-radius: 0; }
html[data-tpl-family="retro"] .site-footer { border-top: 3px double var(--foot-line); }

/* ============================================================
   三、手机端适配
   ============================================================ */
@media (max-width: 820px) {
  /* 汉堡图标线条跟随顶栏颜色 */
  html[data-tpl] .menu-toggle::before {
    background: var(--hdr-ink);
    box-shadow: 0 6px 0 var(--hdr-ink), 0 12px 0 var(--hdr-ink);
  }
  html[data-tpl] .site-header .logo img { filter: var(--logo-filter, none); }

  /* 浮层顶栏在手机上回归整宽 */
  html[data-tpl-family="modern"] .site-header {
    top: 0; margin: 0; width: 100%; max-width: none;
    border-left: 0; border-right: 0; border-top: 0; border-radius: 0;
    box-shadow: none;
  }
  html[data-tpl-family="modern"] .hero.hero-bg { border-radius: 0 0 22px 22px; }

  /* 手机端卡片：画廊/杂志保持无框，高奢/侘寂/复古保留卡片框 */
  html[data-tpl] .card { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  html[data-tpl-family="luxe"] .card,
  html[data-tpl-family="zen"] .card,
  html[data-tpl-family="retro"] .card {
    background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
    overflow: hidden;
  }
  html[data-tpl-family="retro"] .card { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line); }
  html[data-tpl-family="luxe"] .card .body,
  html[data-tpl-family="zen"] .card .body,
  html[data-tpl-family="retro"] .card .body { padding: 10px 10px 14px; text-align: left; align-items: stretch; }
  html[data-tpl-family="zen"] .card .body,
  html[data-tpl-family="retro"] .card .body { text-align: center; align-items: center; }
  html[data-tpl-family="luxe"] .card .actions,
  html[data-tpl-family="zen"] .card .actions,
  html[data-tpl-family="retro"] .card .actions { padding: 0 10px 12px; }

  /* 手机端排版收紧，避免大留白 */
  html[data-tpl-family="editorial"] .section,
  html[data-tpl-family="zen"] .section,
  html[data-tpl-family="retro"] .section { padding: 58px 0; }
  html[data-tpl-family="editorial"] .section-head h2 { font-size: 28px; }
  html[data-tpl-family="editorial"] .grid { gap: 18px; }
  html[data-tpl-family="zen"] .section-head,
  html[data-tpl-family="retro"] .section-head { align-items: flex-start; text-align: left; }
  html[data-tpl-family="zen"] .section-head .more,
  html[data-tpl-family="retro"] .section-head .more { margin-left: 0; }
  html[data-tpl-family="gallery"] .section { padding: 56px 0; }
}

/* 深色模板下滚动条、选中色跟随 */
html[data-tpl] ::selection { background: var(--gold); color: var(--on-gold); }
html[data-tpl] ::-webkit-scrollbar-track { background: var(--bg-soft); }
html[data-tpl] ::-webkit-scrollbar-thumb { background: var(--line); }
