/* ============================================
   暖舍 · 宠物领养平台
   明亮自然风格 — 阳光 · 绿意 · 活力 · 大自然
   ============================================ */

/* ===== Design Tokens ===== */
:root {
  /* Backgrounds — 明亮暖白绿底 */
  --bg-base: #f6f9f2;
  --bg-surface: #ecf3e6;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f9f0;
  --bg-elevated: #f0f5ea;

  /* Text — 深森林色调，在浅底上高对比 */
  --text-primary: #1f2e1a;
  --text-secondary: #5a6b52;
  --text-muted: #8a9785;
  --text-dim: #b5c0aa;

  /* Accents — 活力大自然色板 */
  --accent-gold: #4caf50;       /* 活力叶绿（主色） */
  --accent-gold-soft: rgba(76, 175, 80, 0.12);
  --accent-sage: #66bb6a;       /* 清新鼠尾草 */
  --accent-sage-soft: rgba(102, 187, 106, 0.12);
  --accent-terra: #ff7043;      /* 珊瑚橙 */
  --accent-terra-soft: rgba(255, 112, 67, 0.12);

  /* Borders */
  --border-subtle: rgba(31, 46, 26, 0.08);
  --border-default: rgba(31, 46, 26, 0.12);
  --border-accent: rgba(76, 175, 80, 0.3);

  /* Shadows — 柔和绿色调 */
  --shadow-sm: 0 2px 8px rgba(76, 175, 80, 0.08);
  --shadow-md: 0 8px 24px rgba(76, 175, 80, 0.10);
  --shadow-lg: 0 20px 60px rgba(31, 46, 26, 0.10);
  --shadow-glow: 0 0 40px rgba(76, 175, 80, 0.15);

  /* Layout */
  --container-max: 1280px;
  --container-pad: 24px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.2s var(--ease-out);
  --t-med: 0.4s var(--ease-out);
  --t-slow: 0.7s var(--ease-out);

  /* Fonts — 使用系统字体栈，零外部依赖，各平台完美渲染 */
  --font-serif: Georgia, 'Times New Roman', 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-cn-serif: 'PingFang SC', 'Noto Serif SC', 'Noto Serif CJK SC', 'Hiragino Mincho ProN', 'STSong', 'Songti SC', 'SimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* ===== Film Grain Overlay ===== */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.02;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Container ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--t-med), backdrop-filter var(--t-med),
              border-color var(--t-med), padding var(--t-med);
  padding: 20px 0;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom-color: var(--border-subtle);
  padding: 14px 0;
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cn-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  transition: color var(--t-fast);
}

.nav-logo:hover {
  color: var(--accent-gold);
}

.paw-icon {
  width: 26px;
  height: 26px;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.nav-menu {
  display: flex;
  gap: 36px;
  margin-left: auto;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
  position: relative;
  padding: 4px 0;
  transition: color var(--t-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--accent-gold);
  transition: width var(--t-fast), left var(--t-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

.nav-link.active {
  color: var(--accent-gold);
}

.nav-link.active::after {
  width: 100%;
  left: 0;
  background: var(--accent-gold);
}

.nav-cta {
  padding: 9px 24px;
  background: var(--accent-gold);
  color: var(--bg-base);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 100px;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast);
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  background: #5cb85c;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(246, 249, 242, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med), visibility var(--t-med);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-link {
  font-family: var(--font-cn-serif);
  font-size: 1.6rem;
  color: var(--text-primary);
  font-weight: 600;
  transition: color var(--t-fast);
}

.mobile-link:hover {
  color: var(--accent-gold);
}

.mobile-cta {
  margin-top: 16px;
  padding: 12px 36px;
  background: var(--accent-gold);
  color: var(--bg-base);
  border-radius: 100px;
  font-size: 1.1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 100px;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--bg-base);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(76, 175, 80, 0.4);
  background: #5cb85c;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-ghost:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-3px);
}

.btn-large {
  padding: 18px 44px;
  font-size: 1.1rem;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #e8f5e9 0%, #fff8e1 40%, #f1f8e9 100%);
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img:not([style*="display: none"]) ~ .hero-overlay,
.hero-bg img[src]:not([style*="display: none"]) {
  /* img visible */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(246, 249, 242, 0.4) 0%,
      rgba(246, 249, 242, 0.2) 30%,
      rgba(246, 249, 242, 0.75) 80%,
      var(--bg-base) 100%),
    radial-gradient(ellipse at 30% 50%, rgba(246, 249, 242, 0.15), rgba(246, 249, 242, 0.5));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-cn-serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
  color: var(--text-primary);
}

.hero-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-gold);
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent-gold), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--accent-gold);
  animation: scrollDown 2s var(--ease-out) infinite;
}

