@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Primary color - single unified brand color */
  --primary: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: #60A5FA;

  /* Backgrounds */
  --bg: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --panel: #FFFFFF;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;

  /* Borders */
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  /* Shadows - simplified */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Border radius - consistent */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Spacing system */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --content-width: 1180px;

  /* Legacy compatibility */
  --primary-blue: #3B82F6;
  --primary-purple: #8B5CF6;
  --primary-orange: #F97316;
  --primary-green: #10B981;
  --primary-pink: #EC4899;
  --ink: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --border-color: #E5E7EB;
  --bg-accent: #F9FAFB;
  --panel-strong: #FFFFFF;
  --accent: #3B82F6;
  --accent-strong: #2563EB;
  --radius-xl: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  color: var(--text-secondary);
}

.nav a:hover,
.footer-links a:hover {
  color: var(--primary);
  transition: color 0.2s ease;
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown-btn:hover {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.active .nav-dropdown-menu,
.nav-dropdown-menu:hover {
  display: flex;
}

.nav-dropdown-menu a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.nav-cta,
.primary-link,
.plan-link.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  background: var(--primary);
  color: white;
  border: none;
}

.nav-cta:hover,
.primary-link:hover,
.plan-link.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Header Topbar Actions & Language Switcher */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lang-switch:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.04);
}

.lang-switch-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

@media (max-width: 480px) {
  .lang-switch span {
    display: none;
  }
  .lang-switch {
    padding: 10px;
  }
}

.secondary-link,
.plan-link,
.dropzone,
.mini-card,
.proof-card,
.price-card,
.faq-card,
.legal-card,
.thumb,
.controls,
.signal-bar,
.tool-main,
.tool-side {
  background: var(--panel);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.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, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-weight: 800;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 800;
}

h3 {
  margin-bottom: 10px;
  font-size: 24px;
  font-weight: 700;
}

.simple-hero {
  max-width: 800px;
  margin: var(--space-2xl) auto 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.simple-hero h1 {
  margin-bottom: var(--space-md);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text-primary);
}

.simple-hero-text {
  max-width: 600px;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  flex: 1;
}

.stat-item::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(-1 * var(--space-md));
  transform: translateY(-50%);
  width: 1px;
  height: 32px;
  background: var(--border);
}

.stat-item:last-child::after {
  display: none;
}

.stat-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* FAQ Section - Compact Accordion Style */
.faq-section {
  margin-bottom: 64px;
}

.compact-faq {
  max-width: 800px;
  margin: 0 auto 64px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item-compact {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item-compact:hover {
  border-color: var(--primary);
}

.faq-item-compact[open] {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.faq-question-compact {
  padding: var(--space-md) var(--space-lg);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  user-select: none;
}

.faq-question-compact::-webkit-details-marker {
  display: none;
}

.faq-question-compact::after {
  content: '+';
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.faq-item-compact[open] .faq-question-compact::after {
  transform: rotate(45deg);
}

.faq-question-compact:hover {
  color: var(--primary);
}

.faq-answer-compact {
  padding: 0 var(--space-lg) var(--space-md) var(--space-lg);
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  max-width: 1100px;
  margin: 0 auto;
}

.faq-item {
  padding: 28px;
  background: var(--panel);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-blue);
}

.faq-question {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.faq-answer {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 760px) {
  .hero-stats {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }

  .stat-item {
    justify-content: center;
  }

  .stat-item::after {
    display: none;
  }

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

  .nav-dropdown-menu {
    left: auto;
    right: 0;
  }

  /* 移动端下拉菜单改进 */
  .nav-dropdown-btn:active,
  .nav-dropdown-btn:focus {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
  }

  .nav-dropdown.active .nav-dropdown-menu {
    display: flex;
  }

  /* 移动端额度横幅 */
  .quota-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md);
  }

  .quota-upgrade-btn {
    width: 100%;
    text-align: center;
  }
}

.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;
}

/* 价格卡片 - 简化设计 */
.price-card {
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  background: var(--panel);
}

.price-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.price-card.featured {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.02);
}

