/* ============================================================
   无水印下载 · 界面样式
   设计约束：纯色方案（不使用任何渐变）、无表情符号、PC / 移动双端适配
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f3f4f6;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --surface-sink: #eef0f3;
  --line: #e4e6ea;
  --line-strong: #d3d7dd;
  --text: #0e1116;
  --text-2: #39404b;
  --muted: #6b7280;
  --accent: #ff2b52;
  --accent-soft: #ffe8ed;
  --ink: #111318;
  --ink-contrast: #ffffff;
  --ok: #0f9d58;
  --warn: #b45309;
  --danger: #d92d20;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow-sm: 0 1px 2px rgba(16, 22, 32, 0.05), 0 1px 3px rgba(16, 22, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 22, 32, 0.07), 0 1px 3px rgba(16, 22, 32, 0.05);
  --shadow-lg: 0 18px 48px rgba(16, 22, 32, 0.14);

  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #0a0c0f;
  --bg-elev: #101318;
  --surface: #12161c;
  --surface-soft: #171c23;
  --surface-sink: #1d232b;
  --line: #242a33;
  --line-strong: #333b47;
  --text: #eef1f5;
  --text-2: #c5ccd6;
  --muted: #8b95a3;
  --accent: #ff3d63;
  --accent-soft: #2b1620;
  --ink: #eef1f5;
  --ink-contrast: #0b0d10;
  --ok: #31c48d;
  --warn: #f0a04b;
  --danger: #f97066;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.7);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

h1, h2, h3, p {
  margin: 0;
}

button, textarea, input, select {
  font: inherit;
  color: inherit;
}

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

img, video {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-sm {
  width: 16px;
  height: 16px;
}

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

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  font-size: 16.5px;
}

.brand-text em {
  font-style: normal;
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill[data-state="ok"] .status-dot {
  background: var(--ok);
}

.status-pill[data-state="bad"] .status-dot {
  background: var(--danger);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

#themeBtn .ico-moon { display: none; }
html[data-theme="dark"] #themeBtn .ico-sun { display: none; }
html[data-theme="dark"] #themeBtn .ico-moon { display: block; }

/* ---------------------------- 连接诊断条 ---------------------------- */

.alert-bar {
  background: #fff4e5;
  border-bottom: 1px solid #f0d5ae;
  color: #7a4a05;
}

html[data-theme="dark"] .alert-bar {
  background: #241a0e;
  border-bottom-color: #45331a;
  color: #f2c98a;
}

.alert-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.alert-ico {
  flex: none;
  margin-top: 1px;
}

.alert-ico .ico {
  width: 19px;
  height: 19px;
  color: #c98118;
}

html[data-theme="dark"] .alert-ico .ico {
  color: #f0a94b;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-body strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.alert-body p {
  font-size: 13px;
  line-height: 1.65;
  opacity: 0.92;
}

.alert-cmd {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(122, 74, 5, 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

html[data-theme="dark"] .alert-cmd {
  background: rgba(242, 201, 138, 0.12);
}

.alert-bar .btn {
  flex: none;
  align-self: center;
  border-color: currentColor;
  color: inherit;
  opacity: 0.85;
}

.alert-bar .btn:hover {
  background: rgba(122, 74, 5, 0.08);
  border-color: currentColor;
  color: inherit;
  opacity: 1;
}

/* ------------------------------ Hero ------------------------------ */

.hero {
  padding: 58px 0 26px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(30px, 4.9vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 680;
  max-width: 14em;
}

.mark {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0 0.16em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lede {
  margin-top: 18px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
}

/* --------------------------- 输入卡片 --------------------------- */

.composer {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.composer:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
}

.composer-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.composer-count {
  font-size: 12px;
  color: var(--muted);
}

#input {
  display: block;
  width: 100%;
  min-height: 118px;
  max-height: 320px;
  padding: 12px 18px 8px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  font-size: 15px;
  line-height: 1.72;
  color: var(--text);
  overflow-y: auto;
  scrollbar-width: thin;
}

#input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.composer-tip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

.sep-dot {
  color: var(--line-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease),
    border-color 0.16s var(--ease), transform 0.12s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--ink-contrast);
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-primary[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface-soft);
  border-color: var(--text);
}

.btn-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: 10px;
}

.btn-primary .spinner-ring {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 快捷按钮 / 历史 */

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 520;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-soft);
}

.chip-ghost {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}

