/* TroubleDone — shared styles. Light/dark themes, English/Chinese copy. */

:root {
  --ink: #17181a;
  --muted: #64656b;
  --line: #e3e1dc;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --accent: #14503f;
  --accent-hover: #0e3d31;
  --accent-ink: #ffffff;
  --link-line: rgba(20, 80, 63, 0.35);
  --radius: 10px;
  --maxw: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ecebe7;
    --muted: #9d9e9a;
    --line: #2c2e2c;
    --bg: #121312;
    --surface: #191a19;
    --accent: #4f9f87;
    --accent-hover: #5cb096;
    --accent-ink: #0b1512;
    --link-line: rgba(120, 196, 174, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #ecebe7;
  --muted: #9d9e9a;
  --line: #2c2e2c;
  --bg: #121312;
  --surface: #191a19;
  --accent: #4f9f87;
  --accent-hover: #5cb096;
  --accent-ink: #0b1512;
  --link-line: rgba(120, 196, 174, 0.4);
  color-scheme: dark;
}

/* ---------- language switching ---------- */

html[data-lang="en"] [data-lang="zh"],
html:not([data-lang]) [data-lang="zh"] { display: none !important; }

html[data-lang="zh"] [data-lang="en"] { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: inherit; }

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

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.header-right { display: flex; align-items: center; gap: 20px; }

.site-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover { color: var(--ink); }

.controls { display: flex; align-items: center; gap: 8px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  min-width: 42px;
  padding: 0 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"]:hover { color: var(--accent-ink); }

.icon-button {
  appearance: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.icon-button:hover { color: var(--ink); border-color: var(--muted); }
.icon-button svg { width: 17px; height: 17px; display: block; }

/* Show the mode you'd switch to: light shows a moon, dark shows a sun. */
.icon-button .icon-sun { display: none; }
:root[data-theme="dark"] .icon-button .icon-sun { display: block; }
:root[data-theme="dark"] .icon-button .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-button .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-button .icon-moon { display: none; }
}

/* ---------- hero ---------- */

.hero { padding: 92px 0 96px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 24px;
  max-width: 17em;
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.032em;
  font-weight: 620;
}

.hero p.lead {
  margin: 0 0 34px;
  max-width: 34em;
  font-size: 19px;
  line-height: 1.62;
  color: var(--muted);
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 550;
  text-decoration: none;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); border-color: var(--muted); }

/* ---------- sections ---------- */

section { padding: 84px 0; border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

h2 {
  margin: 0;
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.022em;
  font-weight: 600;
}

.section-note { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- product ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.product h3 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.018em; font-weight: 600; }
.product p { margin: 0 0 20px; color: var(--muted); font-size: 16px; }

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

.price-table th,
.price-table td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.price-table th { font-weight: 500; color: var(--muted); }
.price-table td { text-align: right; font-variant-numeric: tabular-nums; }
.price-table tr:last-child th,
.price-table tr:last-child td { border-bottom: none; }

.text-link {
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--link-line);
  padding-bottom: 1px;
}

.text-link:hover { border-bottom-color: var(--accent); }

/* ---------- about ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
}

.facts { margin: 0; font-size: 16px; }

.facts div {
  display: flex;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.facts div:first-child { padding-top: 0; }
.facts div:last-child { border-bottom: none; }
.facts dt { flex: 0 0 122px; margin: 0; color: var(--muted); }
.facts dd { margin: 0; }

.about-copy p { margin: 0 0 18px; font-size: 16px; }
.about-copy p:last-child { margin-bottom: 0; }

/* ---------- support ---------- */

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.support-grid h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.support-grid p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.6; }
.support-grid a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--link-line); }
.support-grid a:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover { color: var(--ink); }

/* ---------- legal ---------- */

.legal-main { padding: 52px 0 88px; }

.legal-wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.legal-main h1 {
  margin: 0 0 8px;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.026em;
  font-weight: 620;
}

.updated { margin: 0 0 36px; font-size: 14px; color: var(--muted); }

.legal-main h2 {
  font-size: 19px;
  letter-spacing: -0.012em;
  margin: 36px 0 10px;
  font-weight: 600;
}

.legal-main p,
.legal-main li { font-size: 16px; }
.legal-main p { margin: 0 0 16px; }
.legal-main ul,
.legal-main ol { margin: 0 0 16px; padding-left: 22px; }
.legal-main li { margin-bottom: 8px; }
.legal-main a { color: var(--accent); }

.callout {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 24px;
}

.callout p:last-child { margin-bottom: 0; }

.backlinks {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 15px;
}

.backlinks a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- misc ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .site-nav { display: none; }
}

@media (max-width: 860px) {
  .product,
  .about { grid-template-columns: 1fr; gap: 32px; }
  .support-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero { padding: 60px 0 68px; }
  section { padding: 60px 0; }
}

@media (max-width: 560px) {
  .section-head { flex-direction: column; gap: 8px; }
  .btn { width: 100%; }
  .header-right { gap: 10px; }
  .facts dt { flex: 0 0 96px; }
  .hero p.lead { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
