/* ===== DLShortReel — CollectUI-inspired (Geist, white/blue, border-driven, responsive) ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;          /* subtle fill (inputs, ad slots) */
  --panel: #ffffff;
  --panel-2: #f5f6f8;
  --border: #e5e6eb;           /* hairline border */
  --border-strong: #cdd3dd;    /* hover / focus border */
  --txt: #030712;              /* near-black */
  --txt-2: #242424;
  --dim: #71717b;              /* muted gray */
  --acc: #2F6BF2;             /* CollectUI royal blue — sole accent */
  --acc-ink: #1F5AE0;
  --acc-soft: rgba(47, 107, 242, 0.08);
  --acc-line: rgba(47, 107, 242, 0.18);
  --ok: #16a34a;              /* success status */
  --red: #e2473d;
  --red-soft: rgba(226, 71, 61, 0.07);
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(3, 7, 18, 0.04), 0 8px 22px rgba(3, 7, 18, 0.05);
  --shadow-sm: 0 1px 2px rgba(3, 7, 18, 0.04);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 36px 0 0.5em; letter-spacing: -0.025em; line-height: 1.16; color: var(--txt); font-weight: 700; }
h2 { font-size: 1.4rem; margin: 2.8em 0 0.6em; letter-spacing: -0.02em; color: var(--txt); font-weight: 700; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px 110px; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; margin: 0 -20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header.site .logo {
  font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--txt);
  display: flex; align-items: center; gap: 9px;
}
header.site .logo-mark { width: 24px; height: 24px; border-radius: 6px; display: block; flex: none; }
header.site .logo span { color: var(--acc); }
header.site nav { margin-left: auto; display: flex; gap: 2px; flex-wrap: wrap; }
header.site nav a {
  color: var(--dim); font-size: 0.9rem; font-weight: 500;
  padding: 7px 13px; border-radius: 999px; border: 1px solid transparent;
}
header.site nav a:hover { color: var(--acc); background: var(--acc-soft); text-decoration: none; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 64px 0 36px; }
.eyebrow {
  display: inline-block; margin-bottom: 16px; color: var(--acc);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  border: 1px solid var(--acc-line); border-radius: 999px; padding: 5px 14px;
  background: var(--acc-soft);
}
.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem); margin: 0 0 0.35em; letter-spacing: -0.035em; line-height: 1.08;
  font-weight: 700;
}
.hero .sub { color: var(--dim); max-width: 620px; margin: 0 auto 32px; font-size: 1.05rem; }
.hero .sub em { color: var(--txt-2); font-style: normal; font-weight: 600; }

