/* Tessel 官网：首页 + 隐私政策 + 技术支持共用的样式。纯静态，无构建。 */

:root {
  --accent: #0a857a;
  --accent-fill: #0a857a;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --brand-a: #2cc5b3;
  --brand-b: #0a7c73;
  --bg: #ffffff;
  --bg-alt: #f5f7f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #5c6566;
  --text-3: #8a9394;
  --line: rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.06), 0 30px 80px rgba(10, 60, 56, 0.18);
  --radius: 18px;
  --max: 1080px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #2dd4bf;
    --accent-fill: #0d9488;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --bg: #0b0d0e;
    --bg-alt: #121516;
    --card: #171b1c;
    --text: #f2f4f4;
    --text-2: #a3adae;
    --text-3: #77817f;
    --line: rgba(255, 255, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 80px rgba(0, 0, 0, 0.55);
  }
}

/* 双语：同一页面里中英文两份内容，按 html.zh 只显示一份（site.js 在首帧前设好）。 */
html.zh [data-l="en"],
html:not(.zh) [data-l="zh"] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Helvetica Neue", "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font: 0.88em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--accent-soft);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶栏 ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-2);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.lang-toggle {
  font: inherit;
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  cursor: pointer;
}

.lang-toggle:hover {
  color: var(--text);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  background: var(--text);
  color: var(--bg);
}

.btn:hover {
  text-decoration: none;
  opacity: 0.88;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 0 6px;
}

/* ---------- 首页：Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 40px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 900px;
  background: radial-gradient(ellipse at 50% 30%, rgba(44, 197, 179, 0.22), transparent 60%);
  pointer-events: none;
}

.hero > .wrap {
  position: relative;
}

.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(10, 124, 115, 0.35);
}

.eyebrow {
  margin: 26px 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 10px auto 0;
  max-width: 820px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 22px auto 0;
  max-width: 640px;
  color: var(--text-2);
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.55;
}

.cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.platforms {
  margin-top: 16px;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- 首页：Safari 窗口演示 ---------- */

.stage {
  position: relative;
  margin: 64px auto 0;
  max-width: 920px;
  text-align: left;
}

.window {
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}

.lights {
  display: flex;
  gap: 8px;
}

.lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
}

.lights i:nth-child(2) {
  background: #febc2e;
}

.lights i:nth-child(3) {
  background: #28c840;
}

.address {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  height: 28px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ext-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
}

.ext-btn img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.page {
  padding: 40px 340px 48px 56px;
  min-height: 420px;
}

.page .kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page h2 {
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.page .byline {
  color: var(--text-3);
  font-size: 14px;
  margin-bottom: 22px;
}

.page p,
.page li {
  font-size: 16.5px;
  line-height: 1.7;
  max-width: 560px;
}

.page ul {
  padding-left: 22px;
}

/* 一段 = 原文和译文叠在同一格里，切换时交叉淡入，段落位置不跳（呼应「原地替换」）。 */
.seg {
  display: grid;
}

.seg > span {
  grid-area: 1 / 1;
  transition: opacity 0.45s ease, filter 0.45s ease;
  transition-delay: calc(var(--i, 0) * 140ms);
}

.seg > .t,
.translated .seg > .o {
  opacity: 0;
  filter: blur(3px);
}

.translated .seg > .t {
  opacity: 1;
  filter: none;
}

.seg > .o,
.seg > .t {
  pointer-events: none;
}

/* 扩展面板（iOS inset grouped 风格） */
.popup {
  position: absolute;
  top: 54px;
  right: -28px;
  width: 300px;
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-alt) 92%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
}

.popup::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 52px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: inherit;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.card {
  background: var(--card);
  border-radius: 11px;
  padding: 10px 12px;
}

.card + .card {
  margin-top: 10px;
}

.langs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
}

.langs .arrow {
  color: var(--text-3);
}

.chev {
  width: 8px;
  height: 11px;
  margin-left: 4px;
  vertical-align: -1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-3);
}

.site-row .chev {
  color: inherit;
}

.segmented {
  display: flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--bg-alt);
  font-size: 12.5px;
}

.segmented span {
  flex: 1;
  text-align: center;
  padding: 4px 0;
  border-radius: 7px;
  color: var(--text-2);
}

