:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e5eaf0;
  --text: #1a2332;
  --muted: #6b7a90;
  --primary: #1a5fb4;
  --primary-hover: #154a8f;
  --primary-soft: #e8f0fa;
  --accent: #0d9488;
  --danger: #c0392b;
  --warn: #d97706;
  --ok: #059669;
  --shadow: 0 1px 3px rgba(26, 35, 50, 0.06), 0 4px 12px rgba(26, 35, 50, 0.04);
  --radius: 10px;
  --max: 1120px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* —— Top bar (desktop-first) —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.12rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--primary); }
.brand-mark { font-size: 1.2rem; }
.top-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.source-badge {
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* —— Layout —— */
.page {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sep { opacity: 0.5; }

/* —— Page header —— */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}
.page-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— Hero / Radar home —— */
.hero {
  background: linear-gradient(135deg, #1a5fb4 0%, #0d9488 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 8px; font-size: 1.55rem; font-weight: 700; }
.hero p { margin: 0; opacity: 0.92; font-size: 0.95rem; max-width: 640px; }
.hero-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-primary { background: #fff; color: var(--primary); }
.hero .btn-primary:hover { background: #f0f6ff; }
.hero .btn-ghost { border-color: rgba(255,255,255,0.45); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-card .lbl { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.section-block { margin-bottom: 28px; }
.section-block h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-block h2 a { font-size: 0.85rem; font-weight: 500; }

/* —— Filters —— */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search-wrap {
  flex: 1 1 220px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--primary); }
.filter-row select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-width: 118px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-weight: 560;
  transition: background 0.15s, color 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: 0.88rem; }
.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* —— Cards —— */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.bid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bid-card:hover {
  border-color: #b8cce8;
  box-shadow: 0 2px 8px rgba(26, 95, 180, 0.1);
}
.bid-card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.bid-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.4;
  flex: 1;
  color: var(--text);
}
.bid-card:hover .bid-title { color: var(--primary); }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-status { background: #dcfce7; color: #166534; }
.badge-change { background: #fef3c7; color: #92400e; }
.badge-source { background: #e0e7ff; color: #3730a3; }
.badge-source-crccep { background: #dbeafe; color: #1e40af; }
.badge-source-ceec { background: #d1fae5; color: #065f46; }
.badge-source-powerchina { background: #fce7f3; color: #9d174d; }
.badge-source-cnpc { background: #ffedd5; color: #9a3412; }
.bid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.86rem;
  color: var(--muted);
}
.bid-meta strong { color: var(--text); font-weight: 560; }

/* —— Detail —— */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.detail-title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  line-height: 1.35;
}
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--bg);
  border-radius: 8px;
}
.detail-field dt {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 2px;
}
.detail-field dd {
  margin: 0;
  font-size: 0.95rem;
  word-break: break-word;
}
.detail-section { margin-top: 8px; }
.detail-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}
.detail-summary {
  color: var(--text);
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-content {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  background: #fafbfc;
  font-size: 0.92rem;
  line-height: 1.65;
  overflow-x: auto;
  max-height: 640px;
  overflow-y: auto;
}
.detail-content img { max-width: 100%; height: auto; }
.detail-content table { border-collapse: collapse; width: 100%; }
.detail-content td, .detail-content th {
  border: 1px solid var(--border);
  padding: 6px 8px;
}
.disclaimer {
  margin-top: 20px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #92400e;
}
.star-on { color: var(--warn); }

/* —— Forms / subscribe / workspace —— */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  margin: 16px 0;
}
.form-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.form-field textarea { min-height: 72px; resize: vertical; }
.sub-card, .ws-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.sub-card-head, .ws-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.sub-card h3, .ws-card h3 { margin: 0; font-size: 0.98rem; }
.sub-meta, .ws-meta { font-size: 0.85rem; color: var(--muted); }
.match-count { color: var(--accent); font-weight: 600; }

.status-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.85rem;
}

/* —— Empty / loading / panels —— */
.empty-state, .loading-block {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.info-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.info-panel h2 { margin: 0 0 12px; font-size: 1.15rem; }
.info-panel h3 { margin: 20px 0 8px; font-size: 1rem; }
.info-panel p { color: var(--muted); margin: 0 0 10px; }
.info-panel ul { margin: 0 0 12px; padding-left: 1.2em; color: var(--muted); }
.info-panel li { margin-bottom: 4px; }
.source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 12px 0 20px;
}
.source-table th, .source-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.source-table th { background: var(--bg); color: var(--muted); font-weight: 600; }

/* —— Toast —— */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2332;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* —— Responsive  —— */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topbar-inner { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .top-nav { order: 3; width: 100%; overflow-x: auto; }
  .source-badge { margin-left: auto; }
  .page { padding: 16px 14px 40px; }
  .detail-card { padding: 20px 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.25rem; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .filter-row select { flex: 1 1 45%; min-width: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
