/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-accent: #ec4899;
  --color-accent-light: #f472b6;
  --color-bg-deep: #0f172a;
  --color-bg-surface: rgba(255, 255, 255, 0.06);
  --color-bg-glass: rgba(255, 255, 255, 0.12);
  --color-text-main: #f8fafc;
  --color-text-muted: #cbd5e1;
  --color-border-subtle: rgba(255, 255, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.25);
  --font-base: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --space-unit: 1rem;
  --container-max: 1120px;
  --header-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-base);
  line-height: 1.7;
  color: var(--color-text-main);
  background-color: var(--color-bg-deep);
  background-image: radial-gradient(circle at 20% 10%, rgba(124, 58, 237, 0.15), transparent 40%),
                    radial-gradient(circle at 80% 30%, rgba(236, 72, 153, 0.12), transparent 50%);
  min-height: 100vh;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ==================== 通用排版与布局 ==================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  text-wrap: balance;
  position: relative;
  padding-left: 1.25rem;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  bottom: 0.25em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
}

.text-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 768px) {
  .text-grid.two-col { grid-template-columns: repeat(2, 1fr); }
  .text-grid.three-col { grid-template-columns: repeat(3, 1fr); }
}

/* ==================== 页头与导航 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.nav-list {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
}

.nav-link {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--color-text-main);
}

.nav-link[aria-current="page"] {
  color: var(--color-accent-light);
  border-bottom-color: var(--color-accent);
}

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-wrap: balance;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
  background: var(--color-bg-glass);
  color: var(--color-text-main);
  border: 1px solid var(--color-border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 4px;
}

/* ==================== 卡片与玻璃拟态 ==================== */
.card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  min-width: 0;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.card:hover {
  background: var(--color-bg-glass);
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-4px);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--color-primary-light);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.card p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ==================== 表格样式 ==================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th, .data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

.data-table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--color-primary-light);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ==================== FAQ 组件 ==================== */
.faq-item {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--color-bg-surface);
}

.faq-summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-accent-light);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-item[open] {
  background: var(--color-bg-glass);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 1rem;
}

/* ==================== 最新文章卡片 ==================== */
.news-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
}

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-accent-light);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.news-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.news-card p {
  flex-grow: 1;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.news-card .btn {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ==================== 相关阅读列表 ==================== */
.related-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--color-border-subtle);
}

.related-list a {
  color: var(--color-primary-light);
  transition: color 0.2s;
}

.related-list a:hover {
  color: var(--color-accent-light);
}

.related-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: right;
  margin-left: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== 页脚 ==================== */
.site-footer {
  background: rgba(0, 0, 0, 0.25);
  padding: 3rem 0 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--color-border-subtle);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text-main);
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-primary-light);
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(203, 213, 225, 0.6);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-subtle);
}

/* ==================== SVG 动效系统 ==================== */
.svg-animated path,
.svg-animated circle {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.anim-ring {
  animation: drawRing 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-arc {
  animation: drawArc 8s ease-in-out infinite alternate;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.anim-pulse {
  animation: softPulse 4s ease-in-out infinite;
}

@keyframes drawRing {
  0%, 100% { stroke-dashoffset: 0.95; }
  50% { stroke-dashoffset: 0.6; }
}

@keyframes drawArc {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0.4; }
  100% { stroke-dashoffset: 1; }
}

@keyframes softPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .svg-animated path,
  .svg-animated circle {
    animation: none !important;
    stroke-dashoffset: 0;
  }
  .anim-ring, .anim-arc, .anim-pulse {
    animation: none !important;
  }
}

/* ==================== 辅助类 ==================== */
.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:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}

.glass-panel {
  background: var(--color-bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
}

/* 兜底：裁掉横向溢出 */
div.text-grid.two-col {
  overflow-x: clip;
}
