﻿/* ===== Exradoc — AMZ123-style Portal Theme ===== */

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

/* ===== Design Tokens ===== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --bg: #f2f4f7;
  --bg-accent: #eef3ff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #999999;
  --card-bg: #ffffff;
  --card-bg-solid: #ffffff;
  --card-border: #e8ebf0;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 4px 16px rgba(36, 104, 242, 0.12);
  --border-color: #e0e4ea;
  --border: var(--border-color);
  --bg-secondary: #eef1f6;
  --input-bg: #ffffff;
  --primary: #2468f2;
  --primary-dark: #1a56db;
  --primary-light: #4d85f5;
  --primary-gradient: linear-gradient(135deg, #2468f2 0%, #1a56db 100%);
  --primary-glow: rgba(36, 104, 242, 0.28);
  --accent-orange: #ff6b00;
  --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: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --topbar-height: 56px;
  --portal-max: 1200px;
}

.dark {
  --bg: #141820;
  --bg-accent: #1a2230;
  --text-primary: #eef2f7;
  --text-secondary: #a8b4c4;
  --text-muted: #6b7789;
  --card-bg: #1c2432;
  --card-bg-solid: #1c2432;
  --card-border: #2a3548;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  --card-shadow-hover: 0 4px 16px rgba(36, 104, 242, 0.18);
  --border-color: #2f3b50;
  --border: var(--border-color);
  --bg-secondary: #181e28;
  --input-bg: #141820;
  --primary: #4d85f5;
  --primary-dark: #2468f2;
  --primary-light: #6b9aff;
  --primary-glow: rgba(77, 133, 245, 0.22);
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
}

/* ===== 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 20px;
  background: var(--card-bg-solid);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.dark .top-bar { background: var(--card-bg-solid); box-shadow: 0 1px 4px 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: 8px; }

.top-bar .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.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: 6px 12px;
  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: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.toggle-btn:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--bg-accent);
}
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: 28px 20px 32px;
}
.portal-hero-inner {
  max-width: var(--portal-max);
  margin: 0 auto;
  text-align: center;
}
.portal-hero h1 {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.portal-hero p {
  font-size: 14px;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}
.portal-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.portal-hero-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.dark .portal-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 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: 0;
  max-width: var(--portal-max);
  margin: 0 auto;
  padding: 0 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.feature-item {
  text-align: center;
  padding: 20px 14px;
  border-right: 1px solid var(--card-border);
  transition: background 0.2s;
}
.feature-item:last-child { border-right: none; }
.feature-item:hover { background: var(--bg-accent); }
.feature-item .feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin: 0 auto 10px;
  border-radius: var(--radius-md);
  background: var(--bg-accent);
}
.feature-item .feat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.feature-item .feat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}
.dark .feature-item .feat-icon { background: var(--bg-accent); }

/* ===== Category Nav ===== */
.category-nav {
  max-width: var(--portal-max);
  margin: 20px auto 0;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.category-nav a:hover,
.category-nav a.active {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--bg-accent);
}

.portal-main {
  max-width: var(--portal-max);
  margin: 0 auto;
  padding: 0 20px 40px;
}
.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: 20px;
  padding: 0;
}
.portal-main .category-nav {
  padding: 0;
}

/* ===== Section Headers ===== */
.docs-section {
  margin: 20px auto 0;
  padding: 0;
}
.section-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.section-header h2 span:first-child { font-size: 18px; font-weight: 700; }
.section-header h2 span:last-child {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.section-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--bg-accent);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}
.dark .section-count { background: var(--bg-accent); color: var(--primary-light); }

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

/* ===== Doc Cards (AMZ123 tool tiles) ===== */
.doc-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 10px 14px;
  border: 1px solid var(--card-border);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: none;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-light);
}
.doc-card:hover .doc-card-icon { transform: scale(1.06); }

.doc-card-gradient { display: none; }
.doc-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}
.doc-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  transition: transform 0.2s;
}
.doc-card-features { display: none; }
.doc-card-feature-tag { display: none; }
.doc-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
}
.doc-card-desc { display: none; }
.doc-card-actions { display: none; }
.doc-card-btn { display: none; }

