/* IVY Drive studio portal — shared styles. Dark theme; cyan/teal accent taken
   from the circuit-ivy leaf logo (leaf green + PCB-trace cyan). No frameworks. */

:root {
  --bg: #0B110E;
  --bg-2: #0F1713;
  --bg-3: #15201A;
  --line: #22312A;
  --text: #E8EFEB;
  --muted: #96A69D;
  --accent: #159A7B;
  --accent-2: #1FC29A;
  --ok: #2FAE8B;
  --radius: 14px;
  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 17, 14, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px; height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.brand img { height: 22px; }
.brand span { color: var(--muted); font-weight: 500; font-size: 14px; }
nav.main { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
nav.main a { color: var(--muted); transition: color .15s; }
nav.main a:hover, nav.main a.active { color: var(--text); }
nav.main a.cta {
  color: #fff; background: var(--accent); padding: 6px 16px; border-radius: 999px;
}
nav.main a.cta:hover { background: var(--accent-2); }

/* ---- header account chip (injected by js/account-chip.js) ---- */
.acct { position: relative; margin-left: 16px; flex: 0 0 auto; }
.acct-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 4px; cursor: pointer; color: var(--muted);
  font: inherit; font-size: 14px; transition: border-color .15s, color .15s;
}
.acct-btn:hover { border-color: var(--accent); color: var(--text); }
.acct-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}
.acct-avatar.guest { background: var(--bg-3); color: var(--muted); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 232px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; z-index: 60;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 6px;
}
.acct-menu[hidden] { display: none; }
.acct-email { font-size: 14px; color: var(--text); font-weight: 600; word-break: break-all; }
.acct-line { font-size: 13px; color: var(--muted); }
.acct-line b { color: var(--text); font-weight: 600; }
.acct-sub { color: var(--muted); opacity: .75; margin-left: 6px; font-size: 12px; }
.acct-link {
  margin-top: 4px; text-align: left; font-size: 14px; color: var(--accent-2);
  background: none; border: none; padding: 6px 0 0; cursor: pointer; font-family: inherit;
  border-top: 1px solid var(--line);
}
.acct-link.danger { color: #E4796F; }
.acct-link:hover { text-decoration: underline; }

/* ---- sign-in modal (built by js/account.js) ---- */
.ivy-modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 8, 6, .72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ivy-modal-backdrop[hidden] { display: none; }
.ivy-modal {
  position: relative; width: 100%; max-width: 380px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 12px;
}
.ivy-modal h3 { font-size: 20px; }
.ivy-modal-x {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.ivy-modal-x:hover { color: var(--text); }
.ivy-modal-tabs { display: flex; gap: 18px; margin-bottom: 2px; }
.ivy-modal-tabs button {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--muted);
}
.ivy-modal-tabs button.active { color: var(--text); font-weight: 700; }
.ivy-modal input {
  width: 100%; padding: 11px 13px; font-size: 15px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
}
.ivy-modal input:focus { outline: none; border-color: var(--accent); }
.ivy-modal-row { display: flex; gap: 8px; }
.ivy-modal-row input { flex: 1; min-width: 0; }
.ivy-modal-row .btn { white-space: nowrap; flex: 0 0 auto; }
.ivy-modal .btn.primary { width: 100%; justify-content: center; text-align: center; }
.ivy-modal .msg { min-height: 20px; font-size: 14px; }
.ivy-modal .hint { margin-top: 2px; }

/* ---- hero ---- */
.hero { padding: 96px 0 72px; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.15; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { margin-top: 18px; font-size: 18px; color: var(--muted); max-width: 640px; }
.hero .actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font-size: 16px; font-weight: 600;
  border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: all .15s; background: transparent;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.big { padding: 15px 34px; font-size: 17px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* circuit-trace accent strip (echoes the leaf logo's speed lines + node) */
.checker {
  height: 4px; width: 150px; margin-bottom: 28px; border-radius: 2px; position: relative;
  background: linear-gradient(90deg, transparent, #0AB4DC 22%, #19BFEA);
}
.checker::before {
  content: ""; position: absolute; left: 34px; top: -8px; width: 76px; height: 4px;
  border-radius: 2px; background: #0AB4DC; opacity: .45;
}
.checker::after {
  content: ""; position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; border-radius: 50%; background: #19BFEA;
  box-shadow: 0 0 12px rgba(25, 191, 234, .6);
}

/* ---- sections ---- */
section.block { padding: 64px 0; }
section.block.alt { background: var(--bg-2); }
.block h2 { font-size: clamp(24px, 3.2vw, 34px); margin-bottom: 10px; }
.block p.sub { color: var(--muted); max-width: 680px; margin-bottom: 36px; }

/* product cards on the home page */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.card {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); border-color: #33453B; }
.card .thumb { aspect-ratio: 16/10; overflow: hidden; background: #0A100D; display: flex; align-items: center; justify-content: center; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb img.contain { object-fit: contain; padding: 18px; }
.card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.card .go { color: var(--accent); font-weight: 600; font-size: 15px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: rgba(21, 154, 123, .15); color: var(--accent-2); white-space: nowrap;
}
.tag.soon { background: rgba(154, 162, 177, .15); color: var(--muted); }
.tag.free { background: rgba(47, 174, 139, .15); color: var(--ok); }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.feature .ico { font-size: 22px; margin-bottom: 8px; }
.feature h4 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* screenshots / gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.shot {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0A100D;
}
.shot img { width: 100%; }
.shot figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.phone-shots { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.phone-shots .shot { width: min(280px, 80vw); }

/* pricing */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; align-items: stretch; }
.tier {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 8px; position: relative;
}
.tier.hot { border-color: var(--accent); box-shadow: 0 0 32px rgba(21, 154, 123, .12); }
.tier .flag {
  position: absolute; top: -12px; right: 18px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  padding: 2px 12px; border-radius: 999px;
}
.tier h3 { font-size: 19px; }
.tier .price { font-size: 15px; color: var(--muted); }
.tier ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.tier li { font-size: 14.5px; color: var(--muted); padding-left: 22px; position: relative; }
.tier li::before { content: "✓"; color: var(--ok); position: absolute; left: 0; font-weight: 700; }
.tier li.no::before { content: "—"; color: #56655C; }

/* promo claim */
.promo-box {
  background: linear-gradient(135deg, rgba(21,154,123,.14), rgba(21,154,123,.03));
  border: 1px solid rgba(21, 154, 123, .4); border-radius: var(--radius);
  padding: 30px; margin-top: 40px;
}
.promo-box h3 { font-size: 22px; margin-bottom: 6px; }
.counters { display: flex; gap: 28px; margin: 18px 0 6px; flex-wrap: wrap; }
.counter { min-width: 150px; }
.counter .n { font-size: 34px; font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.counter .lbl { font-size: 13px; color: var(--muted); }
.claim-forms { margin-top: 18px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.form-row input {
  flex: 1; min-width: 180px; padding: 11px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 15px;
}
.form-row input:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }
.msg { margin-top: 10px; font-size: 14.5px; min-height: 22px; }
.msg.ok { color: var(--ok); }
.msg.err { color: #ff6b5e; }
.linkish { background: none; border: none; color: var(--accent-2); cursor: pointer; font-size: 14px; padding: 0; }
.claim-choices { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }

/* wechat contact */
.wechat-card {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; margin-top: 26px;
}
.wechat-card .num { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--accent-2); }
.wechat-card .cp { font-size: 13px; }

/* coming soon banner */
.soon-banner {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px dashed var(--accent); color: var(--accent-2);
  padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  margin-bottom: 24px;
}

/* spec table */
table.spec { width: 100%; border-collapse: collapse; font-size: 15px; }
table.spec td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.spec td:first-child { color: var(--muted); width: 34%; white-space: nowrap; }

/* footer */
footer.site {
  border-top: 1px solid var(--line); padding: 40px 0 48px; margin-top: 40px;
  color: var(--muted); font-size: 14px;
}
footer.site .cols { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; }
footer.site img { height: 18px; opacity: .7; margin-bottom: 10px; }
footer.site a:hover { color: var(--text); }

/* download box */
.dl-box {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; display: flex; flex-direction: column; gap: 12px; margin-top: 26px;
}
.dl-box .meta { font-size: 13.5px; color: var(--muted); font-family: ui-monospace, monospace; word-break: break-all; }

@media (max-width: 640px) {
  nav.main { gap: 14px; font-size: 14px; }
  nav.main a:not(.cta) { display: none; }
  .acct { margin-left: 10px; }
  .acct-name { display: none; }
  .acct-btn { padding: 4px; }
  .brand { white-space: nowrap; }
  .hero { padding: 64px 0 48px; }
}

/* ---- AI tuning-report showcase (sonoscope page) ---- */
.report-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .report-wrap { grid-template-columns: 1fr; } }
.report-doc {
  background: #f5f6f8; color: #1a1d24; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.45);
  font-size: 13.5px; line-height: 1.55; max-height: 620px; overflow-y: auto;
}
.report-doc .doc-head { background: #12324a; color: #fff; padding: 20px 22px; }
.report-doc .doc-head .kick { font-size: 11px; letter-spacing: 1px; opacity: .7; text-transform: uppercase; }
.report-doc .doc-head h3 { font-size: 19px; margin: 4px 0 6px; color: #fff; }
.report-doc .doc-head .meta { font-size: 12px; opacity: .75; }
.report-doc .doc-body { padding: 18px 22px 24px; }
.report-doc h4 {
  font-size: 14px; margin: 18px 0 8px; padding-left: 10px; color: #12324a;
  border-left: 3px solid var(--accent);
}
.report-doc h4:first-child { margin-top: 0; }
.report-doc ul { margin: 0 0 2px 18px; }
.report-doc li { margin-bottom: 4px; }
.report-doc table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
.report-doc th, .report-doc td { padding: 6px 8px; border-bottom: 1px solid #e0e3e8; text-align: left; }
.report-doc th { color: #5a6270; font-weight: 600; }
.report-doc td.neg { color: #c0392b; }
.report-doc td.pos { color: #2e7d46; }
.report-doc .fr { margin: 8px 0 2px; }
.report-doc .fr .cap { font-size: 11.5px; color: #5a6270; margin-bottom: 2px; }
.report-doc .fr svg { width: 100%; height: auto; display: block; background: #fff; border: 1px solid #e0e3e8; border-radius: 6px; }
.report-side h2 { margin-bottom: 10px; }
.report-steps { list-style: none; margin: 18px 0 0; padding: 0; }
.report-steps li { padding-left: 30px; position: relative; margin-bottom: 14px; color: var(--muted); }
.report-steps li b { color: var(--text); }
.report-steps li::before {
  content: counter(step); counter-increment: step;
  position: absolute; left: 0; top: -1px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.report-steps { counter-reset: step; }

/* ---- language switching (js/i18n.js) ----
   Both languages live in the page; one is hidden. !important because some
   blocks carry inline display styles of their own, and the hidden language must
   win over every one of them — a half-shown translation is worse than none. */
html[data-lang="en"] [lang="zh"],
html[data-lang="zh"] [lang="en"] { display: none !important; }

.langsw { display: flex; margin-left: 12px; flex: 0 0 auto; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.langsw button {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13px; line-height: 1; padding: 7px 11px;
  transition: background .15s, color .15s;
}
.langsw button:hover { color: var(--text); }
.langsw button.on { background: var(--accent); color: #fff; }
/* The switcher sits left of the account chip; account.js appends the chip after
   i18n.js has mounted, so source order already puts them in that order. */
.langsw + .acct { margin-left: 10px; }

/* ---- buy buttons on plan cards (js/checkout.js) ---- */
.tier .btn { display: inline-block; margin-top: 16px; text-align: center; width: 100%; }
/* No product id configured yet: the button still works, but as a "tell me when
   it opens" mailto rather than a checkout link that would 404. */
.tier .btn.pending, .btn.pending { background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); }
.tier .btn.pending:hover, .btn.pending:hover { color: var(--text); border-color: var(--accent); }
