/* ─── 设计 Token ─────────────────────────────────────────── */
:root {
  --primary:       #2563EB;
  --primary-dark:  #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-muted: #BFDBFE;
  --accent:        #0EA5E9;
  --success:       #10B981;
  --success-light: #D1FAE5;
  --warning:       #F59E0B;
  --warning-light: #FEF3C7;
  --danger:        #EF4444;
  --danger-light:  #FEE2E2;

  --bg:            #F8FAFC;
  --surface:       #FFFFFF;
  --surface-2:     #F1F5F9;
  --border:        #E2E8F0;
  --border-focus:  #93C5FD;

  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;

  --sidebar-w:     260px;
  --header-h:      60px;

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.12);

  --font: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: .18s ease;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary);
       line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   登录页
══════════════════════════════════════════════════════════ */
.login-page { display: flex; min-height: 100vh; }

.login-brand {
  flex: 0 0 42%;
  background: linear-gradient(135deg, #1E40AF 0%, #0EA5E9 100%);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 60px 56px; color: #fff; position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.08) 0%, transparent 50%),
              radial-gradient(circle at 15% 85%, rgba(255,255,255,.05) 0%, transparent 50%);
}
.login-brand-logo { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 12px; position: relative; }
.login-brand-logo em { font-style: normal; background: rgba(255,255,255,.2); border-radius: var(--radius-sm); padding: 2px 8px; }
.login-brand-tagline { font-size: 15px; opacity: .8; margin-bottom: 48px; position: relative; }
.login-brand-features { display: flex; flex-direction: column; gap: 20px; position: relative; }
.login-brand-feature { display: flex; align-items: center; gap: 14px; font-size: 14px; opacity: .9; }
.login-brand-feature-icon {
  width: 38px; height: 38px; background: rgba(255,255,255,.15); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}

.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.login-card {
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 48px 44px; width: 100%; max-width: 420px;
}
.login-card-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.login-card-subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 32px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary);
  background: var(--surface); transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted); }
.form-input::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
  border: none; transition: all var(--transition); white-space: nowrap; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #DC2626; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled)   { background: var(--surface-2); color: var(--text-primary); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

