/* ============================================
   base.css — 设计系统：颜色、字体、间距、reset
   ============================================ */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
  /* 品牌主色 — 深绿+金（台球主题） */
  --color-primary: #0F5132;
  --color-primary-dark: #0A3D24;
  --color-primary-light: #1A7A4F;
  --color-primary-bg: #E8F1ED;

  --color-gold: #C9A961;
  --color-gold-dark: #A88A45;
  --color-gold-light: #E5D4A3;
  --color-gold-bg: #FAF6EC;

  /* 台球彩色点缀 */
  --color-ball-red: #E63946;
  --color-ball-blue: #2A9D8F;
  --color-ball-purple: #7B2CBF;
  --color-ball-orange: #F4A261;
  --color-ball-yellow: #F4C430;
  --color-ball-green: #06D6A0;

  /* 中性色 */
  --color-ink: #0A1F1C;
  --color-ink-2: #2A3A37;
  --color-text: #1F2A28;
  --color-text-secondary: #5A6B68;
  --color-text-muted: #8B9996;
  --color-border: #E4E8E3;
  --color-border-strong: #C9D1CB;

  --color-bg: #FFFFFF;
  --color-bg-soft: #F8F6F1;
  --color-bg-warm: #F1EDE4;

  /* 语义色 */
  --color-success: #06D6A0;
  --color-warning: #F4A261;
  --color-danger: #E63946;

  /* 字体 */
  --font-cn: "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-en: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* 字号（rem 基准 16px） */
  --fs-xs: 0.75rem;     /* 12px */
  --fs-sm: 0.875rem;    /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md: 1.125rem;    /* 18px */
  --fs-lg: 1.25rem;     /* 20px */
  --fs-xl: 1.5rem;      /* 24px */
  --fs-2xl: 1.875rem;   /* 30px */
  --fs-3xl: 2.25rem;    /* 36px */
  --fs-4xl: 3rem;       /* 48px */
  --fs-5xl: 3.75rem;    /* 60px */
  --fs-6xl: 4.5rem;     /* 72px */

  /* 行高 */
  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;

  /* 字重 */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;

  /* 间距 */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 81, 50, 0.06), 0 1px 3px rgba(15, 81, 50, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 81, 50, 0.08), 0 2px 4px rgba(15, 81, 50, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 81, 50, 0.12), 0 4px 8px rgba(15, 81, 50, 0.06);
  --shadow-xl: 0 24px 48px rgba(15, 81, 50, 0.16), 0 8px 16px rgba(15, 81, 50, 0.08);
  --shadow-gold: 0 8px 24px rgba(201, 169, 97, 0.25);

  /* 过渡 */
  --t-fast: 0.15s ease;
  --t-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局 */
  --container-max: 1240px;
  --container-narrow: 920px;
  --container-wide: 1440px;
  --nav-height: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-cn), var(--font-en);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-ink);
}

p {
  line-height: var(--lh-relaxed);
}

::selection {
  background-color: var(--color-gold);
  color: var(--color-ink);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section {
  padding: var(--sp-20) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--sp-12) 0;
  }
  .container,
  .container-narrow,
  .container-wide {
    padding: 0 var(--sp-5);
  }
}

/* ---------- Typography utilities ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background-color: var(--color-gold);
}

.eyebrow-gold {
  color: var(--color-gold-dark);
}

.heading-1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-black);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.heading-2 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.heading-3 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.heading-4 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-gold {
  color: var(--color-gold-dark);
}

.text-center {
  text-align: center;
}

.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .heading-1 { font-size: var(--fs-3xl); }
  .heading-2 { font-size: var(--fs-2xl); }
  .heading-3 { font-size: var(--fs-xl); }
  .heading-4 { font-size: var(--fs-lg); }
  .lead { font-size: var(--fs-base); }
}

/* ---------- A11y ---------- */
.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;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Animation utilities ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-on-scroll {
  opacity: 0;
  transition: opacity var(--t-slow), transform var(--t-slow);
  transform: translateY(20px);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive text safety ---------- */
/* 邮箱、电话等长串在小屏可断行，避免联系卡溢出视口 */
.contact-info-value,
.contact-info-label {
  overflow-wrap: anywhere;
}