/* ==========================================================================
   欧八同学个人主页 · 核心设计规范与样式表 (styles.css)
   风格：米白底、深色字、砖红按钮；专业利落、不文艺、移动优先兼容PC
   ========================================================================== */

:root {
  /* 色彩变量体系 */
  --bg-page: #F7F5F0;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #FDFCFB;
  --bg-muted: #EFECE5;
  --bg-highlight: #FBF4F1;
  
  --text-main: #1F1E1C;
  --text-secondary: #524F48;
  /* 实测 4.5:1+：在 #F7F5F0/#EFECE5/#FBF4F1 底色上均达 WCAG AA（原 #78756E 仅 3.9） */
  --text-muted: #6E6B64;
  --text-disabled: #9D9991;
  
  --brand-terracotta: #963F2B;
  --brand-hover: #7E3321;
  --brand-active: #68291A;
  --brand-tint: rgba(150, 63, 43, 0.08);
  
  --border-subtle: #E4E0D6;
  --border-card: #ECE8DF;
  --border-focus: #963F2B;

  /* 阴影与圆角 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  
  /* 字体族 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* 布局尺寸 */
  --container-max-w: 780px;
  --header-height: 0px;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 布局容器：移动端全宽留白，PC 限宽居中 */
.site-container {
  width: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 640px) {
  .site-container {
    padding: 0 32px;
  }
}

/* ==========================================================================
   通用组件：按钮系统 (WCAG AAA/AA 对比度达标)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  min-height: 48px;
  padding: 12px 24px;
  box-sizing: border-box;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background-color: var(--brand-terracotta);
  color: #FFFFFF;
  border-color: var(--brand-terracotta);
  box-shadow: 0 2px 6px rgba(150, 63, 43, 0.18);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-primary:active {
  background-color: var(--brand-active);
  transform: translateY(1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background-color: var(--bg-muted);
  border-color: var(--border-focus);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  background-color: var(--bg-card);
  border-color: var(--text-secondary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 44px; /* 触控目标 ≥44×44px（PLAN 第 4 节） */
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-terracotta);
  outline-offset: 2px;
}

/* 实色砖红焦点圈在白字实底按钮上加白色内圈，保证任意底色下可见 */
.btn-primary:focus-visible {
  box-shadow: 0 2px 6px rgba(150, 63, 43, 0.18), inset 0 0 0 2px #FFFFFF;
}

/* ==========================================================================
   2.1 首屏（Hero 区块）：移动端自然流式间距，保证 375/390 首屏完整且
   系统放大字体时标题可自然换行（PLAN 2.1 / 第 8 节）
   ========================================================================== */
.section-hero {
  padding: 64px 0 40px;
  box-sizing: border-box;
  border-top: 1px solid var(--border-subtle); /* 2026-09-22 起首屏位于个人介绍之后，需与上一区块分隔 */
}

/* 矮屏幕（如 iPhone SE 667px 高度）收紧上下留白 */
@media (max-height: 700px) {
  .section-hero {
    padding: 44px 0 28px;
  }
}

.hero-inner {
  width: 100%;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.45rem, 6.4vw, 1.875rem); /* 移动端自适应 */
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 18px;
}

.hero-title .title-line {
  display: block;
}

.hero-subtitle {
  font-size: 0.9375rem; /* 15px-16px */
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 400;
}

.hero-subtitle .sub-line {
  display: block;
}