.login-switch { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-secondary); }
.login-switch a { color: var(--primary); font-weight: 500; }
.form-error { background: var(--danger-light); color: var(--danger); border-radius: var(--radius-md);
              padding: 10px 14px; font-size: 13px; margin-bottom: 16px; border: 1px solid #FECACA; }
.form-success { background: var(--success-light); color: #065F46; border-radius: var(--radius-md);
                padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.form-checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.form-checkbox input[type=checkbox] { margin-top: 3px; accent-color: var(--primary); }

@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-card { padding: 36px 28px; }
}

/* ═══════════════════════════════════════════════════════════
   主布局
══════════════════════════════════════════════════════════ */
.app-layout { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.app-header {
  height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0; z-index: 100;
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo {
  width: 32px; height: 32px; background: var(--primary); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px;
}
.header-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.header-tenant { font-size: 12px; color: var(--text-muted); background: var(--surface-2);
                  padding: 2px 8px; border-radius: 99px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user  { display: flex; align-items: center; gap: 8px; }
.header-avatar {
  width: 32px; height: 32px; background: var(--primary-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 600; font-size: 13px;
}
.header-username { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.header-points-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--primary-light); color: var(--primary); border-radius: 99px;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--transition); border: none;
}
.header-points-badge:hover { background: var(--primary-muted); }
.header-divider { width: 1px; height: 20px; background: var(--border); }

/* ── 功能导航栏 ── */
.app-nav {
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.app-nav::-webkit-scrollbar { height: 3px; }
.app-nav::-webkit-scrollbar-track { background: transparent; }
.app-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  border: none;
  background: transparent;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-item-label {
  font-size: 13px;
  line-height: 1;
}

.nav-item-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}

/* 证件预警横幅 */
.alert-banner {
  padding: 9px 24px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer; flex-shrink: 0; border-bottom: 1px solid;
}
.alert-banner.warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert-banner.danger  { background: var(--danger-light);  color: #991B1B; border-color: #FECACA; }
.alert-banner-close { margin-left: auto; opacity: .6; cursor: pointer; font-size: 18px; line-height: 1; border: none; background: none; color: inherit; }

.app-body { display: flex; flex: 1; overflow: hidden; }

/* ── 侧边栏 ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: all 0.3s ease;
}
.sidebar.hidden {
  width: 0;
  border-right: none;
  overflow: hidden;
}
.sidebar-section { padding: 16px 12px 4px; }
.sidebar-section-title { font-size: 11px; font-weight: 600; color: var(--text-muted);
                          letter-spacing: .6px; text-transform: uppercase; padding: 0 8px; margin-bottom: 4px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-md); cursor: pointer; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; transition: all var(--transition);
  width: 100%; border: none; background: transparent; text-align: left;
}
.sidebar-item:hover  { background: var(--surface-2); color: var(--text-primary); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); }
.sidebar-item-icon  { width: 18px; text-align: center; flex-shrink: 0; font-size: 15px; }
.sidebar-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-item-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--primary); color: #fff; flex-shrink: 0; }
.sidebar-item-badge.danger { background: var(--danger); }

.sidebar-new-btn {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 4px 0;
  border-radius: var(--radius-md); border: 1.5px dashed var(--border); background: transparent;
  color: var(--text-muted); font-size: 13px; cursor: pointer; width: 100%; transition: all var(--transition);
}
.sidebar-new-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 12px; }

.conv-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
             border-radius: var(--radius-md); cursor: pointer; color: var(--text-secondary); font-size: 13px; transition: all var(--transition); }
.conv-item:hover  { background: var(--surface-2); }
.conv-item.active { background: var(--primary-light); color: var(--primary); }
.conv-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item-del { display: none; color: var(--text-muted); font-size: 16px; line-height: 1;
                  border: none; background: none; cursor: pointer; padding: 2px; border-radius: 4px; }
.conv-item:hover .conv-item-del { display: block; }
.conv-item-del:hover { color: var(--danger); background: var(--danger-light); }

/* ── 主内容 ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}
.main-content.full-width {
  max-width: 100%;
}
.main-tabs { display: flex; align-items: center; gap: 2px; padding: 0 24px;
             border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.main-tab {
  display: flex; align-items: center; gap: 6px; padding: 14px 16px;
  border: none; background: transparent; color: var(--text-secondary); font-size: 14px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition);
}
.main-tab:hover  { color: var(--text-primary); }
.main-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-pane { display: none; flex: 1; overflow-y: auto; padding: 16px 24px; }
.tab-pane.active { display: flex; flex-direction: column; gap: 12px; }

/* ═══════════════════════════════════════════════════════════
   通用组件
══════════════════════════════════════════════════════════ */

/* Card */
.card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title  { font-size: 15px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.card-body   { padding: 20px; }

/* Stat */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
             padding: 20px; display: flex; align-items: flex-start; gap: 14px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-light);  color: var(--danger); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #065F46; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-danger  { background: var(--danger-light);  color: #991B1B; }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); }

/* Table */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted);
                  text-transform: uppercase; letter-spacing: .4px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.td-primary { color: var(--text-primary) !important; font-weight: 500; }
.table-actions { display: flex; align-items: center; gap: 6px; }

/* Empty */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 24px; color: var(--text-muted); text-align: center; gap: 10px; }
.empty-state-icon { font-size: 40px; opacity: .35; }
.empty-state-text { font-size: 14px; }

/* Select / Textarea */
.form-select {
  width: 100%; padding: 9px 36px 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; background: var(--surface); color: var(--text-primary); outline: none;
  transition: border-color var(--transition); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted); }
.form-textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; color: var(--text-primary); outline: none; resize: vertical; min-height: 80px;
  transition: border-color var(--transition); line-height: 1.5;
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted); }

