:root {
  --bg: linear-gradient(180deg, #f7f8fb 0%, #f2f5fa 100%);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --ink: #10203b;
  --muted: #5a6780;
  --line: rgba(16, 32, 59, 0.12);
  --accent: #1959ff;
  --accent-strong: #0f3eb7;
  --accent-warm: #ffb020;
  --shadow: 0 12px 32px rgba(18, 53, 126, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

button,
input {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.wordmark {
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.nav a:hover,
.footer-links a:hover {
  color: var(--accent-strong);
}

.nav-cta,
.primary-link,
.secondary-link,
.plan-link,
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nav-cta,
.primary-link,
.plan-link.primary,
.actions button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(25, 89, 255, 0.18);
}

.secondary-link,
.plan-link,
.dropzone,
.mini-card,
.proof-card,
.feature-card,
.price-card,
.faq-card,
.legal-card,
.thumb,
.controls,
.signal-bar,
.tool-main,
.tool-side {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.secondary-link,
.plan-link {
  color: var(--ink);
}

.nav-cta:hover,
.primary-link:hover,
.secondary-link:hover,
.plan-link:hover,
.actions button:not(:disabled):hover {
  transform: translateY(-2px);
}

.tool-main,
.tool-side,
.legal-card {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

h1,
h2,
h3,
p,
ul {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 7vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.simple-hero {
  max-width: 840px;
  margin: 24px 0 30px;
  padding: 16px 0 8px;
}

.simple-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.04;
}

.simple-hero-text {
  max-width: 720px;
  font-size: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.section-heading p,
.proof-copy,
.plan-copy,
.faq-card p,
.mini-card p,
.legal-card p,
.legal-card li,
.feature-card p,
.footer-copy {
  color: var(--muted);
  line-height: 1.65;
}

.proof-card,
.mini-card,
.feature-card,
.price-card,
.faq-card,
.legal-card,
.tool-main,
.tool-side {
  border-radius: var(--radius-xl);
}

.proof-card,
.mini-card,
.feature-card,
.price-card,
.faq-card,
.legal-card {
  padding: 22px;
}

.proof-card.alt,
.mini-card.contrast,
.price-card.featured {
  background: linear-gradient(165deg, rgba(16, 32, 59, 0.96), rgba(25, 89, 255, 0.88));
  color: #fff;
}

.proof-card.alt p,
.mini-card.contrast p,
.price-card.featured .plan-copy,
.price-card.featured .plan-list li {
  color: rgba(255, 255, 255, 0.82);
}

.proof-label,
.mini-label {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.proof-list,
.plan-list,
.legal-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.proof-list li,
.plan-list li {
  margin-bottom: 8px;
}

.tool-section,
.feature-section,
.pricing-section,
.faq-section {
  margin-bottom: 32px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.section-heading.compact h2 {
  font-size: clamp(24px, 4vw, 34px);
}

.tool-heading {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: end;
}

.tool-heading-note {
  margin-bottom: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.7;
  box-shadow: var(--shadow);
}

.tool-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.tool-main,
.tool-side {
  padding: 18px;
}

.tool-main-standalone {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 246, 255, 0.88));
  border: 1px solid rgba(16, 32, 59, 0.08);
}

.tool-side {
  display: grid;
  gap: 18px;
}

.mini-item {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid rgba(16, 32, 59, 0.1);
}

.mini-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.mini-item span {
  color: var(--muted);
  line-height: 1.5;
}

.dropzone {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  text-align: left;
  background: linear-gradient(135deg, #10203b 0%, #173770 58%, #1959ff 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(16, 32, 59, 0.18);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dropzone::before {
  content: "";
  position: absolute;
  right: -8%;
  bottom: -35%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 62%);
}

.dropzone > * {
  position: relative;
  z-index: 1;
}

.dropzone-kicker {
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.dropzone.dragover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(16, 32, 59, 0.24);
}

.hint {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hint button {
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #10203b;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(10, 24, 53, 0.18);
}

.note {
  margin-bottom: 0;
  max-width: 780px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.7;
}

.dropzone-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dropzone-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
}

.controls {
  display: grid;
  gap: 18px;
  margin-top: 0;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 32, 59, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--shadow);
}

.status {
  margin-bottom: 0;
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

.controls[data-mode="batch"] .workspace-grid {
  display: none;
}

.workspace-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(16, 32, 59, 0.08);
}

.panel-kicker,
.control-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.workspace-summary-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-mode-card {
  grid-column: 1 / -1;
}

.control-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 255, 0.84));
  border: 1px solid rgba(16, 32, 59, 0.08);
  min-width: 0;
}

.control-card h3 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.control-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.reference-card {
  background: linear-gradient(180deg, rgba(236, 242, 255, 0.92), rgba(255, 255, 255, 0.96));
}

.tool-detail-card[hidden] {
  display: none;
}

.control-card-head {
  display: grid;
  gap: 6px;
}

.control-footnote {
  font-size: 14px;
  line-height: 1.6;
}

.tool-mode-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tool-mode-btn {
  min-height: 60px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 32, 59, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.tool-mode-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 89, 255, 0.26);
  color: var(--ink);
  box-shadow: 0 12px 20px rgba(16, 32, 59, 0.08);
}

.tool-mode-btn.active {
  background: linear-gradient(135deg, #10203b, #1959ff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 28px rgba(16, 32, 59, 0.18);
}

.a4-mode-selector {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
  padding: 20px;
  background: linear-gradient(180deg, rgba(18, 46, 95, 0.06), rgba(255, 255, 255, 0.92));
  border-radius: 22px;
  border: 1px solid rgba(25, 89, 255, 0.14);
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-btn {
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid rgba(16, 32, 59, 0.1);
  border-radius: 18px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.mode-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 89, 255, 0.3);
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(16, 32, 59, 0.08);
}

.mode-btn.active {
  background: linear-gradient(135deg, #1959ff, #3b7cff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 28px rgba(25, 89, 255, 0.24);
}

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

.secondary-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 32, 59, 0.1);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.secondary-btn:hover:not(:disabled),
.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(16, 32, 59, 0.08);
}

.secondary-btn:disabled,
.primary-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tool-preview-btn[hidden],
.mode-actions button[hidden] {
  display: none;
}

.preview-actions .secondary-btn {
  background: rgba(246, 249, 255, 0.92);
}

.preview-actions .secondary-btn:hover:not(:disabled) {
  border-color: rgba(25, 89, 255, 0.24);
  color: var(--accent-strong);
}

.preview-actions .secondary-alt {
  display: none;
}

.actions button {
  min-height: 60px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  justify-content: center;
  text-align: center;
  line-height: 1.35;
}

.actions button#downloadBtn {
  background: linear-gradient(135deg, #1959ff, #2d6cff);
  color: #fff;
  box-shadow: 0 14px 28px rgba(25, 89, 255, 0.18);
}

.actions button#a4Btn {
  background: linear-gradient(135deg, #10203b, #214a9f);
  color: #fff;
  box-shadow: 0 14px 28px rgba(16, 32, 59, 0.18);
}

.actions button#splitBtn {
  background: linear-gradient(135deg, #ffb020, #ee7f00);
  color: #fff;
  box-shadow: 0 14px 28px rgba(238, 127, 0, 0.18);
}

.actions button:disabled {
  background: rgba(205, 213, 226, 0.9);
  color: #eef2f8;
  box-shadow: none;
  cursor: not-allowed;
}

.selection-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(16, 32, 59, 0.08);
  box-shadow: var(--shadow);
}

.selection-panel[hidden] {
  display: none;
}

.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.selection-header h3 {
  margin-bottom: 0;
  font-size: 28px;
}

.selection-note {
  max-width: 360px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  margin-top: 0;
}

.mini-feature-section {
  margin-bottom: 28px;
}

.mini-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mini-feature-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.mini-feature-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.mini-feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.checkout-card {
  display: grid;
  gap: 14px;
}

.checkout-status {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 700;
}

.checkout-button {
  width: fit-content;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(25, 89, 255, 0.18);
}

.checkout-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.success-card h1 {
  margin-bottom: 10px;
}

.thumb {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(16, 32, 59, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 255, 0.92));
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(18, 53, 126, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.thumb:hover,
.thumb.selected {
  transform: translateY(-3px);
  border-color: rgba(25, 89, 255, 0.3);
  box-shadow: 0 18px 34px rgba(18, 53, 126, 0.12);
}

.thumb.selected {
  background: linear-gradient(180deg, rgba(237, 243, 255, 0.96), rgba(255, 255, 255, 1));
}

.page-face {
  position: relative;
  width: 100%;
  aspect-ratio: var(--aspect-ratio, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 244, 255, 0.98)),
    repeating-linear-gradient(180deg, rgba(25, 89, 255, 0.08) 0 2px, transparent 2px 30px);
  border: 1px solid rgba(25, 89, 255, 0.12);
  overflow: hidden;
}

.page-face::before {
  content: "";
  position: absolute;
  inset: 10% 14% auto;
  height: 10%;
  border-radius: 999px;
  background: rgba(25, 89, 255, 0.1);
  box-shadow:
    0 52px 0 rgba(25, 89, 255, 0.08),
    0 104px 0 rgba(255, 176, 32, 0.12);
}

.page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 44px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 32, 59, 0.06);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.thumb.selected .page-number {
  background: var(--accent);
  color: #fff;
}

