/* =========================================================
   爱思助手 · i4fj.com.cn
   全站共享样式：设计变量 / 排版 / 页头页脚 / 组件 / SVG 动效
   ========================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  --paper: #f8f6f2;
  --paper-2: #f1ede8;
  --surface: #fffefc;
  --ink: #1e201d;
  --ink-2: #3b3e39;
  --muted: #6a6f6a;
  --faint: #959a94;
  --line: #e3ded7;
  --line-2: #cdc7bf;
  --accent: #4d6f66;
  --accent-deep: #33514b;
  --accent-soft: #e8efeb;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(30, 32, 29, .04), 0 3px 8px rgba(30, 32, 29, .05);
  --shadow-md: 0 8px 22px rgba(30, 32, 29, .08);
  --font-sans: "Yuanti SC", "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --maxw: 1120px;
  --gut: clamp(1.1rem, 4vw, 2.6rem);
  --fs-h1: clamp(2rem, 1.45rem + 2.2vw, 3.1rem);
  --fs-h2: clamp(1.45rem, 1.2rem + 1vw, 2rem);
  --fs-h3: clamp(1.05rem, .98rem + .45vw, 1.28rem);
  --fs-body: clamp(1rem, .96rem + .16vw, 1.06rem);
  --fs-sm: clamp(.9rem, .87rem + .1vw, .98rem);
  --fs-xs: .8rem;
  --lh: 1.9;
}

/* ---------- 2. 基础与排版 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh);
  letter-spacing: .01em;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
ul, ol { margin: 0; }
p { margin: 0; }
li, dd { overflow-wrap: anywhere; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .015em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: 1.3; letter-spacing: .005em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

a { color: var(--accent-deep); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fbfaf7;
  font-size: .9rem;
  transition: top .2s ease;
}
.skip-link:focus { top: .6rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* ---------- 3. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(248, 246, 242, .93);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(.7rem, 1.8vw, .95rem) var(--gut);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 9px;
  flex: none;
}

.brand-text { display: grid; gap: .1rem; line-height: 1.2; }
.brand-name { font-size: 1.02rem; font-weight: 600; letter-spacing: .03em; }
.brand-sub { font-size: .72rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.site-nav a:hover { background: var(--paper-2); color: var(--ink); }

.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  border-color: #d5e1db;
  color: var(--accent-deep);
  font-weight: 600;
}

/* ---------- 4. 首屏 ---------- */
.hero { padding: clamp(2rem, 5vw, 3.8rem) 0 clamp(1.6rem, 4vw, 2.8rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
}

.hero-grid > * { min-width: 0; }
.hero-copy { max-width: 44em; }
.hero-copy h1 { margin-top: .55rem; }

.hero-lead {
  margin-top: 1rem;
  max-width: 38em;
  color: var(--ink-2);
  font-size: clamp(1rem, .95rem + .3vw, 1.1rem);
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.5rem;
}

.fact-strip {
  list-style: none;
  margin: 1.7rem 0 0;
  padding: .8rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.fact-strip li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}

.fact-strip li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .75;
  flex: none;
}

.hero-art { display: grid; justify-items: center; gap: .7rem; }
.hero-art svg { width: 100%; max-width: 330px; height: auto; }

.art-note {
  max-width: 24em;
  font-size: var(--fs-xs);
  color: var(--faint);
  text-align: center;
  letter-spacing: .02em;
}

/* ---------- 5. 区块节奏 ---------- */
.section {
  padding: clamp(2rem, 4.5vw, 3.4rem) 0;
  border-top: 1px solid var(--line);
}

