/* =========================================
   SafeW 共享样式表 (style.css)
   ========================================= */

/* --- 设计变量 --- */
:root {
  /* 配色 */
  --color-dark-bg: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;

  /* 圆角与阴影 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);

  /* 间距与布局 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --header-height: 64px;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* --- 基础重置与排版 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* --- 容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-brand);
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-brand);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  height: 48px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
  transform: translateY(-1px);
}

/* --- 区块通用 --- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-dark {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
}

.section-header {
  margin-bottom: 32px;
}

.breadcrumb {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--color-brand);
}

.section-dark .breadcrumb {
  color: var(--color-accent);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
  color: var(--color-text);
}

.section-dark h1 {
  color: var(--color-paper);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 24px;
  color: var(--color-text);
}

.section-dark h2 {
  color: var(--color-paper);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--color-text);
}

.section-dark h3 {
  color: var(--color-paper);
}

.text-intro {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 65ch;
  margin-bottom: 24px;
}

.highlight {
  color: var(--color-brand);
}

.section-dark .highlight {
  color: var(--color-accent);
}

/* --- 卡片 --- */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  border-radius: var(--radius-card);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 12px 32px -12px rgba(25, 21, 35, 0.4);
}

/* --- 表格 --- */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid rgba(25, 21, 35, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

th {
  font-weight: 700;
  background-color: rgba(25, 21, 35, 0.03);
}

td:first-child {
  font-weight: 600;
  color: var(--color-brand);
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  margin-bottom: 16px;
}

.faq-item summary {
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--color-brand);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding-bottom: 16px;
  line-height: 1.7;
  color: var(--color-text);
}

/* --- 新闻卡片 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  background-color: var(--color-paper);
  border: 1px solid rgba(25, 21, 35, 0.1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-date {
  font-size: 0.85rem;
  color: var(--color-brand);
  font-weight: 600;
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.news-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* --- 页脚 --- */
.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  padding: 48px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 1;
  color: var(--color-accent);
}

.copyright {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- SVG 动效 --- */
.svg-container {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 几何旋转拼合 */
.geo-shape {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateShape 12s linear infinite;
}

.geo-shape-alt {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateShapeAlt 15s linear infinite reverse;
}

@keyframes rotateShape {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotateShapeAlt {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

/* 气泡浮现与漂浮 */
.bubble {
  animation: floatBubble 6s ease-in-out infinite;
}

.bubble-delay {
  animation-delay: 2s;
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-10px); opacity: 1; }
}

/* 描边流动 */
.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease-in-out infinite;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; opacity: 0; }
  20% { opacity: 1; }
  80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* 呼吸效果 */
.breathe {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--color-paper);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    box-shadow: var(--card-shadow);
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