.doc-card-featured {
  border: 1.5px solid rgba(255, 107, 0, 0.5);
  background: linear-gradient(165deg, #fff7ed 0%, #fffbf5 38%, var(--card-bg) 100%);
  box-shadow: 0 2px 14px rgba(255, 107, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.doc-card-featured:hover {
  border-color: var(--accent-orange);
  box-shadow: 0 8px 28px rgba(255, 107, 0, 0.24);
  transform: translateY(-3px);
}
.doc-card-featured .doc-card-title {
  color: #c2410c;
  font-weight: 700;
}
.doc-card-hot-badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  padding: 3px 8px 3px 10px;
  border-radius: 0 var(--radius-md) 0 10px;
  background: linear-gradient(135deg, #ff6b00 0%, #ff8533 100%);
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.35);
  letter-spacing: 0.04em;
}
.dark .doc-card-featured {
  border-color: rgba(255, 133, 51, 0.55);
  background: linear-gradient(165deg, rgba(255, 107, 0, 0.12) 0%, rgba(255, 107, 0, 0.04) 38%, var(--card-bg) 100%);
  box-shadow: 0 2px 16px rgba(255, 107, 0, 0.15);
}
.dark .doc-card-featured:hover {
  box-shadow: 0 8px 28px rgba(255, 107, 0, 0.28);
}
.dark .doc-card-featured .doc-card-title { color: #fb923c; }

/* ===== Site Footer ===== */
.site-footer {
  max-width: var(--portal-max);
  margin: 32px auto 0;
  padding: 28px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.site-footer-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.site-footer-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 16px;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.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; }

/* ===== 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: 36px 28px 48px;
}
.doc-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  position: relative;
}
.doc-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.doc-header h1 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: var(--text-primary);
}
.doc-header p {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ===== 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; }

/* Preview language switch — bilingual highlight */
#btn-preview-lang {
  color: #4338ca;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 55%, #f5f3ff 100%);
  border: 1.5px solid #818cf8;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
#btn-preview-lang:hover {
  color: #3730a3;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-color: #6366f1;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
  transform: translateY(-1px);
}
#btn-preview-lang:active {
  transform: scale(0.97);
}
.dark #btn-preview-lang {
  color: #c7d2fe;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(79, 70, 229, 0.14) 100%);
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}
.dark #btn-preview-lang:hover {
  color: #e0e7ff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32) 0%, rgba(79, 70, 229, 0.22) 100%);
  border-color: #818cf8;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.32);
}

/* ===== 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: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  padding-bottom: 0;
  border-bottom: none;
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.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: 16px 20px;
  font-size: 14px;
  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; }

/* ===== Cross-border Wiki (home) ===== */
.wiki-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--card-bg) 0%, rgba(36, 104, 242, 0.04) 50%, rgba(99, 102, 241, 0.06) 100%);
}
.wiki-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #6366f1, #8b5cf6);
}
.wiki-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.wiki-header-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}
.wiki-header-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}
.wiki-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.wiki-subtitle {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
  max-width: 560px;
}
.wiki-lang-badge {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.dark .wiki-lang-badge { color: #93c5fd; }

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) {
  .wiki-grid { grid-template-columns: 1fr; }
}

.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 16px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  background: var(--card-bg-solid, var(--card-bg));
  border: 1px solid var(--card-border);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
.wiki-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0.9;
}
.wiki-card--terms::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.wiki-card--docs::before { background: linear-gradient(90deg, #7c3aed, #8b5cf6); }
.wiki-card--payment::before { background: linear-gradient(90deg, #059669, #10b981); }
.wiki-card--customs::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.wiki-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
  border-color: rgba(37, 99, 235, 0.28);
}
.dark .wiki-card:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }

.wiki-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wiki-card-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.wiki-card--terms .wiki-card-tag { color: #1d4ed8; background: rgba(37, 99, 235, 0.1); }
.wiki-card--docs .wiki-card-tag { color: #6d28d9; background: rgba(124, 58, 237, 0.1); }
.wiki-card--payment .wiki-card-tag { color: #047857; background: rgba(5, 150, 105, 0.1); }
.wiki-card--customs .wiki-card-tag { color: #b45309; background: rgba(217, 119, 6, 0.1); }
.wiki-card-read {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.wiki-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.45;
  transition: color 0.2s;
}
.wiki-card:hover .wiki-card-title { color: var(--primary); }
.wiki-card-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}
.wiki-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--card-border);
}
.wiki-card-date {
  font-size: 11px;
  color: var(--text-muted);
}
.wiki-card-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  transition: transform 0.2s;
}
.wiki-card:hover .wiki-card-more { transform: translateX(3px); }

/* ===== Wiki module pages (index / list / search) ===== */
.wiki-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.07) 0%, transparent 55%),
    linear-gradient(180deg, #eef2f8 0%, var(--bg) 220px);
  min-height: 100vh;
}
.dark .wiki-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #141820 0%, var(--bg) 220px);
}
.wiki-page {
  padding: calc(var(--topbar-height) + 24px) 20px 64px;
}
.wiki-page__layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (min-width: 1024px) {
  .wiki-page__layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px;
  }
}
.wiki-page__main { min-width: 0; }
.wiki-page__aside { min-width: 0; }
@media (max-width: 1023px) {
  .wiki-page__aside { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 640px) {
  .wiki-page__aside { grid-template-columns: 1fr; }
}

.wiki-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: hidden;
}
.wiki-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #6366f1, #8b5cf6);
}
.dark .wiki-hero { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28); }
.wiki-hero--compact { padding: 24px 26px 20px; }
.wiki-hero--compact .wiki-hero__icon { display: none; }
.wiki-hero__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.wiki-hero__text { flex: 1; min-width: 220px; }
.wiki-hero__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 8px 0 8px;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.wiki-hero--compact .wiki-hero__title { font-size: 22px; margin-top: 4px; }
.wiki-hero__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
  max-width: 560px;
}