.sec-head { max-width: 54em; margin-bottom: clamp(1.1rem, 2.4vw, 1.7rem); }
.sec-head h2 { margin-top: .45rem; }
.sec-lead { margin-top: .75rem; max-width: 46em; color: var(--ink-2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 1.3rem;
  height: 1px;
  background: var(--accent);
  opacity: .6;
}

.prose { color: var(--ink-2); }
.prose p + p { margin-top: .85rem; }
.prose p { overflow-wrap: anywhere; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .78rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .22s ease, color .22s ease, border-color .22s ease,
              transform .22s ease, box-shadow .22s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fbfaf7;
  box-shadow: 0 2px 6px rgba(30, 32, 29, .14);
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(51, 81, 75, .2);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.btn-sm { padding: .5rem .95rem; font-size: .85rem; }

/* ---------- 7. 卡片与网格 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: var(--shadow-sm);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}
.split > * { min-width: 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: clamp(.7rem, 1.8vw, 1.1rem);
  margin-top: 1rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.feature:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.f-num {
  display: block;
  margin-bottom: .45rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--accent);
}

.feature h3 { margin-bottom: .35rem; }
.feature p {
  color: var(--ink-2);
  font-size: clamp(.94rem, .92rem + .1vw, 1rem);
  line-height: 1.85;
}

.fit-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.4rem);
  box-shadow: var(--shadow-sm);
}
.fit-card h3 { margin-bottom: .6rem; }

.fit-list { list-style: none; padding: 0; margin-top: .4rem; display: grid; gap: .6rem; }
.fit-list li {
  display: grid;
  gap: .15rem;
  padding-left: .9rem;
  border-left: 2px solid #d5e1db;
  min-width: 0;
}
.fit-list strong { font-size: .95rem; font-weight: 600; color: var(--ink); }
.fit-list span { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- 8. 时间线与步骤 ---------- */
.steps { display: grid; gap: .6rem; margin-top: 1.1rem; }

.step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .85rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.step-num {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid #d5e1db;
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 600;
  flex: none;
}

.step h3 { font-size: clamp(.98rem, .95rem + .15vw, 1.08rem); margin-bottom: .2rem; }
.step p { color: var(--ink-2); font-size: clamp(.93rem, .91rem + .1vw, .99rem); }

.steps-list {
  list-style: none;
  padding: 0;
  margin: .15rem 0 0;
  display: grid;
  gap: .5rem;
  counter-reset: s;
}

.steps-list li {
  counter-increment: s;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .6rem;
  color: var(--ink-2);
  font-size: clamp(.93rem, .91rem + .1vw, .99rem);
  min-width: 0;
}

.steps-list li::before {
  content: counter(s);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--accent-deep);
  font-size: .72rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}

/* ---------- 9. 图示容器 ---------- */
.flow-figure,
.diagram-figure {
  margin: 1.1rem 0 1.3rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.flow-figure svg,
.diagram-figure svg { width: 100%; height: auto; display: block; }

.fig-cap {
  margin-top: .6rem;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-align: center;
  letter-spacing: .02em;
}

/* ---------- 10. 场景分区 ---------- */
.scene-grid { display: grid; gap: clamp(.8rem, 2vw, 1.2rem); margin-top: 1rem; }

.scene {
  display: grid;
  gap: .5rem;
  padding: clamp(1rem, 2vw, 1.4rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.scene-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }

.scene-tag {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid #d5e1db;
  border-radius: 999px;
  padding: .18rem .6rem;
}

.scene h3 { margin: 0; }
.scene > p { color: var(--ink-2); font-size: clamp(.94rem, .92rem + .1vw, 1rem); }

/* ---------- 11. 表格 ---------- */
.table-wrap {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: clamp(.9rem, .88rem + .1vw, .97rem);
}

.table-wrap thead th {
  padding: .8rem 1rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.table-wrap tbody td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: var(--accent-soft); }
.table-wrap td:first-child { color: var(--ink); font-weight: 600; }

/* ---------- 12. 建议清单 ---------- */
.tips { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .55rem; }

.tips li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  padding: .8rem .95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  min-width: 0;
}

.tips li::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  margin-top: .6rem;
  flex: none;
}

.tips strong { color: var(--ink); font-weight: 600; }

/* ---------- 13. 定义列表 ---------- */
.dl-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .45rem 1rem;
  margin: 0;
}

.dl-grid dt { color: var(--muted); font-size: var(--fs-sm); }
.dl-grid dd { margin: 0; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); min-width: 0; }

/* ---------- 14. FAQ ---------- */
.faq { display: grid; gap: .5rem; margin-top: 1rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease;
}
.faq details[open] { border-color: var(--line-2); }

.faq summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "+";
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-size: .9rem;
  line-height: 1;
}

.faq details[open] summary::before {
  content: "−";
  background: var(--accent-soft);
  border-color: #d5e1db;
}

