:root {
  color-scheme: light;
  --ink: #0d1726;
  --muted: #59697c;
  --line: #dce4ed;
  --paper: #f5f8fb;
  --surface: #ffffff;
  --blue: #075bd8;
  --blue-dark: #063778;
  --green: #087f66;
  --green-soft: #e8f6f1;
  --dark: #11151b;
  --lime: #d9ff4f;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
p, h1, h2, h3 { margin: 0; }
.keep-together { white-space: nowrap; }

.product-nav {
  position: sticky; top: 0; z-index: 20; height: 70px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid rgba(220,228,237,.86);
  background: rgba(255,255,255,.9); backdrop-filter: blur(16px);
}
.product-brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 900; }
.product-brand img { width: 34px; height: 34px; border-radius: 7px; }
.product-nav-links { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; font-weight: 700; }
.product-nav-links a:hover { color: var(--blue); }
.back-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 800; }

.sub-hero { min-height: 540px; display: grid; grid-template-columns: minmax(0,.9fr) minmax(460px,1.1fr); gap: clamp(42px,7vw,100px); align-items: center; padding: 76px clamp(20px,7vw,110px); overflow: hidden; }
.sub-hero-copy { display: grid; gap: 22px; }
.eyebrow { color: var(--blue); font-family: Consolas, monospace; font-size: 12px; font-weight: 900; }
.sub-hero h1 { font-size: clamp(43px,6vw,76px); line-height: 1.03; letter-spacing: 0; }
.sub-hero .lead { max-width: 650px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border: 1px solid transparent; border-radius: 6px; font-weight: 900; }
.button.blue { background: var(--blue); color: #fff; box-shadow: 0 14px 32px rgba(7,91,216,.2); }
.button.green { background: var(--green); color: #fff; box-shadow: 0 14px 32px rgba(8,127,102,.18); }
.button.dark { background: var(--dark); color: #fff; }
.button.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.status-line { display: flex; flex-wrap: wrap; gap: 9px; }
.status-line span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.78); color: var(--muted); font-size: 12px; font-weight: 700; }

.chat-demo { width: min(100%,700px); min-height: 520px; justify-self: center; overflow: hidden; border: 1px solid #28425b; border-radius: 8px; background: #06111f; color: #f3f8fb; box-shadow: 0 28px 80px rgba(6,27,45,.24); }
.chat-window-bar { height: 54px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid #294057; background: #0d1c2e; }
.chat-window-bar strong { font-size: 14px; }
.chat-window-bar > span { color: #8ea4b8; font-size: 11px; font-weight: 800; }
.window-dots { display: flex; gap: 7px; }
.window-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.window-dots i:nth-child(2) { background: #ffc928; }
.window-dots i:nth-child(3) { background: #29c977; }
.chat-contact { min-height: 78px; display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.chat-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #25d7b0; color: #052231; font-weight: 900; }
.chat-contact div { display: grid; }
.chat-contact small { color: #7fc3ce; }
.chat-stream { height: 282px; display: flex; flex-direction: column; gap: 12px; padding: 10px 20px 18px; overflow-y: auto; scrollbar-width: none; scroll-behavior: smooth; }
.chat-stream::-webkit-scrollbar { display: none; }
.chat-loading { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; color: #7893a8; font-size: 12px; }
.chat-loading span { width: 8px; height: 8px; border-radius: 50%; background: #25d7b0; box-shadow: 0 0 0 0 rgba(37,215,176,.42); animation: status-pulse 1.4s infinite; }
.chat-bubble { width: min(74%,440px); display: grid; gap: 5px; padding: 12px 15px; border-radius: 7px; background: #1a2939; }
.chat-bubble strong { font-size: 14px; font-weight: 700; line-height: 1.45; }
.chat-bubble small { color: #a9c0d0; line-height: 1.4; }
.chat-bubble.outgoing { align-self: flex-end; background: #19b891; color: #031b1d; }
.chat-bubble.outgoing small { color: #083e38; }
.chat-bubble.short { width: fit-content; max-width: 68%; }
.chat-bubble.is-entering { animation: message-arrive .38s both; }
.chat-bubble.is-leaving { animation: message-leave .28s both; }
.chat-bubble small.is-translating { color: #56d9c5; }
.chat-compose { margin: 0 20px 20px; padding: 12px 14px; border: 1px solid #3b566f; border-radius: 7px; background: #0d1a2c; }
.chat-compose p { min-height: 26px; color: #fff; font-size: 14px; }
.chat-compose div { min-height: 34px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.chat-compose span { color: #79a9bf; font-size: 11px; line-height: 1.4; }
.chat-compose p.is-typing::after { content: ""; display: inline-block; width: 2px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--lime); animation: cursor-blink .7s steps(1) infinite; }
.composer-placeholder { color: #587187; font-size: 13px; }
.chat-compose button { min-width: 58px; min-height: 32px; border: 0; border-radius: 5px; background: #d9ff4f; color: #102114; font-size: 12px; font-weight: 900; pointer-events: none; }
.chat-compose button.is-sending { animation: send-pulse .42s both; }
@keyframes message-arrive { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes message-leave { to { opacity: 0; transform: translateY(-8px); } }
@keyframes send-pulse { 50% { transform: scale(.92); background: #25d7b0; } }
@keyframes cursor-blink { 50% { opacity: 0; } }
@keyframes status-pulse { 70% { box-shadow: 0 0 0 7px rgba(37,215,176,0); } 100% { box-shadow: 0 0 0 0 rgba(37,215,176,0); } }

.content-section { padding: 82px clamp(20px,7vw,110px); }
.content-section.alt { background: #fff; }
.section-head { width: min(780px,100%); margin-bottom: 32px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-bottom: 8px; color: var(--blue); font-family: Consolas, monospace; font-size: 12px; font-weight: 900; }
.section-head h2 { font-size: clamp(31px,4vw,50px); line-height: 1.12; }
.feature-list, .pricing-list, .download-list { width: min(1180px,100%); margin: 0 auto; display: grid; gap: 14px; }
.feature-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.feature-list article, .price-card, .download-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 34px rgba(30,55,82,.07); }
.feature-list article { display: grid; gap: 10px; padding: 24px; }
.feature-list b { color: var(--green); font-family: Consolas, monospace; font-size: 12px; }
.feature-list h3 { font-size: 21px; }
.feature-list p, .price-card li, .download-card p, .notice, .install-steps span { color: var(--muted); }

.pricing-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.price-card { position: relative; display: grid; gap: 14px; padding: 26px; }
.price-card.recommended { border-color: rgba(8,127,102,.44); background: linear-gradient(180deg,#fff,#eefaf6); }
.price-card small { color: var(--green); font-weight: 900; }
.price-card h3 { font-size: 48px; line-height: 1; }
.price-card h3 span { font-size: 15px; color: var(--muted); }
.price-card ul { display: grid; gap: 7px; margin: 4px 0 8px; padding-left: 19px; }

.install-layout { width: min(1100px,100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0,.7fr) minmax(460px,1fr); gap: 56px; }
.install-copy { display: grid; align-content: start; gap: 15px; }
.install-copy h2 { font-size: clamp(31px,4vw,48px); line-height: 1.14; }
.install-copy p { color: var(--muted); }
.install-steps { display: grid; gap: 10px; }
.install-steps article { display: grid; grid-template-columns: 54px 1fr; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.install-steps b { color: var(--blue); font-family: Consolas, monospace; }

.codex-page { --codex-ink: #141713; --codex-paper: #f3f2ed; --codex-line: #d6d6cf; background: var(--codex-paper); color: var(--codex-ink); }
.codex-page .product-nav { border-bottom-color: rgba(22,22,22,.12); background: rgba(243,242,237,.92); }
.codex-page .eyebrow { color: #62685e; }
.codex-primary { width: fit-content; background: var(--codex-ink); color: #fff; }
.codex-primary:hover { background: #35400d; color: var(--lime); }
.codex-hero { width: min(1180px,100%); min-height: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); align-items: center; gap: 72px; padding: 78px 20px 70px; }
.codex-hero-copy { display: grid; gap: 22px; }
.codex-hero h1 { max-width: 830px; font-size: 76px; font-weight: 650; line-height: .98; }
.codex-hero h1 span { color: #6d7069; }
.codex-hero-copy > p:not(.eyebrow) { max-width: 650px; color: #666a63; font-size: 17px; }
.release-panel { min-height: 330px; display: grid; align-content: space-between; gap: 28px; padding: 28px; border: 1px solid var(--codex-ink); border-radius: 8px; background: var(--codex-ink); color: #fff; }
.release-panel > div { display: grid; gap: 4px; }
.release-panel small, .release-panel dt { color: #a9afa2; font-family: Consolas, monospace; font-size: 11px; }
.release-panel strong { font-size: 58px; line-height: 1; }
.release-panel dl { display: grid; gap: 10px; margin: 0; }
.release-panel dl div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid #363a34; }
.release-panel dd { margin: 0; font-size: 13px; font-weight: 800; }
.release-status { width: fit-content; padding: 6px 9px; border-radius: 5px; background: var(--lime); color: #17200c; font-size: 12px; font-weight: 900; }
.codex-downloads { padding: 88px 20px 92px; border-top: 1px solid var(--codex-line); background: #fff; }
.codex-section-head { width: min(1180px,100%); margin: 0 auto 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 60px; align-items: end; }
.codex-section-head .eyebrow { grid-column: 1 / -1; }
.codex-section-head h2 { font-size: 45px; line-height: 1.08; }
.codex-section-head > p:last-child { color: #6f746b; }
.download-list { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0; }
.download-card { min-height: 360px; display: grid; align-content: space-between; gap: 30px; padding: 28px; border-color: var(--codex-line); background: #f0f0eb; box-shadow: none; }
.download-top { display: flex; align-items: center; justify-content: flex-start; gap: 16px; }
.platform-mark { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(22,22,22,.1); border-radius: 8px; background: #fff; font-family: Consolas, monospace; font-size: 13px; font-weight: 900; }
.download-top div { display: grid; }
.download-top span:not(.platform-mark) { color: #777b73; font-family: Consolas, monospace; font-size: 11px; }
.download-top h3 { font-size: 26px; line-height: 1.2; }
.binary-list { display: grid; border-top: 1px solid #cfd0c9; }
.binary-row { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid #cfd0c9; }
.binary-row > span { min-width: 0; display: grid; }
.binary-row strong { font-size: 16px; }
.binary-row small { color: #696e65; }
.binary-row b { min-width: 64px; min-height: 38px; display: grid; place-items: center; border-radius: 5px; background: var(--codex-ink); color: #fff; font-size: 12px; }
.binary-row:hover b { background: var(--lime); color: var(--codex-ink); }
.codex-notice { width: min(1180px,100%); margin: 34px auto 0; padding-top: 22px; border-top: 1px solid var(--codex-line); color: #696e65; font-size: 13px; }
.codex-contact { width: min(1180px,calc(100% - 40px)); min-height: 480px; margin: 100px auto; display: grid; grid-template-columns: 1fr 340px; align-items: center; gap: 80px; }
.codex-contact-copy { display: grid; gap: 18px; }
.codex-contact-copy h2 { max-width: 720px; font-size: 52px; line-height: 1.08; }
.codex-contact-copy > p:not(.eyebrow) { max-width: 660px; color: #696e65; font-size: 17px; }
.contact-qr { display: grid; justify-items: center; gap: 12px; padding: 24px; border-left: 1px solid var(--codex-line); text-align: center; }
.contact-qr img { width: min(250px,100%); height: auto; border-radius: 8px; }
.contact-qr p { font-weight: 800; }
.contact-qr span { color: #73776f; font-size: 13px; font-weight: 500; }
.codex-donation { min-height: 300px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 28px 70px; padding: 64px max(20px,calc((100% - 1140px)/2)); background: #141713; color: #fff; }
.codex-donation > div { display: grid; gap: 12px; }
.codex-donation .eyebrow { color: var(--lime); }
.codex-donation h2 { font-size: 44px; line-height: 1.08; }
.codex-donation p { color: #b8bdb3; }
.donation-button { min-width: 150px; background: var(--lime); color: #17200c; }
.codex-donation > small { grid-column: 1 / -1; color: #92978e; }

.product-footer { display: flex; justify-content: space-between; gap: 32px; padding: 32px clamp(20px,7vw,110px); border-top: 1px solid var(--line); background: #fff; color: var(--muted); }
.product-footer strong { color: var(--ink); }
.product-footer-summary { max-width: 620px; }
.product-footer-meta { display: grid; justify-items: end; align-content: center; gap: 9px; text-align: right; }
.product-footer-meta nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; color: var(--ink); font-size: 13px; font-weight: 800; }
.product-footer-meta a:hover { color: var(--blue); }
.product-footer-meta small { font-size: 12px; }

.legal-main { min-height: calc(100vh - 70px); background: #fff; }
.legal-hero { padding: 76px clamp(20px,7vw,110px) 56px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #eef5ff 0%, #fff 100%); }
.legal-hero-inner { width: min(1080px,100%); margin: 0 auto; display: grid; gap: 18px; }
.legal-hero h1 { max-width: 820px; font-size: clamp(42px,6vw,72px); line-height: 1.05; letter-spacing: 0; }
.legal-hero .lead { max-width: 760px; color: var(--muted); font-size: 17px; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-meta span { padding: 6px 10px; border: 1px solid #cddbec; border-radius: 5px; background: rgba(255,255,255,.78); color: var(--muted); font-size: 12px; font-weight: 800; }
.legal-layout { width: min(1080px,calc(100% - 40px)); margin: 0 auto; display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 70px; padding: 64px 0 96px; }
.legal-toc { position: sticky; top: 98px; align-self: start; display: grid; gap: 8px; }
.legal-toc strong { margin-bottom: 6px; font-size: 13px; }
.legal-toc a { padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.legal-toc a:hover { color: var(--blue); }
.legal-document { min-width: 0; }
.legal-section { display: grid; gap: 12px; padding: 0 0 34px; margin-bottom: 34px; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.legal-section:last-child { margin-bottom: 0; }
.legal-section h2 { font-size: 25px; line-height: 1.25; }
.legal-section h3 { margin-top: 8px; font-size: 17px; }
.legal-section p, .legal-section li { color: var(--muted); }
.legal-section ul, .legal-section ol { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.legal-section a { color: var(--blue); font-weight: 800; }
.legal-callout { padding: 18px 20px; border-left: 4px solid var(--blue); background: #f3f7fc; color: var(--ink); }
.support-contact { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 42px; align-items: center; padding: 28px 0; }
.support-contact img { width: 220px; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.support-contact-copy { display: grid; gap: 12px; }
.support-contact-copy .button { width: fit-content; }
.contact-modal[hidden] { display: none; }
.contact-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.contact-backdrop { position: absolute; inset: 0; background: rgba(13,23,38,.48); backdrop-filter: blur(8px); }
.contact-dialog { position: relative; z-index: 1; width: min(390px,100%); display: grid; gap: 14px; justify-items: center; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.98); box-shadow: 0 28px 80px rgba(13,23,38,.22); text-align: center; }
.contact-dialog h2 { font-size: 26px; line-height: 1.2; }
.contact-dialog img { width: min(176px,78vw); height: auto; border-radius: 8px; }
.contact-dialog p:last-child { color: var(--muted); }
.contact-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #f2f5f8; cursor: pointer; font-size: 22px; line-height: 1; }
.payment-dialog { max-height: calc(100vh - 40px); overflow-y: auto; }
.payment-dialog .payment-image { width: min(300px,76vw); max-height: 60vh; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.payment-loading { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.payment-loading span { width: 26px; height: 26px; border: 3px solid #dbe5de; border-top-color: var(--green); border-radius: 50%; animation: payment-spin .8s linear infinite; }
.payment-error { padding: 14px; border: 1px solid #efb6b6; border-radius: 6px; background: #fff3f3; color: #9e2929; }
.payment-loading[hidden], .payment-image[hidden], .payment-error[hidden] { display: none; }
@keyframes payment-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .product-nav-links { display: none; }
  .sub-hero, .install-layout { grid-template-columns: 1fr; }
  .chat-demo { max-width: 680px; }
  .feature-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .codex-hero { grid-template-columns: 1fr; gap: 42px; }
  .release-panel { min-height: 290px; }
  .codex-contact { grid-template-columns: 1fr 300px; gap: 46px; }
}
@media (max-width: 680px) {
  .product-nav { height: 64px; }
  .product-brand span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .back-link { padding: 0 10px; }
  .sub-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 52px; }
  .sub-hero h1 { font-size: 43px; }
  .chat-demo { min-height: 500px; }
  .chat-window-bar { grid-template-columns: auto 1fr; padding: 0 14px; }
  .chat-window-bar > span { display: none; }
  .chat-contact, .chat-stream { padding-left: 14px; padding-right: 14px; }
  .chat-bubble { width: 86%; }
  .chat-bubble.short { max-width: 84%; }
  .chat-compose { margin-left: 14px; margin-right: 14px; }
  .feature-list, .pricing-list, .download-list { grid-template-columns: 1fr; }
  .hero-actions .button { width: 100%; }
  .install-layout { gap: 30px; }
  .install-steps article { grid-template-columns: 42px 1fr; }
  .codex-hero { min-height: 0; padding-top: 54px; }
  .codex-hero h1 { font-size: 48px; }
  .codex-title-main { font-size: 42px; }
  .release-panel { min-height: 270px; padding: 22px; }
  .release-panel strong { font-size: 48px; }
  .codex-downloads { padding-top: 64px; padding-bottom: 64px; }
  .codex-section-head { grid-template-columns: 1fr; }
  .codex-section-head .eyebrow { grid-column: auto; }
  .codex-section-head h2 { font-size: 36px; }
  .download-card { min-height: 330px; padding: 22px; }
  .codex-contact { min-height: 0; margin-top: 70px; margin-bottom: 70px; grid-template-columns: 1fr; gap: 36px; }
  .codex-contact-copy h2 { font-size: 38px; }
  .contact-qr { border-top: 1px solid var(--codex-line); border-left: 0; padding: 28px 0 0; }
  .codex-donation { grid-template-columns: 1fr; padding-top: 52px; padding-bottom: 52px; }
  .codex-donation h2 { font-size: 36px; }
  .donation-button { width: 100%; }
  .codex-donation > small { grid-column: auto; }
  .product-footer { display: grid; }
  .product-footer-meta { justify-items: start; text-align: left; }
  .product-footer-meta nav { justify-content: flex-start; }
  .legal-layout { grid-template-columns: 1fr; gap: 34px; padding-top: 42px; }
  .legal-toc { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .legal-toc strong { grid-column: 1 / -1; }
  .support-contact { grid-template-columns: 1fr; }
  .support-contact img { width: min(220px,70vw); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chat-loading span, .chat-bubble.is-entering, .chat-bubble.is-leaving, .chat-compose p.is-typing::after, .chat-compose button.is-sending { animation: none; }
  .payment-loading span { animation: none; }
}
