/* Site-wide layer: contrast-safe tokens, semantic layout, responsive behavior. Loaded last. */
:root {
  --green: #0a8046;
  --green-strong: #067a42;
  --ink: #1f2933;
  --muted: #595959;
  --line: #e3e8e6;
  --surface: #ffffff;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  overflow-x: hidden;
}
a { color: var(--green-strong); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--green-strong); outline-offset: 3px; }
::selection { background: #d6f0e2; color: #063d24; }
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 999;
  background: var(--green); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { left: 12px; }

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-header .logo { float: none; }
.site-header .logo img { display: block; height: 36px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: flex; align-items: center; min-height: 44px; padding: 8px 14px;
  color: var(--ink); font-weight: 600; border-radius: 8px; text-decoration: none;
}
.site-nav a:hover { background: #eef6f1; color: var(--green-strong); }
.site-nav a[aria-current="page"] { background: var(--green); color: #fff; }

/* Split-screen selector */
.box, .content_box {
  position: relative; top: auto; bottom: auto; left: auto; right: auto;
  width: 100%; min-width: 0; min-height: 0; overflow: visible;
}
.box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: min(720px, calc(100vh - 72px)); }
.box > .left, .content_box > .left {
  position: relative; top: auto; bottom: auto; left: auto; right: auto;
  float: none; width: auto; height: auto; display: flex; align-items: center;
  background: var(--green); color: #fff;
}
.box > .right, .content_box > .right {
  position: relative; top: auto; bottom: auto; left: auto; right: auto;
  float: none; width: auto; height: auto; display: block;
  padding: clamp(24px, 4vw, 64px); background: var(--surface);
}
.show_box { width: 100%; padding: clamp(24px, 4vw, 64px); color: #fff; }
.show_box h1, .show_box h2, .show_box p, .show_box .show_detail { color: #fff; }
#page-title { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.15; margin: 0 0 12px; color: #fff; }
.show_box .show_desc { font-size: clamp(15px, 1.4vw, 18px); color: #fff; margin: 0 0 28px; }
.show_img img { display: block; width: 100%; max-width: 440px; height: auto; }
.office_btn { position: static; z-index: auto; padding: 0; margin: 0 0 24px; background: transparent; }
.function_btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 8px 16px; margin: 0 0 24px; border-radius: 8px;
  background: var(--green); color: #fff; font-weight: 600;
}
.function_btn:hover { background: var(--green-strong); color: #fff; }
.down_icon { width: 18px; height: 18px; margin: 0; }
.version_box { display: block; width: 100%; padding: 0; }
.form_group { margin: 0 0 26px; }
.form_group h2 { display: inline-block; margin: 0; color: var(--muted); font-size: 20px; font-weight: 600; }
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: 8px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: #f2f5f3;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.tip::after {
  content: attr(data-tip); position: absolute; z-index: 20;
  max-width: 260px; margin-top: 34px; padding: 8px 12px;
  background: var(--ink); color: #fff; border-radius: 6px; font-size: 14px;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.tip:hover::after, .tip:focus-visible::after, .tip.is-open::after { opacity: 1; visibility: visible; }
.options { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.options li { width: auto; height: auto; line-height: normal; margin: 0; padding: 0; }
.options button {
  min-width: 88px; min-height: 48px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink); font-size: 15px; cursor: pointer;
}
.options button:hover, .options button[aria-pressed="true"] {
  background: var(--green); border-color: var(--green); color: #fff;
}
.options .placeholder { color: var(--muted); font-size: 15px; }
.status { min-height: 24px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* Result panel */
.content_box { display: none; }
.content_box.is-visible { display: block; }
.download_content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 560px; }
.show_detail { color: #fff; font-size: 15px; line-height: 1.7; margin-top: 20px; }
.tip_title h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 36px); color: var(--ink); }
.tip_title p { margin: 0 0 20px; color: var(--muted); font-size: 16px; }
.down_btn { display: flex; flex-wrap: wrap; gap: 10px; width: auto; }
.down_btn a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 140px; min-height: 48px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 16px;
}
.down_btn a:hover { border-color: var(--green); background: var(--green); color: #fff; }
.course_btn { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 24px; }
.course_btn a { color: var(--green-strong); font-weight: 600; }
.course_btn button {
  min-height: 44px; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer;
}
.course_btn button:hover { border-color: var(--green); color: var(--green-strong); }

/* Static, crawlable content */
.seo-content { max-width: 1120px; margin: 0 auto; padding: clamp(32px, 5vw, 72px) clamp(16px, 4vw, 48px); }
.seo-content h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; margin: 36px 0 12px; }
.seo-content p, .static-list { max-width: 70ch; color: var(--ink); }
.seo-content .note { color: var(--muted); font-size: 14px; }
.static-list { padding-left: 22px; margin: 12px 0; }
.static-list li { margin-bottom: 8px; }
.faq h2 { font-size: 22px; }
.faq h3 { font-size: 22px; margin: 24px 0 6px; }
.faq p { margin: 0 0 8px; }

/* Tutorial index */
.article_box { width: min(1024px, calc(100% - 32px)); margin: 32px auto; padding: clamp(16px, 3vw, 28px); }
.jiaocheng { padding-left: 0; }
.article_box .title { font-size: clamp(28px, 3.4vw, 40px); }
.instructions { color: var(--ink); }
.a_links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; list-style: none; padding: 0; }
.a_links li { line-height: 1.7; }
.tutorial-offline { color: var(--muted); }
.tutorial-offline::after { content: "（原文待迁移）"; font-size: 12px; color: var(--muted); }
.article_box a { color: var(--green-strong); }
.hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.download_desc { color: var(--muted); margin-top: 32px; }

/* Software index */
.soft-page { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px); }
.soft-page h1 { font-size: clamp(28px, 3.4vw, 40px); margin: 0 0 12px; }
.soft-intro { max-width: 70ch; color: var(--muted); }
.soft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 32px 0; }
.soft-grid .soft_item { display: block; min-height: 180px; padding: 16px; text-align: center; border: 1px solid var(--line); border-radius: 12px; }
.soft-grid .soft_item_img { display: block; width: 96px; height: 96px; margin: 0 auto 12px; border: 0; border-radius: 12px; background: var(--green); }
.soft-grid .soft_item_img img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.soft-grid .soft_item:hover .soft_item_img > img { display: block; }
.soft_item_text { display: block; color: var(--ink); font-weight: 600; }
.soft_item_text span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }

/* Footer */
.site-footer { padding: 32px clamp(16px, 4vw, 48px); text-align: center; background: #f6f8f7; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer p { margin: 6px 0; }
.site-footer a { color: var(--green-strong); }

/* Phone and tablet */
@media (max-width: 900px) {
  .box, .download_content { grid-template-columns: 1fr; }
  .box { min-height: 0; }
}
@media (max-width: 767px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .site-header { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .site-nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .site-nav a { flex: 0 0 auto; padding: 8px 12px; }
  .show_box { padding: 24px 16px; }
  .box > .right, .content_box > .right { padding: 24px 16px; }
  .show_img img { max-width: 100%; }
  .options button { min-width: calc(33.333% - 10px); }
  .seo-content, .soft-page { padding: 28px 16px; }
  .article_box { width: calc(100% - 24px); margin: 16px auto; padding: 16px; }
  .a_links { grid-template-columns: 1fr; }
  .soft-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
  .soft-grid .soft_item { min-height: 150px; padding: 12px; }
  .soft-grid .soft_item_img { width: 72px; height: 72px; }
  .site-footer { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
