/* =========================================================
 * 网页转 PDF · 独立视觉系统「纸夹 / FOLIO」
 * 浅色：暖纸底 + 深松绿 + 朱砂红；深色：墨蓝底 + 薄荷绿 + 珊瑚红。
 * 只作用于 .wtp-page，主题跟随导航 #themeToggle 写入的 data-theme。
 * ========================================================= */

.wtp-page {
  --wt-bg: #f4f1ea;
  --wt-bg-2: #ebe6da;
  --wt-paper: #fffdf8;
  --wt-ink: #163033;
  --wt-ink-2: #496165;
  --wt-ink-3: #7c8f91;
  --wt-line: #d9ddd3;
  --wt-line-strong: #bdc7bd;
  --wt-brand: #0f766e;
  --wt-brand-deep: #0a5650;
  --wt-brand-soft: #dcefea;
  --wt-accent: #d85f4b;
  --wt-accent-soft: #fbe6df;
  --wt-gold: #c99638;
  --wt-shadow: 0 16px 44px rgba(22, 48, 51, .09);
  --wt-shadow-2: 0 8px 22px rgba(22, 48, 51, .08);
  --wt-radius: 18px;
  color: var(--wt-ink);
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(15, 118, 110, .10), transparent 70%),
    radial-gradient(700px 320px at -10% 18%, rgba(216, 95, 75, .08), transparent 70%),
    var(--wt-bg);
  padding: 0 0 86px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] .wtp-page {
  --wt-bg: #0d1618;
  --wt-bg-2: #111e21;
  --wt-paper: #162427;
  --wt-ink: #e7f0ee;
  --wt-ink-2: #b2c5c3;
  --wt-ink-3: #839b99;
  --wt-line: #263a3c;
  --wt-line-strong: #385254;
  --wt-brand: #5eead4;
  --wt-brand-deep: #a7f3e6;
  --wt-brand-soft: rgba(94, 234, 212, .12);
  --wt-accent: #ff9b87;
  --wt-accent-soft: rgba(255, 155, 135, .13);
  --wt-gold: #e8bd67;
  --wt-shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --wt-shadow-2: 0 8px 24px rgba(0, 0, 0, .38);
}

.wtp-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- 面包屑微调（与公共组件共存，不另做一套） ---------- */
.wtp-page .tsk-crumb-bar {
  margin-bottom: 26px;
}

/* ---------- 首屏 ---------- */
.wtp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, .78fr);
  gap: 46px;
  align-items: center;
  min-height: 420px;
  padding: 12px 0 34px;
}

.wtp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--wt-brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.wtp-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wt-accent);
  box-shadow: 0 0 0 5px var(--wt-accent-soft);
}

.wtp-hero h1 {
  margin: 12px 0 10px;
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 1.08;
  letter-spacing: -.02em;
  font-weight: 800;
}

.wtp-lead {
  margin: 0 0 24px;
  max-width: 620px;
  color: var(--wt-ink-2);
  font-size: 17px;
  line-height: 1.85;
}

.wtp-lead strong,
.wtp-reading strong,
.wtp-step strong,
.wtp-hint strong {
  color: var(--wt-brand);
  font-weight: 800;
}

.wtp-console {
  position: relative;
  background: var(--wt-paper);
  border: 1px solid var(--wt-line);
  border-radius: var(--wt-radius);
  padding: 20px;
  box-shadow: var(--wt-shadow);
}

.wtp-console::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(var(--wt-accent), var(--wt-brand));
}

.wtp-field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--wt-ink-2);
}

.wtp-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.wtp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.wtp-input-wrap svg {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--wt-ink-3);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}

.wtp-input-wrap input,
.wtp-batch textarea,
.wtp-field input,
.wtp-field select {
  width: 100%;
  border: 1px solid var(--wt-line-strong);
  background: var(--wt-bg-2);
  color: var(--wt-ink);
  border-radius: 12px;
  font: inherit;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}

.wtp-input-wrap input {
  height: 54px;
  padding: 0 16px 0 44px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14.5px;
}

.wtp-input-wrap input:focus,
.wtp-batch textarea:focus,
.wtp-field input:focus,
.wtp-field select:focus {
  border-color: var(--wt-brand);
  box-shadow: 0 0 0 3px var(--wt-brand-soft);
  background: var(--wt-paper);
}

.wtp-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform .16s, box-shadow .16s, background .16s;
}

.wtp-btn-main {
  height: 54px;
  padding: 0 24px;
  color: #fff;
  background: var(--wt-brand);
  box-shadow: 0 10px 24px rgba(15, 118, 110, .24);
  white-space: nowrap;
}

.wtp-btn-main:hover { background: var(--wt-brand-deep); transform: translateY(-1px); }
.wtp-btn-main:active { transform: translateY(0); }
.wtp-btn-main:disabled { opacity: .62; cursor: wait; transform: none; }
.wtp-btn-main span { margin-left: 8px; font-size: 19px; }

