/* ========== 投标全流程管理平台 - 大气企业风格 ========== */
:root {
  --primary: #1e3a5f;
  --primary-light: #2d5a8e;
  --accent: #e8a33d;
  --bg: #f0f4f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: linear-gradient(180deg, #16283f 0%, #1e3a5f 100%);
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--text-light); }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  box-shadow: 2px 0 20px rgba(0,0,0,0.15);
}
.logo {
  padding: 24px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), #f5c15e);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(232,163,61,0.4);
}
.logo-name { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.logo-sub { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 2px; margin-top: 2px; }

.nav { flex: 1; padding: 16px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  transition: all 0.2s;
  margin-bottom: 4px;
  font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, var(--accent), #d98e1f);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(232,163,61,0.35);
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.server-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,0.6); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: #4ade80; box-shadow: 0 0 8px #4ade80; }

/* ===== 主区域 ===== */
.main { flex: 1; margin-left: 220px; padding: 0; }
.topbar {
  background: var(--card);
  padding: 16px 28px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.page-title { font-size: 20px; font-weight: 700; }
.date-display { color: var(--text-light); font-size: 13px; }
.content { padding: 24px 28px; }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(15,23,42,0.12); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.stat-icon.blue { background: #e0edff; }
.stat-icon.orange { background: #fff1e0; }
.stat-icon.green { background: #e3f7e9; }
.stat-icon.purple { background: #f0e6ff; }
.stat-icon.cyan { background: #e0f7fa; }
.stat-num { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ===== 双栏 ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 10px 12px;
  font-size: 12px; color: var(--text-light);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.table tr:hover td { background: #f8fafc; }
.table .empty { text-align: center; color: var(--text-light); padding: 30px; }

/* 状态标签 */
.status-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.status-badge.s-立项 { background: #e2e8f0; color: #334155; }
.status-badge.s-报名 { background: #dbeafe; color: #1d4ed8; }
.status-badge.s-标书编制 { background: #fef3c7; color: #92400e; }
.status-badge.s-已投标 { background: #ede9fe; color: #6d28d9; }
.status-badge.s-已中标 { background: #dcfce7; color: #15803d; }
.status-badge.s-未中标 { background: #fee2e2; color: #b91c1c; }
.status-badge.s-已放弃 { background: #f1f5f9; color: #64748b; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none;
  box-shadow: 0 2px 8px rgba(30,58,95,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); transform: translateY(-1px); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }

/* ===== 输入框 ===== */
.input {
  padding: 9px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px;
  width: 100%; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(45,90,142,0.1); }
.input-sm { width: 160px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; flex: 1; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.form-row { display: flex; gap: 14px; }
.hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ===== 状态条 ===== */
.status-bars { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.status-bar-item { display: flex; align-items: center; gap: 10px; }
.status-bar-label { width: 70px; font-size: 13px; color: var(--text); text-align: right; }
.status-bar-track { flex: 1; height: 18px; background: #f1f5f9; border-radius: 10px; overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary-light), var(--accent)); transition: width 0.5s; }
.status-bar-num { width: 30px; font-size: 13px; font-weight: 700; }

/* ===== 采集 ===== */
.collect-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.collect-form .input { flex: 1; min-width: 150px; }
.collect-result {
  margin-top: 12px; padding: 12px 16px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; color: #15803d; font-size: 13px;
  display: none;
}
.collect-result.error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ===== AI ===== */
.ai-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.ai-chat-card { display: flex; flex-direction: column; height: calc(100vh - 150px); }
.ai-chat { flex: 1; overflow-y: auto; padding: 20px; background: #f8fafc; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.msg-bubble {
  max-width: 80%; padding: 12px 16px;
  border-radius: 14px; font-size: 13.5px; line-height: 1.7;
}
.msg-bubble.bot {
  background: #fff; border: 1px solid var(--border);
  border-top-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.msg-bubble.user {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border-top-right-radius: 4px;
}
.ai-input {
  display: flex; gap: 10px; padding: 14px;
  border-top: 1px solid var(--border); background: #fff;
}
.ai-input textarea {
  flex: 1; resize: none; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none;
}
.ai-input textarea:focus { border-color: var(--primary-light); }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.ok { background: #dcfce7; color: #15803d; }
/* 上传区域 */
.upload-area {
  border: 2px dashed var(--primary-light, #3b82f6);
  border-radius: 10px;
  padding: 22px 15px;
  text-align: center;
  cursor: pointer;
  background: rgba(59,130,246,0.04);
  transition: all 0.25s;
  margin-bottom: 6px;
}
.upload-area:hover, .upload-area.dragging {
  background: rgba(59,130,246,0.1);
  border-color: var(--primary, #1d4ed8);
}
.upload-icon { font-size: 30px; margin-bottom: 6px; }
.upload-text { font-size: 14px; color: var(--text, #333); font-weight: 500; }
.upload-hint { font-size: 12px; color: #999; margin-top: 5px; }
.file-name {
  background: #e8f4fd;
  border: 1px solid #b3d9f2;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #1d4ed8;
  margin: 8px 0;
}
.analyze-result {
  margin-top: 12px; padding: 14px;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; line-height: 1.8;
  white-space: pre-wrap; max-height: 300px; overflow-y: auto;
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal {
  background: #fff; border-radius: 16px;
  width: 640px; max-width: 95vw; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 迷你列表 */
.mini-list { max-height: 260px; overflow-y: auto; }
.mini-item { padding: 8px 4px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.mini-item:last-child { border-bottom: none; }
.mini-item a { color: var(--primary-light); text-decoration: none; }
.mini-item a:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--text-light); padding: 20px; }

/* 操作按钮 */
.action-btn {
  background: none; border: none; cursor: pointer;
  font-size: 15px; padding: 4px 6px; border-radius: 6px;
  transition: background 0.2s;
}
.action-btn:hover { background: #f1f5f9; }
.action-btn.edit { color: var(--primary-light); }
.action-btn.del { color: var(--danger); }

/* 响应式 */
@media (max-width: 1100px) {
  .dash-grid, .ai-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .logo-text, .nav-item span:not(.nav-icon), .sidebar-footer .server-status span { display: none; }
  .nav-item { justify-content: center; }
  .main { margin-left: 64px; }
  .logo { justify-content: center; padding: 16px 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .header-actions { flex-wrap: wrap; }
}

/* AI 读图 */
.btn-warn { background: linear-gradient(135deg,#d97706,#b45309); color:#fff; }
.btn-warn:hover { box-shadow:0 3px 10px rgba(217,119,6,.35); }
.info-table { width:100%; border-collapse:collapse; font-size:13px; }
.info-table td { padding:6px 8px; border-bottom:1px solid #eef1f6; vertical-align:top; }
.info-table td:first-child { width:86px; color:#64748b; font-weight:600; white-space:nowrap; }
.info-table tr:hover td { background:#f8fafc; }
