:root {
  --purple: #855be8;
  --cyan: #00B6D8;
  --purple-soft: #f3edfd;
  --cyan-soft: #e6f8fc;
  --ink: #1a1530;
  --gray: #6b7280;
  --line: #ececf3;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(133, 91, 232, 0.10);
  --shadow-lg: 0 20px 50px rgba(133, 91, 232, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fbfaff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 20px; font-weight: 800; display: flex; align-items: center; letter-spacing: -0.3px; }
.logo-hello { color: var(--purple); }
.logo-tik { color: var(--cyan); }
.logo-app { color: var(--purple); }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-size: 15px;
  color: #4b4663;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--purple); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  border: 1px solid var(--line);
  background: #fff;
  color: #4b4663;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-toggle:hover { border-color: var(--purple); color: var(--purple); }
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: 70px 20px 90px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(133, 91, 232, 0.16), transparent 70%),
    radial-gradient(55% 50% at 90% 10%, rgba(0, 182, 216, 0.16), transparent 70%),
    linear-gradient(180deg, #f7f3ff 0%, #fbfaff 100%);
  z-index: -1;
}
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.badge {
  display: inline-block;
  background: #fff;
  color: var(--purple);
  border: 1px solid rgba(133, 91, 232, 0.25);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin: 16px auto 0;
  max-width: 560px;
  color: var(--gray);
  font-size: 16px;
}

/* Parser */
.parser {
  margin: 34px auto 0;
  max-width: 620px;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.parser-row { display: flex; gap: 10px; align-items: stretch; }
.parser-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7f7fb;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color 0.2s;
}
.parser-input-wrap:focus-within { border-color: var(--purple); }
.i-link { color: #b6a8e6; flex: none; }
.parser-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  padding: 14px 0;
  color: var(--ink);
}
.btn-paste, .btn-clear {
  border: 1px solid var(--line);
  background: #fff;
  color: #4b4663;
  font-size: 14px;
  font-weight: 600;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-paste:hover, .btn-clear:hover { border-color: var(--purple); color: var(--purple); }
.btn-parse {
  width: 100%;
  margin-top: 12px;
  border: none;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-parse:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(133, 91, 232, 0.35); }
.btn-parse:disabled { opacity: 0.7; cursor: default; transform: none; box-shadow: none; }

.parser-status { margin-top: 12px; font-size: 14px; color: var(--gray); min-height: 20px; }
.parser-status.error { color: #e0414a; }
.parser-status.loading { color: var(--purple); }

/* 解析链路 debug 面板 */
.parse-debug {
  margin-top: 10px;
  padding: 12px 14px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 10px;
  font-size: 12px;
  color: #5a3d00;
  text-align: left;
}
.parse-debug-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #b76b00;
}
.parse-debug pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  max-height: 260px;
  overflow: auto;
}

/* ============ 解析结果区（单列居中） ============ */
.parser-result {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
  display: flex;
  flex-direction: column;       /* 单列，避免双列重复 */
  gap: 16px;
  text-align: left;
}
.result-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.result-cover {
  flex: none;
  width: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--purple-soft), var(--cyan-soft));
  aspect-ratio: 16 / 9;
}
.result-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.result-info { flex: 1; min-width: 0; }
.result-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: #2a2438;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-author {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}
.result-author img {
  width: 16px; height: 16px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}
