/* ==========================================================
   抖音无水印下载 · 全站样式
   ========================================================== */

:root {
  --bg: #f5f6f8;
  --bg-soft: #eef0f4;
  --card: #ffffff;
  --text: #161823;
  --text-2: #414b5a;
  --muted: #7a8494;
  --border: #e6e9ef;
  --primary: #fe2c55;
  --primary-dark: #e11d45;
  --primary-soft: #fff0f3;
  --accent: #25f4ee;
  --ok: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 35, .04), 0 8px 24px rgba(22, 24, 35, .06);
  --shadow-lg: 0 12px 40px rgba(22, 24, 35, .12);
}

* { box-sizing: border-box; }

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

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: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  box-shadow: 2px 2px 0 var(--accent);
}
.logo-text { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--text-2); font-size: 14px; }
.nav a:hover { color: var(--primary); text-decoration: none; }

/* ---------------- Hero ---------------- */
.hero { padding: 44px 0 10px; text-align: center; }
.hero-title {
  font-size: 34px; line-height: 1.3; margin: 0 0 12px;
  font-weight: 800; letter-spacing: -.4px;
}
.hero-title::after {
  content: ""; display: block; width: 56px; height: 4px; margin: 14px auto 0;
  border-radius: 2px; background: linear-gradient(90deg, var(--primary), var(--accent));
}
.hero-sub { color: var(--muted); margin: 0 0 26px; font-size: 15px; }
.hero-sub strong { color: var(--text-2); font-weight: 600; }

