/* InfoseekAI 报告助手 — 科技感主题，对齐 infoseek 平台风格 */

:root {
  --nav-bg: #0b1628;
  --nav-border: rgba(255, 255, 255, 0.06);
  --sidebar-bg: #ffffff;
  --page-bg: #e8ecf3;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.92);
  --text: #1a2332;
  --muted: #6b7a90;
  --border: #dde3ed;
  --border-glow: rgba(59, 130, 246, 0.35);

  --brand: #3b82f6;
  --brand-hover: #2563eb;
  --brand-soft: rgba(59, 130, 246, 0.1);
  --cyan: #06b6d4;
  --purple: #8b5cf6;
  --green: #10b981;
  --orange: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 12px;
  --shadow: 0 4px 24px rgba(11, 22, 40, 0.08);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --mono: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── 顶栏 ── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 28px; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  font-style: italic;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-dot { color: #3b82f6; }

.topnav { display: flex; gap: 4px; }

.topbar-module {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.25);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.4);
  font-weight: 600;
}

.topnav-item {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.topnav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.topnav-item.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.25);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.user-chip {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

.topbar-btn {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-btn.accent {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ── 布局 ── */
.layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 52px);
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: 56px; }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.sidebar-head-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 0.2s;
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  color: var(--muted);
}

.sidebar-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.toggle-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.25s;
  display: block;
}

.sidebar.collapsed .toggle-icon { transform: rotate(180deg); }

.sidebar.collapsed .sidebar-head {
  justify-content: center;
  padding: 14px 8px 10px;
}

.sidebar.collapsed .sidebar-head-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-section { padding: 8px 8px 0; margin-bottom: 8px; }

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-title:hover {
  background: rgba(59, 130, 246, 0.06);
  color: var(--brand);
}

.sidebar-title-text { white-space: nowrap; }

.accordion-icon {
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sidebar-accordion:not(.expanded) .accordion-icon { transform: rotate(-90deg); }

.sidebar-panel {
  max-height: 320px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s;
  opacity: 1;
}

.sidebar-accordion:not(.expanded) + .sidebar-panel {
  max-height: 0;
  opacity: 0;
}

.sidebar.collapsed .sidebar-title {
  justify-content: center;
  padding: 6px 4px;
}

.sidebar.collapsed .sidebar-title-text,
.sidebar.collapsed .accordion-icon {
  display: none;
}

.sidebar.collapsed .sidebar-accordion:not(.expanded) + .sidebar-panel {
  max-height: 320px;
  opacity: 1;
}

.sidebar-menu { list-style: none; }

.sidebar-menu li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, padding 0.25s;
  border-left: 3px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.sidebar-label {
  transition: opacity 0.2s, width 0.2s;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-label { opacity: 0; width: 0; }

.sidebar.collapsed .sidebar-menu li {
  justify-content: center;
  padding: 9px 6px;
  gap: 0;
}

.sidebar.collapsed .sidebar-menu li.active {
  padding-left: 6px;
}

.sidebar.collapsed .sidebar-menu li .si {
  font-size: 16px;
  opacity: 1;
}

.sidebar-menu li:hover:not(.active) {
  background: rgba(59, 130, 246, 0.06);
  color: var(--brand);
}

.sidebar-menu li:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.sidebar-menu li .si { font-size: 14px; opacity: 0.7; }

.sidebar-menu li.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), transparent);
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
  padding-left: 9px;
}

#sidebarQuick li { color: var(--muted); font-size: 12px; }
#sidebarQuick li.active {
  color: var(--brand);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
  border-left-color: var(--green);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

.sidebar.collapsed .sidebar-footer { padding: 12px 8px; }

.sys-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.sidebar.collapsed .sys-status {
  justify-content: center;
  gap: 0;
}

.sys-status-text {
  transition: opacity 0.2s;
}

.sidebar.collapsed .sys-status-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    var(--page-bg);
  background-size: 24px 24px, 24px 24px, auto;
}

.breadcrumb {
  padding: 14px 24px 0;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--brand); font-weight: 600; }