.result-meta { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* 原分享链接 */
.result-source { display: flex; flex-direction: column; gap: 6px; }
.result-source-row { display: flex; gap: 8px; }
.result-source-input {
  flex: 1; min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  background: #f8f8fa;
  color: #555;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* 分区标题 */
.result-section { display: flex; flex-direction: column; gap: 8px; }
.result-section-label {
  font-size: 13px;
  font-weight: 700;
  color: #4a3f6b;
  display: flex; align-items: center;
  gap: 6px;
}
.result-section-label::before {
  content: "";
  display: inline-block;
  width: 3px; height: 14px;
  background: linear-gradient(180deg, var(--purple), var(--cyan));
  border-radius: 2px;
}

/* 多清晰度列表（单列，每行一项） */
.result-resolutions { display: flex; flex-direction: column; gap: 8px; }
.resolution-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafd;
  transition: border-color 0.15s, background 0.15s;
}
.resolution-row:hover {
  border-color: rgba(133, 91, 232, 0.35);
  background: #fff;
}
.resolution-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.resolution-quality {
  font-weight: 700;
  font-size: 14px;
  color: var(--purple);
  flex: none;
}
.resolution-size {
  font-size: 12px;
  color: var(--gray);
  flex: none;
}
.resolution-actions { display: flex; gap: 6px; flex: none; }

/* 按钮 */
.btn-download,
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-download {
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  transition: transform 0.15s;
  text-decoration: none;
}
.btn-download:hover { transform: translateY(-1px); }
.btn-copy {
  background: #fff;
  color: var(--cyan);
  border: 1.5px solid rgba(0, 182, 216, 0.4);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.btn-copy:hover {
  background: var(--cyan);
  color: #fff;
}
.btn-copy.copied {
  background: #2ecc71;
  color: #fff;
  border-color: #2ecc71;
}
.btn-direct {
  background: #fff;
  color: #f0883e;
  border: 1.5px solid rgba(240, 136, 62, 0.45);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-direct:hover {
  background: #f0883e;
  color: #fff;
}
.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
}
.btn-sm.btn-copy { padding: 5px 10px; }

/* 封面区操作 */
.result-cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-cover-actions .btn-download,
.result-cover-actions .btn-copy { flex: 1 1 auto; min-width: 120px; }

/* 移动端 */
@media (max-width: 520px) {
  .result-head { flex-direction: column; }
  .result-cover { width: 100%; aspect-ratio: 16 / 9; }
  .result-source-row { flex-direction: column; }
  .resolution-row { flex-wrap: wrap; gap: 8px; }
  .resolution-info { width: 100%; }
  .resolution-actions { width: 100%; }
  .resolution-actions .btn-download,
  .resolution-actions .btn-copy,
  .resolution-actions .btn-direct { flex: 1; }
}
.hero-note { margin-top: 18px; font-size: 13px; color: #9b94b5; }

/* ============ SECTIONS ============ */
.section { padding: 64px 20px; }
.container { max-width: 1120px; margin: 0 auto; }
.container.narrow { max-width: 760px; }
.section-title {
  text-align: center;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  margin-bottom: 40px;
}

/* Features */
.features { background: #fff; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature-card {
  background: #fbfaff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.f-purple { background: var(--purple-soft); }
.f-cyan { background: var(--cyan-soft); }
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 14px; color: var(--gray); }

/* How */
.how { background: linear-gradient(180deg, #fbfaff, #f5f1ff); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.step-num {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 30px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  color: #fff; font-weight: 800; font-size: 15px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(133, 91, 232, 0.4);
}
.step-icon { font-size: 30px; margin: 6px 0 10px; }
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--gray); }

/* Types */
.types { background: #fff; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.type-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 26px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(133,91,232,0.4); }
.type-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple-soft), var(--cyan-soft));
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.type-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.type-card p { font-size: 14px; color: var(--gray); }

/* FAQ */
.faq { background: linear-gradient(180deg, #f5f1ff, #fbfaff); }
.accordion { display: flex; flex-direction: column; gap: 12px; }
.acc-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.acc-item.open { box-shadow: var(--shadow); border-color: rgba(133,91,232,0.35); }
.acc-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.acc-q::after {
  content: "+";
  font-size: 22px;
  color: var(--purple);
  transition: transform 0.25s;
  flex: none;
}
.acc-item.open .acc-q::after { transform: rotate(45deg); }
.acc-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.acc-a p { padding: 0 20px 18px; color: var(--gray); font-size: 14px; }

/* Footer */
.footer { background: #15121f; color: #c9c3dd; padding: 40px 20px; }
.footer-inner { text-align: center; }
.footer-links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: #c9c3dd; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 14px; color: #8b85a3; }
.footer-disclaimer { font-size: 12px; color: #6f6987; margin-top: 6px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .type-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: #fff;
    padding: 12px 20px;
    gap: 4px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    display: none;
  }
  .nav-links.show { display: flex; }
  .menu-btn { display: flex; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .parser-row { flex-wrap: wrap; }
  .parser-input-wrap { width: 100%; }
  .btn-paste, .btn-clear { flex: 1; padding: 12px 0; }
}

/* ============ 平台切换 Tabs（快手/小红书） ============ */
.plat-tabs {
  display: inline-flex;
  gap: 8px;
  margin: 0 auto 18px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.plat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  padding: 9px 22px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.plat-tab:hover { color: var(--purple); }
.plat-tab.active {
  color: #fff;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  box-shadow: 0 4px 14px rgba(133, 91, 232, 0.28);
}
.plat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.k-dot { background: #ff6a00; }
.x-dot { background: #ff2e4d; }
.d-dot { background: #25f4ee; }
.plat-tab.active .plat-dot { background: #fff; }

/* 平台提示文案（在解析按钮下方，随 tab 切换变化） */
.plat-note {
  margin-top: 10px;
  font-size: 12px;
  color: #9b94b5;
  text-align: center;
  line-height: 1.5;
}

/* 导航当前项高亮 */
.nav-links a.active { color: var(--purple); }

/* ============ 图集 Gallery（小红书图文 / 快手图文） ============ */
.result-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.gallery-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fafafd;
  transition: border-color 0.15s, transform 0.15s;
}
.gallery-item:hover {
  border-color: rgba(133, 91, 232, 0.35);
  transform: translateY(-2px);
}
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #efeff5;
}
.gallery-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
}
.gallery-actions .btn-download,
.gallery-actions .btn-copy { flex: 1; }

@media (max-width: 520px) {
  .plat-tabs { width: 100%; }
  .plat-tab { flex: 1; justify-content: center; padding: 10px 12px; }
  .result-gallery { grid-template-columns: repeat(2, 1fr); }
}
