/* ============================================================
   PDFnoted · AI PDF Cleanup 工作台 · 浅色样式（靛蓝 #4f46e5）
   仅替换原内联深色 style。
   ============================================================ */
:root {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --surface-3: #F3F4F6;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text: #0F172A;
  --text-2: #374151;
  --text-3: #6B7280;
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-soft: #EEF2FF;
  --accent-soft-2: #E0E7FF;
  --ok: #059669;
  --ok-soft: #ECFDF5;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 6px 20px rgba(15,23,42,.08);
  --shadow-lg: 0 14px 44px rgba(79,70,229,.16);
  --font: 'Geist','Noto Sans SC',-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  --ease: cubic-bezier(.16,1,.3,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: auto; }
body { font-family: var(--font); color: var(--text-2); background: var(--bg); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { color: var(--text); font-weight: 800; letter-spacing: -.01em; }

/* ===== Top nav ===== */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); }
.nav-brand .logo-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--text-2); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { background: var(--surface-3); color: var(--text); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-cta { margin-left: auto; background: var(--accent); color: #fff !important; padding: 9px 18px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.nav-cta:hover { background: var(--accent-hover); }

/* ===== Hero / upload ===== */
.hero { padding: 56px 20px 28px; text-align: center; background: radial-gradient(1100px 360px at 50% -12%, #EEF2FF 0%, rgba(238,242,255,0) 70%), var(--bg); }
.hero-badges { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.hero-badge { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.hero h1 { font-size: clamp(28px,4vw,42px); margin-bottom: 12px; }
.hero .sub { color: var(--text-3); font-size: 16px; max-width: 560px; margin: 0 auto; }

.upload-zone { max-width: 680px; margin: 28px auto 0; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); padding: 48px 24px; text-align: center; cursor: pointer; transition: all .18s var(--ease); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-lg); }
.upload-zone .icon { font-size: 38px; }
.upload-zone .title { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 8px; }
.upload-hint { color: var(--text-3); font-size: 13px; margin-top: 8px; }

/* ===== Layout ===== */
.wb-layout { max-width: 1200px; margin: 28px auto; padding: 0 20px 60px; display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .wb-layout { grid-template-columns: 1fr; } }

/* ===== Capability strip ===== */
.capability-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.cap-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow-sm); }
.cap-item .icon { font-size: 22px; }
.cap-item .name { font-weight: 700; color: var(--text); font-size: 14px; margin: 6px 0 2px; }
.cap-item .desc { font-size: 12.5px; color: var(--text-3); }

/* ===== Preview panel ===== */
.preview-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.preview-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.preview-header .title { font-weight: 700; color: var(--text); font-size: 15px; }
.preview-toolbar { display: flex; gap: 8px; align-items: center; }
.preview-pages { padding: 18px; display: flex; flex-direction: column; gap: 16px; background: var(--surface-2); }
.page-thumb { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.page-thumb canvas { display: block; width: 100%; }
.page-num { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; background: rgba(15,23,42,.78); color: #fff; padding: 2px 8px; border-radius: 6px; }

/* ===== Analysis panel ===== */
.analysis-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.analysis-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.analysis-header h3 { font-size: 16px; }
.analysis-state { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.analysis-state.idle { background: var(--surface-3); color: var(--text-3); }
.analysis-state.scanning { background: var(--accent-soft); color: var(--accent); }
.analysis-state.done { background: var(--ok-soft); color: var(--ok); }
.analysis-body { padding: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-card .label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.element-list { display: flex; flex-direction: column; gap: 10px; }
.element-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.element-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.element-item .type-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.element-item .name { font-weight: 600; color: var(--text); font-size: 14px; }
.element-item .sub { font-size: 12px; color: var(--text-3); }
.element-item .badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.badge.high { background: var(--danger-soft); color: var(--danger); }
.badge.medium { background: var(--warn-soft); color: var(--warn); }
.badge.low { background: var(--ok-soft); color: var(--ok); }
.element-count { font-size: 13px; color: var(--text-3); }
.has-elements .element-list { display: flex; }

/* ===== Progress ===== */
.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.progress-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg,#4F46E5,#7C3AED); transition: width .25s var(--ease); }
.progress-overlay { display: none; position: fixed; inset: 0; background: rgba(247,247,245,.72); backdrop-filter: blur(3px); z-index: 200; align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
.progress-overlay.show { display: flex; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--accent-soft-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Upsell / cross-rec ===== */
.upsell-inline { background: linear-gradient(135deg,#EEF2FF,#F5F3FF); border: 1px solid var(--accent-soft-2); border-radius: var(--radius); padding: 20px; margin-top: 18px; }
.upsell-header { font-weight: 800; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.upsell-note { font-size: 13.5px; color: var(--text-2); margin-bottom: 14px; }
.upsell-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upsell-compare { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.upsell-compare.free { border-color: var(--border); }
.upsell-compare.pro { border-color: var(--accent); background: var(--accent-soft); }
.upsell-compare .tier { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.upsell-compare.pro .tier { color: var(--accent); }
.upsell-compare .desc { font-size: 13px; color: var(--text-2); margin: 6px 0 12px; }
.upsell-cta { display: inline-block; width: 100%; text-align: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; padding: 11px; border-radius: 9px; transition: background .15s; }
.upsell-cta:hover { background: var(--accent-hover); }

.cross-rec { margin-top: 24px; }
.cross-rec-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.cross-rec .related-card, .flowsync-rec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: all .18s var(--ease); }
.cross-rec .related-card:hover, .flowsync-rec:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ===== Actions / download ===== */
.actions-section { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.action-btn { flex: 1; min-width: 140px; text-align: center; font-family: inherit; font-size: 14px; font-weight: 600; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .15s; }
.action-btn:hover { background: var(--surface-3); }
.action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-btn.primary:hover { background: var(--accent-hover); }
.action-btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.download-bar { margin-top: 16px; height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.download-bar-inner { height: 100%; width: 0; background: linear-gradient(90deg,#059669,#10B981); transition: width .2s; }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; font-size: 14px; padding: 12px 20px; border-radius: 11px; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); z-index: 300; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 28px 0; font-size: 12px; color: var(--text-3); text-align: center; }

/* ===== state helpers ===== */
.ok { color: var(--ok); } .warn { color: var(--warn); } .error, .danger { color: var(--danger); } .info { color: var(--accent); } .success { color: var(--ok); }
.primary { color: var(--accent); } .free { color: var(--text-3); } .pro { color: var(--accent); } .active { color: var(--accent); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.sub { color: var(--text-3); font-size: 13px; } .desc { color: var(--text-3); font-size: 13px; } .label { color: var(--text-2); font-weight: 600; }
.fill { width: 100%; } .show { display: block; } .icon { color: var(--accent); }
@media (max-width: 760px) { .capability-strip, .stat-grid, .cross-rec-row, .upsell-col { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