/* ── 功能卡片 ── */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 24px 0;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.hero-card.blue::before { background: linear-gradient(180deg, #3b82f6, #60a5fa); }
.hero-card.purple::before { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
.hero-card.cyan::before { background: linear-gradient(180deg, #06b6d4, #22d3ee); }
.hero-card.green::before { background: linear-gradient(180deg, #10b981, #34d399); }

.hero-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.hero-card.blue .hero-icon { background: rgba(59, 130, 246, 0.12); }
.hero-card.purple .hero-icon { background: rgba(139, 92, 246, 0.12); }
.hero-card.cyan .hero-icon { background: rgba(6, 182, 212, 0.12); }
.hero-card.green .hero-icon { background: rgba(16, 185, 129, 0.12); }

.hero-card strong { display: block; font-size: 13px; font-weight: 700; }
.hero-card small { font-size: 11px; color: var(--muted); }

/* ── 工作流步骤 ── */
.workflow {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 24px 0;
  margin-bottom: 4px;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.25s;
}

.workflow-step.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(6, 182, 212, 0.06));
  box-shadow: var(--shadow-glow);
}

.workflow-step.done {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.06);
}

.wf-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.workflow-step.done .wf-num { color: var(--green); background: rgba(16, 185, 129, 0.12); }

.wf-label { font-size: 12px; font-weight: 600; white-space: nowrap; }

.workflow-line {
  flex: 1;
  height: 2px;
  min-width: 24px;
  background: linear-gradient(90deg, var(--border), rgba(59, 130, 246, 0.3), var(--border));
  margin: 0 8px;
}

/* ── 主内容 ── */
.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 24px 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  border-color: rgba(221, 227, 237, 0.8);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.card h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-head h2 { margin-bottom: 0; }

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse-dot 1.5s infinite;
}

.report-date {
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
  white-space: nowrap;
}

.hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

/* ── 表单 ── */
.upload-primary-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.field-data {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.field-template-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}

.field-template-panel > label:first-child {
  margin-bottom: 6px;
}

.field-template-panel .field-hint {
  margin-top: 6px;
  margin-bottom: 0;
}

.template-override {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.template-override-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.template-override-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.template-override-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: #eef2f7;
  padding: 2px 8px;
  border-radius: 999px;
}

.word-upload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.word-upload-bar:hover,
.word-upload-bar.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-glow);
}

.word-upload-bar input[type="file"] { display: none; }

.word-upload-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.word-upload-desc {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  text-align: left;
}

.file-select-btn-sm {
  margin-top: 0;
  padding: 5px 12px;
  font-size: 11px;
  flex-shrink: 0;
}

.template-override .file-name {
  margin-top: 6px;
  text-align: left;
  min-height: 14px;
}

.file-drop-main {
  flex: 1;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-config-row {
  padding-top: 4px;
  border-top: 1px solid #eef2f7;
}

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

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.required { color: var(--danger); }
.optional { color: var(--muted); font-weight: 400; font-size: 11px; }
.field-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

.tech-input,
.field input,
.field select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  background: #fafbfc;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tech-input:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: #fff;
}

.file-drop {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: #fafbfc;
}

.file-drop.tech-drop:hover,
.file-drop.tech-drop.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-glow);
}

.file-drop input[type="file"] { display: none; }
.file-drop-text, .file-name { pointer-events: none; }

.file-icon-wrap {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.file-icon { font-size: 22px; }
.file-drop-text span { display: block; font-size: 13px; }
.file-drop-text small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.file-name {
  margin-top: 8px;
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  min-height: 16px;
}

.file-name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  text-align: left;
}

