/* ============================================================
   李磨来咖啡 · 设计系统 v2.0
   响应式 + 交互动效 + 可访问性 全面升级
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 品牌色 */
  --color-primary: #4A2C2A;      /* 深焙咖啡棕 */
  --color-primary-dark: #3a221f;
  --color-secondary: #C8956C;    /* 焦糖榛果 */
  --color-accent: #D4A574;       /* 燕麦奶咖 */
  --color-bg-main: #FDF8F3;      /* 奶油白 */
  --color-bg-card: #F5EDE4;      /* 亚麻米色 */
  --color-bg-dark: #1A0F0E;      /* 深色模块 */
  --color-text-dark: #2D1810;    /* 深咖啡黑 */
  --color-text-muted: #7A5C52;   /* 中焙灰 */
  --color-border: rgba(74, 44, 42, .08);

  /* 功能色 */
  --color-success: #5a8a5e;
  --color-error: #c0564a;
  --color-focus: #C8956C;

  /* 阴影 */
  --shadow-xs: 0 1px 3px rgba(45, 24, 16, .04);
  --shadow-sm: 0 2px 8px rgba(45, 24, 16, .06);
  --shadow-md: 0 10px 30px rgba(45, 24, 16, .10);
  --shadow-lg: 0 20px 50px rgba(45, 24, 16, .14);
  --shadow-focus: 0 0 0 3px rgba(200, 149, 108, .35);

  /* 圆角 */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-full: 999px;

  /* 间距系统 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* 过渡 */
  --t-fast: .15s ease;
  --t-normal: .25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: .45s cubic-bezier(0.16, 1, 0.3, 1);
  --t-spring: .35s cubic-bezier(0.34, 1.4, 0.64, 1);

  /* 布局 */
  --maxw: 1140px;
  --maxw-wide: 1320px;
  --header-h: 70px;

  /* z-index 层级 */
  --z-header: 50;
  --z-overlay: 90;
  --z-toast: 100;
  --z-progress: 60;
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Noto Sans SC", "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--color-text-dark);
  background: var(--color-bg-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Noto Serif SC", serif;
  line-height: 1.25;
  color: var(--color-primary);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- 3. 可访问性 ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: var(--z-toast);
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  transition: top var(--t-fast);
}
.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.text-center { text-align: center; }

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
  z-index: var(--z-progress);
  transition: width .1s linear;
  pointer-events: none;
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast), background var(--t-normal), color var(--t-normal), box-shadow var(--t-normal);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }

.btn-ghost { border-color: #fff; color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .15); }

/* ===== 键盘键帽按钮（登录页） ===== */
.keycap {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #282828, #202020);
  box-shadow:
    inset -8px 0 8px rgba(0, 0, 0, 0.15),
    inset 0 -8px 8px rgba(0, 0, 0, 0.25),
    0 0 0 2px rgba(0, 0, 0, 0.75),
    10px 20px 25px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in;
  text-align: center;
}

.keycap .letter {
  position: relative;
  display: inline-block;
  padding: 1rem 1.5rem;
  color: #e9e9e9;
  font-size: 16px;
  letter-spacing: 0.15em;
  transition: transform 0.1s ease-in-out;
  z-index: 1;
}

.keycap::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  bottom: 14px;
  right: 12px;
  background: linear-gradient(90deg, #232323, #4a4a4a);
  border-radius: 10px;
  box-shadow:
    -10px -10px 10px rgba(255, 255, 255, 0.25),
    10px 5px 10px rgba(0, 0, 0, 0.15);
  border-left: 1px solid #0004;
  border-bottom: 1px solid #0004;
  border-top: 1px solid #0009;
  transition: all 0.1s ease-in-out;
  pointer-events: none;
}

.keycap:active {
  transform: translateY(2px);
  box-shadow:
    inset -4px 0 4px rgba(0, 0, 0, 0.1),
    inset 0 -4px 4px rgba(0, 0, 0, 0.15),
    0 0 0 2px rgba(0, 0, 0, 0.5),
    5px 10px 15px rgba(0, 0, 0, 0.3);
}

.keycap:active::before {
  top: 5px;
  left: 5px;
  bottom: 11px;
  right: 11px;
  box-shadow:
    -5px -5px 5px rgba(255, 255, 255, 0.15),
    5px 3px 5px rgba(0, 0, 0, 0.1);
}

.keycap:active .letter {
  transform: translateY(1px);
}

/* 尊重减弱动效偏好：关闭按压位移，保留键帽外观 */
@media (prefers-reduced-motion: reduce) {
  .keycap, .keycap .letter, .keycap::before {
    transition: none;
  }
  .keycap:active {
    transform: none;
  }
}

.btn-light { background: var(--color-bg-main); color: var(--color-primary); }
.btn-light:hover { box-shadow: var(--shadow-md); }

/* ---------- 6. 头部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(253, 248, 243, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--t-normal), background var(--t-normal), border-color var(--t-normal);
}
.site-header.scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  transition: opacity var(--t-fast);
}
.brand:hover { opacity: .85; }
.brand-logo {
  height: 36px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
  /* 轻微融入暖米色 header 背景 */
  box-shadow: 0 1px 4px rgba(120, 80, 40, .12);
}

