/* 设计变量与基础重置 */
:root {
  --color-primary: #4A7C59;
  --color-primary-dark: #3A6347;
  --color-secondary: #8B6F47;
  --color-accent: #D4A373;
  --color-bg: #FDFBF7;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F5F0E8;
  --color-text: #2D2A26;
  --color-text-muted: #6B655B;
  --color-border: #E6DFD5;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-soft: 0 4px 16px rgba(45, 42, 38, 0.06);
  --shadow-hover: 0 8px 24px rgba(45, 42, 38, 0.10);
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: var(--font-sans);
  --spacing-section: clamp(60px, 8vw, 100px);
  --spacing-content: clamp(24px, 3vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* 排版系统 */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 var(--spacing-content); }
.heading-xl { font-size: clamp(2.4rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
.heading-lg { font-size: clamp(1.8rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.heading-md { font-size: clamp(1.3rem, 2vw, 1.5rem); font-weight: 700; line-height: 1.35; }
.text-body { font-size: clamp(0.95rem, 1.2vw, 1.05rem); color: var(--color-text); line-height: 1.7; }
.text-muted { font-size: 0.9rem; color: var(--color-text-muted); }

/* 通用布局模块 */
.section { padding: var(--spacing-section) 0; }
.section--alt { background: var(--color-surface-alt); }
.section-header { margin-bottom: clamp(32px, 5vw, 56px); }
.section-header p { margin-top: 12px; max-width: 680px; }
.grid-2 { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: clamp(20px, 2.5vw, 28px); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover, .card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon { width: 40px; height: 40px; margin-bottom: 16px; color: var(--color-primary); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; background: rgba(74, 124, 89, 0.12); color: var(--color-primary-dark); font-size: 0.8rem; font-weight: 600; margin-bottom: 12px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none; transition: background 0.2s ease, transform 0.15s ease; }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--secondary { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn--secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn--download { background: var(--color-secondary); color: #fff; padding: 14px 32px; font-size: 1rem; }
.btn--download:hover { background: #7A5E3A; }
.btn--sm { padding: 8px 16px; font-size: 0.85rem; }

/* 页头与导航 */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(253, 251, 247, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-border); }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.brand span { font-weight: 700; font-size: 1.1rem; }
nav ul { display: flex; gap: 24px; }
nav a { font-size: 0.9rem; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-primary); border-bottom-color: var(--color-primary); }
@media (max-width: 768px) {
  nav { display: none; }
}

/* 页脚 */
.site-footer { background: var(--color-text); color: #EDEAE6; padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 32px; }
.footer-col h3 { font-size: 1rem; margin-bottom: 16px; color: #fff; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.85rem; color: #A8A29E; }

/* 表格 */
.table-wrapper { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.95rem; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-surface-alt); font-weight: 600; }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; color: var(--color-primary-dark); }

/* 详情与折叠 */
details.faq-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 16px; transition: box-shadow 0.2s ease; }
details.faq-item:hover { box-shadow: var(--shadow-soft); }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 24px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
.faq-answer { margin-top: 12px; color: var(--color-text-muted); line-height: 1.65; }

/* 链接列表 */
.link-list { display: flex; flex-direction: column; gap: 14px; }
.link-item { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px dashed var(--color-border); }
.link-item:last-child { border-bottom: none; }
.link-title { font-weight: 600; color: var(--color-primary-dark); }
.link-desc { font-size: 0.85rem; color: var(--color-text-muted); }

/* SVG 动效基础 */
.svg-visual { width: 100%; max-width: 360px; margin: 0 auto; }
svg .stroke-path { fill: none; stroke: var(--color-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .stroke-accent { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .fill-shape { fill: var(--color-surface-alt); stroke: var(--color-border); stroke-width: 1; }

/* 描边自绘动画 */
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-stroke 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards, breathe 4s 3.5s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
@keyframes draw-stroke { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes breathe { from { opacity: 1; transform: scale(1); } to { opacity: 0.92; transform: scale(1.02); } }

/* 界面示意组件 */
.ui-frame { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.ui-toolbar { height: 36px; background: var(--color-surface-alt); border-bottom: 1px solid var(--color-border); display: flex; align-items: center; padding: 0 12px; gap: 6px; }
.ui-dot { width: 10px; height: 10px; border-radius: 50%; background: #D4D4D4; }
.ui-dot:nth-child(1) { background: #FF6058; }
.ui-dot:nth-child(2) { background: #FFBD2E; }
.ui-dot:nth-child(3) { background: #28C840; }
.ui-body { display: grid; grid-template-columns: 240px 1fr; min-height: 240px; }
.ui-sidebar { border-right: 1px solid var(--color-border); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ui-list-row { height: 32px; background: var(--color-surface-alt); border-radius: 4px; }
.ui-chat { padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.ui-msg { max-width: 70%; padding: 10px 12px; border-radius: 8px; font-size: 0.9rem; }
.ui-msg--left { background: var(--color-surface-alt); align-self: flex-start; }
.ui-msg--right { background: #DCF8C6; align-self: flex-end; }
@media (max-width: 768px) { .ui-body { grid-template-columns: 1fr; } .ui-sidebar { display: none; } }

/* 响应式与无障碍 */
@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; }
}
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(74, 124, 89, 0.2); }

/* === 修复 Hero 区域在小屏幕下的横向溢出 === */
@media (max-width: 768px) {
  /* 强制 Hero 网格容器变为块级布局，覆盖内联样式中的 grid-template-columns */
  #hero .container {
    display: block !important;
  }
  /* 确保子元素宽度自适应父容器 */
  #hero .container > div {
    width: 100%;
  }
  /* 将右侧的 SVG 视觉图移至第二行，并居中对齐 */
  #hero .container > div:nth-child(2) {
    margin-top: 32px;
    display: flex;
    justify-content: center;
  }
  /* 进一步限制 SVG 在移动端的最大宽度，防止超出屏幕 */
  .svg-visual {
    max-width: 280px;
  }
}
