:root {
  --ink: #16262c;
  --ink-2: #4e646c;
  --ink-3: #8fa1a7;
  --line: #e4ebec;
  --line-2: #eef3f4;
  --card: #ffffff;
  --sea: #2a7c90;
  --sea-deep: #17505f;
  --sea-soft: #e9f3f5;
  --sand: #c9976f;
  --sand-soft: #f6efe8;
  --warn: #d4703c;
  --good: #4f8a6b;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #edf3f4 0%, #f2f2ee 46%, #f5f2ec 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

.shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 30px 34px 48px;
}

/* ───────── header ───────── */
.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 42px; height: 42px;
  flex: none;
  color: var(--sea);
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand .sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.head-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.date-line {
  text-align: right;
  line-height: 1.5;
}

.date-main {
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.date-sub {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.lunar-hl { color: var(--sea); font-family: "Songti SC", "Noto Serif SC", serif; }

.refresh-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.stamp {
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.back {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: border-color .18s, color .18s, background .18s;
}
.back:hover { border-color: var(--sea); color: var(--sea-deep); background: #fff; }

.refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.refresh:hover { border-color: var(--sea); color: var(--sea-deep); background: #fff; }
.refresh svg { width: 15px; height: 15px; transition: transform .5s ease; }
.refresh.spinning svg { transform: rotate(360deg); }
.refresh:disabled { cursor: default; opacity: .6; }

/* ───────── grid ───────── */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: 0 1px 2px rgba(22, 38, 44, .03), 0 14px 32px -26px rgba(22, 38, 44, .5);
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.card-title .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sea);
  flex: none;
}

.card-note {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.s7 { grid-column: span 7; }
.s5 { grid-column: span 5; }
.s4 { grid-column: span 4; }
.s12 { grid-column: span 12; }

/* ───────── weather ───────── */
.wx-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wx-temp {
  font-size: 66px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.wx-temp sup {
  font-size: 24px;
  font-weight: 400;
  vertical-align: super;
  letter-spacing: 0;
  margin-left: 2px;
  color: var(--ink-2);
}

.wx-desc {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.wx-feels { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.wx-icon {
  width: 92px; height: 92px;
  flex: none;
  color: var(--sea);
  margin: 2px 4px 0 0;
}
.wx-icon.sun { color: #e0a23c; }
.wx-icon.fog { color: #9aa8ac; }
.wx-icon.rain { color: #4d87a3; }
.wx-icon.snow { color: #7fa8bd; }
.wx-icon.thunder { color: #8a7ba8; }

.wx-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
  margin-bottom: 18px;
}

.metric {
  background: #fff;
  padding: 10px 12px 11px;
}
.metric .k {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
.metric .v {
  font-size: 16px;
  color: var(--ink);
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.metric .v small { font-size: 11px; color: var(--ink-3); margin-left: 2px; }

.hourly {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.hour {
  text-align: center;
  padding: 2px 0;
  border-radius: 8px;
}
.hour.on { background: var(--sea-soft); }
.hour .t { font-size: 11px; color: var(--ink-3); }
.hour .i { width: 20px; height: 20px; margin: 5px auto 3px; color: var(--sea); display: block; }
.hour .d { font-size: 13px; color: var(--ink); }
.hour .p { font-size: 10.5px; color: var(--sea); height: 14px; }

.sun-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}
.sun-row b { color: var(--ink-2); font-weight: 500; }

/* ───────── tide ───────── */
.tide-now {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.tide-val {
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--sea-deep);
}
.tide-val small { font-size: 15px; color: var(--ink-2); font-weight: 400; margin-left: 2px; }

.tide-tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.tide-tag.rise { background: #fdf1e8; color: #b4662f; }
.tide-tag.fall { background: var(--sea-soft); color: var(--sea-deep); }

.chart-wrap { margin: 12px -4px 0; position: relative; }
.chart-wrap svg { display: block; width: 100%; height: 132px; overflow: visible; }

.tide-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin-top: 10px;
}

.tide-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}
.tide-item .lab {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--sea);
  border-radius: 4px;
  padding: 1px 5px;
  transform: translateY(-1px);
}
.tide-item .lab.low { background: var(--sand); }
.tide-item .tm { color: var(--ink); }
.tide-item .hh { color: var(--ink-3); font-size: 11.5px; }

.sea-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}
.sea-row .metric { padding: 9px 11px 10px; }

.rmk {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--sand-soft);
  border-radius: 10px;
  padding: 9px 12px;
}
.rmk b { color: #a2642f; font-weight: 600; }

/* ───────── 7-day strip ───────── */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}
.day {
  padding: 2px 10px;
  border-left: 1px dashed var(--line);
  text-align: center;
}
.day:first-child { border-left: none; }
.day.today { background: var(--sea-soft); border-radius: 12px; }
.day .w { font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }
.day .d { font-size: 15px; color: var(--ink); margin-top: 1px; }
.day .l { font-size: 11px; color: var(--sea); font-family: "Songti SC", "Noto Serif SC", serif; margin-top: 2px; height: 18px; }
.day .i { width: 24px; height: 24px; margin: 6px auto 2px; display: block; color: var(--sea); }
.day .tp { font-size: 14px; color: var(--ink); }
.day .tp span { color: var(--ink-3); font-size: 12px; margin-left: 5px; }
.day .td { font-size: 11px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.day .td b { color: var(--sea-deep); font-weight: 500; }

/* ───────── almanac ───────── */
.alm-top { display: flex; align-items: flex-start; gap: 16px; }

.alm-day {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 40px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.alm-month {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  margin-bottom: 2px;
}

.alm-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line-2);
}
.alm-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.alm-row .k { color: var(--ink-3); letter-spacing: 0.06em; flex: none; }
.alm-row .v { color: var(--ink); text-align: right; }
.alm-row .v.serif { font-family: "Songti SC", "Noto Serif SC", serif; }

.moon {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-2);
}
.moon svg { width: 26px; height: 26px; color: var(--sea-deep); flex: none; }

/* ───────── 海边指数 ───────── */
.idx-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-2);
}

.idx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.idx-row:last-child { border-bottom: none; }

.idx-name {
  flex: none;
  width: 62px;
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: 0.05em;
}

.idx-chip {
  flex: none;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.idx-chip.yes { background: #eaf4ee; color: var(--good); }
.idx-chip.mid { background: #f5f2e8; color: #9a8434; }
.idx-chip.no { background: #fdf0e9; color: var(--warn); }

.idx-why {
  flex: 1;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
  line-height: 1.45;
}

/* ───────── 公众号 ───────── */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px 11px;
  background: linear-gradient(180deg, #fbfdfd 0%, #fff 100%);
}

.acc-name {
  font-size: 14.5px;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.acc-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 3px 0 9px;
}

.acc-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--sea-deep);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.acc-btn:hover { border-color: var(--sea); background: var(--sea-soft); }

.acc-hint {
  margin-top: 13px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 12px);
  background: rgba(22, 38, 44, .92);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 50;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.empty {
  padding: 26px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.skel {
  background: linear-gradient(90deg, #f1f5f5 25%, #f8fafa 37%, #f1f5f5 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  border-radius: 6px;
  color: transparent !important;
}
@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.alert {
  font-size: 12px;
  color: var(--warn);
  background: #fdf2ec;
  border-radius: 8px;
  padding: 7px 11px;
  margin-top: 10px;
}

/* ───────── footer ───────── */
.foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--sea-deep); border-color: var(--sea); }

@media (max-width: 1180px) {
  .s7, .s5 { grid-column: span 12; }
  .s4 { grid-column: span 6; }
  .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .day:nth-child(5) { border-left: none; }
}

@media (max-width: 760px) {
  .shell { padding: 20px 16px 36px; }
  .s4 { grid-column: span 12; }
  .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day { border-left: none; }
  .wx-temp { font-size: 54px; }
  .wx-icon { width: 68px; height: 68px; }
  .head { align-items: flex-start; }
  .date-line { text-align: left; }
  .hourly { grid-auto-columns: minmax(58px, 1fr); overflow-x: auto; padding-bottom: 4px; }
  .wx-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-line { min-width: 0; }
  .date-sub { letter-spacing: 0.01em; }
}