.file-count {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.file-name-tag {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  word-break: break-all;
}

.file-select-btn {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.15s;
}

.file-select-btn:hover {
  background: var(--brand);
  color: #fff;
}

/* ── 统计周期日历 ── */
.period-field { position: relative; }
.period-picker { position: relative; }

.period-trigger {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.period-trigger:hover,
.period-picker:focus-within .period-trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: #fff;
}

.period-trigger-icon { font-size: 16px; }
.period-trigger-body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.period-trigger-text { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.period-trigger-sub { font-size: 10px; color: var(--muted); }
.period-trigger-arrow { color: var(--muted); font-size: 11px; }

.period-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 120;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(11, 22, 40, 0.15);
  padding: 14px;
}

.period-dropdown[hidden] { display: none !important; }

.period-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.period-preset {
  border: 1px solid var(--border);
  background: #fafbfc;
  color: var(--text);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.period-preset:hover { border-color: var(--brand); color: var(--brand); }
.period-preset.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.period-custom-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.period-date-input label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.period-date-input input[type="date"] { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font-size: 12px; }
.period-sep { padding-bottom: 8px; color: var(--muted); font-size: 12px; }

.period-calendar {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fafbfc;
  margin-bottom: 12px;
}

.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-month { font-size: 13px; font-weight: 700; }
.cal-nav {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
}
.cal-nav:hover { border-color: var(--brand); color: var(--brand); }

.cal-weekdays, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-weekdays { margin-bottom: 4px; }
.cal-weekdays span { text-align: center; font-size: 10px; color: var(--muted); font-weight: 600; }

.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
}

.cal-day:hover:not(.muted) { background: var(--brand-soft); color: var(--brand); }
.cal-day.muted { color: #cbd5e1; background: transparent; cursor: default; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--brand); }
.cal-day.in-range { background: rgba(59, 130, 246, 0.15); color: var(--brand); border-radius: 3px; }
.cal-day.range-start, .cal-day.range-end { background: var(--brand); color: #fff; font-weight: 700; }

.cal-hint { margin-top: 8px; font-size: 10px; color: var(--muted); text-align: center; }
.period-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-glow {
  position: relative;
}

.btn-glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(6, 182, 212, 0.3));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-glow:hover::after { opacity: 1; }

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn-lg { padding: 12px 24px; font-size: 14px; }

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}

.btn-sm:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ── 进度条 ── */
.progress-panel {
  margin-top: 20px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), rgba(6, 182, 212, 0.03));
  border-radius: var(--radius);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.tech-progress .progress-title { color: var(--brand); }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-title { font-weight: 600; font-size: 13px; }

.progress-timer {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  font-weight: 700;
}

.progress-bar-wrap {
  height: 4px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #3b82f6);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-steps { list-style: none; display: grid; gap: 6px; }

.progress-steps li {
  font-size: 12px;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
}

.progress-steps li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: #cbd5e1;
  font-size: 10px;
}

.progress-steps li.active { color: var(--text); font-weight: 600; }
.progress-steps li.active::before { content: "◉"; color: var(--brand); }
.progress-steps li.done { color: var(--green); }
.progress-steps li.done::before { content: "✓"; color: var(--green); }

/* ── 统计卡片 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-item {
  position: relative;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
  background: #fafbfc;
  overflow: hidden;
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand);
}

.stat-item.negative::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-item.positive::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-item.neutral::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

.stat-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand);
}

.stat-item.negative .stat-value { color: var(--danger); }
.stat-item.positive .stat-value { color: var(--green); }
.stat-item.neutral .stat-value { color: var(--muted); }

.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.timings-info { margin-top: 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); }

.warnings { margin-top: 12px; }

.warning-item {
  font-size: 12px;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 6px;
}

/* ── 图表 ── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head h2 { margin-bottom: 0; font-size: 16px; }
.chart-actions { display: flex; gap: 6px; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.chart-card {
  background: #fafbfc;
  border-radius: var(--radius);
  border: 2px solid transparent;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.chart-card:hover { border-color: rgba(59, 130, 246, 0.3); }

.chart-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-glow);
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px 0;
}

.chart-card-header input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.chart-card-title { font-size: 13px; font-weight: 700; }
.chart-card-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }

.chart-card img {
  width: 100%;
  min-height: 110px;
  padding: 8px;
  display: block;
  background: #fff;
  object-fit: contain;
}

/* ── 分析 ── */
.analysis-sections { display: flex; flex-direction: column; gap: 16px; }

.analysis-block h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 6px;
}

.analysis-block h3::before {
  content: "";
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--brand), var(--cyan));
  border-radius: 2px;
}

.analysis-block textarea {
  width: 100%;
  min-height: 110px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  font-family: inherit;
  transition: all 0.15s;
}