.site-nav { display: flex; gap: 26px; }
.site-nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--color-text-dark);
  position: relative;
  padding: 4px 0;
  transition: color var(--t-fast);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 1px;
  transition: width var(--t-normal);
}
.site-nav a:hover::after,
.site-nav a.active::after { width: 100%; }
.site-nav a:hover { color: var(--color-primary); }
.site-nav a.active { color: var(--color-primary); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform var(--t-normal), opacity var(--t-fast);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. Hero ---------- */
.hero {
  min-height: 78vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  color: #fff;
  position: relative;
}
.hero-inner { padding: 60px 0; max-width: 720px; }
.hero-eyebrow {
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: .8rem;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp .6s var(--t-slow) .2s forwards;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeUp .7s var(--t-slow) .35s forwards;
}
.hero-sub {
  margin: 18px 0 28px;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp .6s var(--t-slow) .5s forwards;
  /* animation 控制透明度，这里用 opacity 覆盖 .95 */
  animation-fill-mode: forwards;
}
.hero-sub { opacity: .95; }
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp .6s var(--t-slow) .65s forwards;
}

@keyframes heroFadeUp {
  to { opacity: 1; transform: none; }
}

/* ---------- 8. 通用区块 ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--color-bg-card); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}
.section-kicker {
  display: inline-block;
  color: var(--color-secondary);
  font-weight: 600;
  letter-spacing: 2px;
  font-size: .8rem;
  margin-bottom: 10px;
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-lead { margin-top: 12px; color: var(--color-text-muted); }

/* ---------- 9. 网格与卡片 ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--t-normal), box-shadow var(--t-normal);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-normal);
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(200, 149, 108, .08),
    transparent 40%
  );
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.card:hover::before { opacity: 1; }

.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-card);
  position: relative;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--t-slow);
}
.card:hover .card-media img { transform: scale(1.06); }

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-body h3 { font-size: 1.2rem; }
.card-desc { color: var(--color-text-muted); font-size: .92rem; }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--color-bg-card);
  color: var(--color-primary);
  transition: transform var(--t-spring), background var(--t-normal);
}
.card:hover .card-icon { transform: scale(1.08) rotate(-3deg); }
.card-icon svg { width: 24px; height: 24px; }

.card-link {
  margin-top: auto;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--t-fast), color var(--t-fast);
}
.card-link:hover { gap: 8px; color: var(--color-secondary); }

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.feature-list li {
  position: relative;
  padding-left: 20px;
  font-size: .9rem;
  color: var(--color-text-muted);
}
.feature-list li::before {
  content: "\2615";
  position: absolute;
  left: 0;
  font-size: .7rem;
  top: 3px;
}

/* ---------- 10. 课程卡片 ---------- */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-secondary);
  backdrop-filter: blur(4px);
}
.badge-\5165\95E8 { background: #8aa37b; }
.badge-\8FDB\9636 { background: var(--color-accent); }
.badge-\4E13\4E1A { background: var(--color-primary); }
.badge-\8BA4\8BC1 { background: #b5651d; }

.course-meta { font-size: .82rem; color: var(--color-text-muted); }
.course-cert { font-size: .85rem; color: var(--color-primary); font-weight: 600; }
.course-price { font-size: .95rem; color: var(--color-secondary); font-weight: 700; margin-top: auto; }

/* ---------- 11. 案例卡片 ---------- */
.case-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { font-size: .72rem; padding: 3px 10px; border-radius: var(--radius-full); font-weight: 600; }
.tag-type { background: var(--color-bg-card); color: var(--color-primary); }
.tag-service { background: rgba(200, 149, 108, .18); color: #9a6a40; }
.case-customer { font-size: .8rem; color: var(--color-text-muted); }

/* ---------- 12. 时间轴 ---------- */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--color-accent), rgba(212, 165, 116, .2));
}
.timeline-item {
  position: relative;
  padding: 0 0 26px 22px;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-bg-main);
  box-shadow: 0 0 0 2px var(--color-accent);
  transition: transform var(--t-spring);
}
.timeline-item:hover .timeline-dot { transform: scale(1.25); }
.timeline-dot[data-type="certification"] { background: #b5651d; }
.timeline-dot[data-type="center"] { background: var(--color-secondary); }
.timeline-date { font-size: .8rem; font-weight: 600; color: var(--color-secondary); letter-spacing: 1px; }
.timeline-event { color: var(--color-text-dark); }

/* ---------- 13. 分栏布局 ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: transform var(--t-slow);
}
.split-media:hover img { transform: scale(1.02); }

.split-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.split-gallery img:nth-child(3) { grid-column: 1 / -1; }
.split-text h2 { margin-bottom: 14px; }
.split-text p { color: var(--color-text-muted); margin-bottom: 12px; }

/* ---------- 14. CTA ---------- */
.cta { background: var(--color-bg-dark); color: #fff; position: relative; overflow: hidden; }
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(200, 149, 108, .12), transparent 60%);
  pointer-events: none;
}
.cta-inner {
  text-align: center;
  padding: 64px 20px;
  position: relative;
}
.cta-inner h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.cta-inner p { opacity: .85; margin: 12px 0 24px; }

