/* ====================================================================
 * styles.css — Velvetnook 全局样式表
 * ====================================================================
 * 职责：定义 Velvetnook 品牌的全部视觉样式，包括布局、组件、动画。
 *       移动端优先，桌面端渐进增强。
 *
 * ⚠️ 关键约束：
 * - index.html 的 CSP 为 script-src 'none'，全部交互效果用纯 CSS 实现
 * - 颜色值保持暖色调纸张质感
 * ==================================================================== */

/* ====================================================================
 * 1. 重置与基础
 * ==================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  /* 暖黄纸底色 — 比纯米白多一分暖意 */
  background-color: #F8ECD8;

  /*
   * 纸张纹理：单层水平细线，避免双重复用渐变对 GPU 的合成压力
   * 低端设备（旧款 iPhone/Android）可流畅渲染
   */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(139, 107, 94, 0.04) 3px,
      rgba(139, 107, 94, 0.04) 4px
    );
  background-size: 4px 4px;

  /* Source Serif 4 — 统一衬线字体，温润有手写感 */
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 300;
  color: #2C2420;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ====================================================================
 * 3. 首屏 — 明信片式沉浸布局
 *    品牌名（左上）→ 宠物肖像（中央）→ 诗句 → 引导链接（底部）
 * ==================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.5rem 2.5rem;
  position: relative;
}

/* ---- 品牌名 — 左上角，克制的小字 ---- */
.brand {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8E857D;
}

/* ---- 主内容区 — 居中，垂直堆叠 ---- */
.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2.5rem;
  padding: 2rem 0;
}

/* ---- 宠物肖像 ---- */
.portrait {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(44, 36, 32, 0.12);
  /* 防止图片加载延迟导致布局偏移 (CLS) */
  aspect-ratio: 1;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- 诗句 — 核心文案，衬线字体，斜体，居中 ---- */
.words {
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  text-align: center;
  line-height: 1.7;
  color: #2C2420;
  max-width: 480px;
}

/* ---- 底部引导链接 ---- */
.footnote {
  text-align: center;
}

.footnote a {
  font-size: 0.9rem;
  font-weight: 400;
  color: #8E857D;
  transition: color 0.3s ease;
}

.footnote a:hover {
  color: #2C2420;
}

/* ====================================================================
 * 4. 容器与留白
 *    所有页面使用 max-width: 1120px 居中容器，
 *    移动端两侧 16px，桌面端 32px。
 * ==================================================================== */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-narrow {
  max-width: 720px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 32px;
  }
}

/* ====================================================================
 * 5. 按钮
 *    变体：ghost（默认，适合 Velvetnook 的安静气质）
 * ==================================================================== */

.btn {
  display: inline-block;
  background: transparent;
  border: 1px solid #D9D0C8;
  padding: 0.8rem 2rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #2C2420;
  text-decoration: none;
  border-radius: 3rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
  background: rgba(139, 107, 94, 0.08);
  border-color: #A88B7E;
  color: #2C2420;
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.97);
}

/* ====================================================================
 * 6. 功能说明区 — "三件安静的事"
 *    无框、无数字标签，只保留顶部细线分隔
 * ==================================================================== */

.section-features {
  padding: 5rem 0 5rem;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: center;
  text-align: center;
}

.feature {
  flex: 1 1 240px;
  padding: 0 0.5rem;
  border-top: 1px solid #E5DBD0;
  padding-top: 2rem;
}

.feature h2 {
  font-size: 1.45rem;
  font-weight: 400;
  color: #2C2420;
  margin-bottom: 0.75rem;
}

.feature p {
  font-size: 0.95rem;
  font-weight: 300;
  color: #8E857D;
  line-height: 1.65;
}

/* ====================================================================
 * 7. 信任与承诺区
 *    无框、左对齐，左侧竖线引导阅读
 * ==================================================================== */

.section-trust {
  padding: 2rem 0 4rem;
}

.trust-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

.trust-item {
  font-size: 0.9rem;
  font-weight: 300;
  color: #6c5d4f;
  border-left: 2px solid #D9D0C8;
  padding-left: 1.2rem;
}

/* ====================================================================
 * 8. 行动号召区
 * ==================================================================== */

.section-action {
  text-align: center;
  padding: 3rem 0 6rem;
}

.action-heading {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 400;
  color: #2C2420;
  margin-bottom: 2rem;
  line-height: 1.3;
}

/* CTA 按钮 — 行动号召区居中 */
.section-action .btn {
  margin-bottom: 1.5rem;
}

.action-note {
  margin-top: 1.2rem;
  font-size: 0.8rem;
  font-weight: 300;
  color: #8E857D;
}

/* ====================================================================
 * 9. 页脚
 * ==================================================================== */

.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid #E5DBD0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-links a {
  font-size: 0.8rem;
  font-weight: 300;
  color: #8E857D;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #2C2420;
}

.footer-copy {
  font-size: 0.75rem;
  font-weight: 300;
  color: #D9D0C8;
}

/* ====================================================================
 * 10. 响应式 — 移动端适配
 *    断点：< 640px 移动单列
 * ==================================================================== */

@media (max-width: 640px) {
  .hero {
    padding: 1.5rem 1rem 2rem;
  }

  .portrait {
    width: 140px;
    height: 140px;
  }

  .words {
    font-size: 0.9rem;
    max-width: 300px;
  }

  .features {
    gap: 2rem;
  }

  .feature {
    flex-basis: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .trust-list {
    padding: 0 1rem;
  }

  .container {
    padding: 0 16px;
  }
}

/* ====================================================================
 * 11. 滚动条美化
 *     注意：::-webkit-scrollbar 仅支持 Chrome/Safari。
 *           Firefox 使用 scrollbar-width 和 scrollbar-color 代替。
 * ==================================================================== */

/* Firefox：细滚动条 + 自定义颜色 */
html {
  scrollbar-width: thin;
  scrollbar-color: #D9D0C8 #E5DBD0;
}

/* Chrome / Safari */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: #E5DBD0;
}

::-webkit-scrollbar-thumb {
  background: #D9D0C8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #A88B7E;
}