.segmented .on {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.primary {
  margin-top: 10px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-fill);
  color: #fff;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.primary span {
  grid-area: 1 / 1;
  transition: opacity 0.3s;
}

.primary .when-done,
.translated .primary .when-idle {
  opacity: 0;
}

.translated .primary .when-done {
  opacity: 1;
}

.site-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
}

.site-row b {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- 首页：分区 ---------- */

.section {
  padding: 110px 0;
}

.section.alt {
  background: var(--bg-alt);
}

.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 16px 0 0;
  color: var(--text-2);
  font-size: 19px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.feature .glyph {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature .glyph svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  margin: 18px 0 8px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.6;
}

.engines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.engine {
  border-radius: 24px;
  padding: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.engine.llm {
  background: linear-gradient(150deg, #11a596, #0a6f68);
  color: #fff;
  border: none;
}

.engine .tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.engine.llm .tag {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.engine h3 {
  margin: 16px 0 10px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.engine p {
  margin: 0;
  font-size: 16.5px;
  color: var(--text-2);
}

.engine.llm p {
  color: rgba(255, 255, 255, 0.86);
}

.engine ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15.5px;
}

.engine li {
  padding: 9px 0 9px 28px;
  border-top: 1px solid var(--line);
  position: relative;
}

.engine.llm li {
  border-color: rgba(255, 255, 255, 0.16);
}

.engine li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 16px;
  width: 12px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.7;
}

.native {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.native .big {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.native p {
  margin: 6px auto 0;
  max-width: 280px;
  color: var(--text-2);
  font-size: 15.5px;
}

.closing {
  text-align: center;
  padding: 120px 0;
}

.closing img {
  width: 84px;
  height: 84px;
  border-radius: 20px;
}

.closing h2 {
  margin: 22px 0 0;
  font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: -0.025em;
}

.closing p {
  color: var(--text-2);
  font-size: 19px;
  margin: 12px 0 30px;
}

/* App Store 二维码：只在桌面上有意义（手机上直接点按钮） */
.qr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-2);
}

.qr img {
  width: 92px;
  height: 92px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
}

@media (hover: none), (max-width: 620px) {
  .qr {
    display: none;
  }
}

/* ---------- 文档页（隐私政策、技术支持） ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.doc h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 46px);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.doc .meta {
  margin: 10px 0 0;
  color: var(--text-3);
  font-size: 14px;
}

.doc .summary {
  margin: 34px 0 10px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.doc .summary ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.doc .summary li {
  margin: 4px 0;
}

.doc h2 {
  margin: 48px 0 10px;
  font-size: 24px;
  letter-spacing: -0.015em;
}

.doc h3 {
  margin: 28px 0 6px;
  font-size: 18px;
}

.doc p,
.doc li {
  color: var(--text);
  font-size: 16.5px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc .muted {
  color: var(--text-2);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.doc th {
  color: var(--text-2);
  font-weight: 600;
}

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 30px 0 10px;
}

.contact > div {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.contact h3 {
  margin: 0 0 6px;
}

.contact p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}

details summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 28px 14px 0;
  font-weight: 600;
  font-size: 17px;
  position: relative;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 10px;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-3);
}

details[open] summary::after {
  content: "−";
}

details > :not(summary) {
  margin-top: 0;
  color: var(--text-2);
}

details > :last-child {
  margin-bottom: 18px;
}

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.steps > div {
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.steps h3 {
  margin: 0 0 6px;
}

.steps ol {
  margin: 0;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
  font-size: 13px;
  color: var(--text-3);
}

.footer .wrap {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.footer a {
  color: var(--text-2);
}

.footer .spacer {
  flex: 1;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 860px) {
  .grid,
  .native {
    grid-template-columns: 1fr 1fr;
  }

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

  .page {
    padding-right: 56px;
  }

  .popup {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    max-width: 340px;
    margin: -60px auto 0;
  }

  .popup::before {
    display: none;
  }
}

@media (max-width: 620px) {
  .nav-links .hide-sm {
    display: none;
  }

  .hero {
    padding-top: 56px;
  }

  .page {
    padding: 28px 22px 80px;
    min-height: 0;
  }

  .page h2 {
    font-size: 24px;
  }

  .grid,
  .native,
  .contact,
  .steps {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 80px 0;
  }

  .engine {
    padding: 30px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .seg > span,
  .primary span {
    transition: none;
  }
}
