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

/* ===== Exradoc — Professional Trade Tools Portal ===== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ===== Design Tokens ===== */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bg: #f8fafc;
  --bg-accent: #eff6ff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --card-bg: #ffffff;
  --card-bg-solid: rgba(255, 255, 255, 0.92);
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --card-shadow-hover: 0 12px 32px rgba(37, 99, 235, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  --border-color: #e2e8f0;
  --border: var(--border-color);
  --bg-secondary: #f1f5f9;
  --input-bg: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  --primary-glow: rgba(37, 99, 235, 0.25);
  --accent-orange: #f97316;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #047857;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #dc2626;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --topbar-height: 64px;
  --portal-max: 1280px;
}

.dark {
  --bg: #0b1120;
  --bg-accent: #111827;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --card-bg: #111827;
  --card-bg-solid: rgba(17, 24, 39, 0.94);
  --card-border: #1e293b;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 12px 32px rgba(37, 99, 235, 0.2);
  --border-color: #1e293b;
  --border: var(--border-color);
  --bg-secondary: #0f172a;
  --input-bg: #0b1120;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.22);
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
  letter-spacing: -0.011em;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.whitespace-nowrap { white-space: nowrap; }
.tracking-tight { letter-spacing: -0.025em; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }
.pt-4 { padding-top: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.gap-4 { gap: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.overflow-x-auto { overflow-x: auto; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.absolute { position: absolute; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) { .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media print { .no-print { display: none !important; } }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body.printing-preview { background: #fff !important; }
  body.printing-preview .top-bar,
  body.printing-preview .doc-header,
  body.printing-preview .tab-bar,
  body.printing-preview .action-bar,
  body.printing-preview .footer-note,
  body.printing-preview .clear-modal,
  body.printing-preview #panel-edit,
  body.printing-preview #panel-history { display: none !important; }
  body.printing-preview #panel-preview { display: block !important; }
  body.printing-preview .doc-page-content { padding: 0 !important; max-width: none !important; }
  body.printing-preview #preview-container { display: block !important; }
  body.printing-preview #preview-content {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* ===== Top Bar ===== */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--card-bg-solid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.dark .top-bar { background: var(--card-bg-solid); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); }

.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

.top-bar .logo {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
  letter-spacing: -0.02em;
}
.top-bar .logo:hover { opacity: 0.88; }
.top-bar .logo span:last-child { color: var(--text-primary); }
.top-bar .logo svg { color: var(--primary); }

.toggle-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--card-bg-solid);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease-out-expo);
}
.toggle-btn:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--bg-accent);
  transform: translateY(-1px);
}
a.toggle-btn { text-decoration: none; }
a.toggle-btn svg { vertical-align: middle; display: inline-block; }
.dark .toggle-btn { background: var(--card-bg); }
.dark .toggle-btn:hover { background: var(--bg-accent); }

/* ===== Portal Hero Banner ===== */
.portal-hero {
  margin-top: var(--topbar-height);
  background: var(--primary-gradient);
  color: #fff;
  padding: 56px 24px 64px;
  position: relative;
  overflow: hidden;
}
.portal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255,255,255,0.18) 0%, transparent 60%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}
.portal-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
}
.portal-hero-inner {
  max-width: var(--portal-max);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.portal-hero h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.portal-hero p {
  font-size: clamp(15px, 2vw, 18px);
  opacity: 0.92;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.75;
  font-weight: 400;
}
.portal-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.portal-hero-tag {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}
.portal-hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s var(--ease-out-expo);
  cursor: pointer;
  border: none;
}
.hero-cta-primary {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.hero-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.hero-cta-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.portal-hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.hero-stat {
  text-align: center;
}
.hero-stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero-stat-label {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
  font-weight: 500;
}
.dark .portal-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
}
.dark .portal-hero-tag {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ===== Home — Hero (legacy compat) ===== */
.hero {
  text-align: center;
  padding: calc(var(--topbar-height) + 24px) 20px 0;
  max-width: var(--portal-max);
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
}
.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
}
.hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero h1 #hero-icon {
  display: inline-flex;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
}
.hero h1 #hero-icon svg { color: #fff !important; }
.hero p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.75;
}

/* ===== Feature Highlights ===== */
.feature-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: var(--portal-max);
  margin: -28px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.feature-item {
  text-align: center;
  padding: 24px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s, border-color 0.25s;
}
.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-light);
}
.feature-item .feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  background: var(--bg-accent);
}
.feature-item .feat-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.feature-item .feat-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.dark .feature-item .feat-icon { background: var(--bg-accent); }

/* ===== Category Nav ===== */
.category-nav {
  max-width: var(--portal-max);
  margin: 32px auto 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.category-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  transition: all 0.2s var(--ease-out-expo);
}
.category-nav a:hover,
.category-nav a.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.portal-main {
  max-width: var(--portal-max);
  margin: 0 auto;
  padding: 0 24px 48px;
}
.portal-main .feature-highlights,
.portal-main .category-nav,
.portal-main .site-footer,
.portal-main .footer-note {
  max-width: none;
  width: 100%;
}
.portal-main .feature-highlights {
  margin-top: -28px;
  padding: 0;
}
.portal-main .category-nav {
  padding: 0;
}

/* ===== Section Headers ===== */
.docs-section {
  margin: 24px auto 0;
  padding: 0;
}
.section-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
}
.section-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  letter-spacing: -0.02em;
}
.section-header h2 span:first-child { font-size: 20px; font-weight: 800; }
.section-header h2 span:last-child {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.section-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--bg-accent);
  padding: 5px 14px;
  border-radius: 100px;
}
.dark .section-count { background: var(--bg-accent); color: var(--primary-light); }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

/* ===== Doc Cards ===== */
.doc-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 14px 18px;
  border: 1px solid var(--card-border);
  text-align: center;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-out-expo);
  box-shadow: var(--card-shadow);
  position: relative;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-light);
}
.doc-card:hover .doc-card-icon { transform: scale(1.08); }

.doc-card-gradient { display: none; }
.doc-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}
.doc-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  transition: transform 0.25s var(--ease-out-expo);
}
.doc-card-features { display: none; }
.doc-card-feature-tag { display: none; }
.doc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}
.doc-card-desc { display: none; }
.doc-card-actions { display: none; }
.doc-card-btn { display: none; }

/* ===== Site Footer ===== */
.site-footer {
  max-width: var(--portal-max);
  margin: 40px auto 0;
  padding: 40px 32px 32px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}
.site-footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  text-align: left;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--card-border);
}
.site-footer-brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.site-footer-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 320px;
}
.site-footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.site-footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.15s;
}
.site-footer-col a:hover { color: var(--primary); }
.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.site-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.site-footer-links a:hover { color: var(--primary); }
.site-footer-links span { cursor: default; }
@media (max-width: 900px) {
  .site-footer-top { grid-template-columns: 1fr 1fr; }
  .site-footer-top > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer-top { grid-template-columns: 1fr; }
}

/* ===== Footer ===== */
.footer-note {
  text-align: center;
  margin: 24px auto 32px;
  padding: 16px 0 0;
  border-top: 1px solid var(--card-border);
  max-width: var(--portal-max);
}
.footer-note p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.footer-icp { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.footer-icp a { color: var(--text-muted); text-decoration: none; }
.footer-icp a:hover { color: var(--primary); text-decoration: underline; }
.footer-icp:empty { display: none; }
.doc-page .footer-note { margin-top: 8px; padding-bottom: 32px; max-width: none; }

/* ===== Document Page ===== */
.doc-page {
  padding-top: var(--topbar-height);
  min-height: 100vh;
}
.doc-page-content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 28px 52px;
}
.doc-header {
  margin-bottom: 28px;
  padding: 28px 32px 24px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-accent) 55%, rgba(37, 99, 235, 0.04) 100%);
  box-shadow: var(--card-shadow);
  position: relative;
}
.doc-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 32px;
  width: 64px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}
.doc-header h1 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.doc-header p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 10px;
  font-weight: 400;
  line-height: 1.65;
  max-width: 720px;
}

/* ===== Wide Document Page Layout ===== */
.doc-wide-page .doc-page-content {
  max-width: 1520px;
  padding: 32px 40px 52px;
}
@media (min-width: 1600px) {
  .doc-wide-page .doc-page-content {
    max-width: 1680px;
    padding-left: 48px;
    padding-right: 48px;
  }
}
@media (min-width: 1920px) {
  .doc-wide-page .doc-page-content { max-width: 1760px; }
}
.doc-wide-page .footer-note {
  max-width: 1520px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}