/* ---------- 15. 页脚 ---------- */
.site-footer { background: var(--color-primary); color: #f3e9e2; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 32px;
  padding: 54px 20px 30px;
}
.footer-brand .brand-logo.footer-logo { height: 42px; border-radius: 6px; }
.footer-slogan { font-family: "Noto Serif SC", serif; font-size: 1.1rem; margin: 10px 0 6px; color: #fff; }
.footer-culture { font-size: .85rem; opacity: .8; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: .98rem; }
.footer-col a, .footer-col p { display: block; font-size: .88rem; opacity: .85; margin-bottom: 8px; transition: opacity var(--t-fast), color var(--t-fast); }
.footer-col a:hover { opacity: 1; color: var(--color-accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .8rem;
  opacity: .7;
}

/* ---------- 16. 页面 Hero ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary), #6b4036);
  color: #fff;
  padding: 90px 0 70px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--color-bg-main), transparent);
  pointer-events: none;
}
.page-hero .section-kicker { color: var(--color-accent); }
.page-title { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-lead { opacity: .9; margin-top: 10px; }

/* ---------- 17. 服务详情 ---------- */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.service-detail:last-child { border-bottom: 0; }
.service-detail:nth-child(even) .service-detail-media { order: 2; }
.service-detail-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: transform var(--t-slow);
}
.service-detail-media:hover img { transform: scale(1.02); }
.service-detail-text h2 { margin: 10px 0; }
.service-short { color: var(--color-secondary); font-weight: 600; margin-bottom: 10px; }
.service-detail-text .card-icon { margin-bottom: 8px; }

/* ---------- 18. 资质卡片 ---------- */
.qual-card { padding: 26px; text-align: center; }
.qual-card h3 { margin-bottom: 8px; }
.qual-card p { color: var(--color-text-muted); font-size: .9rem; }

/* ---------- 19. 团队卡片 ---------- */
.team-card { align-items: center; text-align: center; padding: 24px; }
.team-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--color-bg-card);
  border: 3px solid var(--color-bg-card);
  transition: border-color var(--t-normal);
}
.team-card:hover .team-avatar { border-color: var(--color-accent); }
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-role { color: var(--color-secondary); font-weight: 600; font-size: .85rem; margin-bottom: 8px; }