/* ---------- paste / input ---------- */
.paste {
  display: flex; gap: 8px; max-width: 720px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.paste:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.paste input {
  flex: 1; border: 0; background: transparent; color: var(--txt);
  padding: 13px 16px; font-size: 1rem; outline: none; font-family: var(--mono); min-width: 0;
}
.paste input::placeholder { color: #9aa3af; font-family: var(--sans); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--txt);
  border-radius: var(--radius-sm); padding: 11px 20px; cursor: pointer; font-size: 0.95rem; font-weight: 600;
  white-space: nowrap; transition: all 0.15s ease; font-family: var(--sans);
}
.btn:hover { border-color: var(--acc); color: var(--acc-ink); }
.btn:disabled { cursor: default; opacity: 0.45; }
.btn.primary { border: 0; color: #fff; background: var(--acc); }
.btn.primary:hover { color: #fff; background: var(--acc-ink); }
.btn.primary:disabled { background: var(--acc); opacity: 0.5; }

#status { color: var(--acc); font-size: 0.86rem; min-height: 1.2em; margin: 16px 0 0; font-family: var(--mono); }
#result { margin-top: 28px; }

/* ---------- supported-sources grid ---------- */
.lead { color: var(--dim); }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.platform {
  display: flex; flex-direction: column; gap: 6px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--txt);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.platform:hover { color: var(--txt); text-decoration: none; border-color: var(--acc); transform: translateY(-2px); }
.platform .pname { font-weight: 700; font-size: 1rem; }
.platform .pnum { color: var(--dim); font-size: 0.82rem; }

/* ---------- landing source grid (reelshort / dramabox) ---------- */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.plat-card {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: var(--txt);
  transition: border-color 0.15s ease;
}
.plat-card:hover { color: var(--txt); text-decoration: none; border-color: var(--acc); }
.plat-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); flex: none; }
.plat-card b { display: block; font-size: 0.95rem; font-weight: 600; }
.plat-card span { color: var(--dim); font-size: 0.82rem; }

/* ---------- panel (guide pages) ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 16px; margin: 24px 0;
}

/* ---------- series head ---------- */
.series-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.sh-left { display: flex; gap: 16px; align-items: center; min-width: 0; }
.series-head .cover { width: 58px; height: 82px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-strong); flex: none; }
.series-title { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.series-meta { color: var(--dim); font-size: 0.85rem; margin-top: 2px; }
.series-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chk { color: var(--dim); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- episode grid ---------- */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.ep-grid.hide-locked .locked { display: none; }
.ep-cell {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px 6px 9px; min-height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  user-select: none;
}
.ep-cell:hover { border-color: var(--acc); transform: translateY(-2px); }
.ep-cell .ep-sel { position: absolute; top: 6px; right: 6px; width: 15px; height: 15px; margin: 0; accent-color: var(--acc); cursor: pointer; }
.ep-cell .lock { position: absolute; top: 6px; right: 7px; font-size: 0.82rem; }
.ep-cell .ep-no { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; font-family: var(--mono); line-height: 1; }
.ep-cell .ep-tt { font-size: 0.6rem; color: var(--dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ep-cell .ep-prog { font-size: 0.6rem; color: var(--acc); min-height: 0.8em; margin-top: 4px; font-family: var(--mono); }
.ep-cell:has(.ep-sel:checked) { background: var(--acc-soft); border-color: var(--acc); }
.ep-cell:has(.ep-sel:checked) .ep-no, .ep-cell:has(.ep-sel:checked) .ep-tt { color: var(--acc-ink); }
.ep-cell.locked { cursor: not-allowed; background: var(--panel-2); border-style: dashed; }
.ep-cell.locked .ep-no { color: #9aa3af; }

/* ---------- download queue ---------- */
.queue { margin-top: 18px; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--acc); border-radius: var(--radius); padding: 14px 18px; }
.q-empty { color: var(--dim); font-size: 0.85rem; text-align: center; padding: 6px 0; }
.q-head { font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.86rem; }
.q-row:first-of-type { border-top: 0; }
.q-ep { font-weight: 700; min-width: 46px; font-family: var(--mono); color: var(--acc); }
.q-name { flex: 1; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-prog { color: var(--ok); font-weight: 600; min-width: 100px; text-align: right; font-family: var(--mono); }

/* ---------- status / error ---------- */
.note { color: var(--dim); font-size: 0.82rem; margin-top: 14px; text-align: center; }
.err { color: var(--red); padding: 16px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--red-soft); }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; counter-reset: st; display: grid; gap: 12px; }
.steps li { counter-increment: st; position: relative; padding: 16px 18px 16px 58px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.steps li::before {
  content: counter(st); position: absolute; left: 18px; top: 16px;
  width: 26px; height: 26px; border-radius: 8px; background: var(--acc-soft); color: var(--acc);
  font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-family: var(--mono);
}
.steps li b { color: var(--txt); }

/* ---------- faq ---------- */
.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--acc); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--dim); margin: 0 0 14px; }

.disclaimer { margin-top: 3em; padding: 18px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--dim); font-size: 0.85rem; }
.disclaimer strong { color: var(--txt-2); }

footer.site { margin-top: 3.4em; color: var(--dim); font-size: 0.82rem; display: flex; gap: 20px; flex-wrap: wrap; }
footer.site a { color: var(--dim); }
footer.site a:hover { color: var(--acc); }

/* ---------- ad slots (AdSense-ready placeholders) ----------
   Keep these box-stable so layout never jumps when an ad loads.
   Drop AdSense <ins> tags inside the slot divs; the dashed frame is
   only a fallback shown before/without an ad. */
.ad-slot {
  margin: 28px 0; min-height: 100px; display: flex; align-items: center; justify-content: center;
  color: #9aa3af; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  font-size: 0.78rem; letter-spacing: 0.04em; background: var(--bg-soft); text-align: center; padding: 8px;
}
.ad-slot:empty::after { content: "Advertisement"; }
.ad-inline { margin: 22px auto; max-width: 728px; }

code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; font-family: var(--mono); color: var(--acc-ink); border: 1px solid var(--border); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px 90px; }
  header.site { padding: 12px 16px; margin: 0 -16px; gap: 10px; }
  header.site nav a { padding: 6px 10px; font-size: 0.84rem; }
  .hero { padding: 44px 0 26px; }
  .paste { flex-direction: column; }
  .paste .btn { width: 100%; }
  .series-head { flex-direction: column; align-items: flex-start; }
  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 7px; }
  .work-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  h2 { margin-top: 2.2em; }
}
@media (max-width: 380px) {
  .ep-grid { grid-template-columns: repeat(2, 1fr); }
  header.site .logo { font-size: 1rem; }
}