/* 解析吧 公开页面样式：整体内联进页面，CSP 哈希由程序自动计算。禁止 @import 外部资源。 */
:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.65;
  --bg: #fbf7f4;
  --surface: #fff;
  --soft: #f4eeea;
  --text: #1f2029;
  --muted: #5d5f6b;
  --border: #e9e0db;
  --accent: #d91536;
  --accent-hover: #b80f2c;
  --accent-ink: #c4122f;
  --accent-soft: #fff0f1;
  --gold: #ffc83d;
  --ring: #d9153659;
  --shadow: 0 1px 2px #3a1f2410, 0 12px 36px #3a1f2414;
  --glow-a: #ffdfe3;
  --glow-b: #ffeccc;
  --pill-border: #f3c9cf;
  --err-border: #f1bdc5;
  --err-text: #a80c27;
  --ok-text: #19734a;
  --warn-bg: #fff3d8;
  --warn-border: #ebc981;
  --warn-text: #6e3f00;
  --focus: var(--accent);
  --overlay: #16161ccc;
  --radius: 20px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -160px, var(--glow-a) 0%, transparent 70%),
    radial-gradient(520px 300px at 92% 0, var(--glow-b) 0%, transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
h1, h2, h3 { line-height: 1.3; }
a { color: var(--accent-ink); }
button, textarea, a, summary, label, [role="button"] { -webkit-tap-highlight-color: transparent; }
button, textarea { font: inherit; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
button, a { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
svg { flex-shrink: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.mark { display: block; width: 1em; height: 1em; }
/* 自定义 Logo 与默认图标同尺寸：1em 随各处 font-size 变化，覆盖 HTML 的 width/height=32 */
.logo-img { display: block; flex-shrink: 0; width: 1em; height: 1em; object-fit: cover; }

/* ---------- 按钮 ---------- */
.primary-button, .secondary-button, .paste-button, .download-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.primary-button {
  background: linear-gradient(180deg, #e3203f, var(--accent));
  color: #fff;
  box-shadow: 0 1px 0 #ffffff40 inset, 0 6px 16px #d9153633;
}
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.secondary-button, .download-link { background: var(--surface); color: var(--text); border-color: var(--border); }
.paste-button { padding: 8px 10px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 14px; }
.paste-button svg { width: 18px; height: 18px; }

/* ---------- 顶部 ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 20px;
  font-size: 14px;
}
.breadcrumb { color: var(--muted); }
.breadcrumb a { color: inherit; text-decoration: none; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.brand-link .mark { font-size: 32px; }
.brand-link .logo-img { width: 32px; height: 32px; font-size: 32px; object-fit: contain; }
.top-nav { display: flex; gap: 2px; }
.top-nav a { padding: 8px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }

/* ---------- 工具页：首屏 ---------- */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1160px;
  min-height: calc(100vh - 140px);
  min-height: calc(100svh - 140px);
  margin: 0 auto;
  padding: 7vh 20px 64px;
}
.search-section { width: min(100%, 720px); text-align: center; }
.search-sentinel { width: 100%; height: 1px; pointer-events: none; visibility: hidden; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  border-radius: 18px;
  background: none;
  color: var(--text);
}
.brand-home .mark, .brand-home .logo-img { font-size: clamp(48px, 13vw, 64px); filter: drop-shadow(0 8px 18px #d9153640); }
.wordmark { font-size: clamp(40px, 11vw, 58px); font-weight: 900; letter-spacing: .06em; line-height: 1.1; }
.tool-name {
  display: inline-block;
  margin: 0;
  padding: 3px 14px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
}
.slogan { margin: 18px 0 26px; color: var(--muted); font-size: clamp(16px, 4.2vw, 19px); letter-spacing: .08em; }
.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 8px 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring), var(--shadow); }
.search-icon { display: none; width: 22px; height: 22px; margin-top: 0; color: var(--accent-ink); }
.search-form textarea {
  box-sizing: border-box;
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  resize: none;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  color: var(--text);
  font-size: 16px; /* 不小于 16px，避免 iOS 聚焦时放大 */
  line-height: 44px;
  overflow-wrap: normal;
  scrollbar-width: none;
}
.search-form textarea::-webkit-scrollbar { display: none; }
.search-form textarea:focus, .search-form textarea:focus-visible { outline: none; }
.search-form textarea::placeholder { color: var(--muted); opacity: 1; }
.search-actions { display: flex; flex-shrink: 0; align-items: center; gap: 6px; align-self: center; }
.search-actions .primary-button { padding-inline: 16px; }
.paste-button span { display: none; }
.hint-enter { display: none; }
.search-hint { margin: 14px auto 0; max-width: 640px; text-wrap: balance; color: var(--muted); font-size: 13px; }

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 720px);
  min-height: 44px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.status.is-error { border-color: var(--err-border); background: var(--accent-soft); color: var(--err-text); }
.status.is-success { color: var(--ok-text); }
.spinner {
  display: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
}
.is-loading .spinner { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 工具页：结果态（紧凑顶栏） ---------- */
.has-result .page { padding-top: 0; min-height: 0; }
.has-result .search-section {
  position: sticky;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 0 14px;
  background: transparent;
  text-align: left;
}
/* 结果态只保留站点顶栏的 logo：隐藏输入框旁的小 logo（#home-button 仍在 DOM 中），不画通栏分隔线，输入框与下方结果卡片同宽对齐 */
.has-result .brand { display: none; }
.has-result .brand-home { gap: 8px; padding: 4px; }
.has-result .brand-home .mark, .has-result .brand-home .logo-img { font-size: 36px; filter: none; }
.has-result .wordmark { display: none; font-size: 22px; letter-spacing: .02em; }
.has-result .tool-name, .has-result .slogan, .has-result .search-hint, .has-result .search-icon { display: none; }
.has-result .search-form {
  flex: 1;
  min-width: 0;
  align-items: center;
  padding: 4px 4px 4px 12px;
  border-width: 1px;
  border-color: color-mix(in srgb, var(--border) 82%, var(--surface));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: 0 1px 2px #3a1f2412, 0 8px 22px #3a1f2416;
  transition: box-shadow .2s ease;
}
.has-result .search-section.is-stuck .search-form {
  box-shadow: 0 2px 8px #3a1f2418, 0 14px 36px #3a1f2422;
}
/* 紧凑态固定单行高度：一行占满整个框，长文本只在框内滚动，不会把顶栏撑高 */
.has-result .search-form textarea { height: 40px; min-height: 40px; max-height: 40px; padding: 0; line-height: 40px; white-space: nowrap; overflow-x: auto; overflow-y: hidden; overflow-wrap: normal; }
.has-result .search-actions { align-self: center; gap: 4px; }
.has-result .search-actions .primary-button { min-height: 40px; padding: 8px 14px; border-radius: 12px; }
.has-result .paste-button { min-height: 40px; padding: 8px; background: color-mix(in srgb, var(--soft) 78%, transparent); }
.has-result .status { justify-content: flex-start; width: 100%; margin-top: 10px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .has-result .search-form {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    box-shadow: 0 1px 2px #0007, 0 8px 24px #0005;
  }
  :root:not([data-theme="light"]) .has-result .search-section.is-stuck .search-form {
    box-shadow: 0 4px 14px #0008, 0 18px 40px #0006;
  }
}
:root[data-theme="dark"] .has-result .search-form {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: 0 1px 2px #0007, 0 8px 24px #0005;
}
:root[data-theme="dark"] .has-result .search-section.is-stuck .search-form {
  box-shadow: 0 4px 14px #0008, 0 18px 40px #0006;
}

/* 实心回退需覆盖更高优先级的深色主题背景。 */
@supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .has-result .search-form { background: var(--surface) !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .has-result .search-form,
  :root .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .has-result .search-form { background: var(--surface) !important; }
  :root .site-header { background: var(--bg); }
}

.result-panel { width: 100%; margin-top: 6px; }
.result-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.result-heading { min-width: 0; }
.result-heading h2 { margin: 0; font-size: clamp(20px, 4vw, 28px); overflow-wrap: anywhere; }
.author { margin: 6px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.author::before { content: "@"; margin-right: 1px; color: var(--accent-ink); font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions > * { flex: 1 1 auto; }
.description {
  margin: 14px 0 0;
  padding: 16px 20px;
  border-left: 3px solid var(--gold);
  border-radius: 4px 14px 14px 4px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.media { display: grid; gap: 20px; margin-top: 20px; }
.media-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.video-card { width: 100%; max-width: 860px; margin-inline: auto; }
.video-card video { display: block; width: 100%; max-height: 72vh; background: #121218; object-fit: contain; }
.watermark-notice { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text); font-size: 14px; font-weight: 700; }
.image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.image-frame { position: relative; background: var(--soft); }
.image-frame img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.image-load-error { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; padding: 16px; background: var(--soft); color: var(--muted); text-align: center; }
.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: #16161ccc;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.live-badge::before { content: ""; width: 8px; height: 8px; border: 2px solid var(--gold); border-radius: 50%; }
.media-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.image-card .media-actions { flex-direction: column; gap: 6px; padding: 8px; }
.image-card .download-link { min-height: 40px; padding: 8px 6px; border-radius: 12px; font-size: 13px; }
.empty-state { margin: 20px 0 0; padding: 48px 20px; border: 2px dashed var(--border); border-radius: 18px; color: var(--muted); text-align: center; }

/* ---------- 正文内容（工具页说明、门户） ---------- */
.has-result:not(.content-open) .content { display: none; }
.content { width: min(100%, 760px); margin: 9vh auto 0; }
.content section { margin-top: 40px; }
.content h2, .portal h2 { margin: 0 0 14px; font-size: clamp(21px, 4.6vw, 26px); letter-spacing: .02em; }
.content h3, .portal h3 { margin: 0; font-size: 16px; }
.content p, .content li { color: var(--text); }
.content ul { padding-left: 1.2em; }
.content li { margin: 6px 0; }
.content li::marker { color: var(--accent); }
.about { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.about h2 { font-size: 20px; }
.about p { margin: 0; }

.steps ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 18px 18px 18px 66px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}
.steps li p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 4px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--accent-ink); font-size: 20px; font-weight: 600; line-height: 1; }
.faq-item[open] summary::after { content: "−"; background: var(--accent); color: #fff; }
.faq-item h3 { font-size: 16px; font-weight: 700; }
.faq-item p { margin: 0 4px 18px; color: var(--muted); font-size: 15px; }

/* ---------- 门户首页 ---------- */
.portal { width: min(100%, 1160px); margin: 0 auto; padding: 0 20px; }
.portal > section { margin-top: 72px; }
.portal > .hero { margin-top: 0; }
.hero { display: grid; gap: 40px; align-items: center; padding: 28px 0 8px; }
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.hero h1 { margin: 0; font-size: clamp(34px, 9vw, 58px); font-weight: 900; letter-spacing: .02em; line-height: 1.15; text-wrap: balance; }
.hero .intro { max-width: 34em; margin: 18px 0 0; color: var(--muted); font-size: clamp(16px, 4vw, 19px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-cta .primary-button, .hero-cta .secondary-button { min-height: 50px; padding-inline: 22px; font-size: 16px; }
.hero-cta .primary-button { gap: .35em; }
:lang(zh) .hero-cta .primary-button > span:first-child, :lang(ja) .hero-cta .primary-button > span:first-child { margin-right: -.35em; }
.hero-demo {
  position: relative;
  width: min(100%, 440px);
  margin-inline: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
}
.hero-demo::after { content: ""; position: absolute; top: -14px; right: 22px; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); box-shadow: 0 6px 16px #ffb40055; }
.demo-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 2px solid var(--accent); border-radius: 16px; }
.demo-bar svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; }
.demo-link { flex: 1; overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.demo-go { padding: 6px 14px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.demo-tile { position: relative; overflow: hidden; aspect-ratio: 3 / 4; border-radius: 14px; }
.demo-tile.t1 { background: linear-gradient(160deg, #ffd5c2, #ff8a8a); }
.demo-tile.t2 { background: linear-gradient(160deg, #c9e7ff, #8aa8ff); }
.demo-tile.t3 { background: linear-gradient(160deg, #fff0b8, #ffb25c); }
.demo-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo-tile i { position: absolute; z-index: 1; top: 6px; left: 6px; padding: 0 8px; border-radius: 999px; background: var(--overlay); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; }
.demo-tile .play { position: absolute; z-index: 1; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--overlay); }
.demo-tile .play::after { content: ""; position: absolute; top: 10px; left: 13px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 700; }
.demo-chip { color: var(--ok-text); }
.demo-dl { padding: 6px 12px; border-radius: 10px; background: var(--soft); }

.section-lead { margin: -6px 0 20px; color: var(--muted); }

/* 工具卡片：已上线为浅色主卡，即将上线为平台品牌色卡（始终有图标与底色） */
.tool-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tool-card { position: relative; overflow: hidden; min-width: 0; border-radius: var(--radius); isolation: isolate; }
.tool-bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: .2; pointer-events: none; }
.tool-icon { display: block; flex-shrink: 0; width: 48px; height: 48px; font-size: 48px; }
.tool-icon .platform-icon { display: block; width: 100%; height: 100%; }
.tool-icon img, .tool-icon .mark { display: block; width: 100%; height: 100%; border-radius: 14px; object-fit: contain; }
.tool-card h3 { margin: 14px 0 0; font-size: 19px; overflow-wrap: anywhere; }
.tool-card.is-live { grid-column: span 2; border: 1px solid var(--pill-border); background: linear-gradient(135deg, var(--surface) 40%, var(--accent-soft)); box-shadow: var(--shadow); }
.tool-card.is-live a { display: block; height: 100%; padding: 22px; border-radius: inherit; color: inherit; text-decoration: none; }
.tool-card.is-live .tool-icon { width: 56px; height: 56px; filter: drop-shadow(0 8px 16px #ff244240); }
.tool-card.is-live p { margin: 6px 0 16px; color: var(--muted); font-size: 15px; }
.tool-enter { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 800; }
.tool-card.is-soon {
  --c1: #d91536;
  --c2: #ff6a3d;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 16px;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  color: #fff;
  box-shadow: 0 10px 24px -12px var(--c1);
}
.tool-card.is-soon::after { content: ""; position: absolute; z-index: -1; right: -36px; bottom: -36px; width: 120px; height: 120px; border-radius: 50%; background: #ffffff1c; }
.tool-card.is-soon .tool-icon { width: 44px; height: 44px; padding: 3px; border-radius: 15px; background: #ffffff38; box-shadow: 0 4px 12px #0003; }
.tool-card.is-soon .tool-icon img, .tool-card.is-soon .tool-icon .mark { border-radius: 12px; }
.tool-card.is-soon h3 { margin-top: auto; padding-top: 14px; font-size: 18px; font-weight: 800; text-shadow: 0 1px 2px #0003; }
.soon-pill { align-self: flex-start; margin: 8px 0 0; padding: 2px 10px; border-radius: 999px; background: #0000002e; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
/* 已上线卡统一浅色主卡（.is-live）；品牌色只写在 --c1/--c2，供即将上线卡使用，不要给已上线卡铺满高对比渐变。 */
.tool-card[data-card="douyin"] { --c1: #161823; --c2: #3b1230; }
.tool-card[data-card="tiktok"] { --c1: #050505; --c2: #10343a; }
.tool-card[data-card="kuaishou"] { --c1: #e63d00; --c2: #ff7a1a; }
.tool-card[data-card="instagram"] { --c1: #833ab4; --c2: #e1306c; }
.tool-card[data-card="bilibili"] { --c1: #0086c4; --c2: #23ade5; }
.tool-card[data-card="weibo"] { --c1: #d0142a; --c2: #f05a24; }
.tool-card[data-card="xhs"].is-soon { --c1: #e0132f; --c2: #ff5470; }
.tool-card[data-card="haokan"] { --c1: #008ea8; --c2: #00c4d6; }
.tool-card[data-card="zhihu"] { --c1: #0052d9; --c2: #0f88eb; }
.tool-card[data-card="twitter"] { --c1: #0f1419; --c2: #3d4650; }
.tool-card[data-card="pipixia"] { --c1: #ff5a1f; --c2: #ff9a3d; }
.tool-card[data-card="huya"] { --c1: #ff6d00; --c2: #ffb000; }
.tool-card[data-card="lishipin"] { --c1: #00a19a; --c2: #3dd6c6; }
.tool-card[data-card="zuiyou"] { --c1: #ffb000; --c2: #ff7a00; }
.tool-card[data-card="quanminkge"] { --c1: #2b6cff; --c2: #6aa0ff; }
.tool-card[data-card="pipigaoxiao"] { --c1: #ff8a00; --c2: #ffc53d; }
.tool-card[data-card="qqvideo"] { --c1: #ff6a00; --c2: #ffb34d; }
.tool-card[data-card="sohu"] { --c1: #e51c23; --c2: #fda934; }

/* 演示：图片 / 实况 / 视频 */
.demo-cards { display: grid; grid-auto-flow: column; grid-auto-columns: min(76%, 300px); gap: 14px; margin-inline: -20px; padding: 4px 20px 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: thin; }
.demo-card { scroll-snap-align: start; }
.demo-card { margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.demo-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: linear-gradient(160deg, var(--glow-a), var(--glow-b)); }
.demo-card:nth-child(2) .demo-media { background: linear-gradient(160deg, #c9e7ff, #8aa8ff); }
.demo-card:nth-child(3) .demo-media { background: linear-gradient(160deg, #fff0b8, #ffb25c); }
.demo-media img, .demo-media video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.media-badge { position: absolute; z-index: 1; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 9px; border-radius: 999px; background: var(--overlay); color: #fff; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); }
.badge-live::before { content: ""; width: 9px; height: 9px; border: 2px solid var(--gold); border-radius: 50%; }
.badge-video { padding: 6px; }
.badge-video svg { width: 16px; height: 16px; fill: #fff; }
.demo-card figcaption { padding: 16px 18px 20px; }
.demo-card h3 { margin: 0; font-size: 18px; }
.demo-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.highlights ul { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: hl; }
.highlights li { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); counter-increment: hl; }
.highlights li::before { content: "0" counter(hl); display: block; margin-bottom: 10px; color: var(--accent-ink); font-size: 14px; font-weight: 900; letter-spacing: .1em; }
.highlights li p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.portal .steps ol { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------- 页脚、友链 ---------- */
.site-footer { margin-top: 64px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--muted); font-size: 13px; text-align: center; }
.site-footer > * { max-width: 760px; margin-inline: auto; }
.friend-links { margin: 0 auto 10px; }
.friend-links-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.friend-links ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; margin: 0; padding: 0; list-style: none; }
.friend-links li { max-width: 100%; }
.friend-links-first { display: inline-flex; align-items: baseline; }
.friend-links-label { flex-shrink: 0; margin-right: .35em; color: var(--muted); font-size: 13px; font-weight: 600; }
.friend-links a { display: inline-flex; align-items: center; min-width: 0; min-height: 32px; padding: 2px 0; color: var(--muted); font-size: 13px; text-decoration: none; overflow-wrap: anywhere; }
.friend-links li:not(.link-apply-item):has(+ li:not(.link-apply-item))::after { content: "·"; margin-left: 8px; color: var(--muted); }
.disclaimer { max-width: 640px; margin: 0 auto; font-size: 12px; line-height: 1.7; }
.site-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 10px auto 0; font-size: 12px; }
.site-meta > a { color: inherit; }
.copyright-line { display: inline; }
.footer-home { color: var(--text); font-weight: 700; text-decoration: none; }
.has-result .site-footer { margin-top: 48px; }

/* ---------- 404 / 维护页 ---------- */
.notfound { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; min-height: 100svh; padding: 40px 20px; text-align: center; }
.status-art { position: relative; display: grid; place-items: center; margin-bottom: 8px; }
.status-code { color: transparent; font-size: clamp(96px, 30vw, 168px); font-weight: 900; letter-spacing: .04em; line-height: 1; background: linear-gradient(160deg, var(--accent), #ff8a3d); -webkit-background-clip: text; background-clip: text; opacity: .9; }
.status-art .mark, .status-art .maint-icon { position: absolute; right: -14px; bottom: -6px; width: 56px; height: 56px; transform: rotate(10deg); filter: drop-shadow(0 10px 18px #d9153640); }
.notfound h1 { margin: 18px 0 6px; font-size: clamp(22px, 5vw, 28px); }
.notfound p { max-width: 30em; margin: 6px 0; color: var(--muted); }
.notfound .maint-msg { margin: 8px 0 4px; padding: 12px 18px; border: 1px solid var(--pill-border); border-radius: 14px; background: var(--accent-soft); color: var(--text); font-weight: 600; }
.status-actions .primary-button { margin-top: 18px; }
.maint-bar { width: min(240px, 70vw); height: 6px; margin-top: 24px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.maint-bar span { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); animation: maint 1.8s ease-in-out infinite alternate; }
@keyframes maint { from { transform: translateX(-20%); } to { transform: translateX(170%); } }

/* ---------- 宽屏 ---------- */
@media (min-width: 640px) {
  .site-header, .page, .portal { padding-inline: 32px; }
  .page { padding-top: 11vh; }
  .search-form { padding: 10px 10px 10px 18px; gap: 10px; }
  .search-icon { display: block; }
  .paste-button span, .hint-enter { display: inline; }
  .search-actions .primary-button { padding-inline: 30px; }
  .has-result .search-section { gap: 20px; padding: 12px 0 16px; }
  .has-result .search-actions .primary-button { padding-inline: 24px; }
  .result-header { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 26px; }
  .result-actions { flex-shrink: 0; }
  .result-actions > * { flex: 0 0 auto; }
  .image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .image-card .media-actions { flex-direction: row; }
  .image-card .download-link { flex: 1; }
}
@media (min-width: 640px) {
  .tool-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .highlights ul { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
  .tool-card.is-soon { min-height: 168px; padding: 20px; }
  .demo-cards { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-inline: 0; padding: 0; overflow: visible; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.15fr 1fr; gap: 64px; padding-top: 56px; }
  .image-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 顶部控件：语言、主题 ---------- */
.portal-header .top-nav { display: none; margin-left: auto; }
.site-controls { display: flex; flex-shrink: 0; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; }
.lang-switch { position: relative; }
.lang-switch summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch svg, .theme-switch svg, .announcement-close svg, .back-to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lang-switch .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.lang-switch[open] .chev { transform: rotate(180deg); }
.lang-switch ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 164px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  list-style: none;
}
.lang-switch a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 12px; border-radius: 10px; color: var(--text); font-size: 14px; text-decoration: none; white-space: nowrap; }
.lang-switch a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.lang-switch a[aria-current]::after { content: "✓"; }
.theme-switch { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.theme-switch button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
/* Use the pre-paint theme; deferred ARIA updates must not change button colors. */
:root[data-theme="light"] .theme-switch button[data-theme-set="light"],
:root[data-theme="dark"] .theme-switch button[data-theme-set="dark"],
:root:not([data-theme="light"]):not([data-theme="dark"]) .theme-switch button[data-theme-set="system"] { background: var(--accent-soft); color: var(--accent-ink); }
.lang-current { max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 公告 ---------- */
.announcement-bar { position: relative; z-index: 20; border-bottom: 1px solid var(--pill-border); background: var(--accent-soft); color: var(--text); font-size: 14px; }
.announcement-inner { display: flex; align-items: center; gap: 10px; max-width: 1160px; margin: 0 auto; padding: 8px 12px 8px 20px; }
.announcement-inner p { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.announcement-inner strong { color: var(--accent-ink); }
.announcement-tag { flex-shrink: 0; padding: 1px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.announcement-close { display: grid; flex-shrink: 0; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.announcement-modal {
  width: min(92vw, 440px);
  padding: 28px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px #0005;
  text-align: center;
}
/* 公开页模态框打开时锁定背景：body 固定在原滚动位置（--scroll-lock-top 由 site.js 写入），长内容在框内滚动 */
html.scroll-locked { overflow: hidden; }
html.scroll-locked body { position: fixed; top: var(--scroll-lock-top, 0); right: 0; left: 0; width: 100%; overflow: hidden; }
.announcement-modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
.announcement-modal::backdrop { background: #14101399; backdrop-filter: blur(3px); }
.announcement-modal h2 { margin: 14px 0 8px; font-size: 21px; }
.announcement-modal p { margin: 0 0 20px; color: var(--muted); overflow-wrap: anywhere; white-space: pre-line; }
.announcement-modal form { margin: 0; }
.announcement-modal .primary-button { width: 100%; }

/* ---------- 广告位 ---------- */
.ad-slot { position: relative; width: min(100% - 40px, 970px); margin: 20px auto; padding: 22px 10px 10px; border: 1px dashed var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.page .ad-slot { width: min(100%, 728px); }
.has-result .page .ad-slot { width: 100%; }
.ad-slot::before { content: attr(aria-label); position: absolute; top: 4px; left: 12px; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.ad-slot img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; }
.ad-slot a { display: block; }
.ad-desktop { display: none; }
.ad-mobile { display: block; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px #d9153659;
  cursor: pointer;
}
.back-to-top svg { width: 22px; height: 22px; stroke-width: 2.4; }

@media (min-width: 640px) {
  .ad-desktop { display: block; }
  .ad-mobile { display: none; }
  .portal-header .top-nav { display: flex; }
  .portal-header .site-controls { margin-left: 8px; }
  .back-to-top { right: 24px; bottom: 24px; }
}

/* ---------- 深色模式：只覆盖变量 ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131217; --surface: #1d1c23; --soft: #2a2831; --text: #f3eff4; --muted: #b3aebb; --border: #36333e;
    --accent: #df2343; --accent-hover: #c41634; --accent-ink: #ff8a9c; --accent-soft: #3a1c25; --ring: #ff6a8259;
    --shadow: 0 1px 2px #0006, 0 12px 36px #0005; --glow-a: #4a1626; --glow-b: #3b2a12; --pill-border: #6a2a3a;
    --err-border: #7b3547; --err-text: #ffb3bf; --ok-text: #7fdcae; --warn-bg: #3f301a; --warn-border: #745326; --warn-text: #ffd58c;
    --focus: #ff8a9c; --overlay: #0b0b0fcc;
  }
}
:root[data-theme="dark"] {
  --bg: #131217; --surface: #1d1c23; --soft: #2a2831; --text: #f3eff4; --muted: #b3aebb; --border: #36333e;
  --accent: #df2343; --accent-hover: #c41634; --accent-ink: #ff8a9c; --accent-soft: #3a1c25; --ring: #ff6a8259;
  --shadow: 0 1px 2px #0006, 0 12px 36px #0005; --glow-a: #4a1626; --glow-b: #3b2a12; --pill-border: #6a2a3a;
  --err-border: #7b3547; --err-text: #ffb3bf; --ok-text: #7fdcae; --warn-bg: #3f301a; --warn-border: #745326; --warn-text: #ffd58c;
  --focus: #ff8a9c; --overlay: #0b0b0fcc;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hero-demo { transform: none; }
  .back-to-top:hover { transform: none; }
}

/* 窄屏工具页：面包屑与控件同行时只显示语言图标，避免换行 */
.breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) {
  .tool-page .lang-current { display: none; }
  .theme-switch button { width: 30px; height: 30px; }
}

/* 公告级别 */
.announcement-bar.level-important, .announcement-modal.level-important { border-color: #f08c1a; }
.announcement-bar.level-warning, .announcement-modal.level-warning { border-color: #d91536; }

/* 友链申请：页脚入口、对话框（有脚本）与展开表单（无脚本）、提交结果页 */
/* 申请入口为友链列表最后一个胶囊，以主题色实线描边区分 */
.friend-links .link-apply-item { margin-left: 8px; }
.friend-links .link-apply-item:has(.link-apply[open]) { flex-basis: 100%; }
.friend-links .link-apply { display: flex; flex-direction: column; align-items: center; }
/* 申请友链：与普通友链同字号、同行高，仅加一圈细描边；点击区域用 ::after 向外扩展，不增高当行 */
.link-apply-open { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 0 .6em; border: 1px solid color-mix(in srgb, var(--accent-ink) 45%, var(--border)); border-radius: 999px; background: none; color: var(--accent-ink); cursor: pointer; list-style: none; font-size: 13px; line-height: inherit; white-space: nowrap; transition: border-color .15s, color .15s; }
.link-apply-open::after { content: ""; position: absolute; inset: -6px -4px; }
.link-apply-open::before { content: "+"; color: var(--accent-ink); font-weight: 600; }
.link-apply[open] > .link-apply-open { border-color: var(--accent-ink); color: var(--accent-ink); }
.link-apply-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-apply-label { display: flex; align-items: baseline; gap: 6px; }
.link-apply-kind { color: var(--muted); font-weight: 500; }
.link-apply-label .req { color: var(--accent-ink); }
.link-apply-contact { display: grid; gap: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.link-apply-contact-row { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 8px; }
.link-apply-form select { height: 46px; padding: 0 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; font-weight: 400; }
.link-apply-form select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--ring); }
.link-apply-open::-webkit-details-marker { display: none; }
.link-apply-form { display: grid; gap: 14px; max-width: 420px; margin-top: 12px; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.link-apply-title { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; color: var(--text); font-size: 1.12rem; line-height: 1.3; }
.link-apply-title::before { content: ""; flex: none; width: 34px; height: 34px; border-radius: 11px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1.2 1.2M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1.2-1.2'/%3E%3C/svg%3E") center / 18px no-repeat, linear-gradient(135deg, #ef3b5a, var(--accent)); box-shadow: 0 6px 14px #d9153633; }
.link-apply-form label { display: grid; gap: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.link-apply-form input { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; font-weight: 400; transition: border-color .15s, box-shadow .15s, background .15s; }
.link-apply-form input::placeholder { color: var(--muted); opacity: .7; }
.link-apply-form input:focus { border-color: var(--accent); outline: none; background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.link-apply-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 4px; }
.link-apply-actions:has([data-link-apply-cancel]:not([hidden])) { grid-template-columns: 1fr 1fr; }
.link-apply-actions [data-link-apply-cancel] { order: -1; }
.link-apply-actions button { width: 100%; min-height: 46px; }
.link-apply-actions button:disabled { opacity: .6; cursor: progress; }
.link-apply-status { margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 14px; line-height: 1.5; }
.link-apply-status[data-state="ok"] { border-color: color-mix(in srgb, var(--ok-text) 35%, transparent); background: color-mix(in srgb, var(--ok-text) 10%, var(--surface)); color: var(--ok-text); }
.link-apply-status[data-state="error"] { border-color: var(--err-border); background: color-mix(in srgb, var(--err-text) 8%, var(--surface)); color: var(--err-text); }
.link-apply-dialog { width: min(100vw - 24px, 420px); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px #0006; text-align: left; }
.link-apply-dialog[open] { animation: link-apply-in .2s ease-out; }
.link-apply-dialog::backdrop { background: #110d12a6; backdrop-filter: blur(3px); }
.link-apply-dialog .link-apply-form { max-width: none; margin: 0; padding: 24px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.link-apply-dialog::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--accent), #ff8a3d, var(--gold)); }
@keyframes link-apply-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 520px) {
  .link-apply-dialog { width: 100%; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .link-apply-dialog .link-apply-form { padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
  .link-apply-dialog[open] { animation-name: link-apply-up; }
  @keyframes link-apply-up { from { transform: translateY(40px); opacity: .4; } }
}
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { gap: 0; }
.notice-card { display: flex; flex-direction: column; align-items: center; width: min(100%, 420px); padding: 34px 26px 28px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.notice-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #ef3b5a, var(--accent)); color: #fff; box-shadow: 0 12px 26px #d9153640; }
.notice-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notice-card h1 { margin: 18px 0 8px; }
.notice .notice-msg { margin: 0; color: var(--text); font-size: 1.02rem; line-height: 1.6; }
.notice .notice-actions { margin: 22px 0 0; }
.notice .back-home { min-width: 160px; text-decoration: none; }

/* ---------- 固定顶栏：通栏毛玻璃背景 + 细底线；--header-h 由 site.js 实测，下列为回退值 ---------- */
/* 锚点跳转留白 = 顶栏 + 结果态吸顶输入条（--sticky-h 由 app.js 实测，无结果时为 0）+ 12px；nav.js 高亮判定线读同一个值 */
:root { --header-h: 66px; --sticky-h: 0px; scroll-padding-top: calc(var(--header-h) + var(--sticky-h) + 12px); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  max-width: none;
  padding-inline: max(20px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
.brand-link { min-width: 0; }
.brand-link > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 结果态的搜索栏贴在顶栏下方，二者不重叠 */
.has-result .search-section { top: var(--header-h); }
@media (min-width: 640px) {
  .site-header { padding-inline: max(32px, calc((100% - 1096px) / 2)); }
}
/* 极窄屏门户顶栏保持单行 */
@media (max-width: 360px) {
  .portal-header .lang-current { display: none; }
}

/* 友链申请提交提示：标题下方的柔和提示卡片（对话框与无脚本展开表单通用） */
.link-apply-tip { margin: -4px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }

/* 顶栏导航：样式并入本文件以沿用 CSP 哈希；交互在 /nav.js。 */

/* 顶栏作为定位上下文，下拉不得撑开高度（否则 site.js 会改 --header-h） */
.portal-header.site-header {
  overflow: visible;
  z-index: 40;
}

.top-nav {
  align-items: center;
  gap: 2px;
}

.top-nav > a,
.top-nav .nav-tools > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.top-nav .nav-tools > summary::-webkit-details-marker { display: none; }

.top-nav > a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.top-nav .nav-tools > summary .chev,
.drawer-tools > summary .chev {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s ease;
}

.nav-tools[open] > summary .chev,
.drawer-tools[open] > summary .chev,
.lang-switch[open] .chev {
  transform: rotate(180deg);
}

.top-nav .nav-tools > summary[aria-current="page"],
.drawer-tools > summary[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.tools-group a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.nav-tools { position: static; }

/* 桌面：居中宽面板，三列分组，图标 + 名称 */
.tools-mega {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: min(940px, calc(100% - 48px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(168px, 0.7fr);
  gap: 8px 0;
  padding: 20px 8px 18px 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tools-mega > .tools-group {
  padding: 0 16px;
}

.tools-mega > .tools-group + .tools-group {
  border-left: 1px solid var(--border);
}

.tools-group h3 {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
  line-height: 1.4;
}

.tools-group ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tools-group[data-group="long"] ul {
  grid-template-columns: 1fr;
}

.tools-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.tools-group a:focus-visible {
  background: var(--soft);
}

.tools-group a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.tools-group a .platform-icon,
.tools-group a > .mark {
  display: block;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
}
.tools-group a .platform-icon img,
.tools-group a > .mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.tools-mega .tools-group a span { white-space: nowrap; }

.tools-mega:has(> .tools-group:nth-child(4)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tools-mega:has(> .tools-group:nth-child(4)) .tools-group ul { grid-template-columns: minmax(0, 1fr); }
.tools-mega:has(> .tools-group:nth-child(4)) .tools-group a > .mark { width: 32px; height: 32px; }
.tools-mega:has(> .tools-group:nth-child(4)) .tools-group a span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 汉堡按钮：窄屏才出现 */
.nav-drawer { display: none; position: static; }

.menu-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.menu-toggle::-webkit-details-marker { display: none; }

.menu-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 12px;
}

.menu-icon span,
.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 0;
  display: block;
  width: 16px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease, top .18s ease;
}

.menu-icon span { top: 5.1px; }
.menu-icon::before,
.menu-icon::after { content: ""; }
.menu-icon::before { top: 0; }
.menu-icon::after { top: 10.2px; }

.nav-drawer[open] .menu-toggle {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nav-drawer[open] .menu-icon span { opacity: 0; }
.nav-drawer[open] .menu-icon::before {
  top: 5.1px;
  transform: rotate(45deg);
}
.nav-drawer[open] .menu-icon::after {
  top: 5.1px;
  transform: rotate(-45deg);
}

/* 不用 fixed：顶栏有 backdrop-filter，会把 fixed 子元素改成相对顶栏定位，遮罩高度会变成 0 */
.drawer-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 35;
  height: calc(100dvh - var(--header-h));
  height: calc(100vh - var(--header-h));
  background: color-mix(in srgb, #16161c 32%, transparent);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100dvh - var(--header-h));
  overflow: auto;
  padding: 12px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}

.drawer-nav > a,
.drawer-tools > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.drawer-tools > summary::-webkit-details-marker { display: none; }

.drawer-nav > a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.top-nav > a:active,
.drawer-nav > a:active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.drawer-tools[open] > summary:not([aria-current="page"]) {
  background: transparent;
  color: var(--accent-ink);
}

.drawer-tools-body {
  display: grid;
  gap: 16px;
  padding: 10px 6px 16px;
}

.drawer-tools-body .tools-group ul {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.drawer-tools-body .tools-group a {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 6px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.drawer-tools-body .tools-group a .platform-icon,
.drawer-tools-body .tools-group a > .mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
}

.drawer-tools-body .tools-group h3 {
  margin: 0 0 8px;
  padding: 4px 10px 0;
}

/* 默认：门户在 <640px 隐藏顶栏导航。这里补上汉堡，并收起语言文案以免挤成两行。 */
@media (max-width: 639px) {
  .nav-drawer { display: block; }
  .portal-header .lang-current { display: none; }
  .portal-header .site-controls { gap: 8px; }
}

/* 中等宽度：导航靠右，紧挨语言和主题，避免和品牌重叠 */
@media (min-width: 640px) and (max-width: 899px) {
  .top-nav > a,
  .top-nav .nav-tools > summary { padding: 8px 9px; }
  .tools-mega { width: min(860px, calc(100% - 32px)); }
}

/* 宽屏：品牌 | 导航居中 | 控件，更像改版后的顶栏 */
@media (min-width: 900px) {
  .portal-header.site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .portal-header .brand-link { justify-self: start; }
  .portal-header .top-nav { margin-left: 0; justify-self: center; }
  .portal-header .site-controls { margin-left: 0; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .top-nav .nav-tools > summary .chev,
  .drawer-tools > summary .chev,
  .menu-icon span,
  .menu-icon::before,
  .menu-icon::after { transition: none; }
}

.parse-captcha{display:flex;justify-content:flex-end;align-items:flex-start;margin:0;min-height:0;overflow:visible}.parse-captcha:not(.is-on){height:0;margin:0;overflow:hidden}.parse-captcha.is-on{height:auto;margin:8px 0 0;overflow:visible}.parse-captcha.is-on .cf-turnstile{transform-origin:top right}
.parse-captcha[hidden]{display:none}
.parse-captcha .cf-turnstile,.parse-captcha iframe{margin-inline-start:auto}

/* 仅在真正能悬停的设备上使用 :hover，避免触屏点按后高亮粘住 */
@media (hover: hover) {
  .primary-button:hover:not(:disabled) { background: var(--accent-hover); }
  .secondary-button:hover:not(:disabled), .download-link:hover { border-color: var(--accent); color: var(--accent-ink); }
  .paste-button:hover:not(:disabled) { color: var(--text); background: var(--border); }
  .breadcrumb a:hover { color: var(--accent-ink); text-decoration: underline; }
  .top-nav a:hover:not([aria-current="page"]),
  .top-nav > a:hover:not([aria-current="page"]),
  .top-nav .nav-tools > summary:hover:not([aria-current="page"]) { background: var(--soft); color: var(--text); }
  .faq-item summary:hover h3 { color: var(--accent-ink); }
  .tool-card.is-live a:hover { box-shadow: inset 0 0 0 2px var(--accent); }
  .friend-links a:hover { color: var(--accent-ink); }
  .footer-home:hover { color: var(--accent-ink); text-decoration: underline; }
  .lang-switch summary:hover { border-color: var(--accent); }
  .lang-switch a:hover { background: var(--soft); }
  .theme-switch button:hover { color: var(--text); }
  .announcement-close:hover { background: var(--surface); color: var(--text); }
  .back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }
  .link-apply-open:hover { border-color: var(--accent-ink); }
  .link-apply-form input:hover { border-color: color-mix(in srgb, var(--border) 50%, var(--muted)); }
  .tools-group a:hover:not([aria-current="page"]) { background: var(--soft); }
  .menu-toggle:hover { border-color: var(--accent); }
  .drawer-nav > a:hover:not([aria-current="page"]) { background: var(--soft); }
  .drawer-tools > summary:hover:not([aria-current="page"]) { color: var(--text); }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .back-to-top:hover { transform: none; }
}

/* ---------- 广告跳转安全提示 ---------- */
.redirect-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100svh - var(--header-h) - 180px);
  padding: 48px 20px 24px;
}
.redirect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 480px);
  padding: 36px 28px 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.redirect-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ef3b5a, var(--accent));
  color: #fff;
  box-shadow: 0 12px 26px #d9153640;
}
.redirect-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.redirect-card h1 {
  margin: 20px 0 6px;
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.3;
  text-wrap: pretty;
}
.redirect-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}
.redirect-host {
  margin: 0;
  max-width: 100%;
  color: var(--text);
  font-size: clamp(20px, 4.4vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.redirect-url {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 8px 0 0;
  padding: 0 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (hover: hover) {
  .redirect-url:hover { color: var(--accent-ink); }
}

.redirect-timer {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 26px 0 8px;
}
.redirect-timer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.redirect-timer .track { stroke: var(--border); fill: none; stroke-width: 3; }
.redirect-timer .value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--remain, 100));
  transition: stroke-dashoffset .8s linear;
}
.redirect-timer .timer-num {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}
.redirect-eta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.redirect-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 22px 0 0;
}
.redirect-actions .primary-button,
.redirect-actions .secondary-button {
  min-width: 148px;
  text-decoration: none;
}
.redirect-page .site-footer { margin-top: 0; }

@media (max-width: 639px) {
  .redirect-main { padding: 28px 16px 16px; }
  .redirect-card { padding: 28px 18px 22px; border-radius: 20px; }
  .redirect-actions { flex-direction: column; }
  .redirect-actions .primary-button,
  .redirect-actions .secondary-button { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .redirect-timer, .redirect-eta { display: none; }
  .redirect-timer .value { transition: none; }
}

/* Secondary inventory navigation remains available below the primary four items. */
.secondary-nav{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem 1.5rem;margin:1rem 0;overflow-wrap:anywhere}
.secondary-tools{max-width:100%;text-align:start}
.secondary-tools summary{cursor:pointer}