.wiki-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.wiki-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.18s;
}
.wiki-breadcrumb a:hover { color: var(--primary); }
.wiki-bc-sep { opacity: 0.45; font-size: 11px; }

.wiki-search {
  margin-bottom: 20px;
}
.wiki-search--panel {
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.wiki-search__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.wiki-search__row {
  display: flex;
  gap: 10px;
}
.wiki-search__row input[type="search"],
.wiki-search__row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.wiki-search__row input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}
.wiki-search__btn {
  flex-shrink: 0;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--primary-gradient);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.wiki-search__btn:hover { transform: translateY(-1px); }
.wiki-search__btn--primary { min-width: 120px; }
.wiki-search__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--card-border);
}
.wiki-search__filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.wiki-search__radios,
.wiki-search__selects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.wiki-search__radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.wiki-search__selects select {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  outline: none;
}
.wiki-search__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.wiki-search__reset {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.wiki-search__reset:hover { color: var(--primary); }

.wiki-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.wiki-cat-nav--bottom { margin-top: 32px; margin-bottom: 0; }
.wiki-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}
.wiki-cat-pill:hover {
  color: var(--primary);
  border-color: rgba(36, 104, 242, 0.35);
  transform: translateY(-1px);
}
.wiki-cat-pill.is-active {
  color: #fff;
  background: var(--primary-gradient);
  border-color: transparent;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.wiki-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.wiki-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.wiki-section-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.wiki-empty {
  text-align: center;
  padding: 48px 24px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
}
.wiki-empty--soft { padding: 32px 24px; background: transparent; border: none; }
.wiki-empty p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 8px;
}
.wiki-empty__hint { font-size: 13px !important; color: var(--text-muted) !important; }
.wiki-empty__btn {
  display: inline-flex;
  margin-top: 16px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid rgba(36, 104, 242, 0.3);
  border-radius: 10px;
  transition: background 0.18s;
}
.wiki-empty__btn:hover { background: var(--bg-accent); }

