/* 全局重置与基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
  /* 背景重构：使用纯白色作为底色，通过额外的波浪容器实现顶部蓝色渐变 */
  background-color: #f8fafc;
  color: #333;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* 波浪形背景容器 */
.bg-wave-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 580px; /* 增加整体蓝色区域的高度，让波浪更靠下 */
  /* 天空蓝到深紫蓝的渐变 */
  background: linear-gradient(90deg, #62b0ff 0%, #766dff 100%);
  z-index: -1;
  overflow: hidden;
}

/* 多重交错波浪 (静态) */
.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 240px; 
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
}

/* 最底层的波浪 (半透明浅白，左高右低，最左侧有一个平缓的波峰) */
.wave1 {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 240' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,120 C180,80 360,100 540,140 C720,180 900,200 1080,180 C1260,160 1350,130 1440,110 L1440,240 L0,240 Z' fill='rgba(255, 255, 255, 0.15)'/%3E%3C/svg%3E");
  z-index: 1;
}

/* 中间的波浪 (稍白透，左低右高，交错感极强) */
.wave2 {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 240' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,180 C240,200 480,180 720,130 C960,80 1200,60 1440,70 L1440,240 L0,240 Z' fill='rgba(255, 255, 255, 0.25)'/%3E%3C/svg%3E");
  z-index: 2;
}

/* 最上层的波浪 (纯白底色，左低中高右低，平缓切分) */
.wave3 {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 240' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,220 C320,240 640,180 960,150 C1160,130 1320,130 1440,140 L1440,240 L0,240 Z' fill='%23f8fafc'/%3E%3C/svg%3E");
  z-index: 3;
}

/* 顶部导航栏 */
header {
  padding: 0 40px;
  height: 64px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  display: inline-block;
  white-space: nowrap;
}

.brand .subtitle {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 1px;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
  top: -1px;
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

nav::-webkit-scrollbar {
  display: none;
}

nav button {
  padding: 8px 10px;
  border-radius: 20px;
  border: none;
  background-color: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

nav button:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
}

nav button.active {
  background-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 主内容区 */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  margin-bottom: 24px;
  font-size: 30px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.5px;
  text-shadow: none;
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 26px;
  background: linear-gradient(to bottom, #3b82f6, #60a5fa);
  border-radius: 4px;
}

/* 现代玻璃拟态卡片 (更明亮通透，模仿腾讯天气) */
.card, .feature-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #333;
}

.feature-card {
  cursor: pointer;
}

.feature-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
}

.card:hover, .feature-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.card h3, .feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.card p, .feature-card p {
  color: #475569;
  line-height: 1.6;
  font-size: 16px;
}

.hint-text {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* 图表容器 */
.chart {
  width: 100%;
  height: 520px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.chart.small {
  height: 380px;
}

.anomaly-layout .chart.small {
  height: 320px;
}

.anomaly-chart-grid {
  align-items: stretch;
}

.anomaly-query-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  margin-bottom: 16px;
}

.anomaly-history-summary {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.88), rgba(239, 246, 255, 0.95));
  color: #1e3a5f;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.anomaly-summary-danger {
  color: #b91c1c;
  font-weight: 700;
}

.anomaly-events-scroll {
  margin-top: 16px;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.anomaly-events-scroll #anomaly-table {
  margin-top: 0;
  border-radius: 0;
  min-width: 520px;
}

.anomaly-events-scroll #anomaly-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.anomaly-row-red td { background: rgba(254, 226, 226, 0.72); }
.anomaly-row-red:hover td { background: rgba(254, 202, 202, 0.84); }

.anomaly-row-orange td { background: rgba(255, 237, 213, 0.72); }
.anomaly-row-orange:hover td { background: rgba(253, 216, 168, 0.84); }

.anomaly-row-yellow td { background: rgba(254, 249, 195, 0.72); }
.anomaly-row-yellow:hover td { background: rgba(253, 230, 138, 0.84); }

