@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'DM Mono', Consolas, 'Cascadia Code', Menlo, monospace;
  --ink: #f2f5f4;
  --muted: #89918f;
  --line: #292f2e;
  --paper: #111514;
  --mist: #1a1f1e;
  --brand: #fe2c55;
  --brand-ghost: rgba(254, 44, 85, 0.1);
  --chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f8885' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body[data-platform='tiktok'] {
  --brand: #00c8be;
  --brand-ghost: rgba(0, 200, 190, 0.14);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand); color: #fff; }
[hidden] { display: none !important; }

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 0%, var(--brand-ghost), transparent 24rem),
    linear-gradient(145deg, #141918 0%, #0f1211 76%);
  transition: background 0.4s;
}
.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 21, 20, 0.8);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1180px;
  height: 100%;
  margin: auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.7px;
  text-decoration: none;
  justify-self: start;
}
.logo-light { font-weight: 500; }
.logo em { color: var(--muted); font: 500 9px var(--font-mono); letter-spacing: 0.1em; margin-left: 8px; font-style: normal; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  color: #fff;
  background: #e9eeeb;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.brand-mark b { z-index: 1; color: #121615; font: 800 16px/1 var(--font-mono); }
.brand-mark i { position: absolute; width: 22px; height: 22px; border: 4px solid var(--brand); border-radius: 50%; transform: translate(10px, -10px); }

.platform-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #343a38;
  border-radius: 6px;
  background: #171c1b;
}
.platform-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #7f8885;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s;
}
.platform-tabs button i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.platform-tabs .douyin { color: #fe2c55; }
.platform-tabs .tiktok { color: #00c8be; }
.platform-tabs button.active { color: #fff; background: #292f2d; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset; }
.platform-tabs button.active i { color: var(--brand); box-shadow: 0 0 10px var(--brand); }

.lang-btn {
  justify-self: end;
  padding: 7px 14px;
  border: 1px solid #343a38;
  border-radius: 6px;
  background: #171c1b;
  color: #a4adab;
  font: 700 12px var(--font-mono);
  letter-spacing: 0.06em;
  transition: 0.2s;
}
.lang-btn:hover { color: #fff; border-color: var(--brand); }

/* ---------- 页面容器 ---------- */
.home-page { max-width: 1180px; margin: auto; padding: 0 28px; position: relative; }

/* ---------- Hero ---------- */
.hero {
  min-height: 356px;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 12px; color: var(--brand); font: 500 10px var(--font-mono); letter-spacing: 0.14em; }
.hero h1 { margin: 0; color: #f4f7f6; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.08; font-weight: 800; letter-spacing: -0.04em; }
.hero h1 .h1-line1 { display: block; }
.hero h1 .h1-line2 { display: block; margin-top: 8px; color: transparent; -webkit-text-stroke: 1px var(--brand); text-shadow: 0 0 26px var(--brand-ghost); }
.lede { width: 340px; margin: 21px 0 27px; color: #a4adab; font-size: 14px; line-height: 1.85; }
.hero-meta { display: flex; gap: 18px; color: #7f8885; font-size: 11px; }
.hero-meta b { margin-right: 5px; color: var(--brand); font: 500 10px var(--font-mono); }

.hero-signal {
  height: 230px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle, var(--brand-ghost), transparent 53%);
}
.signal-line { position: absolute; width: 100%; height: 1px; background: #303634; }
.signal-orbit { position: absolute; border: 1px solid #333a37; border-radius: 50%; }
.orbit-one { width: 140px; height: 140px; border-color: color-mix(in srgb, var(--brand) 42%, #333); }
.orbit-two { width: 205px; height: 205px; border-style: dashed; }
.signal-core {
  position: relative;
  z-index: 1;
  width: 61px;
  height: 61px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #101413;
  background: var(--brand);
  box-shadow: 0 0 0 10px var(--brand-ghost), 0 0 30px var(--brand);
}
.hero-signal p { position: absolute; right: 9px; bottom: 4px; margin: 0; color: #78817e; font: 10px/1.45 var(--font-mono); letter-spacing: 0.08em; }
.hero-signal p b { color: #e3e8e6; }

/* ---------- 下载面板 ---------- */
.download-panel {
  margin-top: 46px;
  padding: 27px;
  border: 1px solid #343a38;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(32, 38, 36, 0.95), rgba(21, 26, 25, 0.95));
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.16);
}
.panel-header, .methods-head { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-header h2, .methods-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.04em; }
.platform-chip { display: flex; align-items: center; gap: 7px; color: #a4adab; font: 500 10px var(--font-mono); letter-spacing: 0.08em; }
.platform-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 9px var(--brand); }

.download-form {
  display: flex;
  align-items: center;
  margin-top: 22px;
  border: 1px solid #3a4240;
  background: #101413;
  transition: 0.2s;
}
.download-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ghost); }
.download-form.has-error { border-color: #fb6060; }
.mode-select {
  height: 58px;
  padding: 0 34px 0 18px;
  border: 0;
  border-right: 1px solid #2a312f;
  background-color: transparent;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--brand);
  font: 700 12px var(--font-sans);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
}
.download-form input {
  height: 58px;
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #e9efec;
  background: transparent;
  font-size: 14px;
}
.download-form input::placeholder { color: #707a77; }

.account-select {
  height: 40px;
  margin-right: 10px;
  padding: 0 30px 0 12px;
  border: 1px solid #3a4240;
  border-radius: 6px;
  background-color: #171c1b;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: #e9efec;
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

.download-button {
  align-self: stretch;
  min-width: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  color: #111514;
  background: var(--brand);
  font-size: 13px;
  font-weight: 800;
  transition: 0.2s;
}
.download-button:hover { filter: brightness(1.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.download-button:disabled { cursor: wait; opacity: 0.7; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(0, 0, 0, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

.form-foot { display: flex; justify-content: space-between; min-height: 20px; padding-top: 11px; color: #77817e; font-size: 11px; }
.form-foot button { border: 0; background: none; color: #a5aeab; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.form-foot .error-text { color: #ff8080; }
.form-foot .success-text { display: flex; align-items: center; gap: 5px; color: #7ae1c2; }

/* ---------- 分区标题（任务区复用） ---------- */
.methods-head { margin-bottom: 22px; }
.methods-head h2 { font-size: 27px; }
.methods-head > p { width: 225px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

/* ---------- 任务区 ---------- */
.tasks-section { margin-top: 88px; }
.tasks { display: flex; flex-direction: column; gap: 12px; }
.empty { margin: 0; color: var(--muted); font-size: 13px; }
.task {
  padding: 16px 18px;
  border: 1px solid #343a38;
  border-radius: 7px;
  background: rgba(23, 28, 27, 0.5);
}
.task-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.status { padding: 2px 10px; border-radius: 999px; font: 500 11px var(--font-mono); color: #111514; background: var(--brand); }
.status.pending { color: #cbd1cf; background: #343b38; }
.status.running { color: #111514; background: var(--brand); }
.status.success { color: #0d1f17; background: #22c55e; }
.status.failed { color: #fff; background: #ef4444; }
.task-id { color: var(--muted); font: 11px var(--font-mono); }
.task-msg { color: var(--ink); }
.task-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  text-decoration: none;
  font: 13px var(--font-mono);
  word-break: break-all;
}
.file-link:hover { text-decoration: underline; }

/* ---------- footer ---------- */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 55px 0 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: #69736f;
  font: 10px var(--font-mono);
  letter-spacing: 0.08em;
}
footer b { color: #c5ceca; font-weight: 500; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #89918f; text-decoration: none; transition: 0.2s; }
.footer-links a:hover { color: var(--brand); }

/* ---------- 法律页面 ---------- */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}
.legal-page h1 {
  margin: 0 0 6px;
  font-size: 36px;
  letter-spacing: -0.04em;
}
.legal-date {
  margin: 0 0 42px;
  color: var(--muted);
  font-size: 13px;
}
.legal-page section {
  margin-bottom: 36px;
}
.legal-page h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--ink);
}
.legal-page p {
  margin: 0 0 12px;
  color: #a4adab;
  font-size: 14px;
  line-height: 1.8;
}
.legal-page ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: #a4adab;
  font-size: 14px;
  line-height: 1.8;
}
.legal-page ul li { margin-bottom: 6px; }
.legal-page a { color: var(--brand); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #3c4541;
  color: #eff5f1;
  background: #1a201e;
  box-shadow: 6px 6px 0 var(--brand-ghost);
  font-size: 12px;
  z-index: 60;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .topbar { height: 64px; }
  .topbar-inner { padding: 0 16px; grid-template-columns: 1fr auto; }
  .platform-tabs { position: absolute; top: 72px; left: 16px; grid-column: 1 / -1; }
  
  .home-page { padding: 0 16px; }
  .hero { min-height: 0; grid-template-columns: 1fr; padding: 83px 0 37px; }
  .hero-signal { display: none; }
  .hero h1 { font-size: 30px; }
  .download-panel { margin-top: 26px; padding: 19px; }
  .download-form { flex-wrap: wrap; }
  .mode-select { width: 100%; height: 44px; border-right: 0; border-bottom: 1px solid #2a312f; }
  .download-form input { width: 100%; flex: none; height: 50px; }
  .account-select { width: 100%; margin: 0; }
  .download-button { width: 100%; height: 48px; }
  .form-foot { gap: 10px; }
  .methods-head > p { display: none; }
  .tasks-section { margin-top: 64px; }
  footer { flex-direction: column; gap: 10px; }
  .footer-links { gap: 12px; }
}