.history {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.link-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--accent);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.history-item b {
  font-weight: 650;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

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

.results-section {
  padding: 18px 0 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  align-items: start;
}

.results[data-count="1"] {
  grid-template-columns: minmax(0, 660px);
}

.results-section {
  scroll-margin-top: 84px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: rise 0.36s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-head {
  display: flex;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: var(--surface-sink);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.head-main {
  min-width: 0;
  flex: 1;
}

.badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.badge-douyin {
  background: #101114;
  color: #ffffff;
}

.badge-xhs {
  background: #ff2442;
  color: #ffffff;
}

.badge-soft {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 550;
}

.card-title {
  font-size: 15px;
  font-weight: 620;
  line-height: 1.45;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-sub span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-body {
  padding: 14px 16px;
  flex: 1;
}

/* 视频 */

.video-shell {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: #0a0b0d;
  border: 1px solid var(--line);
}

.video-shell video {
  width: 100%;
  max-height: 460px;
  background: #0a0b0d;
  object-fit: contain;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  appearance: none;
  height: 38px;
  padding: 0 34px 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  max-width: 240px;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* 图片网格 */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-sink);
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
}

.tile img.loaded {
  opacity: 1;
}

.tile:hover img {
  transform: scale(1.04);
}

.tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  background: rgba(8, 10, 14, 0.46);
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}

.tile:hover .tile-overlay,
.tile:focus-within .tile-overlay {
  opacity: 1;
}

.tile-idx {
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
}

.tile-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  cursor: pointer;
  transition: background 0.14s var(--ease);
}

.mini-btn:hover {
  background: #fff;
}

.mini-btn .ico {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.live-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.66);
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 卡片操作区 */

.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 16px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.card-foot .btn {
  flex: 1 1 auto;
}

.card-foot .btn svg {
  width: 17px;
  height: 17px;
}

/* 错误卡片 */

.card-error {
  border-color: var(--line);
  background: var(--surface);
}

.card-error .card-head {
  border-bottom: 1px solid var(--line);
}

.err-box {
  display: flex;
  gap: 10px;
  padding: 4px 0 12px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.err-box .ico {
  color: var(--danger);
  margin-top: 2px;
}

.err-hint {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------------------- 骨架屏 ---------------------------- */

.skeleton-box {
  padding: 18px 0 8px;
}

.resume-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.sk-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 16px;
  animation: breathe 1.6s var(--ease) infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.sk-line {
  height: 10px;
  border-radius: 6px;
  background: var(--surface-sink);
  margin-bottom: 9px;
}

.sk-line.w40 { width: 40%; }
.sk-line.w35 { width: 35%; }
.sk-line.w45 { width: 45%; }
.sk-line.w70 { width: 70%; }
.sk-line.w60 { width: 60%; }
.sk-line.w65 { width: 65%; }

.sk-media {
  margin-top: 14px;
  height: 150px;
  border-radius: var(--r);
  background: var(--surface-sink);
}

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

.footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------------------------- 灯箱 ---------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 10, 13, 0.94);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  padding: 64px 8px 24px;
}

.lightbox[hidden] {
  display: none;
}

.lb-img {
  grid-column: 2;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  border-radius: 6px;
}

.lb-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #fff;
}

.lb-count {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lb-actions {
  display: flex;
  gap: 8px;
}

.lb-actions .icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.lb-actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lb-nav {
  width: 44px;
  height: 44px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.lb-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }

.lb-nav .ico {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

/* ---------------------------- Toast ---------------------------- */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  background: #111318;
  color: #f4f6f9;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.28s var(--ease) both;
  border-left: 3px solid #5b6472;
}

.toast[data-kind="ok"] { border-left-color: #31c48d; }
.toast[data-kind="warn"] { border-left-color: #f0a04b; }
.toast[data-kind="bad"] { border-left-color: #f97066; }

.toast .ico {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: #31c48d;
}

.toast[data-kind="bad"] .ico { color: #f97066; }
.toast[data-kind="warn"] .ico { color: #f0a04b; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------- 响应式 ---------------------------- */

@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }

  .topbar-inner {
    height: 58px;
  }

  .status-pill span {
    display: none;
  }

  .status-pill {
    padding: 0 9px;
    height: 30px;
  }

  .hero {
    padding: 36px 0 18px;
  }

  .hero h1 {
    max-width: none;
    font-size: 28px;
    line-height: 1.2;
  }

  .lede {
    font-size: 14.5px;
    margin-top: 14px;
  }

  .composer {
    margin-top: 22px;
    border-radius: var(--r);
  }

  #input {
    min-height: 132px;
    font-size: 16px;
  }

  .composer-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px 14px;
  }

  .composer-bottom .btn {
    width: 100%;
  }

  .results {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .footer {
    margin-top: 34px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lightbox {
    grid-template-columns: 52px 1fr 52px;
    padding: 60px 4px 18px;
  }

  .lb-nav {
    width: 38px;
    height: 38px;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: none;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-body {
    padding: 12px;
  }

  .card-foot {
    padding: 12px;
  }

  .card-foot .btn {
    flex: 1 1 46%;
  }

  .video-shell video {
    max-height: 52vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 滚动条 */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