:root[data-theme="dark"] .wtp-btn-main { color: #06201e; }

.wtp-hint {
  margin: 8px 0 0;
  color: var(--wt-ink-3);
  font-size: 12.5px;
  line-height: 1.7;
}

.wtp-quick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.wtp-chip {
  border: 1px dashed var(--wt-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--wt-ink-2);
  padding: 5px 13px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .16s;
}

.wtp-chip:hover,
.wtp-chip[aria-expanded="true"] {
  color: var(--wt-brand);
  border-color: var(--wt-brand);
  background: var(--wt-brand-soft);
}

.wtp-chip-link { border-style: solid; }
.wtp-quick-note { margin-left: auto; color: var(--wt-ink-3); font-size: 12px; }

.wtp-batch {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--wt-line);
}

.wtp-batch textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
}

.wtp-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--wt-accent-soft);
  color: var(--wt-accent);
  font-size: 13.5px;
  font-weight: 700;
}

.wtp-assurance {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  color: var(--wt-ink-3);
  font-size: 12.5px;
}

.wtp-assurance span { display: inline-flex; align-items: center; gap: 7px; }
.wtp-assurance i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wt-brand);
}

/* ---------- 首屏右侧插画：纯 CSS / SVG，无图片请求 ---------- */
.wtp-hero-art {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wtp-art-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  transform: rotate(6deg);
  padding: 5px 12px;
  border: 1px solid var(--wt-accent);
  color: var(--wt-accent);
  border-radius: 4px;
  font: 700 10px/1.4 ui-monospace, monospace;
  letter-spacing: .22em;
}

.wtp-browser {
  width: 86%;
  border: 1px solid var(--wt-line-strong);
  border-radius: 14px;
  background: var(--wt-paper);
  box-shadow: var(--wt-shadow);
  overflow: hidden;
  transform: rotate(-2.5deg);
}

.wtp-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  background: var(--wt-bg-2);
  border-bottom: 1px solid var(--wt-line);
}

.wtp-browser-bar b { width: 8px; height: 8px; border-radius: 50%; background: var(--wt-line-strong); }
.wtp-browser-bar b:first-child { background: var(--wt-accent); }
.wtp-browser-bar span {
  margin-left: 10px;
  padding: 3px 12px;
  border-radius: 99px;
  background: var(--wt-paper);
  color: var(--wt-ink-3);
  font: 11px/1.4 ui-monospace, monospace;
}

.wtp-browser-body { padding: 22px 24px 26px; }

.wtp-skeleton {
  height: 9px;
  margin-bottom: 11px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--wt-line) 25%, var(--wt-bg-2) 50%, var(--wt-line) 75%);
  background-size: 200% 100%;
  animation: wtp-shimmer 2.8s linear infinite;
}

.wtp-skeleton-title { width: 72%; height: 18px; background: var(--wt-brand); opacity: .72; }
.wtp-skeleton-sub { width: 48%; margin-top: -4px; background: var(--wt-gold); opacity: .5; }
.wtp-skeleton-short { width: 62%; }

@keyframes wtp-shimmer { to { background-position: -200% 0; } }

.wtp-paper {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 126px;
  height: 164px;
  padding: 16px 14px;
  background: var(--wt-paper);
  border: 1px solid var(--wt-line-strong);
  border-radius: 4px 12px 4px 4px;
  box-shadow: -14px 16px 30px rgba(0, 0, 0, .12);
  transform: rotate(7deg);
}

.wtp-paper-head {
  font: 800 26px/1 Georgia, serif;
  letter-spacing: .1em;
  color: var(--wt-accent);
}

.wtp-paper-line { height: 6px; margin-top: 12px; border-radius: 99px; background: var(--wt-line); }
.wtp-paper-line.short { width: 62%; }
.wtp-paper-block { height: 42px; margin-top: 12px; border-radius: 6px; background: var(--wt-brand-soft); }

.wtp-arrow {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 64px;
  transform: translateX(-50%);
  color: var(--wt-accent);
}

.wtp-arrow svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 进度与结果 ---------- */
.wtp-progress,
.wtp-result {
  margin: 0 0 34px;
  padding: 18px 22px;
  border: 1px solid var(--wt-line);
  border-radius: 14px;
  background: var(--wt-paper);
  box-shadow: var(--wt-shadow-2);
}

.wtp-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}

.wtp-progress-top b { color: var(--wt-brand); }

.wtp-progress-track {
  height: 8px;
  margin: 10px 0 8px;
  border-radius: 99px;
  background: var(--wt-bg-2);
  overflow: hidden;
}

.wtp-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wt-brand), var(--wt-accent));
  transition: width .4s ease;
}

.wtp-progress p { margin: 0; color: var(--wt-ink-3); font-size: 12.5px; }

.wtp-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-color: var(--wt-brand);
}

.wtp-result-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wt-brand-soft);
  color: var(--wt-brand);
  font-size: 22px;
  font-weight: 900;
}

