/* ==========================================================================
   抖抖一键去水印提取 — 全站样式
   单文件、无构建、无框架。目标：首屏 < 20KB，LCP 不被 CSS 拖累。
   配色：全白底 + 蓝色主行动点。只用一种强调色，其余靠留白和细边框分层。
   全站固定亮色，不跟随系统深色 —— 用户看到的永远是白底蓝按钮。
   ========================================================================== */

:root {
  /* 固定亮色：不写 prefers-color-scheme 分支，系统开深色也不变 */
  color-scheme: light only;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e9f0;
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --brand-soft: rgba(37, 99, 235, 0.06);
  --ok: #059669;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 页头 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* 纯白实底。原来用半透明 + 毛玻璃，滚动时会把下面的文字透上来，
     白底站看起来发灰，不如直接给死白色。 */
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  /* flex 子项默认 min-width:auto，不加这条 .nav 撑不开会溢出到视口外，
     手机上整页跟着横向滚动。 */
  min-width: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }

.logo-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  object-fit: cover;
  /* 这张图本身是紫底圆 + 透明四角的圆形构图，边缘自带轮廓，
     不用再加描边，加了反而像贴了个边框。 */
}

.nav {
  display: flex;
  gap: 16px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 14px;
  min-width: 0;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.on { color: var(--text); border-bottom-color: var(--brand); }

/* ---------------------------------------------------------------- 首屏 */

.hero { padding: 52px 0 8px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 4.2vw, 2.3rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.lead {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 62ch;
}

/* ---------------------------------------------------------------- 解析框 */

.parse {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.parse textarea {
  width: 100%;
  min-height: 92px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.parse textarea::placeholder { color: var(--muted); opacity: 0.75; }
.parse textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.parse-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 24px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 4px 14px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 2px 4px rgba(37, 99, 235, 0.24), 0 6px 18px rgba(37, 99, 235, 0.26); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: 0.65; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quota {
  font-size: 13.5px;
  color: var(--muted);
}
.quota b { color: var(--text); font-weight: 600; }

.hint {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 20px;
}
.hint.err { color: #e11d48; }
.hint.ok { color: var(--ok); }

/* ---------------------------------------------------------------- 结果 */

.result { margin-top: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.card-cover {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}

.card-title {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
}

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.fmt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.fmt:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.fmt small { color: var(--muted); font-size: 12.5px; font-weight: 400; }

.imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.imgs a { display: block; }
.imgs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-2);
  display: block;
}

/* ---------------------------------------------------------------- 正文 */

main h2 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 44px 0 12px;
  letter-spacing: -0.01em;
}

/* 正文里的链接压暗：整段都是红色会让页面看起来很吵，
   只留一条细下划线做提示，悬停才变品牌色。 */
main a:not(.fmt):not(.btn) {
  color: inherit;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
}
main a:not(.fmt):not(.btn):hover {
  color: var(--brand);
  text-decoration: none;
  border-bottom-color: var(--brand);
}

main p, main li { color: var(--muted); font-size: 15px; }

/* 正文限制行宽。860px 容器下整行能排到 90 多个字符，读起来很累。 */
main section > p,
main section > ul,
main section > ol { max-width: 70ch; }

main ul, main ol { padding-left: 20px; }
main li { margin: 6px 0; }

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 38px;
  border-bottom: 1px dashed var(--border);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 12px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------------------------------------------------------------- FAQ */

.faq { margin-top: 44px; }

.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px; top: 14px;
  color: var(--muted);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 0;
  padding: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.75;
}

/* ---------------------------------------------------------------- 小程序 */

.mp-card {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 48px 0 0;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.mp-text { flex: 1 1 auto; min-width: 0; }
.mp-text h2 { margin: 0 0 8px; font-size: 1.05rem; }
.mp-text p { margin: 0 0 6px; font-size: 14.5px; color: var(--muted); }
.mp-text strong { color: var(--text); }
.mp-note { font-size: 13px !important; opacity: 0.85; }

.mp-qr {
  flex: 0 0 auto;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.mp-qr img {
  display: block;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

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

.site-footer {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 12px;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--brand); }
.footer-note { margin: 0 0 10px; line-height: 1.7; max-width: 70ch; }
.footer-copy { margin: 0; opacity: 0.7; }

/* ---------------------------------------------------------------- 弹层 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 350px;
  padding: 26px 24px 24px;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
}
.modal-box h2 { margin: 0 0 8px; font-size: 1.05rem; }
.modal-box p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.modal-qr { display: block; margin: 0 auto 12px; border-radius: 10px; background: #fff; padding: 6px; }
.modal-tip { margin: 0 !important; font-size: 13.5px; }
.modal-x {
  position: absolute;
  top: 8px; right: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.modal-x:hover { color: var(--text); }

/* ---------------------------------------------------------------- 移动端 */

@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .header-inner { height: 54px; gap: 12px; }
  .nav { gap: 13px; font-size: 13.5px; }
  .logo-text { font-size: 15.5px; }
  .mp-card { flex-direction: column-reverse; text-align: center; gap: 18px; }
  .mp-text h2 { font-size: 1rem; }
  .btn-primary { width: 100%; }
  .parse-row { gap: 10px; }
  .quota { width: 100%; text-align: center; }
  .card-cover { width: 68px; height: 68px; flex-basis: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