/* ---------------- 输入卡片 ---------------- */
.input-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
  transition: box-shadow .2s, border-color .2s;
}
.input-card:focus-within {
  border-color: #ffc4d0;
  box-shadow: 0 0 0 4px rgba(254, 44, 85, .08), var(--shadow);
}
#linkInput {
  width: 100%; border: 0; outline: 0; resize: vertical;
  font: inherit; color: var(--text); background: transparent;
  padding: 8px 6px; min-height: 74px; line-height: 1.6;
}
#linkInput::placeholder { color: #adb5c0; }
.input-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 12px; margin-top: 4px;
}
.input-tips { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.input-tips .dot { opacity: .5; }
.input-actions { display: flex; gap: 8px; }

.btn {
  font: inherit; font-size: 14px; border-radius: 10px;
  padding: 9px 16px; cursor: pointer; border: 1px solid transparent;
  transition: all .16s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(254, 44, 85, .28);
  min-width: 112px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: #f3f4f7; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: #eaecf1; }
.btn-mini {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: 5px 12px; font-size: 12.5px; border-radius: 8px;
}
.btn-mini:hover { color: var(--primary); border-color: #ffc4d0; }

.error-box {
  max-width: 760px; margin: 14px auto 0; text-align: left;
  background: #fff5f6; border: 1px solid #ffd7de; color: #c81e3f;
  padding: 11px 16px; border-radius: 12px; font-size: 14px;
}

/* ---------------- 广告位 ---------------- */
.ad-slot {
  margin: 26px auto; max-width: 1000px; min-height: 0;
  display: flex; justify-content: center; align-items: center;
}
.ad-slot:empty { display: none; }
.ad-slot ins { display: block; }
.ad-placeholder {
  width: 100%; border: 1px dashed #d6dae2; border-radius: 12px;
  background: #fafbfc; color: #a7aebb; font-size: 12.5px;
  text-align: center; padding: 16px; letter-spacing: .5px;
}

/* ---------------- 结果卡片 ---------------- */
.result-section { padding: 26px 0 6px; animation: fadeUp .35s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow);
  padding: 22px; display: grid; gap: 22px;
  grid-template-columns: 300px 1fr;
}
@media (max-width: 760px) { .result-card { grid-template-columns: 1fr; } }

.result-media {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--bg-soft); aspect-ratio: 3 / 4;
  display: flex; align-items: center; justify-content: center;
}
.result-media img,
.result-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.result-media .badge {
  position: absolute; left: 10px; top: 10px;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  backdrop-filter: blur(4px);
}
.result-media .badge.right { left: auto; right: 10px; }

.result-info { min-width: 0; }
.result-title {
  font-size: 17px; font-weight: 700; margin: 0 0 12px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.author-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.author-row img {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.author-meta { min-width: 0; }
.author-name { font-weight: 600; font-size: 14px; }
.author-id { color: var(--muted); font-size: 12.5px; }

.stats { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.stats b { color: var(--text-2); font-weight: 600; }

.dl-block { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.dl-label {
  font-size: 12.5px; color: var(--muted); font-weight: 600;
  letter-spacing: .6px; margin-bottom: 10px; text-transform: uppercase;
}
.quality-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.q-chip {
  border: 1px solid var(--border); background: #fafbfc; color: var(--text-2);
  border-radius: 9px; padding: 7px 13px; font-size: 13px; cursor: pointer;
  transition: all .15s ease;
}
.q-chip:hover { border-color: #ffc4d0; color: var(--primary); }
.q-chip.active {
  background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary); font-weight: 600;
}
.q-chip small { color: var(--muted); font-size: 11.5px; }
.q-chip.active small { color: var(--primary); opacity: .8; }

.dl-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-download {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary); color: #fff; border: 0;
  padding: 11px 20px; border-radius: 11px; font-size: 14px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 14px rgba(254, 44, 85, .26);
  transition: all .16s ease;
}
.btn-download:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-download.secondary {
  background: #f3f4f7; color: var(--text-2); box-shadow: none;
  border: 1px solid var(--border); font-weight: 500;
}
.btn-download.secondary:hover { background: #eaecf1; color: var(--text); }

.image-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.image-grid a {
  display: block; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-soft);
  aspect-ratio: 3 / 4;
}
.image-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.image-grid a:hover img { transform: scale(1.05); }

.raw-link {
  margin-top: 16px; font-size: 12.5px; color: var(--muted);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.raw-link input {
  flex: 1; min-width: 180px; font: inherit; font-size: 12.5px;
  padding: 7px 11px; border: 1px solid var(--border);
  border-radius: 8px; background: #fafbfc; color: var(--text-2);
  outline: 0;
}
.raw-link input:focus { border-color: #ffc4d0; }

/* ---------------- 加载 ---------------- */
.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 最近解析 ---------------- */
.history-section { padding: 10px 0 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 18px; margin: 0; }
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.history-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; display: flex; gap: 10px;
  cursor: pointer; transition: all .16s ease; text-align: left;
  font: inherit; color: inherit;
}
.history-item:hover { border-color: #ffc4d0; box-shadow: var(--shadow); }
.history-item img {
  width: 46px; height: 62px; object-fit: cover; border-radius: 7px;
  background: var(--bg-soft); flex-shrink: 0;
}
.history-item .hi-body { min-width: 0; }
.history-item .hi-title {
  font-size: 13px; font-weight: 600; line-height: 1.45; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.history-item .hi-meta { font-size: 11.5px; color: var(--muted); }

/* ---------------- 通用区块 ---------------- */
.section-title {
  font-size: 22px; font-weight: 700; text-align: center;
  margin: 0 0 30px; letter-spacing: -.2px;
}
.steps-section, .feature-section, .faq-section { padding: 46px 0 8px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.step-num {
  width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft);
  color: var(--primary); font-weight: 700; display: grid; place-items: center;
  margin-bottom: 12px; font-size: 15px;
}
.step h3 { margin: 0 0 8px; font-size: 15.5px; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.feature-icon { font-size: 24px; margin-bottom: 10px; }
.feature h3 { margin: 0 0 8px; font-size: 15.5px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.75; }

.faq { max-width: 860px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 18px; font-weight: 600; font-size: 14.5px;
  list-style: none; position: relative; padding-right: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-weight: 400; font-size: 19px;
}
.faq details[open] summary::after { content: "−"; color: var(--primary); }
.faq details[open] summary { color: var(--primary); }
.faq p { margin: 0; padding: 0 18px 17px; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.faq code {
  background: var(--bg-soft); padding: 2px 6px; border-radius: 5px;
  font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #c81e3f;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 56px; background: #fff; border-top: 1px solid var(--border);
  padding: 30px 0 34px; text-align: center;
}
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.footer-links a { color: var(--text-2); font-size: 13.5px; }
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.footer-note { color: var(--muted); font-size: 12.5px; max-width: 720px; margin: 0 auto 12px; line-height: 1.75; }
.footer-copy { color: #a7aebb; font-size: 12.5px; margin: 0; }

/* ---------------- 内容页（政策/教程） ---------------- */
.doc-page { padding: 32px 0 10px; }
.doc {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow);
}
@media (max-width: 640px) { .doc { padding: 22px 18px; } }
.doc h1 { font-size: 24px; margin: 0 0 6px; }
.doc .doc-meta { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.doc h2 { font-size: 17px; margin: 28px 0 10px; }
.doc h3 { font-size: 15px; margin: 20px 0 8px; }
.doc p, .doc li { color: var(--text-2); font-size: 14.5px; line-height: 1.85; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.doc th { background: #fafbfc; font-weight: 600; }
.doc blockquote {
  margin: 16px 0; padding: 12px 16px; background: var(--primary-soft);
  border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0;
  color: var(--text-2); font-size: 14px;
}
.back-link { display: inline-block; margin-bottom: 16px; font-size: 13.5px; color: var(--muted); }
.back-link:hover { color: var(--primary); text-decoration: none; }