.wtp-result-body { min-width: 0; }
.wtp-result-body strong { display: block; font-size: 16px; }
.wtp-result-body > span { color: var(--wt-ink-3); font-size: 12.5px; }
.wtp-result-body ul { margin: 8px 0 0; padding-left: 18px; color: var(--wt-ink-2); font-size: 12.5px; }
.wtp-result-body li { overflow-wrap: anywhere; }

/* ---------- 主体面板 ---------- */
.wtp-main { display: grid; gap: 36px; }

.wtp-panel {
  border: 1px solid var(--wt-line);
  border-radius: 20px;
  background: var(--wt-paper);
  padding: 28px;
  box-shadow: var(--wt-shadow-2);
}

.wtp-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--wt-line);
}

.wtp-panel-head > div { display: flex; align-items: baseline; gap: 12px; }
.wtp-panel-no { color: var(--wt-accent); font: 800 13px/1 ui-monospace, monospace; }
.wtp-panel-head h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 25px;
  letter-spacing: .01em;
}

.wtp-panel-head p { margin: 0; color: var(--wt-ink-3); font-size: 13px; }

.wtp-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.wtp-field { display: block; }
.wtp-field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; color: var(--wt-ink-2); }
.wtp-field small { font-weight: 500; color: var(--wt-ink-3); }
.wtp-field-wide { grid-column: 1 / -1; }
.wtp-field select,
.wtp-field input { height: 46px; padding: 0 13px; font-size: 14px; }

.wtp-switches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.wtp-switch {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--wt-line);
  border-radius: 12px;
  background: var(--wt-bg-2);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}

.wtp-switch:hover { border-color: var(--wt-brand); }
.wtp-switch input { position: absolute; opacity: 0; pointer-events: none; }
.wtp-switch-ui {
  grid-row: 1 / 3;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--wt-line-strong);
  transition: background .18s;
}
.wtp-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
}
.wtp-switch input:checked + .wtp-switch-ui { background: var(--wt-brand); }
.wtp-switch input:checked + .wtp-switch-ui::after { transform: translateX(16px); }
.wtp-switch input:focus-visible + .wtp-switch-ui { box-shadow: 0 0 0 3px var(--wt-brand-soft); }
.wtp-switch b { font-size: 14px; }
.wtp-switch small { color: var(--wt-ink-3); font-size: 11.5px; line-height: 1.5; }

/* ---------- 三步说明 ---------- */
.wtp-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.wtp-step {
  position: relative;
  padding: 24px 22px 22px;
  border: 1px solid var(--wt-line);
  border-radius: 16px;
  background: var(--wt-bg-2);
}

.wtp-step > span {
  position: absolute;
  top: -13px;
  left: 20px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--wt-accent);
  color: #fff;
  font: 800 13px/1 ui-monospace, monospace;
}

.wtp-step h3 { margin: 6px 0 8px; font-size: 16px; }
.wtp-step p { margin: 0; color: var(--wt-ink-2); font-size: 13.5px; line-height: 1.8; }

/* ---------- 阅读区 ---------- */
.wtp-reading {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  gap: 34px;
  align-items: start;
  padding: 30px 0 0;
  border-top: 1px solid var(--wt-line);
}

.wtp-reading h2 {
  margin: 0 0 16px;
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 28px;
}

.wtp-reading h3 { margin: 24px 0 8px; font-size: 17px; color: var(--wt-ink); }
.wtp-reading p { margin: 0 0 12px; color: var(--wt-ink-2); font-size: 14.5px; line-height: 1.95; }

.wtp-reading-side {
  padding: 22px;
  border-radius: 16px;
  background: var(--wt-brand-soft);
  border: 1px solid color-mix(in srgb, var(--wt-brand) 28%, transparent);
}

.wtp-reading-side h3 { margin-top: 0; }
.wtp-reading-side ul { margin: 0; padding-left: 18px; color: var(--wt-ink-2); font-size: 13.5px; line-height: 2; }
.wtp-side-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--wt-line-strong);
  color: var(--wt-ink-3);
  font-size: 12.5px;
  line-height: 1.8;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .wtp-hero { grid-template-columns: 1fr; gap: 20px; }
  .wtp-hero-art { min-height: 270px; order: 2; }
  .wtp-options-grid,
  .wtp-switches,
  .wtp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wtp-reading { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wtp-shell { padding: 0 14px; }
  .wtp-console { padding: 16px; }
  .wtp-url-row { grid-template-columns: 1fr; }
  .wtp-btn-main { width: 100%; }
  .wtp-quick-note { margin-left: 0; }
  .wtp-options-grid,
  .wtp-switches,
  .wtp-steps { grid-template-columns: 1fr; }
  .wtp-panel { padding: 20px 16px; }
  .wtp-panel-head { align-items: flex-start; flex-direction: column; }
  .wtp-result { grid-template-columns: 1fr; }
  .wtp-hero-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wtp-page *, .wtp-page *::before, .wtp-page *::after { animation: none !important; transition: none !important; }
}
