/* ============================================================
 * 儋州文旅 · PC 共享组件层（统一视觉原语）
 * 全部基于 design_tokens.css 的 CSS 变量，禁止硬编码色值。
 * 由 ssg/build.js 全局注入到每个页面 <head>，确保全站一致。
 * ============================================================ */

@import url('design_tokens.css');

/* ---- 布局容器 ---- */
.dz-container {
  max-width: var(--pc-max-width);
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}
.dz-section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}
.dz-section--tight { padding-top: var(--space-8); padding-bottom: var(--space-8); }

/* ---- 区块标题 ---- */
.section-title {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: var(--font-weight-extrabold, 800);
  color: var(--color-primary);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
.section-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  color: var(--color-gold-deep);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.section-sub {
  font-size: 15px;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin-bottom: var(--space-6);
}
.dz-title-wrap { margin-bottom: var(--space-6); }
.dz-title-wrap.center { text-align: center; }
.dz-title-wrap.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 26px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-base);
  cursor: pointer;
  text-decoration: none;
  /* 基类必须自带外观: 站内大量裸 <a class="btn"> 不带修饰类,
     若基类无色则回落到浏览器默认链接蓝 #0000EE, 属严重视觉回归。
     修饰类(.btn-gold/.btn-ghost)在下方覆盖。 */
  background: var(--gradient-primary);
  color: #fff;
  transition: transform var(--transition-fast), box-shadow var(--transition-base), background var(--transition-base);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-gold { background: var(--gradient-gold); color: #4a3a12; box-shadow: var(--shadow-gold); }
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary-lighter);
}
.btn-ghost:hover { background: var(--color-primary-bg); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- 卡片 ---- */
.dz-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid rgba(15,76,117,0.06);
}
.dz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.dz-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-primary-bg) center/cover no-repeat;
  overflow: hidden;
}
.dz-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-card-body { padding: var(--space-5); }
.dz-card-title { font-size: 18px; font-weight: var(--font-weight-semibold); color: var(--color-text-primary); margin-bottom: var(--space-2); }
.dz-card-text { font-size: 14px; color: var(--color-text-secondary); line-height: 1.7; }
.dz-card-meta { margin-top: var(--space-3); font-size: 13px; color: var(--color-text-tertiary); }

/* ---- 标签 / 徽标 ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  background: var(--color-primary-bg);
  color: var(--color-primary);
}
.tag-gold { background: var(--bg-gold); color: var(--color-gold-deep); }
.tag-green { background: var(--color-green-bg); color: var(--color-green); }
.tag-orange { background: rgba(232,136,76,0.12); color: var(--color-orange); }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  background: var(--color-coral);
  color: #fff;
}

/* ---- 链接（统一全站 a 的默认表现） ---- */
.dz-link {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.dz-link:hover { color: var(--color-gold-deep); border-bottom-color: var(--color-gold); }
a.text-link { color: var(--color-primary); text-decoration: none; }
a.text-link:hover { color: var(--color-gold-deep); text-decoration: underline; }

/* ---- 响应式栅格 ---- */
.dz-grid { display: grid; gap: var(--space-6); }
.dz-grid-2 { grid-template-columns: repeat(2, 1fr); }
.dz-grid-3 { grid-template-columns: repeat(3, 1fr); }
.dz-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) {
  .dz-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dz-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dz-grid-2, .dz-grid-3, .dz-grid-4 { grid-template-columns: 1fr; }
  .section-title { font-size: 24px; }
}

/* ---- 通用 Hero（覆盖/补充 common_styles 的 .hero） ---- */
.dz-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  background: var(--gradient-hero-deep);
  color: #fff;
  overflow: hidden;
}
.dz-hero__inner { position: relative; z-index: 2; max-width: var(--pc-max-width); margin: 0 auto; padding: var(--space-16) var(--space-6); }
.dz-hero__eyebrow { color: var(--color-gold-light); letter-spacing: var(--tracking-widest); font-size: 14px; font-weight: var(--font-weight-semibold); }
.dz-hero__title { font-size: 44px; font-weight: var(--font-weight-bold); margin: var(--space-3) 0; line-height: 1.2; }
.dz-hero__sub { font-size: 17px; color: var(--color-text-muted); max-width: 560px; }

/* ---- 回到顶部：全站唯一实现 ----
   按钮实体由 partials/footer.pc.html 注入（25 个 PC 页一致），
   样式在此收口。页面内联不得重复定义 .back-to-top，否则架空本层。
   z-index 890 < 语言切换按钮 900，避免抢占右上角交互层。 */
.back-to-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: var(--gradient-primary);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(15, 76, 117, .32);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, box-shadow .3s ease;
  z-index: 890;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { box-shadow: 0 10px 28px rgba(15, 76, 117, .42); }
.back-to-top:active { transform: scale(.92); }
@media (max-width: 768px) {
  .back-to-top { right: var(--space-4); bottom: var(--space-4); width: 42px; height: 42px; }
}

/* ---- AI 悬浮入口：PC 统一定位 + 完整外观（删内联重复后经实测） ----
   统一类名 .ai-float-btn（蓝色渐变 + 右下 24px + position:fixed 的悬浮按钮）。
   2026-09-03 命名治理：活动页原 .float-ai/.float-ai-btn 已归一为 .ai-float-btn，
   全站 PC 6 页统一此名。页面内联不得再写定位/外观，否则架空本层。
   纵向排布（互不重叠）：AI 按钮 24~78px → 回到顶部 88~134px → AI 菜单 142px 起。 */