/* ---------- 20. 案例筛选 ---------- */
.case-filter {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-btn {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-accent);
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-normal);
  -webkit-tap-highlight-color: transparent;
}
.filter-btn:hover { background: rgba(200, 149, 108, .1); }
.filter-btn:active { transform: scale(0.97); }
.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.case-card.hide { display: none; }
/* 筛选动画 */
.case-card.filtering-out {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.case-card.filtering-in {
  animation: filterIn var(--t-slow) forwards;
}
@keyframes filterIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* ---------- 21. 联系表单 ---------- */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 16px;
}
.contact-list li { display: flex; gap: 12px; align-items: baseline; }
.contact-list span { min-width: 64px; color: var(--color-secondary); font-weight: 600; }
.contact-note { font-size: .82rem; color: var(--color-text-muted); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-primary);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1.5px solid rgba(74, 44, 42, .18);
  border-radius: var(--radius-sm);
  background: var(--color-bg-main);
  color: var(--color-text-dark);
  transition: border-color var(--t-normal), box-shadow var(--t-normal), background var(--t-normal);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-focus);
  background: #fff;
}
/* 验证状态 */
.contact-form input[aria-invalid="true"],
.contact-form textarea[aria-invalid="true"] {
  border-color: var(--color-error);
  background: rgba(192, 86, 74, .04);
}
.contact-form input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(192, 86, 74, .25);
}
.field-error {
  font-size: .78rem;
  color: var(--color-error);
  font-weight: 500;
  display: none;
}
.field-error.show { display: block; animation: shakeIn .3s ease; }
@keyframes shakeIn {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.form-success {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(90, 138, 94, .12);
  color: var(--color-success);
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
}
.form-success.show {
  display: block;
  animation: filterIn var(--t-slow) forwards;
}

/* ---------- 22. 错误页 ---------- */
.error-section { padding: 120px 0; }
.error-code {
  font-size: 5rem;
  color: var(--color-secondary);
  animation: floatY 3s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.error-msg { font-size: 1.2rem; color: var(--color-text-muted); margin: 12px 0 26px; }

/* ---------- 23. 滚动入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s var(--t-slow), transform .6s var(--t-slow);
}
.reveal.in { opacity: 1; transform: none; }

/* 多方向动画变体 */
.reveal-left { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-scale { transform: scale(0.94); }
.reveal-blur { filter: blur(8px); }
.reveal-left.in,
.reveal-right.in { transform: none; }
.reveal-scale.in { transform: none; }
.reveal-blur.in { filter: blur(0); transition: opacity .6s var(--t-slow), filter .6s var(--t-slow); }

/* stagger 子项延迟 */
.stagger > * { transition-delay: 0s; }
.stagger.in > *:nth-child(1) { transition-delay: .05s; }
.stagger.in > *:nth-child(2) { transition-delay: .12s; }
.stagger.in > *:nth-child(3) { transition-delay: .19s; }
.stagger.in > *:nth-child(4) { transition-delay: .26s; }
.stagger.in > *:nth-child(5) { transition-delay: .33s; }
.stagger.in > *:nth-child(6) { transition-delay: .40s; }
.stagger.in > *:nth-child(7) { transition-delay: .47s; }
.stagger.in > *:nth-child(8) { transition-delay: .54s; }
.stagger.in > *:nth-child(9) { transition-delay: .61s; }

/* 图片懒加载渐显 */
img.lazy-img {
  opacity: 0;
  transition: opacity .5s var(--t-slow);
}
img.lazy-img.loaded { opacity: 1; }

/* ---------- 24. 回到顶部按钮 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity var(--t-normal), visibility var(--t-normal), transform var(--t-spring), background var(--t-normal);
  -webkit-tap-highlight-color: transparent;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-to-top:hover { background: var(--color-primary-dark); transform: translateY(-2px); }
.back-to-top:active { transform: scale(0.92); }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- 25. 移动端导航遮罩 ---------- */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 15, 14, .4);
  z-index: calc(var(--z-header) - 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-normal), visibility var(--t-normal);
  backdrop-filter: blur(2px);
}
.nav-backdrop.show { opacity: 1; visibility: visible; }

/* ============================================================
   26. 响应式断点
   ============================================================ */

/* 超大屏 */
@media (min-width: 1400px) {
  :root { --maxw: 1200px; }
  .section { padding: 88px 0; }
  .grid { gap: 28px; }
}

/* 平板 */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .split,
  .service-detail { grid-template-columns: 1fr; gap: 24px; }
  .service-detail:nth-child(even) .service-detail-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .section { padding: 64px 0; }
  .hero { min-height: 60vh; }
  .hero-inner { padding: 48px 0; }
}

