:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-muted: #eef0ec;
  --ink: #18201d;
  --muted: #69736e;
  --line: #d9deda;
  --sidebar: #1c2421;
  --sidebar-muted: #9da9a3;
  --accent: #16724a;
  --accent-hover: #105c3b;
  --accent-soft: #e5f2eb;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  /* 0.9.3：移动端兜底，禁止整页横向溢出（代码块/表格自身可横向滚动）。 */
  overflow-x: hidden;
}

img,
svg,
video {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.site-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 头部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.brand-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #53605a;
  border-radius: 6px;
  color: #78d6a5;
  background: var(--sidebar);
}

.brand-symbol svg {
  width: 18px;
  height: 18px;
}

.brand-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
}

a.brand-mark {
  color: inherit;
  text-decoration: none;
}

/* ---------- 部署教程（Tab 与内容排版样式见文件末尾「部署教程独立页」） ---------- */

.site-section h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 30px);
}

.download-msg {
  margin-top: 8px;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.site-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 按钮 ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button.ghost {
  background: transparent;
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button:disabled {
  opacity: 0.5;
}

/* ---------- 首屏 ---------- */

.hero {
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(22, 114, 74, 0.12), transparent),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 56px;
}

.hero-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 26px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0;
}

.hero-stats > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
}

.hero-stats dt {
  font-weight: 700;
  font-size: 15px;
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 区块 ---------- */

.site-section {
  padding: 64px 0;
}

.section-alt {
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-section h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 30px);
}

.section-lead {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 680px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 4px 18px rgba(24, 32, 29, 0.05);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 下载 ---------- */

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(24, 32, 29, 0.05);
}

.download-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.download-head h3 {
  margin: 0;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.download-card .download-link {
  align-self: flex-start;
}

.changelog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface-muted);
}

.changelog summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.changelog pre {
  margin: 8px 0 4px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  color: var(--ink);
}

/* ---------- 反馈 ---------- */

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 40px;
  align-items: start;
}

.feedback-tips {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.feedback-tips li + li {
  margin-top: 6px;
}

.feedback-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: grid;
  gap: 14px;
  box-shadow: 0 4px 18px rgba(24, 32, 29, 0.05);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(22, 114, 74, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-message {
  margin: 0;
  font-size: 13.5px;
  min-height: 1.2em;
}

.form-message.ok {
  color: var(--accent);
}

.form-message.error {
  color: #b23b32;
}

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--sidebar);
  color: var(--sidebar-muted);
  padding: 26px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-brand {
  color: inherit;
  text-decoration: none;
}

.footer-sep {
  opacity: 0.6;
}

.site-footer a {
  color: inherit;
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .feedback-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero {
    padding: 52px 0 44px;
  }

  .site-section {
    padding: 48px 0;
  }
}

/* 0.9.3：平板/手机适配，保证无横向溢出 */
@media (max-width: 768px) {
  .site-nav {
    gap: 0;
    width: 100%;
    justify-content: space-between;
  }

  .site-nav a {
    padding: 6px 8px;
    font-size: 13px;
  }

  .intro-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .tutorial-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .tutorial-block,
  .intro-card,
  .feature-card,
  .feedback-form {
    padding: 18px 16px;
  }
}

@media (max-width: 480px) {
  .site-container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .site-section {
    padding: 38px 0;
  }

  .brand-mark {
    font-size: 15px;
  }

  .brand-symbol {
    width: 28px;
    height: 28px;
  }
}

/* ---------- 滑动验证码弹窗 ---------- */

.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.captcha-modal[hidden] {
  display: none;
}

.captcha-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 19, 0.55);
  backdrop-filter: blur(2px);
}

.captcha-box {
  position: relative;
  width: 372px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 22, 19, 0.28);
  padding: 16px;
}

.captcha-modal.captcha-shake .captcha-box {
  animation: captcha-shake 0.35s ease;
}

@keyframes captcha-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
}

.captcha-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.captcha-close:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.captcha-canvas {
  position: relative;
  width: 320px;
  max-width: 100%;
  height: 140px;
  margin: 0 auto 12px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-muted);
}

.captcha-canvas img {
  position: absolute;
  inset: 0;
  width: 320px;
  height: 140px;
  user-select: none;
  -webkit-user-drag: none;
}

.captcha-canvas .captcha-piece {
  inset: auto;
  left: 0;
  width: auto;
  height: auto;
  will-change: left;
}

.captcha-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.captcha-loading[hidden] {
  display: none;
}

.captcha-track {
  position: relative;
  height: 40px;
  border-radius: 20px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  overflow: hidden;
}