.anomaly-row-blue td { background: rgba(219, 234, 254, 0.72); }
.anomaly-row-blue:hover td { background: rgba(191, 219, 254, 0.84); }

.anomaly-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.anomaly-level-badge.is-red {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: rgba(185, 28, 28, 0.35);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.22);
}

.anomaly-level-badge.is-orange {
  color: #fff;
  background: linear-gradient(135deg, #f97316, #c2410c);
  border-color: rgba(194, 65, 12, 0.35);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.22);
}

.anomaly-level-badge.is-yellow {
  color: #fff;
  background: linear-gradient(135deg, #eab308, #a16207);
  border-color: rgba(161, 98, 7, 0.35);
  box-shadow: 0 8px 18px rgba(234, 179, 8, 0.22);
}

.anomaly-level-badge.is-blue {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.22);
}

.anomaly-events-scroll #anomaly-table th:first-child,
.anomaly-events-scroll #anomaly-table td:first-child {
  white-space: nowrap;
}

/* 网格系统 */
.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* 主页 Hero 区域 (模仿天气首页大字) */
.hero-section {
  padding: 80px 0 180px; /* 根据要求调整为 180px */
  text-align: center;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 46px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #fff; /* 在蓝色背景上保持纯白 */
}

.hero-subtitle {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 32px;
  color: #e0f2fe;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 46px;
  font-weight: 300;
  color: #fff;
  line-height: 1;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.stat-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 主页功能卡片网格 */
.homepage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.feature-card p {
  font-size: 16px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
  min-height: 44px;
}

/* 徽章样式重构 */
.feature-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- 普通用户仪表盘样式扩展 --- */
.normal-dashboard .dashboard-section h2 {
  display: inline-block;
  border-radius: 4px;
}

.normal-hero {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.normal-hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: #0369a1;
  font-size: 13px;
  font-weight: 600;
}

.normal-hero-weather {
  font-size: 48px;
  opacity: 0.8;
}

.normal-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.normal-quick-btn {
  background: rgba(255, 255, 255, 0.72);
}

.normal-index-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

.normal-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.normal-index-aside {
  display: flex;
}

.normal-side-note {
  width: 100%;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.94));
  border: 1px solid rgba(191, 219, 254, 0.8);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.08);
}

.normal-side-note-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.normal-side-note h3 {
  margin: 14px 0 10px;
}

.normal-side-note p {
  margin-bottom: 12px;
  min-height: 0;
}

.normal-side-note-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  line-height: 1.8;
}

.normal-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.normal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: #e2e8f0;
  transition: all 0.3s ease;
}

.normal-card.lifestyle:hover::before { background: #3b82f6; }
.normal-card.phenomena:hover::before { background: #8b5cf6; }

.normal-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.normal-card .feature-icon {
  margin-bottom: 0;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}
.status-badge.excellent { background: #dbeafe; color: #0284c7; }
.status-badge.good { background: #dcfce3; color: #15803d; }

.normal-card h3 {
  margin-bottom: 8px !important;
}

.normal-card .card-desc {
  flex-grow: 1;
  font-size: 15px !important;
  color: #64748b !important;
}

.normal-card .card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #f1f5f9;
}

.normal-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.normal-service-card {
  min-height: 220px;
}

.normal-service-badge {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.24);
  color: #0369a1;
}

.normal-story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.normal-story-card {
  min-height: 0;
}

.normal-story-content {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.normal-story-main {
  display: flex;
  flex-direction: column;
}

.normal-story-main p {
  min-height: 0;
}

.normal-story-facts {
  display: grid;
  gap: 12px;
}

.normal-story-fact {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 180, 254, 0.7);
}

.normal-story-fact strong {
  display: block;
  margin-bottom: 6px;
  color: #6d28d9;
}

.normal-story-fact span {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.normal-scene-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.96), rgba(240, 249, 255, 0.98));
  border: 1px solid rgba(125, 211, 252, 0.55);
}

.normal-scene-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
}

.normal-scene-hero h3 {
  margin-bottom: 8px;
}

.normal-scene-hero p {
  margin-bottom: 0;
  min-height: 0;
}