.thumb .caption,
.thumb .meta {
  text-align: left;
}

.thumb .caption {
  margin-top: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.thumb .meta {
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.feature-grid,
.pricing-grid,
.faq-grid {
  display: grid;
  gap: 18px;
}

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

.pricing-grid {
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}

.simple-pricing {
  margin-bottom: 24px;
}

.simple-pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faq-grid {
  grid-template-columns: repeat(2, 1fr);
}

.feature-number,
.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(25, 89, 255, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plan-name {
  margin: 14px 0 6px;
  font-size: 26px;
  font-weight: 800;
}

.plan-price {
  margin-bottom: 12px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.plan-link {
  margin-top: 14px;
  border-radius: 999px;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 24px 0 8px;
}

.simple-footer {
  padding-top: 12px;
}

.footer-mark {
  display: inline-block;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
}

.footer-meta {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: var(--muted);
}

.legal-shell {
  max-width: 940px;
}

.legal-main {
  padding-top: 20px;
}

.legal-heading {
  margin-bottom: 20px;
}

.legal-card h2 {
  margin-top: 26px;
  margin-bottom: 8px;
  font-size: 24px;
}

.legal-card h2:first-child {
  margin-top: 0;
}

@media (max-width: 1080px) {
  .tool-layout,
  .pricing-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .mini-feature-grid,
  .simple-pricing-grid {
    grid-template-columns: 1fr;
  }

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

  .tool-heading,
  .workspace-summary {
    grid-template-columns: 1fr;
  }

  .selection-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .selection-note {
    max-width: none;
  }

  .preview-actions,
  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-mode-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--content-width));
    padding-top: 12px;
  }

  .topbar {
    position: static;
    flex-wrap: wrap;
    border-radius: 26px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    font-size: 14px;
  }

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

  .tool-heading {
    grid-template-columns: 1fr;
  }

  .tool-main-standalone,
  .controls,
  .selection-panel {
    padding: 18px;
  }

  .dropzone {
    padding: 24px 20px;
  }

  .hint {
    font-size: clamp(24px, 10vw, 32px);
  }

  .workspace-grid,
  .tool-mode-buttons,
  .preview-actions,
  .actions,
  .mode-buttons {
    grid-template-columns: 1fr;
  }

  .selection-header h3 {
    font-size: 24px;
  }

  .thumb {
    padding: 12px;
  }
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, 0.62);
  backdrop-filter: blur(6px);
}