/* ═══════════════════════════════════════════════════════════
   模态框 / 抽屉
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(12px); transition: transform .2s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-box.modal-lg { max-width: 900px; }
.modal-box.modal-sm { max-width: 440px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title  { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close  {
  width: 32px; height: 32px; border-radius: var(--radius-md); border: none;
  background: var(--surface-2); color: var(--text-muted); font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body   { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-shrink: 0; }

/* 抽屉 */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 400; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: -520px; bottom: 0; width: 520px; max-width: 95vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 401;
  display: flex; flex-direction: column; transition: right .25s ease;
}
.drawer.open { right: 0; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-title  { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.drawer-body   { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.drawer-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }

/* Tabs in modal */
.inner-tabs { display: flex; gap: 2px; margin-bottom: 20px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-md); }
.inner-tab { flex: 1; padding: 7px 12px; font-size: 13px; font-weight: 500; text-align: center; cursor: pointer;
              border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-secondary); transition: all var(--transition); }
.inner-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ═══════════════════════════════════════════════════════════
   文档校验 Tab
══════════════════════════════════════════════════════════ */
.validate-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.validate-layout > * { min-width: 0; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all var(--transition); background: var(--surface);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-zone.tender:hover, .upload-zone.tender.drag-over { border-color: var(--success); background: var(--success-light); }
.upload-zone-icon  { font-size: 22px; flex-shrink: 0; }
.upload-zone-body  { flex: 1; min-width: 0; }
.upload-zone-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.upload-zone-sub   { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.upload-zone-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 6px 14px; background: var(--primary); color: #fff; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 500; border: none; cursor: pointer; transition: background var(--transition);
}
.upload-zone-btn:hover { background: var(--primary-dark); }
.upload-zone.tender .upload-zone-btn { background: var(--success); }
.upload-zone.tender .upload-zone-btn:hover { background: #059669; }

.file-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
              background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 12px; }
.file-item-icon { font-size: 15px; flex-shrink: 0; }
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-weight: 500; }
.file-item-size  { color: var(--text-muted); flex-shrink: 0; }
.file-item-del   { border: none; background: none; cursor: pointer; color: var(--text-muted); font-size: 15px; padding: 2px; border-radius: 4px; transition: all var(--transition); flex-shrink: 0; }
.file-item-del:hover { color: var(--danger); background: var(--danger-light); }
.file-tag { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; flex-shrink: 0; }
/* upload progress */
.upload-progress-wrap { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 60px; }
.upload-progress-bar  { height: 100%; width: 0%; background: var(--primary); border-radius: 3px; transition: width 0.2s ease; }
.upload-progress-bar.processing { width: 100%; animation: progressPulse 1.2s ease-in-out infinite; }
@keyframes progressPulse { 0%,100% { opacity:1; } 50% { opacity:0.35; } }
.upload-progress-pct  { color: var(--text-muted); font-size: 11px; flex-shrink: 0; min-width: 56px; text-align: right; white-space: nowrap; }
.file-tag.bidding { background: var(--primary-light); color: var(--primary); }
.file-tag.tender  { background: var(--success-light); color: var(--success); }

/* 结果区 */
.result-area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
                display: flex; flex-direction: column; flex: 1; min-height: 300px; overflow: hidden; }