.analysis-block textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: #fff;
}

/* ── 导出 ── */
.export-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.format-option { cursor: pointer; }
.format-option input { display: none; }

.format-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  background: #fafbfc;
}

.format-icon { font-size: 24px; }

.format-option input:checked + .format-box {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-glow);
}

.format-box strong { display: block; font-size: 14px; margin-bottom: 2px; }
.format-box small { color: var(--muted); font-size: 11px; }

.export-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.export-hint { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ── 页脚 ── */
.footer {
  text-align: center;
  padding: 16px 24px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── 弹窗 ── */
.modal[hidden] { display: none !important; }

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

#authModal {
  z-index: 600;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 40, 0.55);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(11, 22, 40, 0.2);
}

.glass-modal {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
}

.modal-wide { width: min(920px, 100%); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: #f1f5f9;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
}

.modal-close:hover { background: #e2e8f0; color: var(--text); }

.modal-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── 模板管理 ── */
.template-list { list-style: none; display: grid; gap: 8px; }

.template-list li {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fafbfc;
  transition: border-color 0.15s;
}

.template-list li:hover { border-color: var(--brand); }

.template-list .tpl-meta small { color: var(--muted); display: block; margin-top: 2px; font-size: 11px; }

.template-list .badge-sys {
  font-size: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.custom-tpl-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.builder-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-bottom: 16px;
}

.builder-col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.builder-col-head h3 { font-size: 14px; font-weight: 700; }
.builder-col-head small { font-size: 11px; color: var(--muted); }

.element-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow: auto;
  padding: 2px;
}

.element-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.element-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.element-card-preview {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  line-height: 0;
}

.element-card-preview svg { width: 100%; height: 68px; display: block; }

.element-card-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.element-card-body strong { font-size: 12px; }
.element-card-body small { font-size: 10px; color: var(--muted); line-height: 1.35; }

.element-type-badge {
  align-self: flex-start;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.selected-elements-list {
  list-style: none;
  border: 1px dashed var(--border);
  border-radius: 10px;
  min-height: 260px;
  max-height: 400px;
  overflow: auto;
  padding: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-elements-list .empty-hint {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 32px 12px;
}

.selected-element-card {
  display: grid;
  grid-template-columns: 26px 80px 1fr 26px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
}

.selected-order {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
}

.selected-preview {
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.selected-preview svg { width: 100%; height: 48px; display: block; }

.selected-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.selected-meta strong { font-size: 12px; }
.selected-meta small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.selected-remove {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
}

.selected-remove:hover { background: rgba(239, 68, 68, 0.15); }

.chart-select-panel {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  background: var(--brand-soft);
}

.chart-select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chart-select-head h3 { font-size: 13px; font-weight: 700; }

.chart-select-grid,
.default-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chart-select-card,
.chart-picker-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
}

.chart-select-card { border: none; padding: 0; text-align: left; }

.chart-select-card:hover,
.chart-picker-card:hover { border-color: var(--brand); }

.chart-picker-card input { display: none; }

.chart-picker-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.chart-picker-preview {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  line-height: 0;
}

.chart-picker-preview svg { width: 100%; height: 72px; display: block; }

.chart-picker-info,
.chart-select-card strong { padding: 6px 8px 2px; font-size: 11px; display: block; }

.chart-picker-info small,
.chart-select-card small {
  display: block;
  padding: 0 8px 8px;
  font-size: 9px;
  color: var(--muted);
}

.default-charts-section { margin-bottom: 14px; }

/* ── 响应式 ── */
@media (max-width: 1100px) {
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 52px;
    bottom: 0;
    z-index: 90;
    box-shadow: 4px 0 24px rgba(11, 22, 40, 0.12);
    transform: translateX(0);
    transition: transform 0.25s, width 0.25s;
  }
  .sidebar.collapsed {
    transform: translateX(calc(-100% + 56px));
    width: 56px;
  }
  .layout { position: relative; }
  .form-grid,
  .form-grid.three-col,
  .upload-primary-grid,
  .charts-grid,
  .charts-grid.selectable,
  .export-options,
  .stats-grid { grid-template-columns: 1fr; }
  .workflow { flex-wrap: wrap; gap: 8px; }
  .workflow-line { display: none; }
}

@media (max-width: 700px) {
  .hero-cards { grid-template-columns: 1fr; }
  .builder-layout,
  .custom-tpl-form,
  .element-catalog-grid,
  .chart-select-grid,
  .default-charts-grid { grid-template-columns: 1fr; }
  .selected-element-card { grid-template-columns: 22px 68px 1fr 22px; }
  .upload-primary-grid { grid-template-columns: 1fr; }
  .file-drop-main { min-height: 160px; }
  .field-template-panel { padding: 12px 14px; }
  .period-dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    max-height: calc(100vh - 24px);
    overflow: auto;
  }
}

