/* =========================================
   Global Variables & Reset
   ========================================= */
:root {
  /* Color Palette */
  --color-deep: #271231;       /* 深色面 */
  --color-paper: #F6F3F7;      /* 浅色纸面 */
  --color-body: #1F1523;       /* 正文色 */
  --color-brand: #9E13DD;      /* 品牌色（纸面上） */
  --color-accent: #ED6EC0;     /* 强调色（按钮、深色面上） */

  /* Design Tokens */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  
  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --lh-tight: 1.1;
  --lh-normal: 1.75;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* =========================================
   Layout Utilities
   ========================================= */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.text-center {
  text-align: center;
}

/* =========================================
   Typography
   ========================================= */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  color: var(--color-body);
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 2rem;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  max-width: 38em;
}

.subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.brand-text {
  color: var(--color-brand);
}

.deep-text .brand-text {
  color: var(--color-accent);
}

/* =========================================
   Components: Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 52px;
  padding: 0 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-deep);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-body);
  color: var(--color-body);
}

.btn-outline:hover {
  background-color: rgba(31, 21, 35, 0.05);
  transform: translateY(-2px);
}

.btn-deep {
  background-color: var(--color-accent);
  color: var(--color-deep);
}

.btn-deep:hover {
  transform: translateY(-2px);
}

/* =========================================
   Components: Cards
   ========================================= */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.35);
  transform: translateY(-4px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--gap);
}

/* =========================================
   Components: Tables
   ========================================= */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  border: 1px solid rgba(31, 21, 35, 0.1);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}

th {
  background-color: rgba(158, 19, 221, 0.05);
  font-weight: 700;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

/* =========================================
   Components: FAQ
   ========================================= */
details {
  border: 1px solid rgba(31, 21, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  background-color: var(--color-paper);
  transition: background-color 0.2s ease;
}

details[open] {
  background-color: rgba(158, 19, 221, 0.03);
}

summary {
  padding: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 3rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-brand);
}

details[open] summary::after {
  content: "-";
}

details p {
  padding: 0 1.25rem 1.25rem;
  margin-bottom: 0;
  color: var(--color-body);
}

/* =========================================
   Components: Header & Footer
   ========================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(246, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.05);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--color-body);
  position: relative;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-brand);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-brand);
}

.footer {
  background-color: var(--color-deep);
  color: var(--color-paper);
  padding: 4rem 0;
}

.footer a {
  color: var(--color-accent);
}

.footer a:hover {
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}

.footer-col h4 {
  color: var(--color-paper);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: rgba(246, 243, 247, 0.7);
}

.footer-col ul li a:hover {
  color: var(--color-paper);
}

/* =========================================
   SVG Animation Keyframes
   ========================================= */
/* Draw Lines */
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.animate-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* Twinkle Stars */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.star-twinkle-1 {
  animation: twinkle 3s ease-in-out infinite;
  transform-origin: center;
}

.star-twinkle-2 {
  animation: twinkle 4s ease-in-out infinite 1s;
  transform-origin: center;
}

.star-twinkle-3 {
  animation: twinkle 2.5s ease-in-out infinite 0.5s;
  transform-origin: center;
}

/* Floating Interface Elements */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.float-anim {
  animation: floatSoft 6s ease-in-out infinite;
  transform-origin: center;
}

/* 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;
  }
  .animate-draw {
    stroke-dashoffset: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 1rem;
  }
  .nav-links {
    gap: 1rem;
  }
  .btn {
    width: 100%;
  }
}