.preview-modal .modal-content {
  position: relative;
  width: min(980px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 255, 0.98));
  box-shadow: 0 28px 70px rgba(16, 32, 59, 0.26);
  overflow: hidden;
}

.preview-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(16, 32, 59, 0.08);
}

.preview-modal .modal-header h3 {
  margin: 0;
  font-size: 26px;
  color: var(--ink);
}

.preview-modal .modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 32, 59, 0.06);
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.preview-modal .modal-close:hover {
  background: rgba(16, 32, 59, 0.1);
  color: var(--ink);
  transform: rotate(90deg);
}

.preview-modal .modal-body {
  padding: 24px;
  overflow-y: auto;
}

.preview-info {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(25, 89, 255, 0.12);
  border-radius: 18px;
  background: rgba(25, 89, 255, 0.06);
  color: var(--ink);
  font-size: 14px;
}

.preview-info p {
  margin: 0.25rem 0;
}

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

.preview-item {
  display: grid;
  gap: 10px;
  text-align: left;
}

.preview-thumb {
  position: relative;
  aspect-ratio: var(--aspect-ratio, 0.707);
  background: linear-gradient(145deg, #f0f4ff, #e8f0ff);
  border: 1px solid rgba(25, 89, 255, 0.12);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-content {
  background: linear-gradient(145deg, rgba(25, 89, 255, 0.15), rgba(255, 176, 32, 0.1));
  border: 1px dashed rgba(25, 89, 255, 0.3);
  border-radius: 10px;
}

.preview-page-num {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.preview-info-item {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.5;
}

.preview-arrow {
  color: var(--accent);
  font-weight: 800;
}

.split-modal-content {
  width: min(760px, 100%);
}

.split-hint {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.split-preview-container {
  position: relative;
  width: 100%;
  height: 300px;
  background: #eef3ff;
  border: 1px solid rgba(16, 32, 59, 0.08);
  border-radius: 18px;
  overflow: hidden;
  cursor: crosshair;
  margin-bottom: 16px;
}

#splitPreviewCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.split-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(180deg, #ff5c33, #ff2e14);
  box-shadow: 0 0 0 4px rgba(255, 92, 51, 0.2), 0 0 20px rgba(255, 92, 51, 0.4);
  cursor: ew-resize;
  z-index: 100;
  transform: translateX(-50%);
  pointer-events: auto;
}

.split-line::before,
.split-line::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 20px;
  height: 20px;
  background: #ff5c33;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(255, 92, 51, 0.4);
}

.split-line::before {
  top: 10px;
}

.split-line::after {
  bottom: 10px;
}

.split-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 18px;
  background: rgba(16, 32, 59, 0.04);
  border-radius: 18px;
}

.split-controls label {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

#splitPositionText {
  color: var(--accent);
}

#splitSlider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.split-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.split-actions .primary-btn {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(25, 89, 255, 0.18);
}