.captcha-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent-soft);
}

.captcha-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.captcha-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-handle.dragging {
  cursor: grabbing;
  background: var(--accent-hover);
}

.captcha-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  min-height: 22px;
}

.captcha-status {
  font-size: 13px;
  color: var(--muted);
}

.captcha-status.error {
  color: #b42318;
}

.captcha-refresh {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}

.captcha-refresh:hover {
  text-decoration: underline;
}

/* ---------- 首页简介：仅服务端 & 客户端两部分 ---------- */

.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 34px 0 30px;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px clamp(18px, 3vw, 30px);
  box-shadow: 0 10px 28px rgba(16, 22, 19, 0.06);
}

.intro-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 20px;
}

.intro-card h2::before {
  content: "";
  width: 8px;
  height: 22px;
  border-radius: 4px;
  background: var(--accent);
}

.intro-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

/* 0.9.3：下载入口与简介同卡片并排 */
.intro-download {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.intro-download .changelog {
  width: 100%;
}

.hero .hero-actions {
  margin-bottom: 0;
}

/* ---------- 部署教程独立页 ---------- */

.tutorial-page {
  padding-top: 48px;
}

.tutorial-page h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.tutorial-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tutorial-tab {
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

.tutorial-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tutorial-panel {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.tutorial-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px clamp(18px, 3vw, 30px);
}

.tutorial-block h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.tutorial-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tutorial-block-head h2 {
  margin: 0;
}

.tutorial-script {
  margin: 0;
  padding: 16px 18px;
  border-radius: 8px;
  background: var(--sidebar);
  color: #d9e2dd;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

.tutorial-script code {
  font-family: inherit;
  white-space: pre;
}

.button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.tutorial-guide h3,
.tutorial-guide h4,
.tutorial-content h3,
.tutorial-content h4 {
  margin: 22px 0 8px;
  line-height: 1.3;
}

.tutorial-guide h3:first-child,
.tutorial-content h3:first-child {
  margin-top: 0;
}

.tutorial-guide p,
.tutorial-content p {
  margin: 8px 0;
  color: var(--ink);
}

.tutorial-guide ul,
.tutorial-guide ol,
.tutorial-content ul,
.tutorial-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.tutorial-guide li,
.tutorial-content li {
  margin: 4px 0;
}

.tutorial-guide code,
.tutorial-content code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 13px;
}

.tutorial-guide pre,
.tutorial-content pre {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--sidebar);
  color: #d9e2dd;
  overflow: auto;
}

.tutorial-guide pre code,
.tutorial-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.tutorial-guide a,
.tutorial-content a {
  color: var(--accent);
}

/* 0.9.3：教程正文中的宽表格在小屏上横向滚动，不撑破页面 */
.tutorial-guide table,
.tutorial-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.tutorial-guide img,
.tutorial-content img {
  max-width: 100%;
  height: auto;
}

/* ---------- 0.9.4 产品详解（图文卡） ---------- */

.detail-list {
  display: grid;
  gap: 28px;
  margin-top: 8px;
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 28px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 4px 18px rgba(24, 32, 29, 0.05);
}

.detail-card:nth-child(even) .detail-text {
  order: 2;
}

.detail-card:nth-child(even) .detail-figure {
  order: 1;
}

.detail-text h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.detail-text p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.detail-figure {
  margin: 0;
}

.detail-figure img,
.detail-tile img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.detail-subhead {
  margin: 40px 0 4px;
  font-size: 21px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.detail-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 10px;
  align-content: start;
  box-shadow: 0 4px 18px rgba(24, 32, 29, 0.05);
}

.detail-tile h4 {
  margin: 0;
  font-size: 16px;
}

.detail-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ---------- 0.9.4 联系邮箱反馈 ---------- */

.feedback-mail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: grid;
  gap: 10px;
  justify-items: start;
  box-shadow: 0 4px 18px rgba(24, 32, 29, 0.05);
}

.feedback-mail-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feedback-mail-address {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.feedback-mail-address a {
  color: var(--accent);
  text-decoration: none;
}

.feedback-mail-address a:hover {
  text-decoration: underline;
}

.feedback-mail-button {
  margin-top: 6px;
}

.feedback-mail .muted {
  margin: 4px 0 0;
}

@media (max-width: 960px) {
  .detail-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-card:nth-child(even) .detail-text {
    order: 1;
  }

  .detail-card:nth-child(even) .detail-figure {
    order: 2;
  }
}

@media (max-width: 768px) {
  .detail-card,
  .detail-tile {
    padding: 18px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .feedback-mail-address {
    font-size: 19px;
  }
}
