/* =============================================================================
 * jkpos AI 官网 · 全站基础样式
 * 设计 token 1:1 移植自桌面端 src/renderer/src/styles/global.css（Cursor
 * Anysphere Light / Dark 双主题），叠加办公模式的近黑高级感面板（--of-*）。
 * 站点为纯静态多页，无构建步骤；改动直接部署。
 * ========================================================================== */

/* ---------- 设计 token（与桌面端逐值一致） ---------- */

:root {
  --bg-app: #fcfcfc;
  --bg-titlebar: #f3f3f3;
  --bg-sidebar: #f3f3f3;
  --bg-editor: #fcfcfc;
  --bg-panel: #f3f3f3;
  --bg-input: #ffffff;
  --bg-card: #fbfbfb;
  --bg-hover: rgba(20, 20, 20, 0.066);
  --bg-active: rgba(20, 20, 20, 0.1);
  --bg-selected: rgba(20, 20, 20, 0.066);
  --border: #ececec;
  --border-light: #d9d9d9;
  --text-primary: #262626;
  --text-strong: #141414;
  --text-secondary: #5e5e5e;
  --text-muted: #8f8f8f;
  --text-faint: #b3b3b3;
  --accent: #3c7cab;
  --accent-dim: #e4edf4;
  --green: #1f8a65;
  --green-soft: rgba(31, 138, 101, 0.13);
  --red: #cf2d56;
  --red-soft: rgba(207, 45, 86, 0.1);
  --yellow: #c08532;
  --yellow-soft: rgba(192, 133, 50, 0.13);
  --code-bg: #f6f6f6;
  --code-bar-bg: #efefef;
  --code-inline-bg: rgba(20, 20, 20, 0.07);
  --selection-bg: rgba(20, 20, 20, 0.12);
  --btn-pri-bg: #1f1f1f;
  --btn-pri-fg: #ffffff;
  --btn-pri-hover: #000000;
  --shadow-menu: 0 8px 28px rgba(0, 0, 0, 0.14);
  --shadow-pop:
    0 12px 40px rgba(0, 0, 0, 0.16),
    0 2px 10px rgba(0, 0, 0, 0.08);
  --font-ui: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: Consolas, "Courier New", "Microsoft YaHei", monospace;

  /* 办公模式高级感面板（office.css --of-*） */
  --of-grad: #111114;
  --of-on-grad: #ffffff;
  --of-r-lg: 16px;
  --of-r-md: 12px;

  /* 站点级 */
  --site-max: 1180px;
  --nav-h: 56px;
  --hero-ink: #141414;
}

:root[data-theme="dark"] {
  --bg-app: #1a1a1a;
  --bg-titlebar: #181818;
  --bg-sidebar: #181818;
  --bg-editor: #1a1a1a;
  --bg-panel: #202020;
  --bg-input: #202020;
  --bg-card: #1e1e1e;
  --bg-hover: rgba(255, 255, 255, 0.055);
  --bg-active: rgba(255, 255, 255, 0.09);
  --bg-selected: rgba(255, 255, 255, 0.07);
  --border: #2a2a2a;
  --border-light: #3a3a3a;
  --text-primary: #d6d6dd;
  --text-strong: #ffffff;
  --text-secondary: #a0a0ab;
  --text-muted: #7d7d87;
  --text-faint: #5a5a63;
  --accent: #4aa5f0;
  --accent-dim: rgba(74, 165, 240, 0.16);
  --green: #4ec9a6;
  --green-soft: rgba(78, 201, 166, 0.15);
  --red: #ff6b81;
  --red-soft: rgba(255, 107, 129, 0.14);
  --yellow: #e0b060;
  --yellow-soft: rgba(224, 176, 96, 0.15);
  --code-bg: #202020;
  --code-bar-bg: #262626;
  --code-inline-bg: rgba(255, 255, 255, 0.09);
  --selection-bg: rgba(255, 255, 255, 0.16);
  --btn-pri-bg: #e6e6e6;
  --btn-pri-fg: #141414;
  --btn-pri-hover: #ffffff;
  --shadow-menu: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-pop:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 2px 10px rgba(0, 0, 0, 0.4);
  --of-grad: #f5f5f7;
  --of-on-grad: #111114;
  --hero-ink: #f2f2f4;
}