.normal-scene-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.normal-scene-kpi {
  margin: 0;
}

.normal-scene-kpi span {
  display: block;
  color: #64748b;
  font-size: 13px;
  margin-bottom: 8px;
}

.normal-scene-kpi strong {
  font-size: 22px;
  color: #0f172a;
}

.normal-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.normal-guide-card {
  margin: 0;
}

.normal-guide-card p {
  min-height: 0;
  margin-bottom: 0;
}

.normal-page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.detail-link {
  color: #3b82f6;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* 安全预警水平卡片 */
.horizontal-card:hover {
  transform: translateY(-2px) scale(1.01) !important;
}

@media (max-width: 768px) {
  .normal-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .normal-hero-weather {
    font-size: 36px;
  }
  .normal-index-layout,
  .normal-story-content,
  .normal-scene-hero {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .normal-index-grid,
  .normal-scene-kpi-grid,
  .normal-guide-grid,
  .normal-service-grid {
    grid-template-columns: 1fr;
  }
  .horizontal-card {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  .horizontal-card .feature-icon {
    font-size: 32px !important;
    padding: 12px !important;
  }
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(77, 164, 240, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(77, 164, 240, 0.3);
}

/* 表单与按钮 */
.btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid rgba(77, 164, 240, 0.4);
  background-color: rgba(77, 164, 240, 0.1);
  color: #1d4ed8;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.btn:hover {
  background-color: rgba(77, 164, 240, 0.2);
  border-color: rgba(77, 164, 240, 0.6);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.btn-small {
  padding: 6px 16px;
  font-size: 14px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.6);
  color: #333;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  border-color: #4da4f0;
  background: rgba(255, 255, 255, 0.9);
}

input::placeholder {
  color: #94a3b8;
}

select option {
  background: #fff;
  color: #333;
}

/* 查询栏 */
.query-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 16px;
  margin-bottom: 24px;
}

.query-label {
  font-size: 15px;
  color: #475569;
  margin-bottom: 8px;
}

.query-actions {
  display: flex;
  gap: 12px;
}

/* 表格样式美化 */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  overflow: hidden;
}

th {
  background: rgba(241, 245, 249, 0.8);
  padding: 16px 18px;
  text-align: left;
  font-weight: 600;
  color: #334155;
  border-bottom: 2px solid rgba(226, 232, 240, 0.8);
  font-size: 16px;
}

td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  color: #475569;
  font-size: 15px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(241, 245, 249, 0.4);
}

.result-scroll {
  max-height: 400px;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  color: #333;
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.modal-title {
  font-size: 20px;
  font-weight: 500;
}

.modal-body {
  padding: 24px;
}

/* 数据预览重构 */
.preview-shell {
  display: grid;
  gap: 14px;
}

.preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
}

.preview-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-control label {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.preview-control .input {
  width: 180px;
  padding: 4px 8px;
  font-size: 13px;
}

.preview-range-text {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
  min-width: 56px;
}

.preview-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.preview-tag {
  font-size: 12px;
  color: #0f172a;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
}

.preview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.preview-kpi-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.8);
}

.preview-kpi-label {
  font-size: 12px;
  color: #64748b;
}

.preview-kpi-value {
  margin-top: 4px;
  font-size: 16px;
  color: #0f172a;
  font-weight: 700;
}

.preview-chart-wrap {
  position: relative;
  padding: 8px;
  border-radius: 14px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(14, 165, 233, 0.08), rgba(14, 165, 233, 0)),
    rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.preview-chart-wrap .chart.small {
  margin-bottom: 0;
  height: 440px;
}

.preview-loading {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

.preview-wave-events {
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

#preview-wave-table {
  width: 100%;
  border-collapse: collapse;
}

#preview-wave-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(236, 253, 245, 0.95);
  color: #0f766e;
  padding: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

#preview-wave-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  color: #334155;
  white-space: nowrap;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
}