.result-tabs-bar { display: flex; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.result-tabs-l2  { background: var(--surface-2); padding: 5px 12px; }
.result-tabs-l3  { background: var(--neutral-100, #f3f4f6); padding: 4px 12px; }
.result-tab-btn  { padding: 6px 14px; border-radius: var(--radius-md); font-size: 12px; font-weight: 500;
                   border: none; background: transparent; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: all var(--transition); }
.result-tabs-l2 .result-tab-btn,
.result-tabs-l3 .result-tab-btn { font-size: 11px; padding: 4px 10px; }
.result-tab-btn.active             { background: var(--primary); color: #fff; }
.result-tab-btn:hover:not(.active) { background: var(--surface-2); color: var(--text-primary); }
.result-tabs-l3 .result-tab-btn:hover:not(.active) { background: var(--neutral-200, #e5e7eb); }
.result-content-wrap { flex: 1; overflow-y: auto; padding: 20px; }
.result-placeholder { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--text-muted);
                       font-size: 14px; flex-direction: column; gap: 10px; padding: 48px; text-align: center; }
.result-placeholder-icon { font-size: 36px; opacity: .3; }

/* Markdown */
.result-content { font-size: 14px; line-height: 1.8; color: var(--text-primary); }
.result-content h1 { font-size: 20px; font-weight: 700; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.result-content h2 { font-size: 16px; font-weight: 700; margin: 24px 0 10px; color: var(--primary); }
.result-content h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.result-content p  { margin: 0 0 12px; }
.result-content ul, .result-content ol { margin: 0 0 12px 20px; }
.result-content li { margin-bottom: 4px; }
.result-content code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: 'Courier New', monospace; }
.result-content pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; overflow-x: auto; margin: 12px 0; }
.result-content pre code { background: none; border: none; padding: 0; font-size: 13px; }
.result-content blockquote { border-left: 3px solid var(--primary-muted); padding-left: 14px; color: var(--text-secondary); margin: 12px 0; }
.result-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.result-content table th { background: var(--surface-2); padding: 8px 12px; font-size: 12px; font-weight: 600; text-align: left; }
.result-content table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.result-content hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.result-content strong { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   企业管理 Tab
══════════════════════════════════════════════════════════ */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.company-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
                 box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow var(--transition); }
.company-card:hover { box-shadow: var(--shadow-md); }
.company-card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.company-avatar { width: 40px; height: 40px; background: var(--primary-light); border-radius: var(--radius-md);
                   display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; font-size: 16px; flex-shrink: 0; }
.company-name    { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.company-license { font-size: 12px; color: var(--text-muted); }
.company-card-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 7px; }
.company-info-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.company-info-icon { width: 15px; text-align: center; flex-shrink: 0; color: var(--text-muted); }
.company-card-foot { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 6px; }

/* 证件项 */
.cert-list { display: flex; flex-direction: column; gap: 6px; }
.cert-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border);
              border-radius: var(--radius-md); background: var(--surface); transition: all var(--transition); }
.cert-item.cert-warning { border-left: 3px solid var(--warning); }
.cert-item.cert-expired { border-left: 3px solid var(--danger); background: var(--danger-light); }
.cert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cert-dot.valid   { background: var(--success); }
.cert-dot.warning { background: var(--warning); }
.cert-dot.expired { background: var(--danger); }
.cert-name  { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.cert-date  { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.cert-days  { font-size: 11px; font-weight: 600; flex-shrink: 0; }
.cert-days.warning { color: var(--warning); }
.cert-days.expired { color: var(--danger); }
.cert-days.valid   { color: var(--success); }
.cert-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   Dashboard Tab
══════════════════════════════════════════════════════════ */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-full { grid-column: 1 / -1; }

.cert-alert-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px;
                    border-bottom: 1px solid var(--border); transition: background var(--transition); }
.cert-alert-item:last-child { border-bottom: none; }
.cert-alert-item:hover { background: var(--bg); }
.cert-alert-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cert-alert-info { flex: 1; }
.cert-alert-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.cert-alert-co   { font-size: 12px; color: var(--text-muted); }
.cert-alert-meta { text-align: right; flex-shrink: 0; }
.cert-alert-date { font-size: 12px; color: var(--text-muted); }
.cert-alert-days { font-size: 13px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   Toast
══════════════════════════════════════════════════════════ */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); min-width: 280px; max-width: 360px;
  animation: toast-in .2s ease; pointer-events: all;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--primary); }
.toast-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body  { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { border: none; background: none; cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 0; line-height: 1; flex-shrink: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* Loading */
.loading-spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 子提示词 */
.sub-prompt-item { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--bg); }
.sub-prompt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sub-prompt-index { width: 22px; height: 22px; background: var(--primary); color: #fff; border-radius: 50%;
                     display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* 点数记录 */
.point-change.positive { color: var(--success); font-weight: 600; }
.point-change.negative { color: var(--danger); font-weight: 600; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 16px; }
.pagination-btn { padding: 6px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-md);
                   background: var(--surface); font-size: 12px; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); }
.pagination-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination-info { font-size: 12px; color: var(--text-muted); }

/* 工具栏 */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar-search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 14px;
                   border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.toolbar-search input { border: none; outline: none; flex: 1; background: transparent; color: var(--text-primary); font-size: 13px; }
.toolbar-search-icon { color: var(--text-muted); font-size: 14px; }

/* 表单布局 */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-hint  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary);
                       margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.form-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* 工具类 */
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; } .px-4 { padding-left: 16px; padding-right: 16px; }
.text-sm { font-size: 12px; } .text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); } .text-primary { color: var(--text-primary); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.w-full { width: 100%; } .flex-1 { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ── 项目列表：重命名 ────────────────────────────── */
.conv-item-edit {
  display: none;
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--text-muted); font-size: 12px; border-radius: 4px; flex-shrink: 0;
  transition: color var(--transition);
}
.conv-item:hover .conv-item-edit { display: inline-flex; }
.conv-item-edit:hover { color: var(--primary); background: var(--primary-light); }
.conv-item-rename-input {
  flex: 1; min-width: 0; border: 1.5px solid var(--primary); border-radius: 4px;
  padding: 1px 6px; font-size: 13px; outline: none; background: var(--surface);
  color: var(--text-primary);
}

/* ── 管理后台：侧边导航布局 ──────────────────────── */
.modal-xl { width: 96vw; max-width: none; max-height: 94vh; display: flex; flex-direction: column; }
.admin-layout { display: flex; flex: 1; overflow: hidden; border-top: 1px solid var(--border); }
.admin-sidenav {
  width: 148px; flex-shrink: 0; border-right: 1px solid var(--border);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 2px;
  background: var(--neutral-50);
}
.admin-nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: var(--radius-md); border: none;
  cursor: pointer; font-size: 13px; font-weight: 500; text-align: left;
  color: var(--text-secondary); background: none; transition: all var(--transition);
}
.admin-nav-item:hover { background: var(--border); color: var(--text-primary); }
.admin-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.admin-nav-icon { font-size: 15px; flex-shrink: 0; }
.admin-content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.admin-pane-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }

