/* ============================================================
   AI 投标技术方案生成工作台 — 企业办公风格样式
   主色深蓝 / 浅灰背景 / 白色内容区 / 绿=成功 / 黄=等待 / 红=风险
   ============================================================ */
:root {
  --primary: #1d4f91;
  --primary-dark: #163c6d;
  --primary-light: #e8f0fa;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9aa3af;
  --success: #178a4e;
  --success-bg: #e8f7ef;
  --warning: #b45309;
  --warning-bg: #fdf3e3;
  --danger: #c53030;
  --danger-bg: #fdecec;
  --info: #1d4f91;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 36, 64, .08), 0 1px 2px rgba(16, 36, 64, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-width: 960px;
}

/* ---------- 顶部导航 ---------- */
.topbar { background: var(--primary-dark); color: #fff; }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; background: none; border: none; color: #fff; cursor: pointer; padding: 0; text-align: left; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 8px; background: #fff; color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none;
}
.brand-name { display: block; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { display: block; font-size: 12px; color: #bcd2ee; margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.mode-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.mode-demo { background: var(--warning-bg); color: var(--warning); }
.mode-real { background: #e3f2e8; color: var(--success); }

.demo-banner {
  background: var(--warning-bg); color: #7c4a03; border-bottom: 1px solid #f3ddb8;
  padding: 8px 24px; text-align: center; font-size: 13px;
}
.demo-banner strong { color: #92400e; margin-right: 8px; }

/* ---------- 布局 ---------- */
.container { max-width: 1180px; margin: 24px auto 48px; padding: 0 24px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 24px;
}
.card + .card { margin-top: 16px; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--primary); border-color: #c7d6e8; }
.btn-secondary:hover:not(:disabled) { background: var(--primary-light); }
.btn-ghost { background: transparent; color: #dbe7f5; border-color: transparent; }
.topbar .btn-ghost { color: #cfe0f2; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a52828; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #126f3e; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--primary); padding: 0; font-size: 13px; cursor: pointer; text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

/* ---------- 标题 ---------- */
.page-title { font-size: 22px; font-weight: 700; margin: 0; }
.page-desc { color: var(--text-2); margin: 6px 0 0; font-size: 14px; }
.section-title { font-size: 16px; font-weight: 700; margin: 0; }
.section-sub { color: var(--text-2); font-size: 13px; margin: 4px 0 0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; }
.label-req { color: var(--danger); margin-left: 3px; }
.label-opt { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 6px; }
.input, .textarea {
  width: 100%; border: 1px solid #ccd5e0; border-radius: 8px; padding: 9px 12px;
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,79,145,.12); }
.textarea { resize: vertical; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field-hint { color: var(--text-3); font-size: 12px; margin-top: 5px; }

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-no_file, .badge-no_requirements { background: var(--warning-bg); color: var(--warning); }
.badge-ready { background: var(--primary-light); color: var(--primary); }
.badge-generating { background: var(--primary-light); color: var(--primary); }
.badge-generating::before { animation: pulse 1.2s infinite; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-failed { background: var(--danger-bg); color: var(--danger); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- 步骤导航 ---------- */
.steps { display: flex; align-items: flex-start; margin: 20px 0 4px; }
.step { flex: 1; text-align: center; position: relative; }
.step .dot {
  width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #c7d2e0;
  color: var(--text-3); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; position: relative; z-index: 1;
}
.step .label { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.step.active .dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.step.active .label { color: var(--primary); font-weight: 600; }
.step.done .dot { border-color: var(--success); background: var(--success); color: #fff; }
.step.done .label { color: var(--success); }
.step::before {
  content: ""; position: absolute; top: 15px; left: calc(-50% + 15px); right: calc(50% + 15px);
  height: 2px; background: #d7e0ec; z-index: 0;
}
.step:first-child::before { display: none; }
.step.done::before, .step.active::before { background: var(--primary); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-2); font-weight: 600; font-size: 12.5px; background: #f8fafc; }
tbody tr:hover { background: #f8fafc; }
td .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.proj-name-link { color: var(--primary); font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; font-size: 14px; text-align: left; }
.proj-name-link:hover { text-decoration: underline; }
.file-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-link { color: var(--success); text-decoration: none; font-size: 12.5px; }
.doc-link:hover { text-decoration: underline; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700;
}
.empty h2 { margin: 16px 0 6px; font-size: 18px; }
.empty p { color: var(--text-2); margin: 0 0 20px; }

/* ---------- 上传区 ---------- */
.upload-zone {
  border: 2px dashed #c3d0e0; border-radius: var(--radius); background: #fafcfe;
  padding: 34px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone .uz-title { font-size: 15px; font-weight: 600; }
.upload-zone .uz-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.upload-zone.uploading { pointer-events: none; opacity: .7; }

.file-card {
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; background: #fbfdff;
}
.file-icon {
  width: 42px; height: 42px; border-radius: 8px; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none;
}
.file-name { font-weight: 600; word-break: break-all; }
.file-meta { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.file-status-ok { color: var(--success); font-weight: 600; }
.file-status-err { color: var(--danger); font-weight: 600; }

/* ---------- 快捷要求 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1px solid #c7d6e8; background: #fff; color: var(--primary); border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; transition: background .15s;
}
.chip:hover { background: var(--primary-light); }
.chip.added { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 提示条 ---------- */
.alert { border-radius: 8px; padding: 12px 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert-warn { background: var(--warning-bg); color: #7c4a03; border-color: #f3ddb8; }
.alert-danger { background: var(--danger-bg); color: #922; border-color: #f3cccc; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border-color: #cfe0f2; }
.alert-success { background: var(--success-bg); color: #0f5c36; border-color: #c6e6d3; }
.alert strong { display: block; margin-bottom: 2px; }

/* ---------- 摘要 ---------- */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.summary-table td:first-child { color: var(--text-2); width: 130px; font-weight: 600; }
.summary-table tr:last-child td { border-bottom: none; }
.summary-req { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; max-height: 180px; overflow: auto; }

/* ---------- 进度 ---------- */
.progress-card { text-align: center; padding: 40px 24px; }
.spinner {
  width: 44px; height: 44px; border: 4px solid #d7e0ec; border-top-color: var(--primary);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.elapsed { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); font-size: 16px; }

.timeline { margin: 20px auto 0; max-width: 560px; text-align: left; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: #d7e0ec;
}
.tl-item:last-child::before { display: none; }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c7d2e0; background: #fff; flex: none; margin-top: 3px; }
.tl-item.done .tl-dot { background: var(--success); border-color: var(--success); }
.tl-item.active .tl-dot { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px rgba(29,79,145,.18); }
.tl-item.done .tl-text { color: var(--text-2); }
.tl-item.active .tl-text { font-weight: 700; }
.tl-text { font-size: 13.5px; }

.log-box {
  border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; padding: 10px 14px;
  max-height: 160px; overflow: auto; font-size: 12.5px; color: var(--text-2); text-align: left;
}
.log-box .log-warn { color: var(--warning); }
.log-box .log-error { color: var(--danger); }

/* ---------- 成功 / 失败 ---------- */
.result-icon { width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; color: #fff; }
.result-icon.success { background: var(--success); }
.result-icon.failed { background: var(--danger); }
.result-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.result-sub { color: var(--text-2); margin: 0 0 20px; }
.url-box {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; background: #f8fafc; font-size: 13px; word-break: break-all;
}
.url-box .url { flex: 1; color: var(--primary); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 360px; animation: slideIn .2s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warning); }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--text-3); font-size: 12px; padding: 18px 24px 28px; }

/* ---------- 模态 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 30, 50, .45); display: flex; align-items: center; justify-content: center; z-index: 90; }
.modal { background: #fff; border-radius: 12px; max-width: 560px; width: 92%; padding: 24px; box-shadow: 0 12px 40px rgba(0,0,0,.2); max-height: 80vh; overflow: auto; }
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-top: 16px; }
.tab {
  border: none; background: none; padding: 9px 18px; font-size: 14px; font-weight: 600;
  color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .cnt {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: #eef2f7; color: var(--text-2); font-size: 12px; margin-left: 6px;
}
.tab.active .cnt { background: var(--primary-light); color: var(--primary); }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0 0; }
.filter-bar label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.filter-bar .input { width: 150px; padding: 5px 10px; font-size: 13px; }

/* ---------- 导出菜单 ---------- */
.export-menu { position: relative; display: inline-block; }
.export-menu summary { list-style: none; cursor: pointer; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-menu[open] .export-pop { display: block; }
.export-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(16,36,64,.12);
  min-width: 150px; padding: 4px;
}
.export-pop a {
  display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px;
}
.export-pop a:hover { background: var(--primary-light); color: var(--primary); }

/* ---------- 回收目录页 ---------- */
.trash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.trash-actions { display: flex; gap: 10px; }
.recycle-icon { width: 58px; height: 58px; border-radius: 50%; background: #eef2f7; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; }