.wiki-aside-card {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.wiki-aside-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
}
.wiki-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wiki-aside-list a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s;
}
.wiki-aside-list a:hover { background: var(--bg-accent); }
.wiki-aside-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: rgba(36, 104, 242, 0.1);
  border-radius: 6px;
}
.wiki-aside-list li:nth-child(1) .wiki-aside-rank { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
.wiki-aside-list li:nth-child(2) .wiki-aside-rank { color: #ea580c; background: rgba(234, 88, 12, 0.1); }
.wiki-aside-list li:nth-child(3) .wiki-aside-rank { color: #ca8a04; background: rgba(202, 138, 4, 0.1); }
.wiki-aside-link-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wiki-aside-tools,
.wiki-aside-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wiki-aside-tools a,
.wiki-aside-cats a {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  transition: color 0.18s, border-color 0.18s;
}
.wiki-aside-tools a:hover,
.wiki-aside-cats a:hover {
  color: var(--primary);
  border-color: rgba(36, 104, 242, 0.35);
}

.wiki-pages {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 20px;
}
.wiki-pages .pages,
.wiki-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.wiki-pages a,
.wiki-pages strong,
.wiki-pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.18s, color 0.18s;
}
.wiki-pages a {
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.wiki-pages a:hover {
  color: var(--primary);
  border-color: rgba(36, 104, 242, 0.35);
  background: var(--bg-accent);
}
.wiki-pages strong {
  color: #fff;
  background: var(--primary-gradient);
  border: none;
  box-shadow: 0 2px 8px var(--primary-glow);
}

@media (max-width: 640px) {
  .wiki-hero { padding: 22px 20px 18px; }
  .wiki-hero__title { font-size: 22px; }
  .wiki-search__row { flex-direction: column; }
  .wiki-search__btn { width: 100%; }
}

/* ===== Blog article pages ===== */
.blog-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.07) 0%, transparent 55%),
    linear-gradient(180deg, #eef2f8 0%, var(--bg) 220px);
}
.dark .blog-body {
  background-color: #000000;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 130, 246, 0.06) 0%, transparent 55%),
    #000000;
}
.blog-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.blog-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2563eb, #6366f1, #8b5cf6);
  transition: width 0.12s ease-out;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
}
.blog-body--terms .blog-progress-bar { background: linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa); box-shadow: 0 0 12px rgba(37, 99, 235, 0.4); }
.blog-body--docs .blog-progress-bar { background: linear-gradient(90deg, #6d28d9, #8b5cf6, #a78bfa); box-shadow: 0 0 12px rgba(124, 58, 237, 0.4); }
.blog-body--payment .blog-progress-bar { background: linear-gradient(90deg, #047857, #10b981, #34d399); box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
.blog-body--customs .blog-progress-bar { background: linear-gradient(90deg, #b45309, #f59e0b, #fbbf24); box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }

.blog-page {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 20px) 20px 56px;
}
.blog-layout {
  display: block;
}
.blog-main {
  min-width: 0;
}
.blog-sidebar {
  display: none;
}
.blog-mobile-panels {
  display: block;
  margin-top: 20px;
}

@media (min-width: 1024px) {
  .blog-page {
    max-width: min(1040px, calc(100vw - 48px));
    padding-left: 28px;
    padding-right: 28px;
  }
  .blog-article-header { padding: 36px 40px 30px; }
  .blog-article-body { padding: 32px 40px 36px; }
  .blog-article-header h1 { font-size: 30px; }
}

@media (min-width: 1280px) {
  .blog-page {
    max-width: min(1680px, calc(100vw - 48px));
    padding: calc(var(--topbar-height) + 24px) 28px 64px;
  }
  .blog-layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr) 272px;
    gap: 24px;
    align-items: start;
  }
  .blog-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--topbar-height) + 16px);
    max-height: calc(100vh - var(--topbar-height) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
  }
  .blog-sidebar::-webkit-scrollbar { width: 5px; }
  .blog-sidebar::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
  }
  .blog-mobile-panels { display: none; }
  .blog-article-header { padding: 40px 48px 32px; }
  .blog-article-body {
    padding: 36px 48px 40px;
    font-size: 16px;
    line-height: 1.88;
  }
  .blog-article-header h1 { font-size: 31px; }
}

@media (min-width: 1600px) {
  .blog-page {
    max-width: min(1760px, calc(100vw - 64px));
    padding-left: 36px;
    padding-right: 36px;
  }
  .blog-layout {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 28px;
  }
  .blog-article { border-radius: 22px; }
  .blog-article-header { padding: 44px 56px 36px; }
  .blog-article-body { padding: 40px 56px 44px; }
  .blog-article-header h1 { font-size: 33px; }
  .blog-article-body h2 { font-size: 20px; }
}

@media (min-width: 1920px) {
  .blog-page {
    max-width: min(1840px, calc(100vw - 80px));
  }
  .blog-layout {
    grid-template-columns: 320px minmax(0, 1fr) 320px;
    gap: 32px;
  }
}