.faq summary:hover { background: var(--paper-2); }

.faq-body {
  padding: 0 1rem .95rem calc(1rem + 2.1rem);
  color: var(--ink-2);
  font-size: clamp(.93rem, .91rem + .1vw, .99rem);
}
.faq-body p { overflow-wrap: anywhere; }

/* ---------- 15. 最新动态 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(.7rem, 2vw, 1.1rem);
  margin-top: 1rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: clamp(1rem, 2vw, 1.3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.news-card time {
  font-size: var(--fs-xs);
  color: var(--faint);
  letter-spacing: .06em;
}

.news-card h3 { font-size: clamp(1rem, .96rem + .2vw, 1.12rem); line-height: 1.5; }
.news-card p {
  flex: 1;
  color: var(--ink-2);
  font-size: clamp(.93rem, .91rem + .1vw, .99rem);
}
.news-card .btn { align-self: flex-start; margin-top: .2rem; }

/* ---------- 16. 相关阅读 ---------- */
.reading-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }

.reading-list a {
  display: block;
  padding: .8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.reading-list a:hover {
  border-color: var(--line-2);
  background: var(--accent-soft);
  transform: translateX(2px);
}

.r-title { display: block; font-weight: 600; color: var(--ink); }
.r-desc { display: block; margin-top: .12rem; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- 17. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: clamp(1.6rem, 4vw, 2.6rem) 0 1.1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .8fr);
  gap: clamp(1rem, 3vw, 2rem);
}
.footer-grid > * { min-width: 0; }

.footer-brand { display: grid; gap: .6rem; max-width: 34em; }
.footer-desc { font-size: var(--fs-sm); color: var(--ink-2); }

.footer-col h4 {
  margin-bottom: .45rem;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

.footer-col ul { list-style: none; padding: 0; display: grid; gap: .32rem; }
.footer-col li { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.footer-col a { color: var(--ink-2); overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--accent-deep); text-decoration: underline; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---------- 18. SVG 通用与动效 ---------- */
.svg-fluid { width: 100%; height: auto; display: block; max-width: 100%; }

/* 环形刻度段缓慢旋转 */
.dial-seg {
  transform-box: fill-box;
  transform-origin: center;
  animation: dialSpin 26s linear infinite;
}
@keyframes dialSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 弧线推进：从起点回到默认状态 */
.arc-draw { animation: arcAdvance 12s ease-in-out infinite; }
@keyframes arcAdvance {
  0% { stroke-dashoffset: 1; }
  70% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 流程连线自绘 */
.flow-draw { animation: flowTrace 15s ease-in-out infinite; }
@keyframes flowTrace {
  0% { stroke-dashoffset: 1; }
  75% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 节点呼吸 */
.pulse { animation: nodeGlow 6.5s ease-in-out infinite; }
.pulse.d2 { animation-delay: 1.1s; }
.pulse.d3 { animation-delay: 2.2s; }
.pulse.d4 { animation-delay: 3.3s; }
.pulse.d5 { animation-delay: 4.4s; }
@keyframes nodeGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* 刻度尺虚线缓慢推移 */
.drift { animation: dashMarch 18s linear infinite; }
@keyframes dashMarch {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 1; }
}

/* 双向箭头描边推进 */
.arrow-draw { animation: arrowTrace 13s ease-in-out infinite; }
@keyframes arrowTrace {
  0% { stroke-dashoffset: 1; }
  65% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* ---------- 19. 响应式 ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art svg { max-width: 280px; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .header-inner { gap: .6rem; }
  .brand img { width: 30px; height: 30px; }
  .site-nav a { padding: .4rem .7rem; font-size: .88rem; }
  .btn { padding: .72rem 1.1rem; }
}

/* ---------- 20. 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dial-seg,
  .arc-draw,
  .flow-draw,
  .pulse,
  .drift,
  .arrow-draw { animation: none; }
  .btn,
  .feature,
  .news-card,
  .reading-list a,
  .faq details,
  .site-nav a,
  .skip-link { transition-duration: .01ms; }
}

/* ---------- 21. 长文件名与路径溢出保护 ---------- */
.dl-file-name {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dl-note { overflow-wrap: anywhere; }