/* 小屏 */
@media (max-width: 640px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 80vw);
    flex-direction: column;
    gap: 0;
    background: var(--color-bg-main);
    padding-top: var(--header-h);
    transform: translateX(100%);
    transition: transform var(--t-slow);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-header);
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav a {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    font-size: 1rem;
  }
  .site-nav a::after { display: none; }
  .site-nav a.active { background: rgba(200, 149, 108, .08); }

  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
  .section-head { margin-bottom: 32px; }
  .container { padding: 0 16px; }

  .hero { min-height: 56vh; }
  .hero-inner { padding: 36px 0; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  .cta-inner { padding: 48px 16px; }
  .footer-grid { padding: 40px 16px 24px; }

  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }

  .contact-form { padding: 18px; }
}

/* 超小屏 */
@media (max-width: 380px) {
  .brand-text em { display: none; }
  .section-title { font-size: 1.4rem; }
  .hero-title { font-size: 1.7rem; }
}

/* 横屏手机 */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: 100vh; }
}

/* ============================================================
   27. 用户偏好设置
   ============================================================ */

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .hero-eyebrow,
  .hero-title,
  .hero-sub,
  .hero-actions { opacity: 1; transform: none; }
}

/* 高对比度 */
@media (prefers-contrast: high) {
  :root {
    --color-text-muted: #5a3a30;
    --color-border: rgba(74, 44, 42, .25);
    --shadow-sm: 0 2px 8px rgba(45, 24, 16, .2);
  }
  .card { border: 1px solid var(--color-border); }
}

/* 触摸设备：禁用悬停依赖的交互 */
@media (hover: none) {
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
  .card:hover::before { opacity: 0; }
  .btn:hover { transform: none; }
  .split-media:hover img { transform: none; }
  .service-detail-media:hover img { transform: none; }
}

/* ============================================================
   后端接入相关样式：登录态 / 认证卡片 / 表单提示 / 短信验证码
   ============================================================ */

/* 头部登录态 */
.nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
}
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .9rem;
}
.nav-username { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-avatar {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--color-secondary);
  color: #fff;
}
.nav-avatar-text {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}
.nav-logout {
  color: var(--color-text-muted);
  font-size: .82rem;
}
.nav-logout:hover { color: var(--color-error); }

@media (max-width: 900px) {
  .nav-auth { margin-left: 0; padding-left: 0; border-left: none; }
}

/* ===== 登录链接 hover 边框动画（基于 Uiverse TISEPSE 思路，作用域限定） =====
   设计：默认态 —— 透明背景 + 深色边框 + 深色字（一眼可读）
         hover 态 —— 两条 L 形线（::before 顶横、::after 右竖）从 0 拉伸到全长，
                    沿"上→右→下→左"顺序勾勒出完整边框，纯动画不遮挡文字 */
.login-fx {
  position: relative;
  display: inline-block;
  padding: 8px 18px;
  border: 2px solid #212121;          /* 深色边框常驻，便于看清"登录"二字 */
  color: #212121;                     /* 深色文字，浅底也清晰 */
  background: transparent;            /* 默认无填充，避免遮字 */
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.2s ease;
}

.login-fx::before,
.login-fx::after {
  content: '';
  position: absolute;
  background: #212121;                /* 与边框同色，看上去像边框延伸 */
  transition: transform 0.18s ease-in-out;
}

/* 顶边：横向，从左往右画 */
.login-fx::before {
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: 2px;
  transform: scaleX(0);
  transform-origin: left center;
}

/* 右边：纵向，从上往下画（延迟 0.18s 形成顺序） */
.login-fx::after {
  top: -2px;
  right: -2px;
  width: 2px;
  height: calc(100% + 4px);
  transform: scaleY(0);
  transform-origin: top center;
  transition-delay: 0.18s;
}

.login-fx:hover::before {
  transform: scaleX(1);
  transition-delay: 0s;
}

