/* ========================================================
   main.css — 全局样式
   ======================================================== */
:root {
  --ink:        #0a1628;
  --ink-soft:   #1e3a5f;
  --sea-deep:   #0d2f5e;
  --sea-mid:    #1a5276;
  --sea-light:  #2e86c1;
  --sea-foam:   #5dade2;
  --sea-pale:   #a9cce3;
  --gold:       #d4a843;
  --gold-light: #f0c96e;
  --white:      #f8fafc;
  --white-dim:  rgba(248,250,252,0.08);
  --white-dim2: rgba(248,250,252,0.14);
  --glass:      rgba(13,47,94,0.55);
  --glass2:     rgba(10,22,40,0.72);
  --border:     rgba(93,173,226,0.22);
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 8px 32px rgba(0,0,0,0.35);
  --font-serif: 'Noto Serif SC', serif;
  --font-mono:  'Space Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-serif);
  background: var(--ink);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 海洋背景 ── */
.ocean-bg {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(160deg, #03111f 0%, #0d2f5e 45%, #1a5276 100%);
  overflow: hidden;
}
.wave {
  position: absolute; bottom: 0; left: -60%;
  width: 220%; border-radius: 50% 50% 0 0;
  opacity: 0.18; animation: waveFlow linear infinite;
}
.wave-1 { height: 200px; background: var(--sea-foam); animation-duration: 14s; }
.wave-2 { height: 160px; background: var(--sea-light); animation-duration: 20s; animation-delay: -6s; opacity: 0.12; }
.wave-3 { height: 120px; background: var(--sea-pale);  animation-duration: 26s; animation-delay: -12s; opacity: 0.08; }
@keyframes waveFlow {
  0%   { transform: translateX(0)   scaleY(1); }
  50%  { transform: translateX(15%) scaleY(1.06); }
  100% { transform: translateX(0)   scaleY(1); }
}

/* ── 层叠 ── */
header, main, footer { position: relative; z-index: 1; }

/* ── 导航 ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px);
  background: var(--glass2);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 600; letter-spacing: 0.04em; color: var(--sea-foam); }
.site-nav { display: flex; gap: 8px; }
.nav-link {
  padding: 6px 16px; border-radius: 999px;
  text-decoration: none; color: var(--sea-pale); font-size: 14px;
  transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { background: var(--white-dim2); color: var(--white); }

/* ── 主内容 ── */
.main-content { max-width: 1200px; margin: 0 auto; padding: 40px 24px 80px; }

/* ── 面包屑 ── */
.breadcrumb { font-size: 13px; color: var(--sea-pale); margin-bottom: 24px; }
.breadcrumb a { color: var(--sea-foam); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 8px; }

/* ── 站点 Hero ── */
.station-hero {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 16px; margin-bottom: 32px;
}
.station-province-badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: rgba(93,173,226,0.18); color: var(--sea-foam);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.station-h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700;
  line-height: 1.2; margin-bottom: 10px;
}
.station-coords {
  display: flex; gap: 16px; align-items: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--sea-pale);
}
.station-id-badge {
  padding: 2px 10px; background: var(--white-dim);
  border-radius: 6px; font-size: 12px; color: var(--gold-light);
}
.update-info {
  font-size: 12px; color: var(--sea-pale); font-family: var(--font-mono);
  background: var(--white-dim); border-radius: 8px; padding: 8px 14px;
  border: 1px solid var(--border);
}

/* ── 日期标签 ── */
.date-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  margin-bottom: 28px; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.date-tab {
  flex-shrink: 0; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--white-dim);
  color: var(--sea-pale); cursor: pointer;
  font-size: 13px; font-family: var(--font-serif);
  transition: background .2s, color .2s; white-space: nowrap;
}
.date-tab.active {
  background: var(--sea-foam); color: var(--ink);
  border-color: var(--sea-foam); font-weight: 700;
}
.date-tab:hover:not(.active) { background: var(--white-dim2); color: var(--white); }

/* ── 标题 ── */
.section-h2 {
  font-size: 16px; font-weight: 600; color: var(--sea-pale);
  letter-spacing: 0.06em; margin-bottom: 18px;
}
.tide-cards-section { margin-bottom: 32px; }

/* ── 潮汐卡片 ── */
.tide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.tide-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 20px;
  text-align: center; backdrop-filter: blur(12px);
  transition: transform .2s, box-shadow .2s;
}
.tide-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.card-type { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.tide-card.high .card-type  { color: var(--gold-light); }
.tide-card.low  .card-type  { color: var(--sea-foam); }
.card-height { font-size: 2.6rem; font-weight: 700; font-family: var(--font-mono); line-height: 1; margin-bottom: 6px; }
.tide-card.high .card-height { color: var(--gold-light); }
.tide-card.low  .card-height { color: var(--sea-foam); }
.card-unit { font-size: 13px; color: var(--sea-pale); margin-bottom: 14px; }
.card-time {
  font-family: var(--font-mono); font-size: 14px; color: var(--white);
  background: var(--white-dim); border-radius: 8px; padding: 6px 12px; display: inline-block;
}

/* ── 骨架屏 ── */
.skeleton-card {
  background: var(--white-dim); border-radius: var(--radius-lg);
  height: 160px; animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%,100% { opacity: .4; } 50% { opacity: .7; }
}

/* ── 图表 ── */
.chart-section {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; backdrop-filter: blur(12px);
  margin-bottom: 32px;
}
.chart-wrap { position: relative; }

/* ── 周边站点 ── */
.nearby-section { margin-bottom: 40px; }
.nearby-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.nearby-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-decoration: none; color: inherit;
  transition: border-color .2s, transform .2s;
}
.nearby-card:hover { border-color: var(--sea-foam); transform: translateY(-2px); }
.nearby-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.nearby-meta { font-size: 12px; color: var(--sea-pale); }

/* ── 科普内容 ── */
.info-section { margin-bottom: 40px; }
.info-block {
  background: var(--white-dim); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.info-block h2 { font-size: 18px; color: var(--sea-foam); margin-bottom: 14px; }
.info-block p {
  font-size: 14px; color: var(--sea-pale); line-height: 1.95;
  margin-bottom: 12px;
}

/* ── 无数据 ── */
.no-data { color: var(--sea-pale); text-align: center; padding: 20px; font-size: 14px; }

/* ── 错误 ── */
.error-banner {
  background: rgba(220,53,69,.18); border: 1px solid rgba(220,53,69,.4);
  color: #f5c6cb; border-radius: var(--radius); padding: 14px 20px;
  font-size: 14px; text-align: center; margin: 16px 0;
}

/* ── 页脚 ── */
.site-footer {
  text-align: center; padding: 24px;
  font-size: 12px; color: var(--sea-pale);
  border-top: 1px solid var(--border); position: relative; z-index: 1;
}
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--sea-foam); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ── 响应式 ── */
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .main-content { padding: 24px 16px 60px; }
  .tide-cards { grid-template-columns: 1fr 1fr; }
  .station-hero { flex-direction: column; }
}