.hero-cta {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-hero {
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}

@media (min-width: 640px) {
  /* 原 min-height: 78vh + 垂直居中是「Hero 作为首屏」的整屏构图；
     2026-09-22 起个人介绍前置、Hero 退居第二屏，改自然流式，
     并收紧上内边距：保证 1440×900 首屏能完整容纳主按钮（含跨平台字体换行余量） */
  .section-hero {
    padding: 32px 0 56px;
  }
  
  .hero-title {
    font-size: 2.375rem; /* 38px */
    line-height: 1.35;
  }
  
  .hero-subtitle {
    font-size: 1.125rem; /* 18px */
  }
  
  .btn-hero {
    width: auto;
    padding: 14px 36px;
    font-size: 1.125rem;
  }
}

/* ==========================================================================
   通用区块标题
   ========================================================================== */
.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.375rem; /* 22px */
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ==========================================================================
   2.2 我的服务（Services，原「产品与服务」，2026-09-22 用户明确更改）
   ========================================================================== */
.section-services {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
}

.service-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.service-card:hover {
  border-color: #D6D0C4;
}

/* 突出咨询主卡片 */
.service-featured {
  border-color: rgba(150, 63, 43, 0.3);
  background: linear-gradient(180deg, #FFFFFF 0%, #FDFBF9 100%);
  position: relative;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background-color: var(--bg-muted);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.service-featured .card-tag {
  color: var(--brand-terracotta);
  background-color: var(--brand-tint);
}

.card-title {
  width: 100%;
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}

.card-price {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  color: var(--brand-terracotta);
}

.card-price .currency {
  font-size: 1rem;
  font-weight: 600;
  margin-right: 2px;
}

.card-price .amount {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
}

.card-price .unit {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.card-price-custom .custom-note {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-value {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  flex-grow: 1;
}

.card-boundary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background-color: var(--bg-muted);
  border-radius: var(--radius-xs);
  margin-bottom: 18px;
  line-height: 1.45;
}

.card-action {
  margin-top: auto;
}

/* ==========================================================================
   2.3 社会证明（Social Proof）
   ========================================================================== */
.section-proof {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
}

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

@media (min-width: 600px) {
  .proof-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.proof-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.quote-badge, .case-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-terracotta);
  background-color: var(--brand-tint);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
}

.quote-text {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 12px;
  flex-grow: 1;
}

.quote-author {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.case-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
}

.case-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  flex-grow: 1;
}

.case-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   2.4 关于我与联系方式（About & Contact）
   ========================================================================== */
.section-about {
  padding: 44px 0 32px;
  /* 页面首区块，不设 border-top（2026-09-22 前置调整） */
}

.about-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 640px) {
  .section-about {
    /* PC 收紧区块上下留白，为首屏完整 Hero 让位（移动端保持 44px 0 32px） */
    padding: 40px 0 24px;
  }

  .about-container {
    padding: 32px 32px;
  }
}

.about-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.avatar-wrap {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  background-color: var(--bg-muted);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profile-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 能力标签（2026-09-22 新增）：与 service-featured .card-tag 同族的砖红胶囊语言。
   单行放不下时自动换行（375px 下两行，3+2），不做横向滚动条、不竖排堆叠；
   位置在简介之后、核心方法论之前（2026-09-22 用户调整） */
.about-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.about-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand-terracotta); /* 在 brand-tint 底上实测 ≈7:1，AA 通过（同 card-tag） */
  background-color: var(--brand-tint);
  border: 1px solid rgba(150, 63, 43, 0.22);
  padding: 4px 10px;
  border-radius: var(--radius-xs); /* 与 card-tag 胶囊同圆角，形状一致性锁 */
}

.about-bio {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.methodology-card {
  background-color: var(--bg-muted);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

@media (min-width: 540px) {
  .methodology-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
}

.methodology-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-terracotta);
  text-transform: uppercase;
}

.methodology-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.channel-email:hover {
  border-color: var(--border-focus);
  background-color: #FFFFFF;
}

.channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-terracotta);
  flex-shrink: 0;
}

.channel-info {
  flex-grow: 1;
  min-width: 0; /* 允许在窄屏收缩，避免长邮箱把行内箭头顶出视口 */
}

.channel-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.channel-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
}

.channel-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* 窄屏（≤400px）：邮箱 14px + 卡片内距微收，保证 albertouoym@gmail.com
   在 375/360 宽度下单行放下，避免 overflow-wrap:anywhere 从单词中间截断；
   320px 等超窄屏物理放不下时仍折行（anywhere 兜底） */
@media (max-width: 400px) {
  .channel-card {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .channel-value {
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   页脚（Footer）
   ========================================================================== */
.site-footer {
  padding: 32px 0 48px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  margin-top: 24px;
}

.footer-inner p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   3. 弹窗模态框体系（Modals）
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1;
}

.modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 24px;
  box-sizing: border-box;
  animation: modal-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 44px; /* 触控热区 ≥44×44px，负边距保持原视觉位置 */
  height: 44px;
  margin: -10px -10px 0 0;
  padding: 0;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-muted);
}

/* 微信弹窗细节 */
.wechat-box {
  background-color: var(--bg-page);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.wechat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.wechat-code {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.08em; /* 拉开字符间距，避免连字符被误读为破折号 */
  color: var(--brand-terracotta);
  user-select: all;
  -webkit-user-select: all;
}

.copy-feedback {
  min-height: 24px;
  margin: 10px 0;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 600;
  color: #2E7D32;
  transition: all 0.2s ease;
}

.copy-feedback.copy-error {
  color: #C62828;
}

.modal-tips {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  background-color: var(--bg-muted);
  padding: 12px;
  border-radius: var(--radius-xs);
}

.modal-tips .tip-line {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.modal-tips strong {
  color: var(--text-main);
}

/* 星球弹窗细节 */
.planet-price-badge {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}

.planet-price-badge .price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand-terracotta);
}

.planet-price-badge .unit {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.planet-price-badge .status {
  font-size: 0.8125rem;
  background-color: var(--brand-tint);
  color: var(--brand-terracotta);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  margin-left: 8px;
}

.planet-qr-wrap {
  text-align: center;
  margin-bottom: 18px;
}

.planet-qr-img {
  max-width: 180px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  background-color: #FFFFFF;
}

.qr-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.planet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

/* ==========================================================================
   无障碍与辅助特性
   ========================================================================== */

/* 键盘焦点可见：实色砖红描边，不依赖新版浏览器的自动对比度修复 */
a:focus-visible,
.modal-close-btn:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-terracotta);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