@media (min-width: 1600px) {
  .doc-wide-page .footer-note {
    max-width: 1680px;
    padding-left: 48px;
    padding-right: 48px;
  }
}
.doc-wide-page .doc-header {
  margin-bottom: 28px;
  padding: 28px 32px 24px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-accent) 55%, rgba(36, 104, 242, 0.05) 100%);
  box-shadow: var(--card-shadow);
}
.doc-wide-page .doc-header:has(+ .tab-bar) {
  margin-bottom: 0;
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.doc-wide-page .doc-header::after {
  width: 72px;
  height: 3px;
  bottom: 0;
  left: 32px;
  border-radius: 3px 3px 0 0;
}
.doc-wide-page .doc-header h1 {
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.doc-wide-page .doc-header p {
  font-size: 15px;
  margin-top: 8px;
}
.doc-wide-page .tab-bar {
  margin-top: -1px;
  margin-bottom: 24px;
  padding: 6px;
  gap: 6px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  overflow: visible;
}
.doc-wide-page .tab-btn {
  flex: 1;
  border-right: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
}
.doc-wide-page .tab-btn.active {
  box-shadow: 0 2px 10px rgba(36, 104, 242, 0.28);
}
.doc-wide-page .action-bar {
  padding: 14px 18px;
  margin-bottom: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.doc-wide-page .section-card {
  padding: 26px 30px;
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
}
.doc-wide-page .section-card:hover {
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
}
.doc-wide-page .section-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-wide-page .section-card h3::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
@media (min-width: 1200px) {
  .doc-wide-page .field-grid { gap: 22px 24px; }
}
.doc-wide-page .totals-summary {
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  background: linear-gradient(135deg, #eef3ff 0%, rgba(36, 104, 242, 0.06) 100%);
}
.dark .doc-wide-page .totals-summary {
  background: linear-gradient(135deg, #1a2740 0%, rgba(36, 104, 242, 0.1) 100%);
}
.doc-wide-page .invoice-preview {
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}
.doc-wide-page .history-search .input-field { max-width: 480px; }
.doc-wide-page #panel-history .history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.doc-wide-page .history-item {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
@media (min-width: 640px) {
  .doc-wide-page .history-item {
    flex-direction: row;
    align-items: center;
  }
}
.doc-wide-page .email-template-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.doc-wide-page .email-template-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: transform 0.2s, box-shadow 0.2s;
}
.doc-wide-page .email-template-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.doc-wide-page .result-card {
  border-radius: var(--radius-lg);
  padding: 28px;
}
.doc-wide-page .translate-grid { gap: 24px; }
.doc-wide-page .translate-textarea,
.doc-wide-page .translate-result { min-height: 360px; }
.doc-wide-page .img-result-cards {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.doc-wide-page.img-compress-page .doc-page-content,
.doc-wide-page.cp-page .doc-page-content,
.doc-wide-page.cc-page .doc-page-content {
  max-width: 1520px;
}
@media (min-width: 1600px) {
  .doc-wide-page.img-compress-page .doc-page-content,
  .doc-wide-page.cp-page .doc-page-content,
  .doc-wide-page.cc-page .doc-page-content {
    max-width: 1680px;
  }
}
@media (max-width: 768px) {
  .doc-wide-page .doc-page-content { padding: 24px 16px 40px; }
  .doc-wide-page .doc-header { padding: 20px 20px 18px; }
  .doc-wide-page .doc-header::after { left: 20px; }
  .doc-wide-page .section-card { padding: 20px 18px; }
  .doc-wide-page .footer-note { padding-left: 16px; padding-right: 16px; }
}

/* ===== Tabs ===== */
.tab-bar {
  display: flex;
  gap: 0;
  padding: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.tab-btn {
  flex: 1;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-right: 1px solid var(--card-border);
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 0;
  transition: all 0.2s;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}
.tab-btn:hover:not(.active) {
  color: var(--primary);
  background: var(--bg-accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s var(--ease-out-expo); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Action Bar & Buttons ===== */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.action-bar-left, .action-bar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--ease-out-expo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--card-bg-solid);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--bg-accent);
}
.btn-danger {
  background: var(--card-bg-solid);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  padding: 5px 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ===== Form Sections ===== */
.section-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 24px;
  transition: box-shadow 0.3s var(--ease-out-expo);
}
@media (min-width: 768px) { .section-card { padding: 28px; } }
.section-card:hover { box-shadow: var(--card-shadow); }
.section-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}
.field-grid { display: grid; gap: 18px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
  display: block;
}
.form-label-cn { font-size: 11px; color: var(--text-muted); font-weight: normal; }

.input-field {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  background: var(--input-bg);
  font-family: inherit;
  color: var(--text-primary);
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:hover { border-color: var(--primary-light); }
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}
.input-field:disabled { background: var(--bg-accent); color: var(--text-muted); cursor: not-allowed; }
.input-field-sm { font-size: 12px; padding: 6px 10px; }
.input-field-xs { font-size: 11px; padding: 5px 8px; }
textarea.input-field { resize: vertical; min-height: 80px; line-height: 1.6; }
select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 36px;
}
input[type="number"].input-field { -moz-appearance: textfield; }
input[type="number"].input-field::-webkit-inner-spin-button,
input[type="number"].input-field::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-group label {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  transition: all 0.2s;
  background: var(--card-bg-solid);
}
.radio-group label:hover {
  border-color: var(--primary-light);
  background: var(--bg-accent);
}
.radio-group input[type="radio"] { margin-right: 7px; accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

/* ===== Logo Upload ===== */
.logo-upload {
  margin-bottom: 16px;
  padding: 16px;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  background: var(--bg-accent);
  transition: border-color 0.2s;
}
.logo-upload:hover { border-color: var(--primary-light); }
.logo-upload-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; display: block; }
.logo-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg-solid);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.logo-upload-btn:hover { border-color: var(--primary); color: var(--primary); }
.logo-upload-btn input { display: none; }
.logo-upload-hint { font-size: 11px; color: var(--text-muted); margin-left: 12px; }
.logo-preview-wrap { position: relative; display: inline-block; }
.logo-preview-wrap img { max-height: 52px; max-width: 140px; object-fit: contain; border-radius: 6px; }
.logo-remove {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}
.logo-preview-wrap:hover .logo-remove { display: flex; }

/* ===== Items Table ===== */
.items-table-container {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.items-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.items-table input, .items-table textarea, .items-table select { box-sizing: border-box; max-width: 100%; }
.items-table thead {
  background: #eef3ff;
  position: sticky; top: 0; z-index: 1;
}
.items-table thead th {
  padding: 10px 6px;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
  border-bottom: 2px solid rgba(36, 104, 242, 0.15);
  white-space: nowrap;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.items-table thead th .col-label-cn {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  margin-top: 2px;
}
.items-table tbody tr { border-bottom: 1px solid rgba(148, 163, 184, 0.15); transition: background-color 0.15s; }
.items-table tbody tr:hover { background-color: rgba(36, 104, 242, 0.04); }
.items-table tbody tr:last-child { border-bottom: none; }
.items-table tbody td { padding: 6px; vertical-align: middle; }
.items-table tbody td.description-cell { padding: 8px; vertical-align: top; }
.items-table tbody tr { min-height: 64px; }
.items-table tbody td.row-number {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-accent);
  width: 40px;
}
.items-table tbody td.actions { text-align: center; width: 52px; }

.dark .items-table thead { background: #1a2740; }
.dark .items-table thead th { color: #6b9aff; border-bottom-color: rgba(77, 133, 245, 0.25); }
.dark .items-table tbody tr:hover { background-color: rgba(36, 104, 242, 0.08); }
.dark .items-table tbody td.row-number { background: rgba(15, 23, 42, 0.6); }

/* ===== Totals ===== */
.totals-summary {
  background: #eef3ff;
  border: 1px solid rgba(36, 104, 242, 0.15);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-top: 20px;
}
.totals-summary .summary-item { display: flex; flex-direction: column; gap: 4px; }
.totals-summary .summary-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.totals-summary .summary-value { font-size: 22px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.dark .totals-summary { background: #1a2740; border-color: rgba(77, 133, 245, 0.2); }
.dark .totals-summary .summary-value { color: #6b9aff; }

/* ===== Invoice Preview ===== */
.invoice-preview {
  font-family: 'Arial', 'Helvetica', sans-serif;
  font-size: 10px;
  color: #000;
  background: #fff;
  line-height: 1.3;
  padding: 28px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}
.invoice-preview table { border-collapse: collapse; width: 100%; }
.invoice-preview th, .invoice-preview td { border: 1px solid #000; padding: 4px 6px; vertical-align: top; }
.invoice-preview th { background-color: #f0f0f0; font-weight: bold; text-align: center; font-size: 9px; }
.invoice-preview .section-label { font-size: 9px; color: #111827; font-weight: 700; margin-bottom: 1px; letter-spacing: 0.03em; text-transform: uppercase; }
.section-label2 { font-size: 10px; color: #111827; font-weight: 700; margin-bottom: 5px; letter-spacing: 0.03em; text-transform: uppercase; }
.invoice-preview .section-value { font-size: 10px; min-height: 18px; word-break: break-word; }
.invoice-preview .header-title { font-size: 20px; font-weight: bold; text-align: center; margin: 10px 0; color: #2468f2; }
.invoice-preview .header-subtitle { font-size: 10px; text-align: center; color: #666; margin-top: -4px; margin-bottom: 10px; }

/* ===== History ===== */
.history-search { margin-bottom: 18px; }
.history-search .input-field { max-width: 360px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.history-item:hover {
  box-shadow: var(--card-shadow);
  border-color: var(--primary-light);
}
.history-item-info { flex: 1; }
.history-item-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.history-item-ref { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.history-item-actions { display: flex; gap: 8px; }
.history-empty { text-align: center; padding: 64px 24px; color: var(--text-muted); }
.history-empty svg { margin-bottom: 16px; opacity: 0.4; }

/* ===== Modal ===== */
.clear-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.5);
}
.clear-modal-content {
  background: var(--card-bg-solid);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--card-border);
}
.clear-modal-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; letter-spacing: -0.02em; }
.clear-modal-msg { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.clear-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Utility Tools ===== */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--card-border);
  margin-top: 20px;
  box-shadow: var(--card-shadow);
}
.result-value { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.shipping-mark-preview {
  background: #fff;
  border: 2px solid #1e293b;
  padding: 24px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  min-height: 140px;
  border-radius: var(--radius-sm);
}

/* ===== FAQ ===== */
.faq-section {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.faq-section h2, .faq-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
  padding-bottom: 0;
  border-bottom: none;
  letter-spacing: -0.02em;
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  background: var(--card-bg);
}
.faq-item:hover { border-color: var(--primary-light); }
.faq-item.open { box-shadow: var(--card-shadow-hover); border-color: var(--primary-light); }
.faq-question {
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  transition: background-color 0.2s;
  gap: 12px;
}
.faq-item.open .faq-question { color: var(--primary); }
.faq-arrow {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-out-expo);
}
.faq-arrow::before { content: '▶'; }
.faq-item.open .faq-arrow { transform: rotate(90deg); color: var(--primary); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out-expo), padding 0.35s;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 0 20px;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 20px 18px; }

/* Back to top (portal home) */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg-solid);
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .2s, visibility .2s, transform .2s, background .15s, color .15s, border-color .15s;
  z-index: 900;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dark .back-to-top { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }

/* ===== Dark Mode Overrides ===== */
.dark .btn-secondary { background: rgba(30, 41, 59, 0.9); color: #e2e8f0; border-color: var(--border-color); }
.dark .btn-secondary:hover { background: rgba(51, 65, 85, 0.9); }
.dark .btn-danger { background: rgba(30, 41, 59, 0.9); border-color: #7f1d1d; color: #fca5a5; }
.dark .btn-danger:hover { background: rgba(69, 10, 10, 0.8); }
.dark .tab-btn { color: #94a3b8; }
.dark .tab-btn.active { color: #fff; }
.dark .tab-btn:hover:not(.active) { color: #e2e8f0; background: rgba(51, 65, 85, 0.5); }
.dark .tab-bar { background: rgba(30, 41, 59, 0.8); }
.dark .form-label { color: #cbd5e1; }
.dark .section-card { background: var(--card-bg); }
.dark .section-card h3 { color: var(--primary-light); }
.dark .input-field { background: var(--input-bg); color: var(--text-primary); border-color: var(--border-color); }
.dark .input-field:focus { box-shadow: 0 0 0 3px rgba(77, 133, 245, 0.15); }
.dark select.input-field {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}
.dark .radio-group label { background: rgba(30, 41, 59, 0.8); color: #cbd5e1; }
.dark .logo-upload { background: rgba(15, 23, 42, 0.5); }
.dark .history-item { background: var(--card-bg); }
.dark .clear-modal-content { background: var(--card-bg-solid); }
.dark .shipping-mark-preview { background: #1e293b; border-color: #475569; color: #f1f5f9; }
.dark .result-card { background: var(--card-bg); }
.dark .faq-section { background: var(--card-bg); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .portal-hero { padding: 40px 20px 48px; }
  .portal-hero-stats { gap: 20px; margin-top: 28px; padding-top: 24px; }
  .hero-stat-value { font-size: 22px; }
  .feature-highlights { grid-template-columns: repeat(2, 1fr); margin-top: -20px; }
  .docs-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .doc-page-content { padding: 28px 16px 40px; }
  .doc-header { padding: 22px 20px 20px; }
  .doc-header::after { left: 20px; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .top-bar { padding: 0 16px; }
  .tab-bar { flex-wrap: wrap; }
  .tab-btn { flex: 1 1 auto; min-width: 80px; padding: 10px 12px; font-size: 13px; border-right: none; border-bottom: 1px solid var(--card-border); }
  .section-header h2 { font-size: 17px; }
  .faq-section { padding: 20px 16px; }
  .category-nav { padding: 0 16px; }
  .portal-main { padding: 0 16px 36px; }
  .back-to-top { right: 16px; bottom: 20px; width: 40px; height: 40px; }
  .site-footer { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .feature-highlights { grid-template-columns: 1fr; }
  .portal-hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta-btn { justify-content: center; }
}

/* ===== Wide Screen (1440px+) ===== */
@media (min-width: 1440px) {
  :root { --portal-max: 1360px; }
  .portal-main { padding: 0 28px 44px; }
  .section-panel { padding: 22px 24px; }
  .docs-grid { gap: 14px; }
  #doc-grid-1 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  #doc-grid-2 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  #doc-grid-3 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  #doc-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  #doc-grid-2 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #doc-grid-3 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1600px) {
  :root { --portal-max: 1520px; }
  .portal-main { padding: 0 32px 48px; }
  .section-panel { padding: 24px 28px; }
  .feature-item { padding: 22px 16px; }
  .category-nav { gap: 10px; }
  #home-faq[data-injected="1"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }
  #home-faq .faq-header { grid-column: 1 / -1; }
}

@media (min-width: 1920px) {
  :root { --portal-max: min(1840px, calc(100vw - 64px)); }
  .portal-main { padding: 0 40px 56px; }
  .section-panel { padding: 28px 32px; }
  .section-header h2 span:first-child { font-size: 20px; }
  .docs-grid { gap: 16px; }
  .doc-card { padding: 20px 14px 18px; }
  .doc-card-icon { width: 48px; height: 48px; }
  .doc-card-title { font-size: 14px; }
  .doc-card-subtitle { font-size: 12px; }
  .feature-item { padding: 26px 20px; }
  .feature-item .feat-label { font-size: 15px; }
  .feature-item .feat-desc { font-size: 13px; }
  .category-nav a { padding: 10px 22px; font-size: 14px; }
  .site-footer { padding: 32px 28px; }
}

/* Trade translation tool */
.translate-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:16px; }
.translate-toolbar .form-label { margin-bottom:4px; font-size:12px; }
.translate-lang-select { min-width:160px; }
.translate-swap-btn { margin-top:18px; }
.translate-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:768px) { .translate-grid { grid-template-columns:1fr; } .translate-swap-btn { margin-top:0; } }
.translate-panel { display:flex; flex-direction:column; min-height:320px; }
.translate-panel-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.translate-panel-head h3 { margin:0; font-size:15px; }
.translate-textarea { flex:1; min-height:280px; resize:vertical; font-size:14px; line-height:1.6; }
.translate-result { flex:1; min-height:280px; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--bg-secondary); font-size:14px; line-height:1.7; white-space:pre-wrap; word-break:break-word; }
.translate-result.empty { color:var(--text-muted); }
.translate-history { margin-top:20px; }
.translate-history-item { padding:10px 12px; border:1px solid var(--border); border-radius:8px; margin-bottom:8px; cursor:pointer; font-size:13px; }
.translate-history-item:hover { background:var(--bg-accent); }
.translate-history-meta { font-size:11px; color:var(--text-muted); margin-top:4px; }

/* Email template tool */
.email-phase-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.email-phase-tab { padding:6px 14px; border:1px solid var(--border); border-radius:20px; font-size:13px; cursor:pointer; background:var(--card-bg); color:var(--text-secondary); transition:all .15s; }
.email-phase-tab:hover { border-color:var(--primary-light); color:var(--primary); }
.email-phase-tab.active { background:var(--primary); border-color:var(--primary); color:#fff; }
.email-template-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:10px; margin-bottom:20px; }
.email-template-item { padding:12px 14px; border:1px solid var(--border); border-radius:8px; cursor:pointer; font-size:13px; background:var(--card-bg); transition:all .15s; }
.email-template-item:hover { border-color:var(--primary-light); background:var(--bg-accent); }
.email-template-item.active { border-color:var(--primary); background:rgba(77,133,245,.08); box-shadow:0 0 0 1px var(--primary); }
.email-template-item .email-tpl-name { font-weight:600; margin-bottom:4px; }
.email-template-item .email-tpl-desc { font-size:11px; color:var(--text-muted); line-height:1.4; }
.email-output-subject { margin-bottom:12px; }
.email-output-body { min-height:320px; }

/* Cost profit calculator — wide layout */
.cp-page .doc-page-content { max-width: 1520px; padding: 32px 40px 48px; }
@media (min-width: 1600px) {
  .cp-page .doc-page-content { max-width: 1680px; padding-left: 48px; padding-right: 48px; }
}
.cp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) { .cp-layout { grid-template-columns: 1fr; } }
.cp-col { min-width: 0; }
.cp-result-col { position: sticky; top: 72px; }
@media (max-width: 1100px) { .cp-result-col { position: static; } }
.cp-mode-segment {
  display: inline-flex;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-accent);
  border: 1px solid var(--card-border);
  gap: 4px;
  margin-bottom: 16px;
}
.cp-mode-segment .btn { border: none; box-shadow: none; }
.cp-mode-segment .btn-primary { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cp-rate-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid var(--card-border);
}
.cp-rate-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cp-rate-meta { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cp-rate-values { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cp-rate-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; background: var(--card-bg-solid); border: 1px solid var(--card-border);
  color: var(--text-secondary); white-space: nowrap;
}
.cp-rate-pill strong { color: #059669; font-weight: 700; }
.cp-page .section-card h3 {
  font-size: 15px; font-weight: 700; margin: 0 0 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}
.cp-result-card {
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  border-radius: 12px;
}
.cp-hero { padding: 20px; border-radius: 12px; margin-bottom: 16px; text-align: center; }
.cp-hero-green { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); }
.cp-hero-red { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); }
.cp-hero-blue { background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2); margin-bottom: 12px; }
.cp-hero-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.cp-hero-value { font-size: 32px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.cp-hero-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cp-table thead td { font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--border-color); padding: 8px 6px; }
.cp-table tbody tr:nth-child(even) { background: var(--bg-accent); }
.cp-table tbody tr:hover { background: rgba(16,185,129,.06); }
.cp-table td { padding: 9px 6px; border-bottom: 1px solid var(--border-color); }
.cp-table td:nth-child(2), .cp-table td:nth-child(3) { text-align: right; white-space: nowrap; }
.cp-row-bold td { font-weight: 700; color: var(--text-primary); border-top: 2px solid var(--border-color); background: transparent !important; }

/* Currency converter — wide layout */
.cc-page .doc-page-content { max-width: 1520px; padding: 32px 40px 48px; }
@media (min-width: 1600px) { .cc-page .doc-page-content { max-width: 1680px; padding-left: 48px; padding-right: 48px; } }
.cc-page .tab-bar { margin-bottom: 20px; }
.cc-page .action-bar { margin-bottom: 16px; }
.cc-page .section-card { margin-bottom: 0; }

.cc-rate-strip { margin-bottom: 20px; }
.cc-rate-bar { background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(36, 104, 242, 0.06) 100%) !important; }
.cc-rate-note { font-size: 13px; color: var(--text-muted); margin: 12px 0 0; line-height: 1.65; }
.cc-rate-actions { flex-wrap: wrap; justify-content: flex-end; }
.cc-rate-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-rate-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; background: var(--card-bg-solid); border: 1px solid var(--card-border);
  color: var(--text-secondary); white-space: nowrap;
}
.cc-rate-pill strong { color: var(--primary); font-weight: 700; }

.cc-main-grid {
  display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 20px; align-items: start;
}
@media (max-width: 1100px) { .cc-main-grid { grid-template-columns: 1fr; } }

.cc-single {
  position: sticky; top: calc(var(--topbar-height) + 16px);
  padding: 24px !important; overflow: hidden;
}
@media (max-width: 1100px) { .cc-single { position: static; } }
.cc-single::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}
.cc-single-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--card-border);
}
.cc-single-head h3 { margin: 0; padding: 0; border: 0; font-size: 16px; }
.cc-live-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: #059669; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25);
}
.dark .cc-live-badge { color: #34d399; background: rgba(16, 185, 129, 0.15); }

.cc-panel-label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.02em; }

.cc-amount-panel { margin-bottom: 18px; }
.cc-amount-field {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 16px;
  border: 2px solid var(--card-border); border-radius: 12px; background: var(--input-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cc-amount-field:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}
.cc-amount-symbol { font-size: 22px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; min-width: 1.2em; text-align: center; }
.cc-amount-input {
  flex: 1; min-width: 0; border: none; background: transparent; padding: 14px 0;
  font-size: 28px; font-weight: 800; color: var(--text-primary); font-family: inherit;
}
.cc-amount-input:focus { outline: none; }
.cc-amount-input::placeholder { color: var(--text-muted); font-weight: 500; opacity: 0.5; }
.cc-amount-code {
  flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--primary);
  padding: 6px 10px; border-radius: 8px; background: rgba(36, 104, 242, 0.08); border: 1px solid rgba(36, 104, 242, 0.15);
}

.cc-direction { display: flex; align-items: stretch; gap: 6px; margin-bottom: 16px; }
.cc-cur-tile {
  position: relative; flex: 1; min-width: 0; padding: 14px 12px 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--bg-accent);
  text-align: center; transition: border-color 0.2s, box-shadow 0.2s;
}
.cc-cur-tile:hover { border-color: var(--primary-light); box-shadow: 0 2px 8px rgba(36, 104, 242, 0.08); }
.cc-cur-tile-to { background: linear-gradient(160deg, rgba(36, 104, 242, 0.07) 0%, var(--bg-accent) 100%); }
.cc-tile-label { display: block; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.cc-tile-code { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1.1; margin-bottom: 4px; pointer-events: none; }
.cc-tile-tag {
  display: inline-block; font-size: 10px; font-weight: 600; color: #059669;
  padding: 2px 7px; border-radius: 4px; background: rgba(16, 185, 129, 0.1); pointer-events: none;
}
.dark .cc-tile-tag { color: #34d399; }
.cc-tile-select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  font-size: 16px;
}

.cc-direction-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 36px; flex-shrink: 0; position: relative; }
.cc-direction-line {
  position: absolute; top: 20%; bottom: 20%; width: 2px; border-radius: 1px;
  background: linear-gradient(180deg, transparent, var(--card-border) 20%, var(--card-border) 80%, transparent);
}
.cc-swap-btn {
  position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--card-border); background: var(--card-bg-solid);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--primary); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s var(--ease-out-expo), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.cc-swap-btn span { display: block; line-height: 1; }
.cc-swap-btn:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
  transform: rotate(180deg); box-shadow: 0 4px 12px rgba(36, 104, 242, 0.3);
}

.cc-rate-panel {
  margin-bottom: 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-accent); border: 1px solid var(--card-border);
}
.cc-rate-equation { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-rate-unit { font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.cc-rate-input {
  flex: 1; min-width: 80px; max-width: 140px; border: 1px solid var(--card-border);
  border-radius: 8px; padding: 8px 10px; font-size: 15px; font-weight: 700;
  text-align: center; background: var(--card-bg-solid); color: var(--primary); font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cc-rate-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12); }
.cc-mid-hint { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.cc-result-hero {
  text-align: center; padding: 20px 14px 18px; border-radius: 12px;
  background: var(--bg-accent); border: 1px dashed var(--card-border);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.cc-result-hero.cc-result-active {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.03) 100%);
  border: 1px solid rgba(16, 185, 129, 0.28); border-style: solid;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
}
.dark .cc-result-hero.cc-result-active {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.04) 100%);
}
.cc-result-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.cc-result-active .cc-result-label { color: #059669; }
.dark .cc-result-active .cc-result-label { color: #34d399; }
.cc-result-value { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--text-primary); line-height: 1.15; word-break: break-all; }
.cc-result-active .cc-result-value { color: #059669; }
.dark .cc-result-active .cc-result-value { color: #34d399; }
.cc-result-value span { font-size: 0.45em; font-weight: 700; vertical-align: middle; opacity: 0.85; }
.cc-result-sub { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cc-result-formula { font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.04); }
.dark .cc-result-formula { background: rgba(255, 255, 255, 0.06); }
.cc-result-times { font-size: 14px; color: var(--text-muted); font-weight: 500; }

.cc-batch { min-height: 320px; display: flex; flex-direction: column; }
.cc-batch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cc-batch-head h3 { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 4px; padding: 0; border: 0; }
.cc-batch-desc { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.cc-table-wrap { flex: 1; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--card-border); }
.cc-items-table { margin: 0; }
.cc-items-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-accent); font-size: 12px; font-weight: 700;
  padding: 10px 8px; white-space: nowrap;
}
.cc-items-table tbody td { padding: 8px 6px; vertical-align: middle; }
.cc-items-table tbody tr:hover { background: var(--bg-accent); }
.cc-row-result { font-weight: 700; color: var(--primary); white-space: nowrap; font-size: 13px; }

.cc-preview-wrap .invoice-preview { max-width: 100%; margin: 0 auto; }
.cc-page #panel-history .history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cc-page #panel-history .history-item { margin-bottom: 0; }

/* Batch image compress */
.img-compress-page .doc-page-content { max-width: 960px; }
.img-tool-intro { font-size: 13px; line-height: 1.7; color: var(--text-muted); margin-bottom: 16px; }
.img-tool-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.img-tool-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--primary); background: var(--bg-accent);
  border: 1px solid var(--card-border);
}
.img-tool-layout { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 768px) { .img-tool-layout { grid-template-columns: 1fr; } }
.img-tool-panel-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.img-quality-value {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px;
}
.img-quality-value span:first-child { font-size: 12px; color: var(--text-muted); }
.img-quality-value strong { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; }
.img-quality-slider {
  width: 100%; height: 6px; margin: 8px 0 6px; accent-color: var(--primary); cursor: pointer;
}
.img-quality-hints { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.img-tool-tips { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-color); }
.img-tool-tips li { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin: 0 0 6px 16px; }
.img-dropzone {
  position: relative; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed var(--primary-light); border-radius: var(--radius-lg); padding: 36px 24px; text-align: center;
  background: var(--bg-secondary); cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.img-dropzone:hover, .img-dropzone.dragover {
  border-color: var(--primary); background: var(--bg-accent);
  box-shadow: 0 4px 16px var(--primary-glow);
}
.img-dropzone-icon {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 14px; color: var(--primary);
  background: var(--bg-accent); border: 1px solid var(--card-border);
}
.img-dropzone-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.img-dropzone p { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); max-width: 320px; }
.img-format-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.img-format-tag {
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: #b45309; background: rgba(217, 119, 6, 0.1); border: 1px solid rgba(217, 119, 6, 0.15);
}
.img-format-tag.png { color: #0369a1; background: rgba(3, 105, 161, 0.08); border-color: rgba(3, 105, 161, 0.15); }
.img-tool-progress {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px;
  border-radius: var(--radius-md); background: var(--bg-accent); border: 1px solid var(--card-border);
  color: var(--primary); font-size: 14px; font-weight: 600;
}
.img-tool-spinner {
  width: 18px; height: 18px; border: 2px solid var(--card-border); border-top-color: var(--primary);
  border-radius: 50%; animation: img-spin .8s linear infinite; flex-shrink: 0;
}
@keyframes img-spin { to { transform: rotate(360deg); } }
.img-tool-results { margin-top: 4px; }
.img-tool-results-head {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-bottom: 16px;
}
.img-tool-results-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.img-tool-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
@media (max-width: 640px) { .img-tool-stats { grid-template-columns: 1fr; } }
.img-stat-card {
  padding: 14px 16px; border-radius: 12px; background: var(--card-bg);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
}
.img-stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.img-stat-value { margin-top: 6px; font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.img-stat-value.highlight { color: #16a34a; }
.img-stat-sub { margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.img-result-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.img-result-card {
  display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card-bg);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow); transition: box-shadow .2s, transform .2s;
}
.img-result-card:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); transform: translateY(-1px); }
.img-result-preview {
  width: 72px; height: 72px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-color); background: var(--bg-secondary);
}
.img-result-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.img-result-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-result-tag { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.img-result-bar { height: 6px; border-radius: 999px; background: var(--bg-secondary); overflow: hidden; }
.img-result-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #16a34a);
}
.img-result-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.img-saved { color: #16a34a; font-weight: 700; font-size: 13px; }
.img-saved.none { color: var(--text-muted); font-weight: 500; }
.img-result-error {
  padding: 12px 14px; border-radius: 10px; background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15); color: #dc2626; font-size: 13px;
}
.dark .img-dropzone { background: var(--bg-secondary); border-color: var(--border-color); }
.dark .img-dropzone:hover, .dark .img-dropzone.dragover { border-color: var(--primary); background: var(--bg-accent); }