.batch-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 1rem;
}

.batch-progress-bar {
  width: 100%;
  max-width: 300px;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* 统一宽度选项样式 */
.uniform-options {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
}

.options-header h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #212529;
}

.options-header p {
  margin: 0 0 1rem 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.option-group {
  margin-bottom: 1.25rem;
}

.option-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #495057;
  font-size: 0.95rem;
}

.option-hint {
  margin: 0.25rem 0 0.5rem 0;
  color: #6c757d;
  font-size: 0.85rem;
}

.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-btn {
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
}

.option-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.option-btn.active {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.selected-page {
  padding: 0.75rem;
  background: #e9ecef;
  border-radius: 4px;
  font-weight: 500;
  color: #495057;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.size-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

#customWidth {
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  width: 120px;
  font-size: 0.95rem;
}

.size-unit {
  color: #6c757d;
  font-size: 0.9rem;
}

.size-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 0.4rem 0.75rem;
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #dee2e6;
}

.option-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.primary-btn {
  padding: 0.75rem 1.5rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: #0056b3;
}

.secondary-btn {
  padding: 0.75rem 1.5rem;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.secondary-btn:hover {
  background: #545b62;
}

.text-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: #6c757d;
  border: none;
  font-weight: 500;
  cursor: pointer;
}

.text-btn:hover {
  color: #495057;
}

.analysis-actions {
  margin-bottom: 1rem;
}

/* 分析报告模态框样式 */
.analysis-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analysis-modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #212529;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #212529;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.summary-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
}

.report-details h4 {
  margin: 1.5rem 0 1rem 0;
  font-size: 1.1rem;
  color: #212529;
}

.size-distribution {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

.anomalies-list, .suggestions {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.page-data-table {
  overflow-x: auto;
}

.page-data-table table {
  width: 100%;
  border-collapse: collapse;
}

.page-data-table th,
.page-data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.page-data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.page-data-table tr:hover {
  background: #f8f9fa;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ========================================
   简洁功能选择 - 3个大按钮
   ======================================== */

.tool-section {
  margin-bottom: 48px;
}

.feature-selection {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  border: 2px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(25, 89, 255, 0.15);
}

.feature-card:active {
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 48px;
  line-height: 1;
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

/* ========================================
   内嵌工作区（在当前页面展开）
   ======================================== */

.tool-workspace {
  margin-top: 32px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: var(--accent);
}

.current-tool {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* 上传区 */
.upload-section {
  margin-bottom: 24px;
}

.upload-box {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-box:hover,
.upload-box.dragover {
  border-color: var(--accent);
  background: rgba(25, 89, 255, 0.05);
}

.upload-prompt {
  text-align: center;
  padding: 40px 24px;
}

.upload-icon-large {
  font-size: 48px;
  opacity: 0.6;
  display: block;
  margin-bottom: 12px;
}

.upload-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px 0;
}

.upload-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

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

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

.workspace-status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  min-height: 20px;
}

/* 选项区 */
.options-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px 0;
  text-align: center;
}

/* 页面选择 */
.page-select-area .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* A4 选项 */
.a4-options-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.mode-toggle-inline {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--line);
  border-radius: 999px;
}

.mode-toggle-inline .mode-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-inline .mode-btn.active {
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-hint-inline {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* 统一宽度模式切换（参考页 vs 自定义宽度） */
.width-mode-toggle {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--line);
  border-radius: 999px;
  margin-bottom: 16px;
}

.width-mode-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.width-mode-btn.active {
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-width-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.custom-width-input {
  flex: 1;
  max-width: 200px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
  transition: border-color 0.2s ease;
}

.custom-width-input:focus {
  outline: none;
  border-color: var(--accent);
}

.custom-width-unit {
  font-weight: 600;
  color: var(--muted);
}

.custom-width-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

.preset-widths {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.width-status {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* 拆分就绪 */
.split-ready-inline {
  text-align: center;
  margin-bottom: 20px;
}

.ready-text {
  font-size: 14px;
  color: var(--accent);
  margin: 0;
}

/* 导出按钮 */
.export-btn-inline {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(25, 89, 255, 0.3);
}

.export-btn-inline:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(25, 89, 255, 0.4);
}

.export-btn-inline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .feature-selection {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    padding: 32px 24px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 20px;
  }

  .tool-workspace {
    padding: 16px;
  }

  .workspace-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .page-select-area .grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
