/* ========================================================
   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;
}
/* 全局链接重置：去掉蓝色和下划线 */
a { color: inherit; text-decoration: none; }

/* ── 海洋背景 ── */
.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 16px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit; flex-shrink: 0;
}
.logo-icon { font-size: 22px; }
.logo-text { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; color: var(--sea-foam); white-space: nowrap; }
.site-nav { display: flex; gap: 2px; flex-shrink: 0; }
.nav-link {
  padding: 5px 10px; border-radius: 999px;
  text-decoration: none; color: var(--sea-pale); font-size: 13px;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { background: var(--white-dim2); color: var(--white); }

/* 手机端导航紧凑处理 */
@media (max-width: 480px) {
  .header-inner { padding: 0 10px; height: 50px; }
  .logo-text { font-size: 14px; }
  .nav-link { padding: 4px 7px; font-size: 12px; }
  .site-nav { gap: 0; }
}

/* ── 主内容 ── */
.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; }
}

/* ══════════════════════════════════════════
   潮汐状态实时指示器
══════════════════════════════════════════ */
.tide-status-bar {
  background: var(--glass2);
  border: 1px solid rgba(93,173,226,0.2);
  border-radius: var(--radius);
  padding: 14px 20px 12px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
}
.tsb-inner {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.tsb-arrow {
  font-size: 1.6rem; line-height: 1; font-weight: 700;
  transition: color .4s;
}
.tsb-arrow.rising  { color: #e67e22; }
.tsb-arrow.falling { color: #5dade2; }
.tsb-label {
  font-size: 14px; color: var(--white); font-weight: 500;
}
.tsb-countdown {
  font-family: var(--font-mono); font-size: 15px;
  color: #f1c40f; font-weight: 700; letter-spacing: 0.03em;
}
.tsb-progress-wrap {
  width: 100%; height: 4px;
  background: rgba(93,173,226,0.15); border-radius: 999px; overflow: hidden;
}
.tsb-progress {
  height: 100%; border-radius: 999px;
  transition: width 1s linear, background-color .4s;
}
.tsb-progress.rising  { background: linear-gradient(90deg, #e67e22, #f39c12); }
.tsb-progress.falling { background: linear-gradient(90deg, #2980b9, #5dade2); }

/* ══════════════════════════════════════════
   赶海日历
══════════════════════════════════════════ */
.ganhai-section { margin-top: 36px; }
.ganhai-tip {
  font-size: 12px; color: var(--sea-pale);
  font-weight: 400; margin-left: 8px;
}
.ganhai-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .ganhai-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
}
@media (max-width: 480px) {
  .ganhai-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .ganhai-tip  { display: none; }
}
.ganhai-day {
  border-radius: var(--radius); padding: 12px 8px;
  text-align: center; border: 1px solid var(--border);
  backdrop-filter: blur(8px); transition: transform .15s;
}
.ganhai-day:hover { transform: translateY(-2px); }
.ganhai-day.good {
  background: rgba(46,125,50,0.18);
  border-color: rgba(102,187,106,0.4);
}
.ganhai-day.bad {
  background: var(--glass2);
  border-color: var(--border);
}
.gd-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px; flex-wrap: wrap; gap: 2px;
}
.gd-label { font-size: 12px; font-weight: 700; color: var(--white); }
.gd-date  { font-size: 10px; color: var(--sea-pale); }
.gd-icon  { font-size: 1.5rem; margin-bottom: 4px; }
.gd-status {
  font-size: 11px; font-weight: 600; margin-bottom: 4px;
}
.ganhai-day.good .gd-status { color: #81c784; }
.ganhai-day.bad  .gd-status { color: var(--sea-pale); }
.gd-time   { font-size: 10px; color: var(--sea-pale); margin-bottom: 2px; font-family: var(--font-mono); }
.gd-height { font-size: 12px; color: #5dade2; font-family: var(--font-mono); font-weight: 700; }