/* ===== Global Reset & Variables ===== */
:root {
  --navy: #1B2A4A;
  --tech-blue: #008CD4;
  --tech-blue-light: #e6f4fa;
  --tech-blue-dark: #007aa8;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-secondary: #6b7c93;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(27,42,74,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.site-logo svg { flex-shrink: 0; }

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 8px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
}

.nav-tab:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-tab.active { color: #fff; background: var(--tech-blue); }

/* ===== Main Content ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.section { display: none; }
.section.active { display: block; }

/* ===== Section Title ===== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===== Search Bar ===== */
.search-bar {
  margin-bottom: 20px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 12px 44px 12px 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.search-input:focus {
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 3px rgba(0, 140, 212, 0.12);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-clear {
  position: absolute;
  right: 12px;
  background: var(--border);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.search-clear:hover {
  background: #d0d8e0;
  color: var(--navy);
}

.search-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.search-meta .search-highlight {
  color: var(--tech-blue);
  font-weight: 600;
}

.search-no-result {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.search-no-result-icon { font-size: 48px; margin-bottom: 12px; }
.search-no-result-text { font-size: 16px; margin-bottom: 4px; }
.search-no-result-hint { font-size: 13px; }

/* ===== Incident List ===== */
.incident-list { display: flex; flex-direction: column; gap: 12px; }

.incident-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  border-left: 4px solid var(--tech-blue);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incident-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.incident-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.incident-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
  min-width: 0;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-type { color: #fff; }
.badge-type-数据泄露 { background: #e74c3c; }
.badge-type-勒索软件 { background: #8e44ad; }
.badge-type-APT攻击 { background: #2c3e50; }
.badge-type-DDoS攻击 { background: #e67e22; }
.badge-type-恶意软件 { background: #c0392b; }
.badge-type-供应链攻击 { background: #d35400; }
.badge-type-后门漏洞 { background: #16a085; }
.badge-type-AI安全 { background: #6c5ce7; }
.badge-type-OT安全 { background: #e17055; }
.badge-type-网络钓鱼 { background: #2980b9; }
.badge-type-内部威胁 { background: #7f8c8d; }
.badge-type-其他 { background: #95a5a6; }

.badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.badge-new {
  background: #fff1f0;
  color: #d93025;
  border: 1px solid #ffa39e;
}

.incident-card.is-new {
  border-left: 3px solid #d93025;
}

.incident-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}

.incident-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.incident-card-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.incident-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.incident-date { font-size: 12px; color: var(--text-secondary); }

.detail-link {
  font-size: 13px;
  color: var(--tech-blue);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.detail-link:hover { color: var(--tech-blue-dark); }

/* ===== Load More Button ===== */
.load-more-wrapper { text-align: center; padding: 20px 0; }

.btn-load-more {
  padding: 10px 32px;
  background: var(--tech-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-load-more:hover { background: var(--tech-blue-dark); }
.btn-load-more:disabled { background: var(--border); cursor: not-allowed; }

/* ===== Report Center ===== */
.report-list { display: flex; flex-direction: column; gap: 16px; }

.report-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  border-left: 4px solid var(--navy);
}

.report-card:hover { box-shadow: var(--shadow-hover); }

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.report-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.report-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.report-card-summary {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}

.report-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--tech-blue); color: #fff; }
.btn-primary:hover { background: var(--tech-blue-dark); }

.btn-outline {
  background: transparent;
  color: var(--tech-blue);
  border: 1px solid var(--tech-blue);
}
.btn-outline:hover { background: var(--tech-blue-light); }

/* ===== Detail Page ===== */
.detail-page { max-width: 900px; margin: 0 auto; padding: 24px 20px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tech-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--tech-blue-dark); }

.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-card-header {
  background: var(--navy);
  color: #fff;
  padding: 24px 28px;
}

.detail-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.detail-meta-item { display: flex; flex-direction: column; gap: 2px; }

.detail-meta-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-meta-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.detail-section {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-child { border-bottom: none; }

.detail-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.source-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-link {
  color: var(--tech-blue);
  text-decoration: none;
  font-size: 14px;
  word-break: break-all;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.source-link:hover { color: var(--tech-blue-dark); text-decoration: underline; }

/* ===== Report Page ===== */
.report-page { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

.report-doc {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-doc-header {
  background: var(--navy);
  color: #fff;
  padding: 28px 32px;
  text-align: center;
}

.report-doc-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }

.report-doc-meta { font-size: 14px; color: rgba(255,255,255,0.7); }

.report-doc-body { padding: 28px 32px; }

.report-section { margin-bottom: 28px; }

.report-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--tech-blue);
}

.report-analysis-block { margin-bottom: 16px; }

.report-analysis-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--tech-blue-dark);
  margin-bottom: 6px;
}

.report-analysis-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

/* ===== Report Table ===== */
.report-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 700px;
}

.report-table thead tr {
  background: var(--navy);
  color: #fff;
}

.report-table thead th {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.report-table tbody tr:nth-child(even) {
  background: #f0f4ff;
}

.report-table tbody tr:hover {
  background: #e3ebff;
}

.report-table tbody td {
  padding: 10px 14px;
  font-size: 13px;
  vertical-align: top;
  border-bottom: 1px solid #e8eef6;
}

.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.table-detail-link {
  color: var(--tech-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.table-detail-link:hover {
  color: var(--tech-blue-dark);
  text-decoration: underline;
}

.report-actions {
  display: flex;
  gap: 12px;
  padding: 20px 32px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ===== Stats Bar ===== */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.stat-value { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; color: var(--text-secondary); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 16px; }

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner { height: auto; padding: 10px 16px; flex-direction: column; gap: 8px; }
  .site-logo { font-size: 16px; }
  .nav-tabs { width: 100%; justify-content: center; }
  .nav-tab { padding: 6px 16px; font-size: 14px; }
  .main-content { padding: 16px; }
  .section-title { font-size: 18px; }
  .incident-card { padding: 14px; }
  .incident-card-title { font-size: 15px; }
  .incident-card-meta { gap: 10px; font-size: 12px; }
  .detail-meta-grid { grid-template-columns: 1fr; }
  .detail-page, .report-page { padding: 16px; }
  .detail-card-header, .report-doc-header { padding: 18px 20px; }
  .detail-title { font-size: 20px; }
  .detail-section { padding: 16px 20px; }
  .report-doc-body { padding: 20px; }
  .report-doc-title { font-size: 22px; }
  .stats-bar { gap: 8px; }
  .stat-card { min-width: 100px; padding: 10px; }
  .stat-value { font-size: 20px; }
  .report-card { padding: 18px; }
}

@media (max-width: 480px) {
  .nav-tab { padding: 6px 12px; font-size: 13px; }
  .incident-card-header { flex-direction: column; align-items: flex-start; }
  .badge { font-size: 11px; }
  .search-input { font-size: 14px; padding: 10px 40px 10px 44px; }
  .search-meta { font-size: 12px; }
}
