:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.78);
  --card-solid: #ffffff;
  --ink: #152238;
  --muted: #748095;
  --line: rgba(37, 57, 88, 0.11);
  --blue: #246bfe;
  --blue-dark: #1756d1;
  --blue-soft: #eaf1ff;
  --green: #2dbd76;
  --shadow: 0 22px 70px rgba(54, 75, 112, 0.1), 0 2px 8px rgba(54, 75, 112, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 0%, rgba(114, 165, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 100% 12%, rgba(174, 224, 207, 0.28), transparent 24rem),
    var(--bg);
}

button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

.shell {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 0 32px;
}

.topbar, .brand, .secure-badge, .input-toolbar, .cookie-title-row, .result-heading, .media-actions, .meta-line {
  display: flex;
  align-items: center;
}

.topbar { justify-content: space-between; min-height: 44px; }
.brand { gap: 10px; color: var(--ink); font-size: 15px; font-weight: 750; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(145deg, #5b92ff, #2458ed);
  box-shadow: 0 7px 16px rgba(36, 107, 254, 0.28);
}
.secure-badge { gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(45, 189, 118, 0.12); }

.hero { padding: 62px 0 30px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; }
.hero h1 { max-width: 680px; margin: 0; font-size: clamp(38px, 8vw, 66px); font-weight: 800; line-height: 0.98; letter-spacing: -0.065em; }
.hero h1 span { color: var(--blue); }
.hero-copy { margin: 20px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.card {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.workspace-card { padding: 25px; margin-top: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.section-heading h2, .cookie-title-row h3 { margin: 0; font-size: 20px; font-weight: 780; letter-spacing: -0.035em; }
.step-number {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--blue);
  border-radius: 50%;
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.platform-button {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.platform-button:hover { transform: translateY(-1px); border-color: rgba(36, 107, 254, 0.35); }
.platform-button.selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(36, 107, 254, 0.12); }
.platform-button.unavailable { opacity: 0.48; }
.platform-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; color: #fff; border-radius: 11px; background: linear-gradient(145deg, #2f435e, #1a2538); font-size: 15px; font-weight: 800; }
.platform-button[data-platform="douyin"] .platform-icon { background: linear-gradient(145deg, #10151f, #ec4275); }
.platform-button[data-platform="kuaishou"] .platform-icon { background: linear-gradient(145deg, #ffb400, #f06e19); }
.platform-button[data-platform="xiaohongshu"] .platform-icon { background: linear-gradient(145deg, #ff6c71, #e51f4f); }
.platform-button[data-platform="bilibili"] .platform-icon { background: linear-gradient(145deg, #73d7ec, #419bd7); }
.platform-name { display: block; font-size: 13px; font-weight: 750; }
.platform-state { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.muted-note { min-height: 17px; margin: 14px 2px 0; color: var(--muted); font-size: 12px; }

.share-input, .cookie-input {
  display: block;
  width: 100%;
  resize: vertical;
  padding: 17px 18px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  background: rgba(250, 252, 255, 0.84);
  line-height: 1.65;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.share-input { min-height: 145px; font-size: 15px; }
.cookie-input { min-height: 86px; font-size: 12px; }
.share-input:focus, .cookie-input:focus { border-color: rgba(36, 107, 254, 0.65); box-shadow: 0 0 0 4px rgba(36, 107, 254, 0.1); }
textarea::placeholder { color: #9ca8ba; }
.input-toolbar { justify-content: space-between; gap: 12px; min-height: 37px; }
.input-tip, .muted-note { color: var(--muted); font-size: 12px; }
.tip-icon { display: inline-block; margin-right: 5px; color: var(--blue); font-size: 17px; vertical-align: -1px; }
.text-button { padding: 5px 0; color: var(--blue); border: 0; background: transparent; font-size: 12px; font-weight: 750; }
.cookie-panel { margin-top: 16px; padding: 17px; border: 1px solid rgba(36, 107, 254, 0.13); border-radius: 19px; background: rgba(234, 241, 255, 0.52); }
.cookie-title-row { justify-content: space-between; margin-bottom: 12px; }
.cookie-title-row h3 { font-size: 16px; }
.cookie-lock { color: var(--muted); font-size: 11px; }

.primary-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding: 16px 18px 16px 20px;
  color: #fff;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(110deg, var(--blue), #568cff);
  box-shadow: 0 12px 23px rgba(36, 107, 254, 0.24);
  font-size: 15px;
  font-weight: 780;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 16px 28px rgba(36, 107, 254, 0.28); background: linear-gradient(110deg, var(--blue-dark), #4e86ff); }
.primary-button:active { transform: translateY(1px); }
.button-arrow { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.18); font-size: 18px; }

.result-card { margin-top: 16px; padding: 25px; }
.result-state { padding: 6px 9px; color: var(--green); border-radius: 9px; background: rgba(45, 189, 118, 0.11); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.result-state.error { color: #e05260; background: rgba(224, 82, 96, 0.1); }
.result-meta { padding: 15px; border-radius: 17px; background: rgba(245, 247, 251, 0.75); }
.meta-line { gap: 10px; }
.author-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 12px; object-fit: cover; background: #e9eef7; }
.meta-title { margin: 0; font-size: 14px; font-weight: 780; }
.meta-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.result-description { margin: 13px 0 0; color: #56647a; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.media-item { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--card-solid); }
.media-item video, .media-item img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #edf1f7; }
.media-item video { aspect-ratio: 16 / 10; }
.media-item img { aspect-ratio: 1 / 1; }
.previewable-image { cursor: zoom-in; outline: none; }
.previewable-image:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }
.media-item .media-error { min-height: 160px; object-fit: contain; }
.media-caption { padding: 11px 12px; }
.media-label { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.download-button { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; padding: 7px 10px; color: var(--blue); border: 0; border-radius: 9px; background: var(--blue-soft); font-size: 11px; font-weight: 750; }
.download-button:hover { background: #dce8ff; }
.media-actions { justify-content: flex-end; gap: 8px; margin-top: 14px; }
.batch-download-button { display: inline-flex; align-items: center; gap: 5px; padding: 9px 12px; color: #fff; border: 0; border-radius: 10px; background: var(--blue); font-size: 12px; font-weight: 750; }
.batch-download-button:hover { background: var(--blue-dark); }
.batch-download-button:disabled { cursor: wait; }
.preview-open { overflow: hidden; }
.image-preview { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(12, 20, 35, 0.82); }
.image-preview[hidden] { display: none; }
.image-preview-panel { position: relative; display: grid; place-items: center; width: min(100%, 1100px); max-height: 100%; padding: 38px 16px 16px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; background: rgba(21, 34, 56, 0.96); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3); }
.image-preview-title { width: 100%; margin: 0 38px 10px 0; overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-image { display: block; width: auto; max-width: 100%; max-height: min(78vh, 820px); object-fit: contain; border-radius: 10px; background: #edf1f7; }
.image-preview-close { position: absolute; top: 9px; right: 10px; display: grid; width: 32px; height: 32px; place-items: center; color: #fff; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); font-size: 23px; line-height: 1; cursor: pointer; }
.image-preview-close:hover { background: rgba(255, 255, 255, 0.28); }
.empty-media { margin: 0; padding: 24px 0 4px; color: var(--muted); font-size: 13px; text-align: center; }

.loading { display: flex; align-items: center; gap: 13px; margin-top: 16px; padding: 18px 21px; }
.loading strong { font-size: 14px; }
.loading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.spinner { width: 22px; height: 22px; flex: 0 0 22px; border: 3px solid #dce6fa; border-top-color: var(--blue); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 20; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); left: 16px; max-width: 520px; margin: auto; padding: 12px 15px; color: #fff; border-radius: 13px; background: rgba(21, 34, 56, 0.9); box-shadow: 0 12px 30px rgba(21, 34, 56, 0.2); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.footer { display: flex; justify-content: center; gap: 9px; padding: 28px 0 4px; color: #98a3b4; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 820px); }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .workspace-card, .result-card { padding: 19px; border-radius: 23px; }
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-button { min-height: 62px; padding: 9px; }
  .platform-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 10px; }
  .media-grid { grid-template-columns: 1fr; }
  .secure-badge { display: none; }
}