/* QR code scanner */
.qr-page .doc-page-content { max-width: 1160px; padding-bottom: 40px; }
.qr-page .section-card { margin-bottom: 20px; }

.qr-hero-strip {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12) 0%, rgba(36, 104, 242, 0.06) 100%);
  border-color: rgba(20, 184, 166, 0.22);
}
.qr-hero-strip::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #0d9488, #14b8a6, var(--primary-light));
}
.qr-hero-main { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.qr-hero-icon {
  flex-shrink: 0; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; color: #0d9488; background: rgba(20, 184, 166, 0.14); border: 1px solid rgba(20, 184, 166, 0.25);
}
.qr-hero-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin: 0 0 6px; }
.qr-hero-desc { font-size: 14px; line-height: 1.65; color: var(--text-muted); margin: 0; }
.qr-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #0d9488; background: var(--card-bg-solid);
  border: 1px solid rgba(20, 184, 166, 0.22);
}
.dark .qr-hero-badge { color: #2dd4bf; }

.qr-workbench {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px;
}
@media (max-width: 900px) { .qr-workbench { grid-template-columns: 1fr; } }

.qr-card {
  position: relative; overflow: hidden; margin-bottom: 0 !important;
  display: flex; flex-direction: column; min-height: 420px;
}
.qr-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}
.qr-card-success::before { background: linear-gradient(90deg, #059669, #10b981); }
.qr-card-success { border-color: rgba(16, 185, 129, 0.28); }

.qr-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.qr-panel-head h3 { margin: 0; padding: 0; border: 0; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.qr-panel-tag {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: var(--text-muted); background: var(--bg-accent); border: 1px solid var(--card-border);
}
.qr-success-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; color: #059669;
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25);
}
.dark .qr-success-badge { color: #34d399; }
.qr-file-meta { font-size: 12px; color: var(--text-muted); max-width: 55%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qr-dropzone {
  flex: 1; min-height: 300px; border-color: rgba(20, 184, 166, 0.35);
  background: linear-gradient(160deg, rgba(20, 184, 166, 0.04) 0%, var(--bg-secondary) 100%);
}
.qr-dropzone:hover, .qr-dropzone.dragover {
  border-color: #14b8a6; background: rgba(20, 184, 166, 0.08);
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.12);
}
.qr-drop-icon {
  width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 16px; color: #0d9488;
  background: rgba(20, 184, 166, 0.1); border: 2px dashed rgba(20, 184, 166, 0.3);
  transition: transform 0.2s, border-color 0.2s;
}
.qr-dropzone:hover .qr-drop-icon, .qr-dropzone.dragover .qr-drop-icon {
  transform: scale(1.05); border-color: #14b8a6;
}
.qr-format-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.qr-format-tags span {
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700;
  color: #0d9488; background: rgba(20, 184, 166, 0.1); border: 1px solid rgba(20, 184, 166, 0.18);
}

.qr-scan-frame {
  position: relative; flex: 1; min-height: 260px; padding: 20px; border-radius: 12px;
  background: linear-gradient(145deg, var(--bg-accent) 0%, rgba(20, 184, 166, 0.05) 100%);
  border: 1px solid var(--card-border);
}
.qr-corner {
  position: absolute; width: 22px; height: 22px; border-color: #14b8a6; border-style: solid; z-index: 2;
}
.qr-c-tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.qr-c-tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.qr-c-bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.qr-c-br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.qr-preview-box {
  display: flex; align-items: center; justify-content: center; height: 100%; min-height: 220px;
  overflow: hidden;
}
.qr-preview-box img {
  max-width: 100%; max-height: 280px; object-fit: contain; border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.qr-scan-line {
  position: absolute; left: 16px; right: 16px; height: 2px; z-index: 3;
  background: linear-gradient(90deg, transparent, #14b8a6, transparent);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.8);
  animation: qr-scan-move 1.8s ease-in-out infinite;
}
@keyframes qr-scan-move {
  0%, 100% { top: 20%; opacity: 0.4; }
  50% { top: 75%; opacity: 1; }
}
.qr-scanning .qr-corner { animation: qr-corner-pulse 1.2s ease-in-out infinite; }
@keyframes qr-corner-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.qr-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.qr-btn-scan { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; justify-content: center; }
.qr-btn-spinner { width: 16px; height: 16px; border-width: 2px; }

.qr-result-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.qr-result-empty-ring {
  width: 88px; height: 88px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 16px; color: var(--text-muted); opacity: 0.4;
  border: 2px dashed var(--card-border); background: var(--bg-accent);
}
.qr-result-empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.qr-result-empty p { margin: 0; font-size: 13px; line-height: 1.6; }

.qr-status {
  flex: 1; display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: 12px;
}
.qr-status-loading { background: var(--bg-accent); border: 1px solid var(--card-border); }
.qr-loading-ring {
  flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(20, 184, 166, 0.1); border: 1px solid rgba(20, 184, 166, 0.2);
}
.qr-loading-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.qr-loading-desc { font-size: 13px; color: var(--text-muted); }

.qr-status-error {
  background: rgba(220, 38, 38, 0.06); border: 1px solid rgba(220, 38, 38, 0.15);
}
.qr-error-icon {
  flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #dc2626; background: rgba(220, 38, 38, 0.1);
}
.qr-error-title { font-size: 15px; font-weight: 700; color: #dc2626; margin-bottom: 4px; }
.qr-error-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.qr-result-body { flex: 1; display: flex; flex-direction: column; }
.qr-result-type {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 12px; align-self: flex-start;
}
.qr-result-type-url { color: #0369a1; background: rgba(3, 105, 161, 0.1); border: 1px solid rgba(3, 105, 161, 0.18); }
.qr-result-type-text { color: #0d9488; background: rgba(20, 184, 166, 0.1); border: 1px solid rgba(20, 184, 166, 0.18); }
.qr-result-text {
  flex: 1; width: 100%; min-height: 160px; max-height: 240px; padding: 16px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--input-bg); font-size: 14px; line-height: 1.7;
  color: var(--text-primary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical; word-break: break-all;
}
.qr-card-success .qr-result-text {
  border-color: rgba(16, 185, 129, 0.25); background: rgba(16, 185, 129, 0.04);
}
.qr-result-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.qr-result-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.qr-steps-card h3 { margin-bottom: 18px; font-size: 16px; }
.qr-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 900px) { .qr-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .qr-steps { grid-template-columns: 1fr; } }
.qr-step {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px;
  border-radius: 12px; background: var(--bg-accent); border: 1px solid var(--card-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.qr-step:hover { border-color: rgba(20, 184, 166, 0.35); box-shadow: 0 4px 12px rgba(20, 184, 166, 0.08); }
.qr-step-icon {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #0d9488; background: rgba(20, 184, 166, 0.12);
}
.qr-step-num {
  position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
  color: #fff; background: #0d9488;
}
.qr-step-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.qr-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.qr-tip {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 13px; line-height: 1.65;
  color: var(--text-secondary); background: rgba(20, 184, 166, 0.08); border: 1px solid rgba(20, 184, 166, 0.2);
}
.qr-tip strong { color: #0d9488; font-weight: 700; }
.dark .qr-tip strong { color: #2dd4bf; }

/* QR code generator */
.qrg-page .doc-page-content { max-width: 1200px; padding-bottom: 44px; }
.qrg-page .section-card { margin-bottom: 20px; }
.qrg-page .doc-header h1 { font-size: clamp(26px, 3vw, 34px); }

.qrg-hero-strip {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(36, 104, 242, 0.06) 55%, rgba(109, 40, 217, 0.1) 100%);
  border-color: rgba(139, 92, 246, 0.26);
  padding: 22px 24px !important;
}
.qrg-hero-strip::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #5b21b6, #7c3aed, #a78bfa, var(--primary-light));
}
.qrg-hero-strip::after {
  content: ''; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.14) 0%, transparent 70%); pointer-events: none;
}
.qrg-hero-deco {
  position: absolute; left: -30px; bottom: -30px; width: 140px; height: 140px; opacity: 0.35; pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.15) 1px, transparent 1px);
  background-size: 14px 14px;
  mask-image: radial-gradient(circle at center, #000 20%, transparent 75%);
}
.qrg-hero-main { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 16px; position: relative; z-index: 1; }
.qrg-hero-icon {
  flex-shrink: 0; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: #7c3aed; background: rgba(139, 92, 246, 0.16); border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}
.qrg-hero-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin: 0 0 8px; letter-spacing: -0.02em; }
.qrg-hero-desc { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin: 0; max-width: 720px; }
.qrg-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.qrg-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #6d28d9; background: var(--card-bg-solid);
  border: 1px solid rgba(139, 92, 246, 0.24); transition: transform 0.2s, box-shadow 0.2s;
}
.qrg-hero-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12); }
.dark .qrg-hero-badge { color: #c4b5fd; }

.qrg-workbench {
  display: grid; grid-template-columns: minmax(320px, 1fr) minmax(300px, 1fr); gap: 22px;
  align-items: stretch; margin-bottom: 20px;
}
@media (max-width: 900px) { .qrg-workbench { grid-template-columns: 1fr; } }

.qrg-card {
  position: relative; overflow: hidden; margin-bottom: 0 !important;
  display: flex; flex-direction: column; min-height: 460px; padding: 22px !important;
}
.qrg-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #5b21b6, #8b5cf6, #a78bfa);
}
.qrg-card-success::before { background: linear-gradient(90deg, #059669, #10b981, #34d399); }
.qrg-card-success {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.08);
}

.qrg-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.qrg-panel-head h3 { margin: 0; padding: 0; border: 0; font-size: 17px; font-weight: 700; color: var(--text-primary); }
.qrg-panel-tag {
  font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  color: var(--text-muted); background: var(--bg-accent); border: 1px solid var(--card-border);
}
.qrg-success-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; color: #059669;
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.28);
  animation: qrg-badge-in 0.35s ease;
}
@keyframes qrg-badge-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.dark .qrg-success-badge { color: #34d399; }

.qrg-mode-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px;
}
@media (max-width: 520px) { .qrg-mode-tabs { grid-template-columns: repeat(2, 1fr); } }
.qrg-mode-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 8px; border-radius: 12px; font-size: 12px; font-weight: 600;
  color: var(--text-muted); background: var(--bg-accent); border: 1px solid var(--card-border);
  cursor: pointer; transition: all 0.22s ease;
}
.qrg-mode-tab-icon { display: flex; opacity: 0.75; transition: opacity 0.2s, transform 0.2s; }
.qrg-mode-tab-label { line-height: 1.2; }
.qrg-mode-tab:hover {
  border-color: rgba(139, 92, 246, 0.45); color: #7c3aed;
  background: rgba(139, 92, 246, 0.06); transform: translateY(-1px);
}
.qrg-mode-tab:hover .qrg-mode-tab-icon { opacity: 1; transform: scale(1.08); }
.qrg-mode-tab.active {
  color: #fff; background: linear-gradient(145deg, #6d28d9, #8b5cf6);
  border-color: transparent; box-shadow: 0 6px 18px rgba(124, 58, 237, 0.32);
}
.qrg-mode-tab.active .qrg-mode-tab-icon { opacity: 1; }

