/* ============================================
   shared.css - 公共样式 v2 美化升级版
   天气污染监测平台
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg-dark: #060a14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-solid: #0f172a;
  --bg-card2: rgba(30, 41, 59, 0.65);
  --border: rgba(99,179,237,0.1);
  --border-glow: rgba(99,179,237,0.25);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent-blue: #60a5fa;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --accent-yellow: #fbbf24;
  --accent-orange: #fb923c;
  --accent-red: #f87171;
  --accent-purple: #a78bfa;
  --accent-pink: #f472b6;
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-border: rgba(255,255,255,0.08);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-hover: 0 8px 40px rgba(96,165,250,0.12), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 30px rgba(96,165,250,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 动态网格背景 */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(96,165,250,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(34,211,238,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(167,139,250,0.03) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* 网格线 */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(96,165,250,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ===== 粒子背景容器 ===== */
#particleCanvas {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
}

/* ===== 导航栏 ===== */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(6,10,20,0.8);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; gap: 24px;
}

.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee, #a78bfa);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(96,165,250,0.25);
  animation: logoShimmer 4s ease-in-out infinite;
}

@keyframes logoShimmer {
  0%,100% { box-shadow: 0 0 20px rgba(96,165,250,0.25); }
  50% { box-shadow: 0 0 30px rgba(96,165,250,0.4); }
}

.logo-text {
  font-size: 17px; font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #22d3ee, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; white-space: nowrap;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex; align-items: center; gap: 4px; flex: 1;
}

.nav-link {
  padding: 8px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none; transition: all 0.25s; white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(96,165,250,0.5);
}

.nav-right {
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
}

.live-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 20px; color: var(--accent-green);
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--accent-green); border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(52,211,153,0.6);
}

@keyframes livePulse {
  0%,100% { opacity:1; transform:scale(1); box-shadow: 0 0 8px rgba(52,211,153,0.6); }
  50% { opacity:0.6; transform:scale(1.4); box-shadow: 0 0 16px rgba(52,211,153,0.3); }
}

.nav-time {
  font-size: 13px; color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
}

/* ===== 页面容器 ===== */
.page-container {
  position: relative; z-index: 1;
  max-width: 1600px; margin: 0 auto;
  padding: 28px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 22px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}

.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}

/* ===== 按钮 ===== */
.btn-primary {
  padding: 10px 24px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #0a0e1a; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.25s; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(96,165,250,0.25);
  letter-spacing: 0.3px;
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(96,165,250,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(96,165,250,0.2); }

.mini-btn {
  padding: 5px 14px; border-radius: 10px;
  background: var(--bg-card2); border: 1px solid var(--glass-border);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.mini-btn.active, .mini-btn:hover {
  background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.3); color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(96,165,250,0.08);
}

/* ===== AQI 颜色类（升级发光版）===== */
.bg-good     { background:rgba(52,211,153,0.1); border-color:rgba(52,211,153,0.3)!important; color:#34d399; box-shadow: inset 0 0 20px rgba(52,211,153,0.05); }
.bg-moderate { background:rgba(251,191,36,0.1); border-color:rgba(251,191,36,0.3)!important;  color:#fbbf24; box-shadow: inset 0 0 20px rgba(251,191,36,0.05); }
.bg-usg      { background:rgba(251,146,60,0.1); border-color:rgba(251,146,60,0.3)!important;  color:#fb923c; box-shadow: inset 0 0 20px rgba(251,146,60,0.05); }
.bg-unhealthy{ background:rgba(248,113,113,0.1);border-color:rgba(248,113,113,0.3)!important; color:#f87171; box-shadow: inset 0 0 20px rgba(248,113,113,0.05); }
.bg-very     { background:rgba(167,139,250,0.1);border-color:rgba(167,139,250,0.3)!important; color:#a78bfa; box-shadow: inset 0 0 20px rgba(167,139,250,0.05); }
.bg-hazardous{ background:rgba(244,63,94,0.12); border-color:rgba(244,63,94,0.35)!important;  color:#fb7185; box-shadow: inset 0 0 20px rgba(244,63,94,0.05); }

/* ===== 进度条 ===== */
.progress-bar-bg {
  width:100%; height:6px;
  background:rgba(255,255,255,0.06);
  border-radius:3px; overflow:hidden;
}
.progress-bar-fill {
  height:100%; border-radius:3px;
  transition:width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 0 3px 3px 0;
}

/* ===== 数字动画 ===== */
.num-animate {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Inter', monospace;
}

/* ===== 渐变文字 ===== */
.gradient-text-blue {
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-green {
  background: linear-gradient(135deg, #34d399, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #fb923c, #f87171);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== 发光分隔线 ===== */
.glow-divider {
  height: 1px; border: none; margin: 20px 0;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(96,165,250,0.2); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:rgba(96,165,250,0.35); }

/* ===== 入场动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.animate-in {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ===== 工具 ===== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--glass-border);
}

.glow-border {
  position: relative;
}
.glow-border::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(96,165,250,0.15), transparent, rgba(34,211,238,0.1));
  z-index: -1;
  filter: blur(4px);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .page-container { padding: 14px; }
  .navbar { padding: 0 16px; gap: 10px; height: 56px; }
  .logo-text { display: none; }
  .nav-link { font-size: 12px; padding: 6px 10px; }
  .nav-time { display: none; }
}