/* AI 聊天框重构 */
.chat-container {
  border: none;
  background: transparent;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

/* 为帮助页内嵌版覆盖样式 */
.card .chat-container {
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
}

.card .chat-input-area {
  background: #fff !important;
  border-top: 1px solid rgba(37, 99, 235, 0.15) !important;
  border-radius: 0 0 8px 8px !important;
}

.message-bubble.user {
  background: #4da4f0 !important;
  border: 1px solid #4da4f0 !important;
  color: #fff !important;
}

.message-bubble.assistant {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  color: #333 !important;
}

.chat-input-area {
  background: rgba(255, 255, 255, 0.6) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* 列表等其他小部件 */
.card ul {
  padding-left: 20px;
  line-height: 1.8;
}

.card li {
  margin-bottom: 8px;
}

/* 底部栏美化 */
.app-footer {
  margin-top: 40px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* 全局智能助手悬浮窗 */
.floating-chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-toggle-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-toggle-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.chat-panel {
  width: 360px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: chatPanelFadeIn 0.3s ease forwards;
  transform-origin: bottom right;
}

@keyframes chatPanelFadeIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-panel-header {
  padding: 16px 20px;
  background: rgba(241, 245, 249, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-panel-header h3 {
  margin: 0;
  font-size: 16px;
  color: #1e293b;
  font-weight: 600;
}

.chat-panel-header .close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s;
}

.chat-panel-header .close-btn:hover {
  color: #ef4444;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-title {
  font-size: 18px;
  font-weight: 500;
  color: #1e293b; /* 深色文字，提升可读性 */
  letter-spacing: 1px;
}

.footer-subtitle {
  font-size: 16px;
  color: #334155; /* 略浅一点的深色，与标题形成层次 */
}

.footer-copyright {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  font-family: Arial, sans-serif;
}

/* 登录状态相关样式 */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
  white-space: nowrap;
}

.auth-user {
  font-size: 15px;
  color: #1e3a8a;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.auth-user-name {
  font-weight: 700;
}

.logout-btn {
  margin-left: 0;
}

/* 中尺度涡旋模块 */
.eddy-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.eddy-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.eddy-stat-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.eddy-stat-label {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 8px;
}

.eddy-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.eddy-stat-value.ok {
  color: #166534;
}

.eddy-note-list {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.eddy-query-bar {
  grid-template-columns: 1fr 1fr 2fr auto;
  margin-bottom: 8px;
}

.eddy-chart-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.eddy-chart-panel {
  min-width: 0;
}

.eddy-chart-panel .query-label {
  margin-bottom: 10px;
}

.eddy-chart-main,
.eddy-chart-secondary {
  height: 420px;
  margin-bottom: 0;
}

.eddy-detail-panel {
  display: grid;
  gap: 10px;
}

.eddy-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.eddy-artifact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
}

.eddy-artifact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.eddy-artifact-image {
  width: 100%;
  display: block;
  height: 320px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
  object-fit: contain;
}

/* 海域要素预测模块 */
.forecast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.forecast-title-block {
  display: grid;
  gap: 8px;
}

.forecast-header h2 {
  margin: 0;
  color: #123b67;
  font-size: 32px;
  font-weight: 700;
  text-shadow: none;
}

.forecast-subtitle {
  margin: 0;
  max-width: 760px;
  color: #355372;
  font-size: 16px;
  line-height: 1.7;
}

.forecast-page-shell {
  display: grid;
  gap: 18px;
}

.forecast-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.82));
  border: 1px solid rgba(191, 219, 254, 0.55);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.forecast-panel-head,
.forecast-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.forecast-panel-head {
  margin-bottom: 16px;
}

.forecast-section-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forecast-panel-desc,
.forecast-section-desc {
  margin: 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.7;
}

.forecast-control-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.forecast-summary-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.88));
  border: 1px solid rgba(191, 219, 254, 0.58);
}

.forecast-summary-label {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 13px;
}