@keyframes scrollDown {
  0% { transform: translateY(-100%); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(240%); opacity: 0; }
}

/* ===== Fade Up Animation ===== */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.9s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Reveal on Scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Stats Bar ===== */
.stats {
  padding: 60px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  flex: 1;
  min-width: 140px;
}

.stat-number {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border-default);
}

/* ===== Section Header ===== */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 16px;
  font-weight: 500;
}

.section-title {
  font-family: var(--font-cn-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Pets Section ===== */
.pets-section {
  padding: 120px 0;
  position: relative;
}

.pets-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 800px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-default), transparent);
}

.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: 100px;
  transition: all var(--t-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.filter-tab.active {
  background: var(--accent-gold);
  color: var(--bg-base);
  border-color: var(--accent-gold);
}

/* ===== Pet Grid ===== */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.pet-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-med), box-shadow var(--t-med),
              background var(--t-fast);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.pet-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.pet-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f0e0, #dfe9d5);
}

.pet-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.pet-card:hover .pet-card-image img {
  transform: scale(1.08);
}

.pet-card-type {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.pet-card-type.type-dog { color: var(--accent-terra); border: 1px solid var(--accent-terra-soft); }
.pet-card-type.type-cat { color: var(--accent-gold); border: 1px solid var(--accent-gold-soft); }
.pet-card-type.type-other { color: var(--accent-sage); border: 1px solid var(--accent-sage-soft); }

.pet-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pet-card-name {
  font-family: var(--font-cn-serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.pet-card-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pet-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pet-tag {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.pet-card-cta {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--t-fast);
}

.pet-card:hover .pet-card-cta {
  gap: 12px;
}

.pet-card-cta svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-fast);
}

/* ===== Process Section ===== */
.process-section {
  padding: 120px 0;
  background: var(--bg-surface);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.process-card {
  position: relative;
  padding: 40px 28px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: transform var(--t-med), border-color var(--t-fast);
  overflow: hidden;
}

.process-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent-gold), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med);
}

.process-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
}

.process-card:hover::before {
  transform: scaleX(1);
}

.process-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--bg-elevated);
  line-height: 1;
  margin-bottom: 16px;
  position: absolute;
  top: 28px;
  right: 28px;
}

.process-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.process-icon svg {
  width: 100%;
  height: 100%;
}

.process-card h3 {
  font-family: var(--font-cn-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.process-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Mission Section ===== */
.mission-section {
  padding: 140px 0;
  position: relative;
  overflow: hidden;
}

.mission-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.mission-image {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.mission-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mission-image-frame {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(245, 239, 228, 0.15);
  border-radius: var(--radius-xl);
  pointer-events: none;
}

.mission-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255, 255, 255, 0.25));
  border-radius: var(--radius-xl);
}

.mission-text .section-title {
  text-align: left;
  margin-bottom: 28px;
}

.mission-body {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.mission-values {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.value-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.value-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-gold-soft);
}

/* ===== Stories Section ===== */
.stories-section {
  padding: 120px 0;
  background: var(--bg-surface);
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.story-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: transform var(--t-med), border-color var(--t-fast);
}

.story-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
}

.story-image {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f0e0, #dfe9d5);
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.story-card:hover .story-image img {
  transform: scale(1.06);
}

.story-body {
  padding: 28px 24px;
}

.story-quote {
  font-family: var(--font-cn-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 20px;
  position: relative;
  padding-left: 20px;
}

.story-quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent-gold);
  border-radius: 3px;
}