/* ── 流式校验：结果展示 ─────────────────────────── */
.stream-status {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--primary-light); border-radius: var(--radius-md); margin-bottom: 12px;
  font-size: 13px; color: var(--primary); font-weight: 500;
}
.stream-step-info { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.stream-content {
  flex: 1; font-family: inherit; font-size: 14px; line-height: 1.8;
  color: var(--text-primary); white-space: pre-wrap; word-break: break-word;
  padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); min-height: 200px; max-height: 60vh; overflow-y: auto;
}

/* ── 提示词执行模式切换 ─────────────────────────── */
.prompt-mode-tabs {
  display: flex; gap: 4px; margin-bottom: 8px;
  background: var(--neutral-100,#f3f4f6); border-radius: var(--radius-md); padding: 3px;
}
.prompt-mode-btn {
  flex: 1; padding: 5px 8px; border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-muted); background: transparent;
  transition: all var(--transition); white-space: nowrap;
}
.prompt-mode-btn.active {
  background: var(--surface); color: var(--primary); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── 分组勾选列表（侧边栏） ───────────────────────── */
.group-check-list { display: flex; flex-direction: column; gap: 6px; }
.group-check-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.group-check-item:hover { border-color: var(--primary); background: var(--primary-light); }
.group-check-item input[type=checkbox] { margin-top: 2px; flex-shrink: 0; accent-color: var(--primary); }
.group-check-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.group-check-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── 结果内容区：统一滚动容器 ──────────────────────── */
#resultContentWrap {
  min-height: 50vh;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  position: relative;
}