.price-card.featured:hover {
  transform: scale(1.02) translateY(-2px);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.plan-price {
  margin-bottom: 12px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan-copy {
  color: rgba(255, 255, 255, 0.9);
}

.plan-list {
  padding-left: 0;
  list-style: none;
}

.plan-list li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
}

.plan-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.plan-link.primary {
  margin-top: 16px;
  background: white;
  color: var(--primary);
  border: none;
  font-weight: 600;
}

.plan-link.primary:hover {
  background: rgba(255, 255, 255, 0.95);
}

.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: 52px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--panel);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: var(--shadow);
}

.mode-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-hover);
}

.mode-btn.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
  box-shadow: var(--shadow);
}

.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: 48px;
  padding: 12px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--panel);
  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;
  box-shadow: var(--shadow);
}

.secondary-btn:hover:not(:disabled),
.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.primary-btn {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.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: 56px;
  padding: 14px 16px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  justify-content: center;
  text-align: center;
  line-height: 1.35;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.actions button#downloadBtn {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: white;
}

.actions button#a4Btn {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
  color: white;
}

.actions button#splitBtn {
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-pink));
  color: white;
}

.actions button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.actions button:disabled {
  background: #e0e0e0;
  color: #999;
  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: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--panel);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumb:hover,
.thumb.selected {
  transform: translateY(-4px);
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-hover);
}

.thumb.selected {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  border-color: var(--primary-purple);
}

.thumb.selected .page-number {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: white;
}

.thumb.selected .caption,
.thumb.selected .meta {
  color: var(--ink);
}

.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: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-accent);
  color: var(--primary-blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.thumb.selected .page-number {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: white;
}

.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;
}

.price-card.featured .plan-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.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;
  border-top: 2px solid var(--border-color);
}

.footer-mark {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.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 {
  /* Removed max-width to allow consistent topbar width */
}

.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;
  }
}

/* 工作区全屏模式 */
body.workspace-active .simple-hero,
body.workspace-active .hero-stats,
body.workspace-active .quota-banner,
body.workspace-active .feature-selection,
body.workspace-active .pricing-section,
body.workspace-active .hero-minimal,
body.workspace-active .tools-grid-section,
body.workspace-active .guide-teaser-section,
body.workspace-active .faq-section,
body.workspace-active .compact-faq {
  display: none;
}

body.workspace-active .tool-workspace {
  margin-top: 0;
  min-height: 70vh;
}

body.workspace-active .page-shell {
  max-width: 1400px;
}
@media (max-width: 760px) {
  :root {
    --border-thick: 1px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

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

  .topbar {
    position: static;
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
  }

  .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;
  }

  .feature-card {
    width: 100%;
  }
}

.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: var(--radius-xl);
  border: 1px solid var(--border-color);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.preview-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-accent);
}

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

.preview-modal .modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow);
}

.preview-modal .modal-close:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  transform: rotate(90deg);
  box-shadow: var(--shadow-hover);
}

.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;
}

.quota-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.quota-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.quota-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.quota-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quota-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.quota-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.quota-count {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.quota-desc {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.quota-upgrade-btn {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.quota-upgrade-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 760px) {
  .quota-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .quota-upgrade-btn {
    width: 100%;
    text-align: center;
  }
}

.feature-selection {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  width: 280px;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

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

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  transition: all 0.2s ease;
}

.feature-card:hover .feature-icon {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

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

.tool-workspace {
  margin-top: 32px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border-color);
  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: 2px solid var(--border-color);
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-purple);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link {
  padding: 10px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link::before {
  content: '←';
  font-size: 18px;
  font-weight: 800;
}

.back-link:hover {
  background: var(--bg-accent);
  color: var(--primary-blue);
  border-color: var(--primary-blue);
  transform: translateX(-2px);
}

.current-tool {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-blue);
}

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

.upload-box {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--primary-blue);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.upload-box:hover,
.upload-box.dragover {
  border-color: var(--primary-purple);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.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: 16px 32px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.export-btn-inline:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: linear-gradient(135deg, var(--accent-strong), #7C3AED);
}

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

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

  .feature-card {
    width: 100%;
    padding: var(--space-lg);
    min-height: 140px;
  }

  .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));
  }

  .feature-icon {
    width: 48px;
    height: 48px;
  }

  .feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .feature-title {
    font-size: 16px;
  }

  .feature-desc {
    font-size: 13px;
  }
}