.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.story-pet {
  color: var(--accent-gold);
  font-weight: 500;
}

/* ===== CTA Section ===== */
.cta-section {
  position: relative;
  padding: 160px 0;
  overflow: hidden;
  text-align: center;
}

.cta-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cta-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cta-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-base);
  z-index: 1;
}

.cta-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(246, 249, 242, 0.75), rgba(246, 249, 242, 0.92));
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.cta-title {
  font-family: var(--font-cn-serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.cta-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 80px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}

.footer-brand .nav-logo {
  margin-bottom: 20px;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a,
.footer-col ul li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--t-fast);
}

.footer-col ul li a:hover {
  color: var(--accent-gold);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.social-link:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: translateY(-3px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-credits .heart {
  color: var(--accent-terra);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(31, 46, 26, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med), visibility var(--t-med);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  transform: scale(0.92) translateY(20px);
  transition: transform var(--t-med);
  scrollbar-width: thin;
  scrollbar-color: var(--text-dim) transparent;
}

.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 3px;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  transition: all var(--t-fast);
}

.modal-close:hover {
  background: var(--accent-gold);
  color: var(--bg-base);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-image {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  background: linear-gradient(135deg, #e8f0e0, #dfe9d5);
  position: relative;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.2));
}

.modal-info {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

.modal-info .pet-card-type {
  position: static;
  display: inline-block;
  margin-bottom: 16px;
  width: fit-content;
}

.modal-info h2 {
  font-family: var(--font-cn-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-info .modal-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-info .modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.modal-story {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

.modal-health {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.health-item svg {
  width: 18px;
  height: 18px;
  color: var(--accent-sage);
  flex-shrink: 0;
}

.modal-info .btn {
  margin-top: auto;
  width: 100%;
}

/* ===== Mobile Bottom Navigation ===== */
.mobile-nav {
  display: none;
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .mission-container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .mission-image {
    aspect-ratio: 16 / 10;
    max-height: 400px;
  }

  .mission-text .section-title {
    text-align: center;
  }

  .mission-text .section-eyebrow {
    text-align: center;
  }
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 768px) {
  :root {
    --container-pad: 16px;
  }

  /* --- Global mobile tweaks --- */
  body {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    padding-bottom: env(safe-area-inset-bottom, 0);
    font-size: 15px;
    line-height: 1.75;
  }

  /* --- Hide desktop nav, show toggle --- */
  .nav-menu,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-container {
    padding: 0 var(--container-pad);
    gap: 16px;
  }

  .navbar {
    padding: 14px 0;
    padding-top: max(14px, env(safe-area-inset-top, 0));
  }

  .navbar.scrolled {
    padding: 10px 0;
    padding-top: max(10px, env(safe-area-inset-top, 0));
  }

  .nav-logo {
    font-size: 1.2rem;
  }

  .paw-icon {
    width: 22px;
    height: 22px;
  }

  /* --- Mobile menu fullscreen --- */
  .mobile-menu {
    padding-top: env(safe-area-inset-top, 0);
  }

  .mobile-link {
    font-size: 1.4rem;
  }

  /* --- Hero --- */
  .hero {
    min-height: 100vh;
    min-height: 100svh;
    padding-top: env(safe-area-inset-top, 0);
  }

  .hero-bg img {
    object-position: center 40%;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg,
        rgba(246, 249, 242, 0.3) 0%,
        rgba(246, 249, 242, 0.15) 40%,
        rgba(246, 249, 242, 0.6) 75%,
        var(--bg-base) 100%),
      radial-gradient(ellipse at 50% 40%, rgba(246, 249, 242, 0.1), rgba(246, 249, 242, 0.45));
  }

  .hero-eyebrow {
    font-size: 0.75rem;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.2rem);
    line-height: 1.25;
    margin-bottom: 20px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 32px;
    line-height: 1.7;
    max-width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  /* --- Stats --- */
  .stats {
    padding: 40px 0;
  }

  .stats-grid {
    gap: 20px;
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    min-width: 44%;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* --- Section headers --- */
  .pets-section,
  .process-section,
  .stories-section {
    padding: 64px 0;
  }

  .mission-section {
    padding: 64px 0;
  }

  .section-header {
    margin-bottom: 40px;
    padding: 0 4px;
  }

  .section-title {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    line-height: 1.3;
  }

  .section-desc {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  /* --- Filter tabs: horizontal scroll --- */
  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding-bottom: 4px;
    margin-bottom: 32px;
    gap: 10px;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    flex-shrink: 0;
    padding: 9px 22px;
    font-size: 0.85rem;
  }

  /* --- Pet grid: 2 columns on mobile --- */
  .pet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .pet-card-image {
    aspect-ratio: 3 / 4;
  }

  .pet-card-body {
    padding: 14px;
  }

  .pet-card-name {
    font-size: 1.05rem;
    line-height: 1.3;
  }

  .pet-card-info {
    font-size: 0.75rem;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .pet-card-tags {
    gap: 5px;
    margin-bottom: 12px;
  }

  .pet-tag {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .pet-card-cta {
    font-size: 0.78rem;
  }

  .pet-card-type {
    font-size: 0.65rem;
    padding: 3px 10px;
    top: 10px;
    left: 10px;
  }

  /* --- Process --- */
  .process-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .process-card {
    padding: 28px 18px;
  }

  .process-number {
    font-size: 2rem;
    top: 18px;
    right: 14px;
    opacity: 0.12;
  }

  .process-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
  }

  .process-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.3;
  }

  .process-card p {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  /* --- Mission --- */
  .mission-section {
    padding: 64px 0;
  }

  .mission-image {
    aspect-ratio: 16 / 10;
    max-height: 320px;
    border-radius: var(--radius-lg);
  }

  .mission-body {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .mission-values {
    gap: 12px;
  }

  .value-item {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* --- Stories --- */
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .story-image {
    aspect-ratio: 16 / 10;
    max-height: 240px;
  }

  .story-body {
    padding: 24px 20px;
  }

  .story-quote {
    font-size: 0.95rem;
    line-height: 1.75;
    padding-left: 16px;
  }

  /* --- CTA --- */
  .cta-section {
    padding: 80px 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
  }

  .cta-title {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    line-height: 1.25;
  }

  .cta-subtitle {
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .cta-content .btn {
    width: 100%;
  }

  /* --- Pricing --- */
  .pricing-section {
    padding: 64px 0;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pricing-card {
    padding: 28px 24px;
  }

  .pricing-amount {
    font-size: 2.2rem;
  }

  .pricing-features li {
    font-size: 0.88rem;
    padding: 9px 0;
  }

  .pricing-note {
    font-size: 0.82rem;
    line-height: 1.6;
    padding: 16px;
    margin-top: 24px;
  }

  /* --- Footer --- */
  .footer {
    padding: 56px 0 100px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 0.78rem;
  }

  /* --- Modal: fullscreen on mobile --- */
  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    max-height: 100vh;
    max-height: 100svh;
    max-width: 100%;
    height: 100vh;
    height: 100svh;
    border-radius: 0;
    border: none;
    transform: translateY(100%);
    transition: transform 0.35s var(--ease-out);
    padding-top: env(safe-area-inset-top, 0);
  }

  .modal-overlay.open .modal {
    transform: translateY(0);
  }

  .modal-close {
    top: max(16px, env(safe-area-inset-top, 0));
    right: 16px;
    width: 40px;
    height: 40px;
  }

  .modal-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .modal-image {
    aspect-ratio: 16 / 10;
    border-radius: 0;
    max-height: 38vh;
  }

  .modal-info {
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
    overflow-y: auto;
  }

  .modal-info h2 {
    font-size: 1.6rem;
    line-height: 1.25;
  }

  .modal-meta {
    font-size: 0.84rem;
  }

  .modal-story {
    font-size: 0.9rem;
    line-height: 1.75;
  }

  .modal-health {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
  }

  .health-item {
    font-size: 0.78rem;
  }

  /* --- Mobile bottom nav --- */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid var(--border-default);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0));
    justify-content: space-around;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    transition: color var(--t-fast);
    flex: 1;
    max-width: 90px;
  }

  .mobile-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform var(--t-fast);
  }

  .mobile-nav-item.active {
    color: var(--accent-gold);
  }

  .mobile-nav-item.active svg {
    transform: translateY(-2px) scale(1.1);
  }

  .mobile-nav-item:active {
    color: var(--text-primary);
  }
}

/* ===== Responsive — Small Mobile ===== */
@media (max-width: 380px) {
  :root {
    --container-pad: 12px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .pet-grid {
    gap: 10px;
  }

  .pet-card-body {
    padding: 12px 10px;
  }

  .pet-card-name {
    font-size: 0.95rem;
  }

  .pet-card-info {
    font-size: 0.68rem;
  }

  .pet-card-tags {
    display: none;
  }

  .filter-tab {
    padding: 8px 18px;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .stat-item {
    min-width: 42%;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* ===== Touch Device Adjustments ===== */
@media (hover: none) and (pointer: coarse) {
  .pet-card:hover {
    transform: none;
  }

  .pet-card:hover .pet-card-image img {
    transform: none;
  }

  .pet-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }

  .story-card:hover {
    transform: none;
  }

  .story-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .process-card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }

  .nav-cta:hover {
    transform: none;
  }
}

/* ===== Pricing Section ===== */
.pricing-section {
  padding: 100px 0;
  background: var(--bg-base);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  position: relative;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.pricing-card:hover {
  border-color: var(--accent-gold-soft);
  transform: translateY(-4px);
}

.pricing-card-featured {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
  box-shadow: 0 8px 40px rgba(76, 175, 80, 0.08);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: var(--bg-base);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-card-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.pricing-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pricing-amount {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.pricing-amount .currency {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent-gold);
  margin-right: 2px;
}

.pricing-amount .pricing-unit {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

.pricing-card-featured .pricing-amount {
  color: var(--accent-gold);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pricing-features li {
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-sage);
  flex-shrink: 0;
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-card-featured .pricing-features li::before {
  background: var(--accent-gold);
}

.pricing-note {
  margin-top: 32px;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.pricing-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-sage);
}

/* ===== Pet Card Price Badge ===== */
.pet-card-price {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent-gold);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  white-space: nowrap;
}

/* ===== Pet Card Source Badge ===== */
.pet-card-source {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.pet-card-source.source-bred {
  background: rgba(102, 187, 106, 0.2);
  color: var(--accent-sage);
  border: 1px solid rgba(102, 187, 106, 0.35);
}

.pet-card-source.source-rescued {
  background: rgba(255, 112, 67, 0.2);
  color: var(--accent-terra);
  border: 1px solid rgba(255, 112, 67, 0.35);
}

/* Source badge in modal */
.modal-info .pet-card-source {
  position: static;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== Modal Pricing ===== */
.modal-pricing {
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.modal-pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.modal-pricing-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-pricing-value {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-pricing-value em {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.modal-pricing-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.modal-pricing-total .modal-pricing-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.modal-pricing-total .modal-pricing-value {
  color: var(--accent-gold);
  font-size: 1.4rem;
}

/* ===== Responsive: Pricing ===== */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .pricing-section {
    padding: 60px 0;
  }

  .pricing-card {
    padding: 28px 24px;
  }

  .pricing-amount {
    font-size: 2.2rem;
  }

  .pet-card-price {
    font-size: 0.65rem;
    padding: 4px 8px;
    bottom: 8px;
    left: 8px;
  }

  .pet-card-source {
    font-size: 0.6rem;
    padding: 3px 7px;
    top: 8px;
    right: 8px;
  }

  .modal-pricing {
    padding: 16px 18px;
  }
}

@media (max-width: 480px) {
  .pet-card-price {
    font-size: 0.6rem;
    padding: 3px 6px;
  }

  .pet-card-source {
    font-size: 0.55rem;
    padding: 2px 5px;
  }
}

/* ============================================
   领养表单 & 支付流程 样式
   ============================================ */

/* ===== Full-width Button ===== */
.btn-block {
  width: 100%;
  display: flex;
}

/* ===== Form Container ===== */
.form-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.form-header {
  padding: 36px 36px 0;
  position: relative;
}

.form-header h2 {
  font-family: var(--font-cn-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-pet-name {
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.form-back {
  position: absolute;
  top: 36px;
  left: 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--t-fast);
  background: var(--bg-card);
}

.form-back:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.form-back svg {
  width: 18px;
  height: 18px;
}

.form-header h2,
.form-header .form-pet-name {
  margin-left: 52px;
}

/* ===== Form Body ===== */
.form-body {
  padding: 24px 36px 36px;
  overflow-y: auto;
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--accent-terra);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-soft);
}

.form-input-error {
  border-color: var(--accent-terra) !important;
  box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.15) !important;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a9785' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-error {
  display: block;
  font-size: 0.78rem;
  color: var(--accent-terra);
  margin-top: 6px;
  min-height: 0;
}

/* ===== Checkbox Agreement ===== */
.form-agreement {
  margin: 24px 0;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--t-fast);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  transition: all var(--t-fast);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent-sage);
  border-color: var(--accent-sage);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Order Summary ===== */
.order-summary {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 28px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.order-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 0;
}

.order-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.order-total span:last-child {
  color: var(--accent-gold);
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

/* ===== Payment Plan Selector ===== */
.payment-plans {
  margin-bottom: 24px;
}

.plan-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-card {
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}

.plan-card:hover {
  border-color: var(--text-muted);
}

.plan-selected {
  border-color: var(--accent-gold) !important;
  background: var(--accent-gold-soft);
}

.plan-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.plan-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.plan-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  background: var(--accent-sage);
  color: var(--bg-base);
  border-radius: 999px;
}

.plan-check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.plan-selected .plan-check {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
}

.plan-selected .plan-check::after {
  content: '';
  display: block;
  width: 6px;
  height: 10px;
  border: solid var(--bg-base);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 2px 0 0 5px;
}

.plan-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.plan-price {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.plan-price strong {
  color: var(--accent-gold);
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.plan-save {
  color: var(--accent-sage);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===== Payment Method Selector ===== */
.payment-methods {
  margin-bottom: 28px;
}

.method-options {
  display: flex;
  gap: 12px;
}

.method-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.method-card:hover {
  border-color: var(--text-muted);
}

.method-selected {
  border-color: var(--accent-gold) !important;
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
}

.method-selected svg {
  color: var(--accent-gold);
}

/* ===== QR Payment Page ===== */
.qr-body {
  text-align: center;
}

.qr-amount {
  margin-bottom: 28px;
}

.qr-currency {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent-gold);
  font-family: var(--font-serif);
}

.qr-number {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.qr-code-wrapper {
  margin-bottom: 28px;
}

.qr-code {
  max-width: 220px;
  margin: 0 auto 18px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  position: relative;
}

.qr-code::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 2px dashed var(--accent-gold-soft);
  pointer-events: none;
  animation: qrPulse 2s ease-in-out infinite;
}

@keyframes qrPulse {
  0%, 100% { border-color: var(--accent-gold-soft); }
  50% { border-color: var(--accent-gold); }
}

.qr-svg {
  width: 100%;
  height: auto;
  display: block;
}

.qr-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.qr-order-info {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  text-align: left;
}

.qr-order-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.qr-order-total {
  border-top: 1px solid var(--border-subtle);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 700;
  color: var(--text-primary);
}

.qr-order-total span:last-child {
  color: var(--accent-gold);
  font-size: 1.05rem;
}

.qr-note {
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Success Page ===== */
.success-container {
  text-align: center;
  padding: 0;
}

.success-icon {
  margin: 40px 0 24px;
}

.success-icon svg {
  width: 80px;
  height: 80px;
  animation: successPop 0.5s var(--ease-spring);
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: var(--font-cn-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 0.95rem;
  color: var(--accent-gold);
  margin-bottom: 32px;
}

.success-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 0 36px 28px;
  text-align: left;
}

.success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.success-row:last-child {
  border-bottom: none;
}

.success-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.success-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.success-amount {
  color: var(--accent-gold) !important;
  font-family: var(--font-serif);
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}

/* ===== Next Steps ===== */
.success-next {
  padding: 0 36px;
  text-align: left;
  margin-bottom: 28px;
}

.success-next h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.success-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.success-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  color: var(--text-muted);
}

.step-dot.done {
  background: var(--accent-sage);
  border-color: var(--accent-sage);
  color: #fff;
}

.step-dot.done::after {
  content: '✓';
}

.success-step strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.success-step p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* "返回继续浏览" button spacing in success */
.success-container .btn-block {
  margin: 0 36px 36px;
  width: calc(100% - 72px);
}

/* ===== Shake animation for form errors ===== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* ===== Modal step transitions ===== */
.modal-content {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Full-height modal for form steps */
.modal-step-2,
.modal-step-3,
.modal-step-4,
.modal-step-5 {
  grid-template-columns: 1fr !important;
  max-height: 85vh;
  overflow: hidden;
}

.modal-step-2 .form-body,
.modal-step-3 .form-body,
.modal-step-4 .form-body {
  overflow-y: auto;
  max-height: calc(85vh - 100px);
  scrollbar-width: thin;
  scrollbar-color: var(--text-dim) transparent;
}

.modal-step-4 .form-body::-webkit-scrollbar,
.modal-step-3 .form-body::-webkit-scrollbar,
.modal-step-2 .form-body::-webkit-scrollbar {
  width: 4px;
}

.modal-step-4 .form-body::-webkit-scrollbar-thumb,
.modal-step-3 .form-body::-webkit-scrollbar-thumb,
.modal-step-2 .form-body::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 2px;
}

/* ===== Responsive: Form & Payment ===== */
@media (max-width: 768px) {
  .form-header {
    padding: 24px 20px 0;
  }

  .form-header h2 {
    font-size: 1.3rem;
  }

  .form-back {
    top: 24px;
    left: 20px;
    width: 32px;
    height: 32px;
  }

  .form-header h2,
  .form-header .form-pet-name {
    margin-left: 46px;
  }

  .form-body {
    padding: 20px 20px 28px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .qr-number {
    font-size: 2.2rem;
  }

  .qr-code {
    max-width: 180px;
  }

  .success-icon {
    margin: 28px 0 20px;
  }

  .success-icon svg {
    width: 64px;
    height: 64px;
  }

  .success-title {
    font-size: 1.3rem;
  }

  .success-card {
    margin: 0 20px 24px;
  }

  .success-next {
    padding: 0 20px;
  }

  .success-container .btn-block {
    margin: 0 20px 28px;
    width: calc(100% - 40px);
  }

  .method-options {
    flex-direction: column;
  }

  .plan-desc {
    font-size: 0.78rem;
  }

  .form-textarea {
    min-height: 80px;
  }
}

@media (max-width: 480px) {
  .form-header {
    padding: 20px 16px 0;
  }

  .form-header h2 {
    font-size: 1.2rem;
  }

  .form-back {
    top: 20px;
    left: 16px;
  }

  .form-header h2,
  .form-header .form-pet-name {
    margin-left: 42px;
  }

  .form-body {
    padding: 16px 16px 24px;
  }

  .form-input {
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .qr-number {
    font-size: 1.8rem;
  }

  .qr-code {
    max-width: 160px;
    padding: 12px;
  }

  .plan-card {
    padding: 14px 16px;
  }

  .plan-name {
    font-size: 0.88rem;
  }

  .success-card {
    margin: 0 16px 20px;
    padding: 16px 18px;
  }

  .success-next {
    padding: 0 16px;
  }

  .success-container .btn-block {
    margin: 0 16px 24px;
    width: calc(100% - 32px);
  }
}

/* ===== QR Payment: Canvas & Timer ===== */
.qr-code canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.qr-timer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

/* ===== QR Actions ===== */
.qr-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.qr-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.qr-contact svg {
  flex-shrink: 0;
  color: var(--accent-sage);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
