/* =========================================
   WPS Office 官网共享样式系统
   设计变量 / 基础排版 / 组件 / SVG 动效
   ========================================= */

:root {
  /* 色彩系统：午夜蓝 + 暖橙强调 */
  --clr-bg: #f4f6f9;
  --clr-surface: #ffffff;
  --clr-primary: #0f172a;
  --clr-accent: #f97316;
  --clr-accent-hover: #ea580c;
  --clr-text: #1e293b;
  --clr-text-muted: #64748b;
  --clr-border: #e2e8f0;
  --clr-focus-ring: rgba(249, 115, 22, 0.4);

  /* 排版与间距 */
  --font-head: "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --container-max: 1200px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 12px rgb(15 23 42 / 0.08);
  --shadow-hover: 0 10px 24px rgb(15 23 42 / 0.12);

  /* 响应式断点 */
  --bp-sm: 640px;
  --bp-md: 1024px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--clr-text);
  background: var(--clr-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 排版流 */
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--clr-primary); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.2; margin-bottom: var(--space-md); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: var(--space-md); position: relative; display: inline-block; }
h2::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 48px; height: 4px;
  background: var(--clr-accent); border-radius: 2px;
}
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin-bottom: var(--space-sm); }
p { margin-bottom: var(--space-sm); color: var(--clr-text); }
a { color: var(--clr-accent); text-decoration: none; transition: color 0.2s; }
a:hover, a:focus-visible { color: var(--clr-accent-hover); text-decoration: underline; }
img, svg { display: block; max-width: 100%; height: auto; }

/* 容器 */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-xl) 0; }
.section-alt { background: var(--clr-surface); border-top: 1px solid var(--clr-border); border-bottom: 1px solid var(--clr-border); }

/* 页头导航 */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--clr-border); height: 64px; display: flex; align-items: center;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.brand { display: flex; align-items: center; gap: var(--space-xs); font-family: var(--font-head); font-weight: 700; color: var(--clr-primary); }
.brand img { width: 36px; height: 36px; object-fit: contain; }
nav ul { list-style: none; display: flex; gap: var(--space-md); }
nav a { padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 500; color: var(--clr-text-muted); transition: all 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--clr-primary); background: rgba(15, 23, 42, 0.05); }
nav a[aria-current="page"] { font-weight: 600; border-bottom: 2px solid var(--clr-accent); }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s; border: none; font-size: 1rem;
}
.btn-primary { background: var(--clr-accent); color: #fff; box-shadow: 0 4px 12px rgb(249 115 22 / 0.3); }
.btn-primary:hover { background: var(--clr-accent-hover); transform: translateY(-2px); box-shadow: 0 8px 16px rgb(249 115 22 / 0.4); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--clr-primary); border: 1px solid var(--clr-border); }
.btn-secondary:hover { background: var(--clr-bg); border-color: var(--clr-text-muted); text-decoration: none; }

/* 网格与交错版式 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
.stagger-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg); }
.stagger-row.reverse { flex-direction: row-reverse; }
.content-side { flex: 1 1 400px; }
.visual-side { flex: 1 1 320px; display: flex; justify-content: center; align-items: center; }

/* 卡片 */
.card {
  background: var(--clr-surface); border: 1px solid var(--clr-border); border-radius: var(--radius-md);
  padding: var(--space-md); transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.card-meta { font-size: 0.85rem; color: var(--clr-text-muted); margin-bottom: var(--space-xs); }
.card-title { font-family: var(--font-head); font-weight: 600; color: var(--clr-primary); margin-bottom: var(--space-xs); }
.card-summary { font-size: 0.95rem; color: var(--clr-text); margin-bottom: var(--space-sm); }

/* 表格 */
.table-wrapper { overflow-x: auto; border: 1px solid var(--clr-border); border-radius: var(--radius-md); background: var(--clr-surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--clr-border); }
th { background: var(--clr-bg); font-weight: 600; color: var(--clr-primary); }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 500; }

/* FAQ details */
details { background: var(--clr-surface); border: 1px solid var(--clr-border); border-radius: var(--radius-md); margin-bottom: var(--space-sm); overflow: hidden; }
summary {
  padding: 16px; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 40px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-weight: 400; color: var(--clr-accent); transition: transform 0.2s;
}
details[open] summary::after { content: "-"; }
details p { padding: 0 16px 16px; color: var(--clr-text); }

/* 焦点可见性 */
:focus-visible { outline: 2px solid var(--clr-accent); outline-offset: 2px; }

/* SVG 动效基类 */
.svg-container { width: 100%; max-width: 600px; }
.draw-path { fill: none; stroke: var(--clr-primary); stroke-width: 2; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 6s ease-in-out infinite alternate; }
.flow-dot { fill: var(--clr-accent); animation: flowDot 8s linear infinite; }
.flow-line { stroke: var(--clr-accent); stroke-width: 1.5; opacity: 0.7; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 5s ease-in-out infinite alternate; }
.float-slow { animation: floatSlow 12s ease-in-out infinite alternate; }

@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes flowDot {
  0% { transform: translateX(0) translateY(0); opacity: 0.5; }
  50% { opacity: 1; }
  100% { transform: translateX(180px) translateY(-40px); opacity: 0.5; }
}
@keyframes floatSlow {
  0% { transform: translateY(0); }
  100% { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .draw-path { stroke-dashoffset: 0; }
  .flow-dot { opacity: 0.8; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .stagger-row, .stagger-row.reverse { flex-direction: column; }
  .visual-side { order: -1; margin-bottom: var(--space-md); }
  nav ul { gap: var(--space-xs); }
  nav a { padding: 6px 8px; font-size: 0.9rem; }
}