/* ── 登录门禁 ── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 22, 40, 0.72);
  backdrop-filter: blur(8px);
}

.auth-gate[hidden] { display: none !important; }

.auth-gate-card {
  width: min(440px, 100%);
  padding: 36px 32px 28px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 64px rgba(11, 22, 40, 0.35);
}

.auth-gate-brand .logo-mark.lg {
  width: 52px;
  height: 52px;
  font-size: 26px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.auth-gate-brand h1 {
  margin: 0 0 10px;
  font-size: 22px;
  color: var(--text);
}

.auth-gate-brand p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0 12px;
}

.auth-gate-note {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.app-shell.app-locked .layout,
.app-shell.app-locked .topbar {
  pointer-events: none;
  user-select: none;
}

.app-shell.app-locked {
  filter: blur(3px);
}

.auth-modal-panel { width: min(400px, 100%); }

.auth-modal-desc {
  margin: -4px 0 16px;
  font-size: 12px;
  color: var(--muted);
}

.auth-error {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
}

.auth-switch {
  margin: 14px 0 0;
  text-align: center;
}

.link-btn {
  border: none;
  background: none;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover { color: #1d4ed8; }

.chart-img-wrap {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

.chart-img-wrap.chart-img-error { color: #dc2626; }

.chart-card img {
  width: 100%;
  display: block;
  border-top: 1px solid var(--border);
}

/* ── 导出中心 ── */
.modal-export {
  width: min(1100px, 96vw);
  max-height: 92vh;
  height: min(820px, 92vh);
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.export-center-head {
  margin-bottom: 16px;
  padding-right: 36px;
  flex-shrink: 0;
}

.export-center-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.export-center-head .hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.export-center-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.export-history-panel,
.export-preview-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.export-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.export-count {
  font-size: 12px;
  color: var(--muted);
}

.export-history-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.export-history-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.export-history-item:hover {
  background: #fff;
  border-color: #e2e8f0;
}

.export-history-item.active {
  background: #eff6ff;
  border-color: #93c5fd;
}

.export-history-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.export-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}

.export-item-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.export-fmt {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
}

.export-missing {
  color: #dc2626;
  margin-left: 4px;
}

.export-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.export-error { color: #dc2626; }

.export-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.export-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-break: break-all;
}

.export-preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.export-preview-meta {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.export-preview-frame-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e2e8f0;
}

.export-preview-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #fff;
}

.export-preview-scroll.is-pdf {
  overflow: hidden;
}

.export-preview-scroll.is-pdf iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: none;
  background: #fff;
}

.export-preview-scroll.is-html {
  overflow-y: auto;
}

.export-preview-doc {
  padding: 24px 32px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1a2332;
  line-height: 1.8;
}

.export-preview-doc h2,
.export-preview-doc h3 {
  color: #2563eb;
  margin: 1.2em 0 0.5em;
}

.export-preview-doc p {
  margin: 0.4em 0;
  font-size: 14px;
}

.export-preview-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.export-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.export-preview-placeholder .preview-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.export-preview-placeholder p {
  margin: 0 0 6px;
  font-size: 14px;
}

.export-preview-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

@media (max-width: 860px) {
  .export-center-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .modal-export {
    height: min(92vh, 92vh);
  }

  .export-history-panel {
    max-height: 200px;
  }

  .export-preview-placeholder {
    min-height: 240px;
  }
}