html body .ai-float-btn,
body button.ai-float-btn,
body a.float-ai-btn {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 900;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 76, 117, .35);
  transition: transform .3s ease, box-shadow .3s ease;
  animation: dz-pulse 2s infinite;
}
.float-ai-btn:hover,
.ai-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(15, 76, 117, .45);
}
.float-ai-btn:active,
.ai-float-btn:active {
  transform: scale(.94);
}
@keyframes dz-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(15, 76, 117, .35); }
  50% { box-shadow: 0 8px 32px rgba(15, 76, 117, .55); }
}
body:has(.ai-float-btn) .back-to-top {
  bottom: 88px;
}
.ai-float-tooltip {
  right: var(--space-6);
  bottom: 142px;
}

/* ============================================================
   页面级视觉统一规范 (Phase 1)
   ============================================================ */

/* ---- 页面 Hero 统一 ---- */
body .hero {
  position: relative;
  height: 480px;
  background: var(--gradient-hero-deep);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-inverse);
  text-align: center;
}
body .hero--home {
  height: calc(100vh - var(--navbar-height));
  min-height: 600px;
}
body .hero-title,
body .hero h1 {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: var(--font-weight-bold);
  line-height: 1.15;
  color: #fff;
  margin-bottom: var(--space-4);
  text-align: center;
}
body .hero-subtitle,
body .hero > p {
  font-size: 16px;
  font-weight: var(--font-weight-regular);
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
body .hero--home .hero-title {
  font-size: clamp(56px, 8vw, 92px);
  font-weight: var(--font-weight-extrabold);
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: var(--space-5);
}
body .hero--home .hero-subtitle {
  font-size: clamp(18px, 2.2vw, 24px);
  max-width: 760px;
}

/* ---- 区块标题统一居中 ---- */
body .section-title {
  text-align: center;
  margin-bottom: var(--space-4);
}
body .section-title--left {
  text-align: left;
}

/* ============================================================
   DZ_P2_VISUAL_UNIFY — 页面级视觉统一 (Phase 2)
   卡片几何 / 标签 / 交互 chip / hero 细节 全站单一规范。
   基线（_p2_audit.py 实测）：卡片圆角 11 种、阴影 18 种；
   标签圆角 7 种、字号 7 种 —— 此块将其收敛为各 1 种。
   注意：用 `body ` 前缀取 (0,1,1) 特异性，压过 common_styles.css 的裸类名；
   各页内联同名几何声明已由 _p2_visual_unify.py 剥离，勿再写回。
   ============================================================ */

/* ---- 卡片容器：单一圆角 + 单一阴影 + 单一 hover 抬升 ---- */
body .card,
body .attr-card,
body .journey-card,
body .testimonial-card,
body .nt-card,
body .video-play-card,
body .scenic-card,
body .flavor-card,
body .activity-card,
body .weather-card,
body .nav-scene-card,
body .planner-card,
body .pc-scenic-card,
body .heritage-card,
body .spot-card,
body .base-card,
body .exp-card,
body .feature-card,
body .route-card,
body .town-card,
body .city-item,
body .honor-item,
body .product-card,
body .combo-card,
body .card-item,
body .story-item {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
body .card:hover,
body .attr-card:hover,
body .journey-card:hover,
body .testimonial-card:hover,
body .nt-card:hover,
body .video-play-card:hover,
body .scenic-card:hover,
body .flavor-card:hover,
body .activity-card:hover,
body .weather-card:hover,
body .nav-scene-card:hover,
body .planner-card:hover,
body .pc-scenic-card:hover,
body .heritage-card:hover,
body .spot-card:hover,
body .base-card:hover,
body .exp-card:hover,
body .feature-card:hover,
body .route-card:hover,
body .town-card:hover,
body .city-item:hover,
body .honor-item:hover,
body .product-card:hover,
body .combo-card:hover,
body .card-item:hover,
body .story-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ---- 小标签 / 徽标：统一 pill + 12px ---- */
body .tag,
body .badge,
body .card-tag,
body .spot-tag,
body .base-feature,
body .card-badge,
body .card-level,
body .story-tag,
body .story-cover-tag,
body .flavor-heritage-tag,
body .flavor-badge,
body .scenic-badge,
body .attr-tag,
body .pc-scenic-tag,
body .route-tag,
body .hero-tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  white-space: nowrap;
}

/* ---- 可点交互 chip：统一 pill + 13px（比标签大一号） ---- */
body .filter-chip,
body .filter-tag,
body .planner-interest-tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

/* ---- Hero 细节统一（承接 Phase 1 的 .hero/.hero-title/.hero-subtitle） ---- */
/* Phase 1 给 .hero 设了 display:flex 居中；但 flex 默认主轴是 row，
   凡是没有 .hero-content 包裹层的页面（product-list 曾如此）会把
   eyebrow / h1 / p 横排成一行。此处强制纵向堆叠作为结构性默认值。 */
body .hero {
  flex-direction: column;
}
body .hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  padding: 0 var(--space-6);
  text-align: center;
}
/* eyebrow 历史上有 4 套类名：.hero-eyebrow（index/culture/feiyi/yanxue/activity）、
   .kicker（product-list）、.hero-tag（story-list）、.pc-hero-eyebrow（scenic-list）。
   全部归一为"纯文字小字距眉标"，清掉各自的 pill 底色/边框/内距。 */
body .hero-eyebrow,
body .hero .kicker,
body .hero .hero-tag,
body .pc-scenic-hero .pc-hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: var(--space-3);
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
}
/* story-list 用 .hero-desc 作副标题，与 .hero-subtitle 同规范 */
body .hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