/* ========================================
   Add Photo to PDF
   ======================================== */

.add-photo-options {
  margin-bottom: 20px;
}

.add-photo-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.add-photo-pdf-info {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.upload-image-btn {
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-image-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.add-photo-image-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
  text-align: center;
}

.add-photo-preview-area {
  margin-bottom: 20px;
  min-height: 150px;
}

.add-photo-preview-area .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.add-photo-canvas-wrap {
  margin-bottom: 20px;
  text-align: center;
  min-height: 300px;
}

.add-photo-canvas-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f5f5f5;
  margin: 0 auto;
  min-height: 250px;
}

#addPhotoCanvas {
  display: block;
  max-width: 100%;
  min-width: 200px;
  min-height: 200px;
}

.add-photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
  cursor: move;
  object-fit: contain;
  border: 2px solid rgba(25, 89, 255, 0.6);
  background: rgba(255, 255, 255, 0.3);
  display: none;
  box-sizing: border-box;
}

.add-photo-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 4px 0 0 0;
  cursor: se-resize;
  z-index: 10;
}

.add-photo-resize-handle::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.add-photo-position-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.add-photo-position-controls label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.add-photo-position-controls input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
}

.add-photo-position-controls input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ========================================
   Rename Batch
   ======================================== */

.rename-batch-options {
  margin-bottom: 20px;
}

.rename-batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.rename-batch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
}

.rename-status-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.rename-original {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.rename-arrow {
  color: var(--accent);
  font-weight: 800;
  flex-shrink: 0;
}

.rename-new {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}

.rename-status-pending .rename-status-icon { opacity: 0.5; }
.rename-status-extracting .rename-status-icon { animation: spin 1s linear infinite; }
.rename-status-empty .rename-new { color: var(--muted); font-style: italic; }
.rename-status-failed .rename-original { text-decoration: line-through; opacity: 0.6; }

.rename-batch-status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

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

/* Feature grid - now 5 items */
@media (min-width: 900px) {
  .feature-selection {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 899px) and (min-width: 600px) {
  .feature-selection {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .mini-feature-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 899px) and (min-width: 600px) {
  .mini-feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Add Photo preview area fixes */
.add-photo-preview-area {
  min-height: 150px !important;
}
.add-photo-preview-area .grid {
  min-height: 120px;
}
#addPhotoThumbGrid {
  min-height: 120px;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
  gap: 12px;
}
#addPhotoCanvasWrap {
  min-height: 300px !important;
}
#addPhotoCanvasContainer {
  min-height: 250px !important;
}

/* Add Photo - image to PDF */
.add-photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 120px;
  justify-content: center;
}
.add-photo-upload-area.dragover,
.add-photo-upload-area:hover {
  border-color: var(--primary);
}
.add-photo-upload-area button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
}
.add-photo-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}
.add-photo-grid-wrap {
  margin-top: 16px;
}
.add-photo-grid-wrap .section-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.add-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.add-photo-thumb {
  position: relative;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.add-photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 4px;
}
.add-photo-drag-handle {
  position: absolute;
  top: 4px;
  left: 6px;
  cursor: grab;
  font-size: 0.875rem;
  opacity: 0.5;
}
.add-photo-drag-handle:hover { opacity: 1; }
.add-photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255,0,0,0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-photo-del:hover { background: rgba(255,0,0,1); }
.add-photo-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* 加载状态指示器 */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-indicator[hidden] {
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Toast 通知 */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-md) var(--space-lg);
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 15px;
  font-weight: 500;
  z-index: 10000;
  animation: slideUp 0.3s ease;
}

.toast.error {
  background: #EF4444;
}

.toast.success {
  background: #10B981;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