/* Blog sidebars */
.blog-sidebar-inner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.dark .blog-sidebar-inner {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}
.blog-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, transparent 100%);
}
.blog-sidebar-brand--right {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
}
.blog-sidebar-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  flex-shrink: 0;
}
.blog-sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.blog-sidebar-brand-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.blog-sidebar-brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.blog-sidebar-block {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--card-border);
}
.blog-sidebar-block:last-child { border-bottom: none; }
.blog-sidebar-block-head {
  margin-bottom: 10px;
}
.blog-sidebar-block-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.blog-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.blog-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s, transform 0.18s;
}
.blog-sidebar-link:hover {
  background: var(--bg-accent);
  transform: translateX(2px);
}
.blog-sidebar-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
.blog-sidebar-link-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-sidebar-articles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.blog-sidebar-article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-accent);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.blog-sidebar-article:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}
.blog-sidebar-article-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
}
.blog-sidebar-article-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
}
.blog-sidebar-article-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Mobile tool panels */
.blog-mobile-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}
.blog-mobile-panel:last-child { margin-bottom: 0; }
.blog-mobile-panel .blog-sidebar-brand {
  border-radius: 0;
}
.blog-mobile-panel .blog-sidebar-block:last-child { border-bottom: none; }

/* Blog pager */
.blog-article-body:has(+ .blog-pager-wrap),
.blog-article-body:has(+ .blog-pager) {
  padding-bottom: 28px;
}
.blog-pager-wrap {
  margin-top: 12px;
  padding: 40px 24px 32px;
  border-top: 1px dashed var(--card-border);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 72px);
}
.blog-article--docs .blog-pager-wrap {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.05) 0%, transparent 72px);
}
.blog-pager-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.blog-pager-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--card-border), transparent);
}
.blog-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0;
  border-top: none;
  background: transparent;
}
.blog-article-body + .blog-pager {
  margin-top: 40px;
  padding: 32px 24px 28px;
  border-top: 1px dashed var(--card-border);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 72px);
}
.blog-pager-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
  min-height: 96px;
  overflow: hidden;
}
.blog-pager-item::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.22s;
}
.blog-pager-prev::before { left: 0; }
.blog-pager-next::before { right: 0; left: auto; }
.blog-pager-item:hover {
  border-color: rgba(36, 104, 242, 0.35);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.blog-pager-item:hover::before { opacity: 1; }
.blog-article--docs .blog-pager-item:hover {
  border-color: rgba(124, 58, 237, 0.35);
}
.blog-article--docs .blog-pager-prev::before,
.blog-article--docs .blog-pager-next::before {
  background: linear-gradient(180deg, #7c3aed, #8b5cf6);
}
.blog-pager-prev { text-align: left; padding-left: 22px; }
.blog-pager-next { text-align: right; align-items: flex-end; padding-right: 22px; }
.blog-pager-empty { visibility: hidden; pointer-events: none; border: none; background: transparent; box-shadow: none; }
.blog-pager-dir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.blog-pager-next .blog-pager-dir { flex-direction: row-reverse; }
.blog-pager-dir-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
  color: var(--primary);
  background: rgba(36, 104, 242, 0.1);
  border: 1px solid rgba(36, 104, 242, 0.14);
  transition: color 0.22s, background 0.22s, border-color 0.22s, transform 0.22s;
}
.blog-article--docs .blog-pager-dir-icon {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.16);
}
.blog-pager-item:hover .blog-pager-dir-icon {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
  transform: scale(1.05);
}
.blog-article--docs .blog-pager-item:hover .blog-pager-dir-icon {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}
.blog-pager-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
}
.blog-article--docs .blog-pager-label { color: #7c3aed; }
.blog-pager-arrow {
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
.blog-pager-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  background: var(--bg);
  border: 1px solid var(--card-border);
}
.blog-pager-next .blog-pager-tag { align-self: flex-end; }
.blog-article--docs .blog-pager-tag {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.14);
}
.blog-pager-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.22s;
}
.blog-pager-item:hover .blog-pager-title { color: var(--primary); }
.blog-article--docs .blog-pager-item:hover .blog-pager-title { color: #7c3aed; }

@media (min-width: 1280px) {
  .blog-pager-wrap {
    padding: 48px 48px 36px;
  }
  .blog-pager {
    gap: 20px;
  }
  .blog-article-body + .blog-pager {
    padding: 40px 48px 32px;
  }
  .blog-pager-item {
    padding: 20px 24px;
    min-height: 104px;
  }
  .blog-pager-title { font-size: 15px; }
}

@media (max-width: 640px) {
  .blog-pager-wrap {
    padding: 32px 20px 24px;
  }
  .blog-pager,
  .blog-article-body + .blog-pager {
    grid-template-columns: 1fr;
    padding-left: 20px;
    padding-right: 20px;
  }
  .blog-pager-next { text-align: left; align-items: flex-start; padding-right: 20px; }
  .blog-pager-next .blog-pager-dir { flex-direction: row; }
  .blog-pager-next .blog-pager-tag { align-self: flex-start; }
  .blog-pager-empty { display: none; }
}

.blog-article {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(15, 23, 42, 0.07), 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.dark .blog-article {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.blog-article-header {
  position: relative;
  padding: 32px 36px 28px;
  border-bottom: 1px solid var(--card-border);
  overflow: hidden;
}
.blog-header-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(36, 104, 242, 0.10) 0%, rgba(77, 133, 245, 0.05) 48%, rgba(238, 243, 255, 0.55) 100%);
}
.dark .blog-header-bg {
  background: linear-gradient(155deg, rgba(36, 104, 242, 0.14) 0%, rgba(77, 133, 245, 0.06) 48%, transparent 100%);
}

.blog-article-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1a56db, #2468f2, #6b9aff);
}