.forecast-summary-value {
  display: block;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.forecast-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.forecast-query-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.forecast-query-bar-main {
  grid-template-columns: minmax(220px, 2fr) minmax(140px, 1fr) auto;
}

.forecast-query-bar .query-item {
  min-width: 0;
}

.forecast-query-bar .query-label {
  font-size: 14px;
  font-weight: 600;
  color: #48627f;
}

.forecast-panel input[type="date"],
.forecast-panel input[type="datetime-local"],
.forecast-panel input[type="number"],
.forecast-panel select {
  border-radius: 14px;
  border: 1px solid rgba(191, 219, 254, 0.7);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.1);
}

.forecast-query-bar-main input[type="datetime-local"] {
  min-height: 54px;
  padding: 14px 18px;
  color: #123b67;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

.forecast-query-bar-advanced {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  margin-bottom: 0;
}

.forecast-actions {
  flex-wrap: wrap;
  align-items: stretch;
}

.forecast-btn-primary,
.forecast-btn-secondary {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 700;
}

.forecast-btn-primary {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border-color: rgba(37, 99, 235, 0.25);
  color: #fff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
}

.forecast-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-color: rgba(37, 99, 235, 0.35);
}

.forecast-inline-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(254, 242, 242, 0.9);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #dc2626;
  font-size: 14px;
  font-weight: 600;
}

.forecast-kv-list {
  display: grid;
  gap: 10px;
  color: #475569;
  font-size: 15px;
}

.forecast-script-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.forecast-script-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.92);
}

.forecast-script-name {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

.forecast-core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.forecast-core-card {
  margin: 0;
  padding: 18px 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.9));
  border: 1px solid rgba(191, 219, 254, 0.52);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.forecast-core-plot {
  grid-column: 1 / -1;
}

.forecast-plot-panel {
  grid-column: 1 / -1;
  margin-top: 0;
}

.forecast-plot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.forecast-plot-grid .forecast-core-plot {
  grid-column: auto;
}

.forecast-core-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.forecast-core-head h3 {
  margin: 0;
  font-size: 22px;
}

.forecast-core-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.forecast-update-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  border: 1px solid rgba(191, 219, 254, 0.82);
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.forecast-link {
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.forecast-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.forecast-core-image {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #fff;
  max-height: none;
  object-fit: contain;
}

.forecast-section-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.forecast-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.68);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
}

.forecast-sync-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.95), rgba(224, 242, 254, 0.95));
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: #0369a1;
  font-size: 14px;
  font-weight: 700;
}

.forecast-table-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

.forecast-compare-desc {
  margin-bottom: 12px;
}

.forecast-note-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.forecast-advanced-panel {
  margin-top: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px 16px;
}

.forecast-advanced-panel summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #2563eb;
  user-select: none;
  list-style: none;
}

.forecast-advanced-panel summary::-webkit-details-marker {
  display: none;
}

.forecast-advanced-panel summary::after {
  content: "展开";
  float: right;
  color: #64748b;
  font-weight: 500;
}

.forecast-advanced-panel[open] summary::after {
  content: "收起";
}

.forecast-doc-panel {
  border: 0;
  position: relative;
  margin-left: auto;
}

.forecast-doc-panel summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(191, 219, 254, 0.75);
  color: #123b67;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
  list-style: none;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.forecast-doc-panel summary::-webkit-details-marker {
  display: none;
}

.forecast-doc-panel summary::after {
  content: "展开";
  color: #355372;
  font-size: 13px;
  font-weight: 500;
}

.forecast-doc-panel[open] summary::after {
  content: "收起";
}

.forecast-doc-content {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(560px, calc(100vw - 80px));
  max-height: 420px;
  overflow: auto;
  margin-top: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  color: #475569;
}

.forecast-table-wrap {
  overflow-x: auto;
}

.forecast-table-wrap-tall {
  max-height: 420px;
  overflow: auto;
}

.forecast-compare-controls {
  margin: 14px 0 18px;
  max-width: 360px;
}

.forecast-compare-summary {
  margin-top: 10px;
  padding: 16px 18px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.92));
  border: 1px solid rgba(191, 219, 254, 0.54);
}