/* ---------- 基础 ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection-bg);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.28);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.55);
  background-clip: content-box;
  border: 2px solid transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  color: inherit;
}

::placeholder {
  color: var(--text-muted);
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 28px;
}

/* 行内 SVG 图标：与桌面端 .icon 同规格（stroke 1.6 圆头） */
.icon {
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 顶部导航（对齐应用 titlebar 质感） ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg-titlebar) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 26px;
}

/* 品牌：JK 徽标（登录页同款近黑渐变圆角方块）+ 字标 */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2d2d2d, #0f0f0f);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(20, 20, 20, 0.18);
}

:root[data-theme="dark"] .brand-logo {
  background: linear-gradient(145deg, #f4f4f4, #d8d8d8);
  color: #141414;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.brand-word {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-strong);
}

.brand-word .ai {
  margin-left: 4px;
  font-weight: 800;
  background: linear-gradient(100deg, #2f6f9f 10%, #7db1d6 38%, #2f6f9f 62%, #6fb1de 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:root[data-theme="dark"] .brand-word .ai {
  background-image: linear-gradient(100deg, #5da8e8 10%, #9cd0f7 38%, #5da8e8 62%, #8ec8f2 90%);
  -webkit-background-clip: text;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}

.nav-links a:hover {
  background: var(--bg-hover);
  color: var(--text-strong);
}

.nav-links a.on {
  color: var(--text-strong);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 主题切换：应用式图标按钮 */
.theme-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
}

.theme-btn:hover {
  background: var(--bg-hover);
  color: var(--text-strong);
}

.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }

/* 移动端汉堡 */
.nav-burger {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.nav-burger:hover {
  background: var(--bg-hover);
  color: var(--text-strong);
}

/* ---------- 按钮体系（对齐应用主按钮 / 次级按钮 / 胶囊 CTA） ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, transform 0.13s, box-shadow 0.13s;
  user-select: none;
}

.btn-primary {
  background: var(--btn-pri-bg);
  color: var(--btn-pri-fg);
}

.btn-primary:hover {
  background: var(--btn-pri-hover);
}

.btn-secondary {
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-faint);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  filter: brightness(1.06);
}

.btn-lg {
  height: 42px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 14.5px;
}

/* 胶囊 CTA（办公模式 trade-hero-cta 同款） */
.btn-pill {
  border-radius: 999px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- 章节骨架 ---------- */

.section {
  padding: 96px 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.sec-head {
  max-width: 720px;
  margin-bottom: 52px;
}

.sec-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--text-faint);
}

.sec-head.center .eyebrow::after {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--text-faint);
}

.sec-title {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-strong);
}

.sec-lede {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ---------- 页脚（正规企业站规格） ---------- */

.site-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}

.foot-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 44px;
}

.foot-brand p {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.7;
}

.foot-col h5 {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-strong);
  margin-bottom: 14px;
}

.foot-col a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color 0.12s;
}

.foot-col a:hover {
  color: var(--text-strong);
}

.foot-legal {
  border-top: 1px solid var(--border);
  padding: 18px 0 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.foot-legal a {
  color: var(--text-muted);
}

.foot-legal a:hover {
  color: var(--text-strong);
}

/* ---------- 滚动浮现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

/* ---------- 通用弹层 / 提示 ---------- */

.toast-stack {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-menu);
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.ok { color: var(--green); }
.toast.err { color: var(--red); }

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 模态基座 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: mask-in 0.18s ease-out;
}

:root[data-theme="dark"] .modal-mask {
  background: rgba(0, 0, 0, 0.6);
}

@keyframes mask-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-app);
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--border);
}

.modal-head strong {
  flex: 1;
  font-size: 14.5px;
  color: var(--text-strong);
}

.modal-x {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.modal-x:hover {
  background: var(--bg-hover);
  color: var(--text-strong);
}

.modal-body {
  padding: 18px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .foot-main {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 840px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 14px;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-menu);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 12px;
    font-size: 14.5px;
  }

  .nav-burger {
    display: inline-flex;
  }

  .nav-actions .btn {
    display: none;
  }

  .nav-actions .btn.nav-keep,
  .nav-actions #navAuth .btn {
    display: inline-flex;
  }

  .section {
    padding: 64px 0;
  }

  .sec-title {
    font-size: 27px;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 18px;
  }

  .site-nav-inner {
    padding: 0 18px;
  }

  .foot-main {
    grid-template-columns: 1fr;
  }
}

/* 减弱动态效果 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