.blog-article-header::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 104, 242, 0.10) 0%, transparent 68%);
  pointer-events: none;
}

.blog-breadcrumb {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 20px;
}
.blog-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.blog-breadcrumb a:hover { color: var(--primary); }
.blog-bc-sep { color: var(--text-muted); opacity: 0.5; font-size: 11px; }

.blog-header-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.blog-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.blog-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}
.blog-article--docs .blog-cat { color: #6d28d9; background: rgba(124, 58, 237, 0.1); border-color: rgba(124, 58, 237, 0.2); }
.blog-article--docs .blog-cat-dot { background: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.55); }
.blog-article--terms .blog-cat { color: #1d4ed8; background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.2); }
.blog-article--terms .blog-cat-dot { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.55); }
.blog-article--payment .blog-cat { color: #047857; background: rgba(5, 150, 105, 0.1); border-color: rgba(5, 150, 105, 0.2); }
.blog-article--payment .blog-cat-dot { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.55); }
.blog-article--customs .blog-cat { color: #b45309; background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.2); }
.blog-article--customs .blog-cat-dot { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.55); }

.blog-meta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--card-bg-solid, var(--card-bg));
  border: 1px solid var(--card-border);
}

.blog-article-header h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(24px, 4.5vw, 32px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.38;
  margin: 0;
  letter-spacing: -0.025em;
}

