/* ===========================
   Global Design Variables & Reset
   =========================== */
:root {
  --bg-primary: #FAFAF8;
  --bg-secondary: #F2F0EC;
  --bg-card: #FFFFFF;
  --text-main: #1C1C1E;
  --text-secondary: #6E6E73;
  --accent-gradient: linear-gradient(135deg, #FF6B6B, #FF8E53);
  --accent-color: #FF6B6B;
  --border-light: rgba(0, 0, 0, 0.06);
  
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  
  --spacing-unit: 8px;
  --container-width: 1200px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover {
  opacity: 0.85;
}

ul, ol {
  list-style: none;
}

img, svg {
  max-width: 100%;
  display: block;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit));
}

p {
  color: var(--text-secondary);
  margin-bottom: 1em;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  max-width: 65ch;
}

/* ===========================
   Layout Components
   =========================== */
.container {
  width: min(92%, var(--container-width));
  margin-inline: auto;
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
  position: relative;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85em 2em;
  border-radius: 99px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  border: none;
}
.btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}
.btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.35);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--border-light);
  color: var(--text-main);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 0;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo img {
  height: 32px;
  width: auto;
}

.nav ul {
  display: flex;
  gap: 1.5rem;
}
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}
.nav a[aria-current="page"],
.nav a:hover {
  color: var(--text-main);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.footer__col h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.footer__col ul li {
  margin-bottom: 0.6rem;
}
.footer__bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}
th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}
th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-main);
}
td:last-child {
  text-align: right;
  white-space: nowrap;
}

/* FAQ / Details */
details {
  border-bottom: 1px solid var(--border-light);
}
summary {
  padding: 1.25rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 300;
  transition: transform 0.2s ease;
}
details[open] summary::after {
  transform: rotate(45deg);
}
details p {
  padding-bottom: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Timeline */
.timeline {
  border-left: 2px solid var(--border-light);
  padding-left: 2rem;
  position: relative;
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 0.35em;
  width: 10px;
  height: 10px;
  background: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}
.timeline-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  display: block;
}

/* Blog Cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.blog-card .card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.blog-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.blog-actions {
  margin-top: auto;
  padding-top: 1rem;
}
.link-btn {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.link-btn::after {
  content: "→";
  transition: transform 0.2s ease;
}
.link-btn:hover::after {
  transform: translateX(3px);
}

/* Related Links */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.related-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border-light);
}
.related-item strong {
  font-size: 1rem;
  color: var(--text-main);
}
.related-item span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* SVG Animations */
.svg-deco {
  width: 100%;
  height: auto;
  overflow: visible;
}
.starry-point {
  animation: twinkle 4s infinite alternate ease-in-out;
}
.starry-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 8s infinite linear;
  transform-origin: center;
}
@keyframes twinkle {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@media (max-width: 480px) {
  .nav {
    display: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 移动端窄屏防溢出优化 */
@media (max-width: 480px) {
  .container {
    width: 100%;
    padding-inline: 0;
  }
  .grid-2, .feature-grid, .blog-grid, .grid-links {
    grid-template-columns: 1fr;
  }
  .svg-deco, .starry-visual {
    max-width: 100%;
    height: auto;
  }
}

/* ===========================
   Specific Pages / Sections
   =========================== */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 80% 20%, rgba(255, 142, 83, 0.15), transparent 60%),
              radial-gradient(circle at 10% 90%, rgba(255, 107, 107, 0.1), transparent 50%);
}

.download-section {
  background: var(--bg-secondary);
}

.icon-feature {
  width: 40px;
  height: 40px;
  color: var(--accent-color);
  margin-bottom: 1rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

/* Utilities */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 1rem; }
.grid-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