.forecast-compare-time {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.forecast-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.forecast-compare-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.48);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.92));
}

.forecast-compare-title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1e3a8a;
}

.forecast-compare-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
  color: #475569;
}

.forecast-compare-item:last-child {
  border-bottom: 0;
}

.forecast-compare-item strong {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
}

.forecast-secondary-layout {
  display: grid;
  gap: 18px;
}

.forecast-info-grid {
  display: grid;
  gap: 18px;
}

.forecast-info-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 250, 255, 0.82));
}

.forecast-info-card .hint-text {
  margin-bottom: 12px;
}

.forecast-kv-list div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.86);
}

.forecast-artifact-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.forecast-artifact-image {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
}

@media (max-width: 1024px) {
  .eddy-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eddy-header {
    flex-direction: column;
  }

  .forecast-stat-grid {
    grid-template-columns: 1fr;
  }

  .forecast-control-summary {
    grid-template-columns: 1fr;
  }

  .forecast-script-list,
  .forecast-core-grid,
  .forecast-compare-grid {
    grid-template-columns: 1fr;
  }

  .forecast-plot-grid {
    grid-template-columns: 1fr;
  }

  .forecast-header {
    flex-direction: column;
    align-items: stretch;
  }

  .forecast-doc-panel {
    margin-left: 0;
  }

  .forecast-panel-head,
  .forecast-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .forecast-section-tags {
    justify-content: flex-start;
  }

  .forecast-doc-content {
    width: min(560px, calc(100vw - 48px));
  }

  .forecast-query-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forecast-query-bar-main,
  .forecast-query-bar-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forecast-core-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .eddy-query-bar {
    grid-template-columns: 1fr;
  }

  .eddy-stat-grid {
    grid-template-columns: 1fr;
  }

  .eddy-chart-row {
    grid-template-columns: 1fr;
  }

  .eddy-chart-main,
  .eddy-chart-secondary {
    height: 360px;
  }

  .eddy-artifact-image {
    height: 260px;
  }

  .eddy-artifact-grid {
    grid-template-columns: 1fr;
  }

  .forecast-query-bar {
    grid-template-columns: 1fr;
  }

  .forecast-query-bar-main,
  .forecast-query-bar-advanced {
    grid-template-columns: 1fr;
  }

  .forecast-control-summary {
    grid-template-columns: 1fr;
  }

  .forecast-doc-content {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .anomaly-events-scroll {
    max-height: 460px;
  }

  .anomaly-query-bar {
    grid-template-columns: 1fr;
  }

  .anomaly-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-tags {
    margin-left: 0;
  }

  .preview-chart-wrap .chart.small {
    height: 360px;
  }
}

/* 管理仪表盘样式 */
.admin-overview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-stat-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.admin-stat-label {
  font-size: 13px;
  color: #64748b;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 10px;
}

.admin-tabs button {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-tabs button.active {
  background: white;
  color: #3b82f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.admin-tabs button:hover:not(.active) {
  color: #3b82f6;
}

.admin-gauge-card {
  text-align: center;
}

.admin-gauge-card h3 {
  margin-bottom: 12px;
  font-size: 15px;
  color: #475569;
}

.admin-gauge-detail {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  font-size: 13px;
  color: #64748b;
}

.admin-gauge-detail strong {
  color: #334155;
}

.admin-uptime-panel {
  text-align: center;
  padding: 20px 0;
}

.admin-uptime-value {
  font-size: 32px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 8px;
}

.admin-uptime-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.admin-uptime-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.admin-uptime-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.admin-user-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.admin-user-stat {
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
}

.admin-user-stat .label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.admin-user-stat .value {
  font-size: 26px;
  font-weight: 700;
  color: #3b82f6;
}

.admin-user-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-search-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-search-box input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  min-width: 180px;
}

.admin-search-box input:focus {
  outline: none;
  border-color: #3b82f6;
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
}

.admin-pagination .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.admin-action-btns {
  display: flex;
  gap: 6px;
}

.admin-role-select {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  background: white;
}

.btn-tiny {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tiny:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  color: #3b82f6;
}

.btn-tiny.btn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.btn-tiny.btn-primary:hover {
  background: #2563eb;
}

.btn-tiny.btn-danger {
  color: #ef4444;
  border-color: #fecaca;
}

.btn-tiny.btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.user-list-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.user-list-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.user-list-header > span,
.user-list-item > span {
  flex-shrink: 1;
  text-align: left;
  padding: 0 6px;
}

.user-list-header > span:first-child,
.user-list-item > span:first-child {
  padding-left: 0;
}

.user-list-header > span:last-child,
.user-list-item > span:last-child {
  padding-right: 0;
}

.user-list-header .user-id,
.user-list-item .user-id {
  width: 40px;
}

.user-list-header .user-name,
.user-list-item .user-name {
  width: 100px;
}

.user-list-header .user-email,
.user-list-item .user-email {
  width: 200px;
}

.user-list-header .user-role,
.user-list-item .user-role {
  width: 70px;
}

.user-list-header .user-status,
.user-list-item .user-status {
  width: 50px;
}

.user-list-header .user-logins,
.user-list-item .user-logins {
  width: 60px;
}

.user-list-header .user-last,
.user-list-item .user-last {
  width: 140px;
}

.user-list-header .user-actions,
.user-list-item .user-actions {
  flex: 1;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.user-list-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.user-list-item:hover {
  background: #f8fafc;
}

.user-list-item .user-id {
  color: #94a3b8;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-list-item .user-name {
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-list-item .user-email {
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-list-item .user-status {
  font-weight: 500;
}

.user-list-item .user-logins {
  color: #64748b;
}

.user-list-item .user-last {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 900px) {
  .user-list-header,
  .user-list-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .user-list-header .user-email,
  .user-list-item .user-email {
    flex: none;
    width: calc(100% - 120px);
    max-width: none;
  }

  .user-list-header .user-last,
  .user-list-item .user-last {
    display: none;
  }

  .user-list-header .user-actions,
  .user-list-item .user-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .user-list-header {
    display: none;
  }
}

@media (max-width: 768px) {
  .admin-overview-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-user-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-user-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-search-box {
    flex-wrap: wrap;
  }

  .admin-search-box input {
    min-width: 120px;
    flex: 1;
  }
}

/* =============================================
   聊天 Markdown 渲染样式 (DeepSeek 风格)
   ============================================= */
.markdown-body {
  font-size: 14px;
  line-height: 1.65;
  color: #333;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 12px 0 6px 0;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}
.markdown-body h1 { font-size: 1.4em; border-bottom: 1px solid #e8e8e8; padding-bottom: 6px; }
.markdown-body h2 { font-size: 1.25em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body h4 { font-size: 1.05em; }

.markdown-body p {
  margin: 4px 0 8px 0;
}

.markdown-body strong {
  font-weight: 600;
  color: #1a1a1a;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 20px;
  margin: 4px 0 8px 0;
}
.markdown-body li {
  margin: 2px 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}
.markdown-body th,
.markdown-body td {
  border: 1px solid #e0e0e0;
  padding: 6px 10px;
  text-align: left;
}
.markdown-body th {
  background: #f5f7fa;
  font-weight: 600;
  color: #444;
}
.markdown-body tr:nth-child(even) {
  background: #fafbfc;
}

.markdown-body code {
  background: #f0f0f0;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
  color: #d63384;
}
.markdown-body pre {
  background: #f5f7fa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  margin: 8px 0;
}
.markdown-body pre code {
  background: none;
  padding: 0;
  color: #333;
  font-size: 0.85em;
  line-height: 1.5;
}

.markdown-body blockquote {
  border-left: 3px solid #2563eb;
  margin: 8px 0;
  padding: 6px 12px;
  background: #f0f4ff;
  color: #555;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 12px 0;
}

.markdown-body a {
  color: #2563eb;
  text-decoration: none;
}
.markdown-body a:hover {
  text-decoration: underline;
}