.login-fx:hover::after {
  transform: scaleY(1);
  transition-delay: 0.18s;
}

.login-fx span {
  position: relative;
  z-index: 2;                         /* 文字永远浮在动画线之上 */
}

/* 减弱动效偏好：保留静态边框，关掉动画过渡 */
@media (prefers-reduced-motion: reduce) {
  .login-fx::before, .login-fx::after { transition: none; }
  .login-fx:hover::before, .login-fx:hover::after { transform: none; }
}

/* 认证表单卡片 */
.auth-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.auth-card .contact-form label { display: block; margin-bottom: 16px; font-weight: 600; color: var(--color-text-dark); }
.auth-card .contact-form input { width: 100%; }

/* 表单提示条 */
.form-hint {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: .9rem;
  border: 1px solid transparent;
}
.form-hint-success { background: rgba(90, 138, 94, .12); color: var(--color-success); border-color: rgba(90, 138, 94, .3); }
.form-hint-error   { background: rgba(192, 86, 74, .12); color: var(--color-error);   border-color: rgba(192, 86, 74, .3); }
.form-hint-warn    { background: rgba(200, 149, 108, .15); color: #8a5a2a;            border-color: rgba(200, 149, 108, .4); }

/* 短信验证码输入行 */
.sms-row { display: flex; gap: 10px; align-items: stretch; }
.sms-row input { flex: 1; }
.btn-sms {
  flex-shrink: 0;
  padding: 0 16px;
  white-space: nowrap;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: .85rem;
  transition: all var(--t-fast);
}
.btn-sms:hover:not(:disabled) { background: var(--color-primary); color: #fff; }
.btn-sms:disabled { opacity: .6; cursor: not-allowed; }

/* 课程报名按钮 */
.course-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.course-actions .btn { flex: 1; min-width: 120px; }

/* 订单 / 我的页面 */
.order-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.order-card .order-meta { flex: 1; min-width: 200px; }
.order-card .order-no { color: var(--color-text-muted); font-size: .82rem; }
.order-card .order-title { font-weight: 600; color: var(--color-primary); margin: 4px 0; }
.order-card .order-price { color: var(--color-error); font-weight: 700; }
.order-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .76rem;
  font-weight: 600;
}
.order-status-pending { background: rgba(200, 149, 108, .2); color: #8a5a2a; }
.order-status-paid    { background: rgba(90, 138, 94, .15); color: var(--color-success); }
.order-status-cancel  { background: rgba(122, 92, 82, .15); color: var(--color-text-muted); }
.order-status-done    { background: rgba(74, 44, 42, .1); color: var(--color-primary); }

/* Toast 提示（联系表单 AJAX 反馈） */
.toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--color-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: var(--z-toast);
  opacity: 0;
  transition: all var(--t-normal);
  pointer-events: none;
  font-size: .9rem;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: var(--color-error); }
.toast.toast-success { background: var(--color-success); }

/* ============================================================
   微信二维码弹出（联系页）
   ============================================================ */
.contact-wechat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.wechat-label { min-width: 64px; color: var(--color-secondary); font-weight: 600; }
.wechat-qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #07c160;
  color: #fff;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.wechat-qr-btn:hover {
  background: #06ad56;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(7, 193, 96, .35);
}
.wechat-qr-btn:active { transform: scale(0.95); }
.wechat-qr-btn img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.9);
}

/* 二维码弹出层：默认隐藏，hover 或 .qr-visible 时显示 */
.wechat-qr-popup {
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%) scale(.9);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(45, 24, 16, .22);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--t-normal);
  z-index: var(--z-overlay);
  width: 200px;
  text-align: center;
}
.contact-wechat:hover .wechat-qr-popup,
.contact-wechat.qr-visible .wechat-qr-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.wechat-qr-popup img {
  width: 168px;
  height: 168px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto 8px;
  border: 1px solid rgba(74, 44, 42, .08);
}
.wechat-qr-popup p {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* 小屏：弹出层改为下方显示 */
@media (max-width: 640px) {
  .wechat-qr-popup {
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) scale(.9);
  }
  .contact-wechat:hover .wechat-qr-popup,
  .contact-wechat.qr-visible .wechat-qr-popup {
    transform: translateX(-50%) scale(1);
  }
}