.blog-article-body {
  padding: 32px 36px 36px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-secondary);
}
.blog-lead {
  font-size: 17px !important;
  line-height: 1.85 !important;
  color: var(--text-primary) !important;
  padding: 20px 22px;
  margin: 0 0 28px !important;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-left: 4px solid #3b82f6;
  font-weight: 400;
}
.blog-article--docs .blog-lead { border-left-color: #8b5cf6; background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(124, 58, 237, 0.04) 100%); }
.blog-article--terms .blog-lead { border-left-color: #3b82f6; background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(37, 99, 235, 0.04) 100%); }
.blog-article--payment .blog-lead { border-left-color: #10b981; background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(16, 185, 129, 0.04) 100%); }
.blog-article--customs .blog-lead { border-left-color: #f59e0b; background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(245, 158, 11, 0.04) 100%); }

.blog-article-body h2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-accent);
  border: 1px solid var(--card-border);
  border-left: 4px solid #3b82f6;
  line-height: 1.45;
}
.blog-article--docs .blog-article-body h2 { border-left-color: #8b5cf6; }
.blog-article--terms .blog-article-body h2 { border-left-color: #3b82f6; }
.blog-article--payment .blog-article-body h2 { border-left-color: #10b981; }
.blog-article--customs .blog-article-body h2 { border-left-color: #f59e0b; }

.blog-article-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--card-border);
}
.blog-article-body p { margin: 0 0 16px; }
.blog-article-body ul,
.blog-article-body ol {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}
.blog-article-body ul li,
.blog-article-body ol li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 22px;
  line-height: 1.75;
}
.blog-article-body ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
}
.blog-article--docs .blog-article-body ul li::before { background: #8b5cf6; }
.blog-article--terms .blog-article-body ul li::before { background: #3b82f6; }
.blog-article--payment .blog-article-body ul li::before { background: #10b981; }
.blog-article--customs .blog-article-body ul li::before { background: #f59e0b; }

.blog-article-body ol { counter-reset: blog-ol; }
.blog-article-body ol li { counter-increment: blog-ol; padding-left: 28px; }
.blog-article-body ol li::before {
  content: counter(blog-ol);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 6px;
}
.blog-article--docs .blog-article-body ol li::before { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.blog-article--terms .blog-article-body ol li::before { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.blog-article--payment .blog-article-body ol li::before { background: linear-gradient(135deg, #047857, #10b981); }
.blog-article--customs .blog-article-body ol li::before { background: linear-gradient(135deg, #b45309, #f59e0b); }

.blog-article-body strong { color: var(--text-primary); font-weight: 600; }
.blog-article-body em { color: var(--text-primary); font-style: italic; }
.blog-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 12px 0 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.blog-article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s;
}
.blog-article-body a:hover { color: var(--primary-dark, #1d4ed8); }
.blog-article-body blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: var(--bg-accent);
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.75;
}
.blog-article-body .cms-content > *:first-child { margin-top: 0; }
.blog-article-body .cms-content > *:last-child { margin-bottom: 0; }
.blog-article-body code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 6px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.dark .blog-article-body code { color: #93c5fd; }

.blog-table-wrap {
  margin: 20px 0 24px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  overflow-x: auto;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.blog-article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0;
  min-width: 480px;
}
.blog-article-body th,
.blog-article-body td {
  border: none;
  border-bottom: 1px solid var(--card-border);
  padding: 12px 16px;
  text-align: left;
}
.blog-article-body tr:last-child td { border-bottom: none; }
.blog-article-body th {
  background: linear-gradient(180deg, var(--bg-accent) 0%, var(--card-bg) 100%);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}
.blog-article-body tbody tr:hover td { background: rgba(37, 99, 235, 0.03); }
.blog-article--docs .blog-article-body tbody tr:hover td { background: rgba(124, 58, 237, 0.04); }
.blog-article--payment .blog-article-body tbody tr:hover td { background: rgba(16, 185, 129, 0.04); }
.blog-article--customs .blog-article-body tbody tr:hover td { background: rgba(245, 158, 11, 0.04); }

.blog-callout {
  position: relative;
  padding: 18px 20px 18px 52px;
  border-radius: 14px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.75;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--text-secondary);
}
.blog-callout::before {
  content: '!';
  position: absolute;
  left: 16px;
  top: 17px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.15);
  border-radius: 50%;
}
.blog-article--docs .blog-callout::before { color: #6d28d9; background: rgba(124, 58, 237, 0.15); }
.blog-article--payment .blog-callout::before { color: #047857; background: rgba(5, 150, 105, 0.15); }
.blog-article--customs .blog-callout::before { color: #b45309; background: rgba(217, 119, 6, 0.15); }
.blog-article--docs .blog-callout { background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%); border-color: rgba(124, 58, 237, 0.2); }
.blog-article--payment .blog-callout { background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%); border-color: rgba(5, 150, 105, 0.2); }
.blog-article--customs .blog-callout { background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%); border-color: rgba(217, 119, 6, 0.2); }
.blog-callout strong { color: #1d4ed8; font-weight: 700; }
.blog-article--docs .blog-callout strong { color: #6d28d9; }
.blog-article--payment .blog-callout strong { color: #047857; }
.blog-article--customs .blog-callout strong { color: #b45309; }
.dark .blog-callout strong { filter: brightness(1.25); }

.blog-article-footer {
  padding: 0;
  border-top: 1px solid var(--card-border);
  background: var(--bg-accent);
}
.blog-footer-section {
  padding: 24px 36px;
}
.blog-footer-section + .blog-footer-section {
  border-top: 1px dashed var(--card-border);
  background: linear-gradient(180deg, var(--bg-accent) 0%, var(--card-bg) 100%);
}
.blog-article-footer h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  text-transform: none;
  letter-spacing: 0;
}
.blog-footer-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.blog-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}
.blog-related[data-section="doc-generators"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
  .blog-related[data-section="doc-generators"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.blog-tools-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: -6px 0 14px;
  line-height: 1.55;
}
.blog-tool-card {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 16px 10px 14px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.blog-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-light);
}
.blog-tool-card:hover .blog-tool-icon {
  transform: scale(1.08);
}
.blog-tool-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}
.blog-tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  transition: transform 0.2s;
}
.blog-tool-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-tool-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 640px) {
  .blog-related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .blog-related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.blog-more-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.blog-more-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.blog-more-item:hover {
  border-color: var(--primary-light);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.blog-more-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-more-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
}

.blog-page .footer-note {
  margin-top: 24px;
  padding: 0;
  text-align: center;
}

@media (max-width: 640px) {
  .blog-page { padding: calc(var(--topbar-height) + 16px) 14px 40px; }
  .blog-article { border-radius: 16px; }
  .blog-article-header,
  .blog-article-body { padding-left: 20px; padding-right: 20px; }
  .blog-article-header { padding-top: 24px; }
  .blog-article-body h2 { font-size: 17px; padding: 12px 14px; }
  .blog-lead { font-size: 15px !important; padding: 16px; }
  .wiki-header-icon { width: 44px; height: 44px; }
  .wiki-title { font-size: 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: 22px 16px 26px; }
  .feature-highlights { grid-template-columns: repeat(2, 1fr); }
  .feature-item:nth-child(2) { border-right: none; }
  .feature-item { border-bottom: 1px solid var(--card-border); }
  .feature-item:nth-last-child(-n+2) { border-bottom: none; }
  .docs-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .doc-page-content { padding: 24px 16px 36px; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .top-bar { padding: 0 12px; }
  .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: 16px; }
  .faq-section { padding: 20px 16px; }
  .category-nav { padding: 0 12px; }
  .portal-main { padding: 0 12px 32px; }
  .back-to-top { right: 16px; bottom: 20px; width: 40px; height: 40px; }
}

@media (max-width: 480px) {
  .feature-highlights { grid-template-columns: 1fr; }
  .feature-item { border-right: none !important; }
  .feature-item:last-child { border-bottom: none; }
}

/* ===== 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 Navigation Page ===== */
.trade-nav-body { background: #f0f2f5; }
.dark body.trade-nav-body { background: #000; }
.trade-nav-page {
  max-width: var(--portal-max);
  margin: 0 auto;
  padding: 0 20px 48px;
}
.trade-nav-hero {
  margin: 24px 0 20px;
  padding: 28px 24px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--card-bg) 55%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}
.trade-nav-hero h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}
.trade-nav-hero p {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
}
.trade-nav-search-wrap {
  position: relative;
  max-width: 420px;
}
.trade-nav-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}
.trade-nav-search {
  width: 100%;
  padding: 11px 14px 11px 42px;
  font-size: 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.trade-nav-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.trade-nav-tabs-wrap {
  position: sticky;
  top: 56px;
  z-index: 20;
  margin-bottom: 16px;
  padding: 8px 0;
  background: var(--bg-primary);
}
.trade-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trade-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.trade-nav-tab-icon { display: flex; color: var(--tab-color, var(--primary)); }
.trade-nav-tab:hover,
.trade-nav-tab.active {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--bg-accent);
}
.trade-nav-tab.active { font-weight: 600; }
.trade-nav-panel { display: none; }
.trade-nav-panel.active { display: block; }
.trade-nav-group {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}
.trade-nav-group.is-empty { display: none; }
.trade-nav-group-title {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.trade-nav-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.trade-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.trade-nav-link:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--bg-accent);
}
.trade-nav-link.is-hidden { display: none; }
.trade-nav-link-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trade-nav-link-ext {
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.5;
}
.trade-nav-credit {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.trade-nav-credit a { color: var(--primary); }
@media (max-width: 640px) {
  .trade-nav-page { padding: 0 12px 32px; }
  .trade-nav-hero { padding: 20px 16px; }
  .trade-nav-hero h1 { font-size: 22px; }
  .trade-nav-links { grid-template-columns: 1fr; }
  .trade-nav-tabs-wrap { top: 52px; }
}

/* 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; }