.qrg-field-box {
  padding: 16px; border-radius: 14px; margin-bottom: 16px; flex: 1;
  background: linear-gradient(160deg, var(--bg-accent) 0%, rgba(139, 92, 246, 0.04) 100%);
  border: 1px solid var(--card-border);
}
.qrg-fields { display: flex; flex-direction: column; gap: 10px; }
.qrg-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qrg-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.qrg-char-count { font-size: 11px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.qrg-input-wrap { position: relative; display: flex; align-items: center; }
.qrg-input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #7c3aed; opacity: 0.7; pointer-events: none; display: flex;
}
.qrg-input, .qrg-textarea, .qrg-select {
  width: 100%; padding: 11px 13px; border-radius: 11px; font-size: 14px;
  color: var(--text-primary); background: var(--bg-secondary);
  border: 1px solid var(--card-border); transition: border-color 0.2s, box-shadow 0.2s;
}
.qrg-input-iconed { padding-left: 38px; }
.qrg-input:focus, .qrg-textarea:focus, .qrg-select:focus {
  outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}
.qrg-textarea { resize: vertical; min-height: 110px; font-family: inherit; line-height: 1.6; }
.qrg-hint { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; line-height: 1.5; }
.qrg-vcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
@media (max-width: 520px) { .qrg-vcard-grid { grid-template-columns: 1fr; } }