/* ── 分组结果：外层 Tab（sticky 固定在滚动容器顶部） ── */
.group-result-tabs-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 2px solid var(--border); padding: 8px 0 6px;
  position: sticky; top: 0; z-index: 30;
  background: var(--surface, #fff);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  margin-bottom: 0;
}
.group-tab-btn {
  padding: 6px 14px; border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-secondary); background: var(--neutral-50,#f9fafb);
  transition: all var(--transition);
}
.group-tab-btn.active { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.group-tab-btn.done::after { content: " ✓"; color: var(--success,#16a34a); }
.group-pane { display: none; }
.group-pane.active { display: block; }

/* ── 分组结果：内层 Tab（sticky 固定在外层 Tab 下方） ── */
.inner-result-tabs-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding: 8px 0 6px;
  position: sticky; top: 46px; z-index: 20;
  background: var(--surface, #fff);
  margin-bottom: 0;
}
.inner-tab-btn {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px; cursor: pointer;
  font-size: 12px; color: var(--text-secondary); background: var(--neutral-50,#f9fafb);
  transition: all var(--transition);
}
.inner-tab-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 600; }
/* 总结 Tab 样式（步骤层和提示词层均适用）*/
.inner-tab-btn.summary-tab,
.step-tab-btn.summary-tab { border-style: dashed; }
.inner-tab-btn.summary-tab.active,
.step-tab-btn.summary-tab.active { background: var(--primary); color: #fff; border-style: solid; }
.inner-pane { display: none; }
.inner-pane.active { display: block; }
.inner-pane.stream-content { max-height: none; overflow-y: visible; }
.inner-pane.result-content { padding: 0; background: none; border: none; white-space: normal; }

/* ── 第三级：步骤 Tab（sticky 固定在内层 Tab 下方） ── */
.step-tabs-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding: 6px 0 4px;
  position: sticky; top: 90px; z-index: 10;
  background: var(--surface, #fff);
  margin-bottom: 0;
}
.step-tab-btn {
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  font-size: 12px; color: var(--text-secondary); background: transparent;
  transition: all var(--transition); white-space: nowrap;
}
.step-tab-btn.active {
  background: var(--neutral-100, #f3f4f6); color: var(--text-primary);
  border-color: var(--text-secondary); font-weight: 500;
}
.step-tab-btn:hover:not(.active) { background: var(--neutral-50, #f9fafb); }
.step-tab-btn.step-streaming-done::after { content: " ✓"; color: var(--success, #16a34a); font-size: 10px; }
.step-content-wrap { padding-top: 8px; }
.step-pane { display: none; }
.step-pane.active { display: block; }
.step-pane.stream-content { max-height: none; overflow-y: visible; border: none; background: none; padding: 0; }
.step-pane.result-content { padding-top: 4px; }

/* ── 管理后台：提示词分组多选列表 ────────────────── */
.group-prompt-checklist {
  display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px;
}
.group-prompt-checklist label {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px;
  border-radius: var(--radius); cursor: pointer; font-size: 13px;
  color: var(--text-primary); transition: background var(--transition);
}
.group-prompt-checklist label:hover { background: var(--primary-light); }
.group-prompt-checklist input[type=checkbox] { accent-color: var(--primary); }

/* ── 注册模式卡片 ─────────────────────────────────────────── */
.mode-select-wrap {
  display: flex;
  gap: 12px;
}
.mode-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}
.mode-card:hover {
  border-color: var(--primary);
}
.mode-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.mode-card span {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.mode-card small {
  font-size: 12px;
  color: var(--text-muted);
}