.qrg-settings {
  padding: 0; border-radius: 14px; background: var(--bg-accent);
  border: 1px solid var(--card-border); margin-bottom: 16px; overflow: hidden;
}
.qrg-settings-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  font-size: 12px; font-weight: 700; color: #7c3aed; text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(139, 92, 246, 0.08); border-bottom: 1px solid var(--card-border);
}
.qrg-settings-icon { display: flex; opacity: 0.85; }
.qrg-settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 14px;
}
@media (max-width: 520px) { .qrg-settings-grid { grid-template-columns: 1fr; } }
.qrg-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qrg-setting-row label { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.qrg-select-sm { width: auto; min-width: 96px; padding: 7px 10px; font-size: 13px; }
.qrg-color-row { justify-content: space-between; }
.qrg-color {
  width: 48px; height: 34px; padding: 3px; border-radius: 9px; cursor: pointer;
  border: 2px solid var(--card-border); background: var(--bg-secondary);
  transition: border-color 0.2s, transform 0.15s;
}
.qrg-color:hover { border-color: #8b5cf6; transform: scale(1.05); }

.qrg-error {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: 11px; font-size: 13px; margin-bottom: 14px;
  color: #dc2626; background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.22);
}
.dark .qrg-error { color: #f87171; }

.qrg-actions { display: flex; gap: 10px; margin-top: auto; }
.qrg-btn-gen {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 20px !important; font-size: 15px !important; font-weight: 700 !important;
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #7c3aed 100%) !important;
  border: none !important; box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.qrg-btn-gen:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.42) !important;
}
.qrg-btn-gen:active { transform: translateY(0); }

.qrg-meta-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.qrg-meta-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #6d28d9;
  background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.2);
}
.dark .qrg-meta-chip { color: #c4b5fd; }

.qrg-preview-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px; border-radius: 14px; min-height: 300px;
  background:
    linear-gradient(145deg, var(--bg-accent) 0%, rgba(139, 92, 246, 0.06) 100%),
    repeating-conic-gradient(rgba(124, 58, 237, 0.04) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
  border: 1px solid var(--card-border);
}
.qrg-preview-frame {
  position: relative; padding: 18px;
}
.qrg-corner {
  position: absolute; width: 24px; height: 24px; border-color: #8b5cf6; border-style: solid; z-index: 2;
}
.qrg-c-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.qrg-c-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 6px 0 0; }
.qrg-c-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 6px; }
.qrg-c-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }
.qrg-card-success .qrg-corner { border-color: #10b981; }

.qrg-qrcode-box {
  display: flex; align-items: center; justify-content: center;
  padding: 18px; border-radius: 14px; background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: qrg-qr-in 0.4s ease;
}
@keyframes qrg-qr-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.qrg-qrcode-box canvas, .qrg-qrcode-box img { display: block; max-width: 100%; height: auto; border-radius: 4px; }

.qrg-result-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px; min-height: 300px;
  background: linear-gradient(160deg, var(--bg-accent) 0%, rgba(139, 92, 246, 0.04) 100%);
  border-radius: 14px; border: 1px dashed rgba(139, 92, 246, 0.28);
}
.qrg-result-empty-ring {
  width: 96px; height: 96px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-bottom: 18px; color: #7c3aed;
  background: rgba(139, 92, 246, 0.1); border: 2px dashed rgba(139, 92, 246, 0.35);
  animation: qrg-float 3s ease-in-out infinite;
}
@keyframes qrg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.qrg-result-empty-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.qrg-result-empty p { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; max-width: 260px; line-height: 1.6; }
.qrg-empty-dots { display: flex; gap: 6px; }
.qrg-empty-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; opacity: 0.4;
  animation: qrg-dot-pulse 1.4s ease-in-out infinite;
}
.qrg-empty-dots span:nth-child(2) { animation-delay: 0.2s; }
.qrg-empty-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes qrg-dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.qrg-result-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.qrg-result-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.qrg-btn-dl {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6) !important;
  border: none !important; box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.qrg-payload-detail {
  margin-top: 14px; font-size: 13px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-accent); border: 1px solid var(--card-border);
}
.qrg-payload-detail summary {
  cursor: pointer; color: var(--text-muted); font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.qrg-payload-detail summary::-webkit-details-marker { display: none; }
.qrg-payload-detail summary::before {
  content: '▸'; font-size: 11px; color: #7c3aed; transition: transform 0.2s;
}
.qrg-payload-detail[open] summary::before { transform: rotate(90deg); }
.qrg-payload-detail summary:hover { color: #7c3aed; }
.qrg-payload-text {
  margin: 10px 0 0; padding: 12px; border-radius: 10px; font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all; color: var(--text-secondary);
  background: var(--bg-secondary); border: 1px solid var(--card-border);
  max-height: 120px; overflow-y: auto;
}

.qrg-steps-card { padding: 22px !important; }
.qrg-steps-card h3 { margin-bottom: 20px; font-size: 17px; font-weight: 700; }
.qrg-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 900px) { .qrg-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .qrg-steps { grid-template-columns: 1fr; } }
.qrg-step {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px;
  border-radius: 14px; background: var(--bg-accent); border: 1px solid var(--card-border);
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
}
.qrg-step:hover {
  border-color: rgba(139, 92, 246, 0.4); box-shadow: 0 6px 18px rgba(124, 58, 237, 0.1);
  transform: translateY(-2px);
}
.qrg-step-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; color: #7c3aed; background: rgba(139, 92, 246, 0.14);
}
.qrg-step-num {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}
.qrg-step-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.qrg-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.qrg-tip {
  margin-top: 18px; padding: 16px 18px; border-radius: 14px; font-size: 13px; line-height: 1.7;
  color: var(--text-secondary);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(36, 104, 242, 0.04) 100%);
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.qrg-tip strong { color: #7c3aed; font-weight: 700; }
.dark .qrg-tip strong { color: #c4b5fd; }

/* PPT to PDF */
.ppt-page .doc-page-content { max-width: 1200px; padding-bottom: 44px; }
.ppt-page .section-card { margin-bottom: 20px; }
.ppt-page .doc-header h1 { font-size: clamp(26px, 3vw, 34px); }

.ppt-hero-strip {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.14) 0%, rgba(36, 104, 242, 0.05) 55%, rgba(234, 88, 12, 0.08) 100%);
  border-color: rgba(249, 115, 22, 0.24);
}
.ppt-hero-strip::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #c2410c, #f97316, #fb923c, var(--primary-light));
}
.ppt-hero-strip::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%); pointer-events: none;
}
.ppt-hero-main { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 16px; position: relative; z-index: 1; }
.ppt-hero-icon {
  flex-shrink: 0; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: #ea580c; background: rgba(249, 115, 22, 0.14); border: 1px solid rgba(249, 115, 22, 0.28);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.12);
}
.ppt-hero-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin: 0 0 8px; letter-spacing: -0.02em; }
.ppt-hero-desc { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin: 0; max-width: 720px; }
.ppt-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; position: relative; z-index: 1; }
.ppt-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #c2410c; background: var(--card-bg-solid);
  border: 1px solid rgba(249, 115, 22, 0.22);
}
.dark .ppt-hero-badge { color: #fb923c; }
.ppt-hero-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 1;
}
@media (max-width: 640px) { .ppt-hero-metrics { grid-template-columns: 1fr; } }
.ppt-metric {
  padding: 14px 16px; border-radius: 12px; background: var(--card-bg-solid);
  border: 1px solid rgba(249, 115, 22, 0.16); text-align: center;
}
.ppt-metric strong { display: block; font-size: 20px; font-weight: 800; color: #ea580c; line-height: 1.2; margin-bottom: 4px; }
.dark .ppt-metric strong { color: #fb923c; }
.ppt-metric span { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.ppt-workbench {
  display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px;
}
@media (max-width: 900px) { .ppt-workbench { grid-template-columns: 1fr; } }

.ppt-card {
  position: relative; overflow: hidden; margin-bottom: 0 !important;
  display: flex; flex-direction: column; min-height: 420px;
}
.ppt-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #c2410c, #f97316);
}
.ppt-card-upload::before { background: linear-gradient(90deg, #ea580c, #fb923c, #2563eb); }

.ppt-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.ppt-panel-head h3 { margin: 0; padding: 0; border: 0; font-size: 17px; font-weight: 700; color: var(--text-primary); }
.ppt-panel-tag {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: var(--text-muted); background: var(--bg-accent); border: 1px solid var(--card-border);
}
.ppt-panel-label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; letter-spacing: 0.02em; }

.ppt-size-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.ppt-size-opt {
  display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; gap: 2px 12px;
  padding: 14px; border-radius: 12px; border: 2px solid var(--card-border); background: var(--bg-accent);
  cursor: pointer; text-align: left; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
}
.ppt-size-opt:hover { border-color: rgba(249, 115, 22, 0.35); box-shadow: 0 4px 14px rgba(249, 115, 22, 0.08); }
.ppt-size-opt.active {
  border-color: #f97316; background: rgba(249, 115, 22, 0.08);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.ppt-size-icon {
  grid-row: 1 / span 2; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #ea580c; background: rgba(249, 115, 22, 0.12); border: 1px solid rgba(249, 115, 22, 0.18);
}
.ppt-size-opt.active .ppt-size-icon { color: #fff; background: #f97316; border-color: #f97316; }
.ppt-size-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ppt-size-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.ppt-tips { margin: 0; padding: 16px 0 0; border-top: 1px dashed var(--border-color); list-style: none; }
.ppt-tips li {
  position: relative; padding-left: 16px; font-size: 12px; color: var(--text-muted); line-height: 1.65; margin-bottom: 8px;
}
.ppt-tips li::before {
  content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: #f97316;
}

.ppt-dropzone {
  flex: 1; min-height: 320px; border-color: rgba(249, 115, 22, 0.35);
  background: linear-gradient(165deg, rgba(249, 115, 22, 0.05) 0%, var(--bg-secondary) 45%, rgba(37, 99, 235, 0.04) 100%);
}
.ppt-dropzone:hover, .ppt-dropzone.dragover {
  border-color: #f97316; background: rgba(249, 115, 22, 0.08);
  box-shadow: 0 10px 32px rgba(249, 115, 22, 0.14);
}
.ppt-dropzone-busy { pointer-events: none; opacity: 0.72; }

.ppt-flow {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; width: 100%;
}
.ppt-flow-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 88px;
}
.ppt-flow-icon {
  width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; border: 2px solid var(--card-border); background: var(--card-bg-solid);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06); transition: transform 0.2s, border-color 0.2s;
}
.ppt-flow-from .ppt-flow-icon { color: #ea580c; border-color: rgba(249, 115, 22, 0.28); background: rgba(249, 115, 22, 0.08); }
.ppt-flow-to .ppt-flow-icon { color: #2563eb; border-color: rgba(37, 99, 235, 0.28); background: rgba(37, 99, 235, 0.08); }
.ppt-dropzone:hover .ppt-flow-icon, .ppt-dropzone.dragover .ppt-flow-icon { transform: translateY(-2px); }
.ppt-flow-item > span:last-child { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-secondary); }
.ppt-flow-arrow {
  position: relative; display: flex; align-items: center; justify-content: center; width: 56px; flex-shrink: 0;
}
.ppt-flow-line {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.2), #f97316, rgba(37, 99, 235, 0.35));
}
.ppt-flow-dot {
  position: relative; z-index: 1; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; background: linear-gradient(135deg, #f97316, #2563eb);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.28);
}

.ppt-format-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.ppt-format-tags span {
  padding: 5px 12px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: #c2410c; background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.18);
}
.ppt-format-tags .ppt-tag-pdf {
  color: #1d4ed8; background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.18);
}

.ppt-progress-card { border-color: rgba(249, 115, 22, 0.22); background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), var(--card-bg)); }
.ppt-progress-inner { display: flex; align-items: center; gap: 18px; }
.ppt-progress-ring {
  flex-shrink: 0; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.2);
}
.ppt-progress-body { flex: 1; min-width: 0; }
.ppt-progress-title { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.ppt-progress-text { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.ppt-progress-bar {
  height: 6px; border-radius: 999px; background: var(--bg-secondary); overflow: hidden;
}
.ppt-progress-bar-fill {
  display: block; width: 42%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #fb923c, #2563eb);
  animation: ppt-progress-move 1.6s ease-in-out infinite;
}
@keyframes ppt-progress-move {
  0% { transform: translateX(-120%); width: 35%; }
  50% { width: 55%; }
  100% { transform: translateX(280%); width: 35%; }
}

.ppt-results-card { position: relative; overflow: hidden; }
.ppt-results-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #059669, #10b981);
}
.ppt-results-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.ppt-results-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--text-primary); }
.ppt-results-sub { margin: 0; font-size: 13px; color: var(--text-muted); }
.ppt-results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ppt-results-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.ppt-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px;
}
@media (max-width: 640px) { .ppt-stats { grid-template-columns: 1fr; } }
.ppt-stat {
  padding: 16px; border-radius: 14px; background: var(--bg-accent); border: 1px solid var(--card-border);
}
.ppt-stat-accent {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(37, 99, 235, 0.05));
  border-color: rgba(249, 115, 22, 0.2);
}
.ppt-stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ppt-stat-value { margin-top: 8px; font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.ppt-stat-accent .ppt-stat-value { color: #ea580c; }
.dark .ppt-stat-accent .ppt-stat-value { color: #fb923c; }

.ppt-result-list { display: flex; flex-direction: column; gap: 10px; }
.ppt-result-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ppt-result-item:hover {
  transform: translateY(-1px); border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.ppt-result-thumb {
  width: 52px; height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; color: #2563eb; background: rgba(37, 99, 235, 0.08); border: 1px solid rgba(37, 99, 235, 0.16);
}
.ppt-result-info { flex: 1; min-width: 0; }
.ppt-result-name {
  font-size: 14px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ppt-result-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.ppt-page-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
  color: #c2410c; background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.18);
}
.ppt-download-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.ppt-result-error {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: rgba(220, 38, 38, 0.06); border: 1px solid rgba(220, 38, 38, 0.15);
}
.ppt-result-error-icon {
  flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #dc2626; background: rgba(220, 38, 38, 0.1);
}
.ppt-result-error strong { display: block; font-size: 13px; color: #dc2626; margin-bottom: 4px; }
.ppt-result-error p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.ppt-steps-card h3 { margin-bottom: 18px; font-size: 17px; font-weight: 800; }
.ppt-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 900px) { .ppt-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .ppt-steps { grid-template-columns: 1fr; } }
.ppt-step {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 14px;
  border-radius: 14px; background: var(--bg-accent); border: 1px solid var(--card-border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.ppt-step:hover {
  border-color: rgba(249, 115, 22, 0.32); box-shadow: 0 6px 18px rgba(249, 115, 22, 0.08); transform: translateY(-1px);
}
.ppt-step-icon {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #ea580c; background: rgba(249, 115, 22, 0.12);
}
.ppt-step-num {
  position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #ea580c, #f97316);
}
.ppt-step-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ppt-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.ppt-tip {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 13px; line-height: 1.65;
  color: var(--text-secondary); background: rgba(249, 115, 22, 0.08); border: 1px solid rgba(249, 115, 22, 0.2);
}
.ppt-tip strong { color: #ea580c; font-weight: 700; }
.dark .ppt-tip strong { color: #fb923c; }

/* PDF to Excel */
.pex-page .doc-page-content { max-width: 1200px; padding-bottom: 44px; }
.pex-page .section-card { margin-bottom: 20px; }

.pex-hero-strip {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14) 0%, rgba(36, 104, 242, 0.05) 55%, rgba(22, 163, 74, 0.08) 100%);
  border-color: rgba(34, 197, 94, 0.24);
}
.pex-hero-strip::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #15803d, #22c55e, #4ade80, var(--primary-light));
}
.pex-hero-main { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 16px; position: relative; z-index: 1; }
.pex-hero-icon {
  flex-shrink: 0; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: #16a34a; background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(34, 197, 94, 0.28);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.12);
}
.pex-hero-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin: 0 0 8px; letter-spacing: -0.02em; }
.pex-hero-desc { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin: 0; max-width: 720px; }
.pex-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.pex-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #15803d; background: var(--card-bg-solid);
  border: 1px solid rgba(34, 197, 94, 0.22);
}
.dark .pex-hero-badge { color: #4ade80; }

.pex-workbench {
  display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px;
}
@media (max-width: 900px) { .pex-workbench { grid-template-columns: 1fr; } }

.pex-card {
  position: relative; overflow: hidden; margin-bottom: 0 !important;
  display: flex; flex-direction: column; min-height: 420px;
}
.pex-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #15803d, #22c55e);
}
.pex-card-upload::before { background: linear-gradient(90deg, #16a34a, #4ade80, #2563eb); }

.pex-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.pex-panel-head h3 { margin: 0; padding: 0; border: 0; font-size: 17px; font-weight: 700; color: var(--text-primary); }
.pex-panel-tag {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  color: var(--text-muted); background: var(--bg-accent); border: 1px solid var(--card-border);
}
.pex-panel-label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; letter-spacing: 0.02em; }

.pex-option-group { display: flex; flex-direction: column; gap: 10px; }
.pex-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px;
  border-radius: 12px; border: 2px solid var(--card-border); background: var(--bg-accent);
  cursor: pointer; text-align: left; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit; width: 100%;
}
.pex-opt:hover { border-color: rgba(34, 197, 94, 0.35); box-shadow: 0 4px 14px rgba(34, 197, 94, 0.08); }
.pex-opt.active {
  border-color: #22c55e; background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.pex-opt-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.pex-opt-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

.pex-tips { margin: 18px 0 0; padding: 16px 0 0; border-top: 1px dashed var(--border-color); list-style: none; }
.pex-tips li {
  position: relative; padding-left: 16px; font-size: 12px; color: var(--text-muted); line-height: 1.65; margin-bottom: 8px;
}
.pex-tips li::before {
  content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
}

.pex-dropzone {
  flex: 1; min-height: 320px; border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(165deg, rgba(34, 197, 94, 0.05) 0%, var(--bg-secondary) 45%, rgba(37, 99, 235, 0.04) 100%);
}
.pex-dropzone:hover, .pex-dropzone.dragover {
  border-color: #22c55e; background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 10px 32px rgba(34, 197, 94, 0.14);
}
.pex-dropzone-busy { pointer-events: none; opacity: 0.72; }

.pex-flow { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; width: 100%; }
.pex-flow-item { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 88px; }
.pex-flow-icon {
  width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; border: 2px solid var(--card-border); background: var(--card-bg-solid);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06); transition: transform 0.2s, border-color 0.2s;
}
.pex-flow-from .pex-flow-icon { color: #dc2626; border-color: rgba(220, 38, 38, 0.28); background: rgba(220, 38, 38, 0.06); }
.pex-flow-to .pex-flow-icon { color: #16a34a; border-color: rgba(34, 197, 94, 0.28); background: rgba(34, 197, 94, 0.08); }
.pex-dropzone:hover .pex-flow-icon, .pex-dropzone.dragover .pex-flow-icon { transform: translateY(-2px); }
.pex-flow-item > span:last-child { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-secondary); }
.pex-flow-arrow { position: relative; display: flex; align-items: center; justify-content: center; width: 56px; flex-shrink: 0; }
.pex-flow-line {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.2), #22c55e, rgba(34, 197, 94, 0.35));
}
.pex-flow-dot {
  position: relative; z-index: 1; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.28);
}

.pex-format-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.pex-format-tags span {
  padding: 5px 12px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: #b91c1c; background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.16);
}
.pex-format-tags .pex-tag-xlsx {
  color: #15803d; background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.18);
}

.pex-progress-card { border-color: rgba(34, 197, 94, 0.22); background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), var(--card-bg)); }
.pex-progress-inner { display: flex; align-items: center; gap: 18px; }
.pex-progress-ring {
  flex-shrink: 0; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.2);
}
.pex-progress-body { flex: 1; min-width: 0; }
.pex-progress-title { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.pex-progress-text { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.pex-progress-bar { height: 6px; border-radius: 999px; background: var(--bg-secondary); overflow: hidden; }
.pex-progress-bar-fill {
  display: block; width: 42%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80, #16a34a);
  animation: pex-progress-move 1.6s ease-in-out infinite;
}
@keyframes pex-progress-move {
  0% { transform: translateX(-120%); width: 35%; }
  50% { width: 55%; }
  100% { transform: translateX(280%); width: 35%; }
}

.pex-results-card { position: relative; overflow: hidden; }
.pex-results-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #059669, #10b981);
}
.pex-results-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.pex-results-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--text-primary); }
.pex-results-sub { margin: 0; font-size: 13px; color: var(--text-muted); }
.pex-results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pex-results-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.pex-result-list { display: flex; flex-direction: column; gap: 10px; }
.pex-result-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pex-result-item:hover {
  transform: translateY(-1px); border-color: rgba(34, 197, 94, 0.25);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.pex-result-thumb {
  width: 52px; height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; color: #16a34a; background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.16);
}
.pex-result-info { flex: 1; min-width: 0; }
.pex-result-name {
  font-size: 14px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pex-result-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.pex-meta-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
  color: #15803d; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.18);
}
.pex-download-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.pex-result-error {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: rgba(220, 38, 38, 0.06); border: 1px solid rgba(220, 38, 38, 0.15);
}
.pex-result-error-icon {
  flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #dc2626; background: rgba(220, 38, 38, 0.1);
}
.pex-result-error strong { display: block; font-size: 13px; color: #dc2626; margin-bottom: 4px; }
.pex-check-label {
  display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 12px 14px;
  border-radius: 10px; background: rgba(34, 197, 94, 0.06); border: 1px solid rgba(34, 197, 94, 0.18);
  font-size: 13px; color: var(--text-secondary); line-height: 1.5; cursor: pointer;
}
.pex-check-label input { margin-top: 3px; flex-shrink: 0; accent-color: #16a34a; }
.pex-meta-ocr { color: #0369a1 !important; background: rgba(3, 105, 161, 0.1) !important; border-color: rgba(3, 105, 161, 0.18) !important; }
