/* =====================================================================
 * 鲸鱼 · 浅水湾主题（频道转播版 · 气泡流布局）
 * 布局参考 t.me/s 预览页的信息组织（顶栏 + 消息流 + 频道信息侧栏），
 * 视觉风格完全独立：奶油白底 + 浅水蓝/薄荷绿主色 + 少量暖黄强调。
 * ===================================================================== */

/* ---------- 1. 设计 token ---------- */
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/fredoka-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
                 U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:            #FFFDF8;
  --surface:       #FFFFFF;
  --surface-2:     #F3FAFC;
  --brand-50:      #EAF6FB;
  --brand-100:     #D8EEF7;
  --brand-300:     #8FCDE8;
  --brand-500:     #5FB0D5;
  --brand-600:     #3E8DB5;
  --brand-700:     #2F6E90;
  --mint-100:      #E4F6EF;
  --mint-500:      #5BBFA2;
  --warm-100:      #FFF3D6;
  --warm-300:      #FFE193;
  --warm-500:      #F5B940;
  --warm-600:      #8F5F0D;
  --ink-900:       #1F3A4F;
  --ink-700:       #2C5069;
  --ink-500:       #4C6B7E;
  --ink-400:       #567385;
  --line:          #E4EFF4;

  --radius-sm:     10px;
  --radius-md:     16px;
  --radius-lg:     22px;
  --radius-pill:   999px;

  --shadow-soft:   0 2px 10px rgba(62, 141, 181, .08);
  --shadow-lift:   0 8px 20px rgba(62, 141, 181, .15);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-num: "Fredoka", var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;

  --container-narrow: 960px;
  --header-h: 64px;

  /* 时段涂装：正午为默认值，清晨/黄昏/夜晚在下方覆盖 */
  --header-bg:     rgba(255, 253, 248, .92);
  --glow-1:        rgba(143, 205, 232, .14);
  --glow-2:        rgba(168, 224, 206, .13);
  --wave-color:    var(--brand-100);
  --scroll-thumb:  #CFE5EE;
  --code-bg:       #F4FAFD;
  --chip-count-bg: rgba(255, 255, 255, .6);
  --breath-bg:     rgba(255, 255, 255, .65);
  --chan-grad:     linear-gradient(118deg, #FFF6E3 0%, #EAF6FB 46%, #DFF2EF 100%);
  --chan-border:   #E6F2F7;
  --chan-dot:      rgba(124, 198, 226, .16);
  --pinned-grad:   linear-gradient(180deg, #FFFCF0 0%, #FFF6DC 100%);
  --pinned-border: #F0DFAE;
  --tape-bg:       rgba(255, 226, 145, .78);
  --tape-border:   rgba(214, 178, 92, .32);
  --pinned-shadow: 0 2px 10px rgba(158, 124, 42, .09);
  --ticket-grad:   linear-gradient(180deg, #FFFCF1 0%, #FFF7E4 100%);
  --ticket-border: #E8D9AE;
  --ticket-ink:    #7C6631;
  --ticket-strong: #5F4B17;
  --footer-grad:   linear-gradient(180deg, #F2FAFC 0%, #EAF6F1 100%);
  --footer-wave:   #F2FAFC;
  --draft-bg:      #FFF3CD;
  --draft-ink:     #8A6100;
  --on-brand:      #FFFFFF;
  --stat-bg:       rgba(255, 255, 255, .62);
  --stat-border:   rgba(255, 255, 255, .85);
  --stat-inset:    rgba(255, 255, 255, .75);
}

/* ---------- 1.1 时段主题：清晨 · 正午 · 黄昏 · 夜晚 ---------- */
/* 鲸鱼不变，只换鱼塘的光。清晨是雾粉，正午是晴水，黄昏是落日，夜晚是深海。 */
html[data-theme="dawn"] {
  color-scheme: light;
  --bg:            #FFF9F3;
  --glow-1:        rgba(255, 199, 168, .20);
  --glow-2:        rgba(168, 224, 206, .16);
  --header-bg:     rgba(255, 249, 243, .92);
  --wave-color:    #F6D9C8;
  --footer-grad:   linear-gradient(180deg, #FAF5EF 0%, #EDF6F0 100%);
  --footer-wave:   #FAF5EF;
}

html[data-theme="dusk"] {
  color-scheme: light;
  --bg:            #FDF6EE;
  --glow-1:        rgba(246, 194, 122, .24);
  --glow-2:        rgba(238, 154, 122, .13);
  --header-bg:     rgba(253, 246, 238, .92);
  --wave-color:    #F2CBA7;
  --ticket-ink:    #7A5A2E;
  --footer-grad:   linear-gradient(180deg, #F8EFE3 0%, #EFF6F0 100%);
  --footer-wave:   #F8EFE3;
}

html[data-theme="night"] {
  color-scheme: dark;
  --bg:            #0A1620;
  --surface:       #101F2B;
  --surface-2:     #162A38;
  --brand-50:      #0F2836;
  --brand-100:     #173A4C;
  --brand-300:     #4E90AC;
  --brand-500:     #6FC2E2;
  --brand-600:     #86D3F0;
  --brand-700:     #A9E2F7;
  --mint-100:      #12312B;
  --mint-500:      #5FC6A9;
  --warm-100:      #3A2E17;
  --warm-300:      #5C4820;
  --warm-500:      #E8B65C;
  --warm-600:      #F2D08C;
  --ink-900:       #E8F2F8;
  --ink-700:       #C6DCE8;
  --ink-500:       #9DBACB;
  --ink-400:       #86A5B7;
  --line:          #21384A;
  --shadow-soft:   0 2px 12px rgba(0, 0, 0, .38);
  --shadow-lift:   0 10px 26px rgba(0, 0, 0, .5);
  --header-bg:     rgba(10, 22, 32, .9);
  --glow-1:        rgba(58, 138, 168, .28);
  --glow-2:        rgba(30, 96, 88, .18);
  --wave-color:    #1C4054;
  --scroll-thumb:  #274457;
  --code-bg:       #0D1D29;
  --chip-count-bg: rgba(255, 255, 255, .1);
  --breath-bg:     rgba(170, 220, 240, .18);
  --chan-grad:     linear-gradient(118deg, #1B2A20 0%, #13293A 46%, #12312C 100%);
  --chan-border:   #1D3A45;
  --chan-dot:      rgba(111, 194, 226, .10);
  --pinned-grad:   linear-gradient(180deg, #26200F 0%, #211B0E 100%);
  --pinned-border: #4E4224;
  --tape-bg:       rgba(232, 182, 92, .30);
  --tape-border:   rgba(232, 182, 92, .30);
  --pinned-shadow: 0 2px 14px rgba(0, 0, 0, .45);
  --ticket-grad:   linear-gradient(180deg, #241F12 0%, #201B10 100%);
  --ticket-border: #4A3C1E;
  --ticket-ink:    #C9B079;
  --ticket-strong: #F0D69A;
  --footer-grad:   linear-gradient(180deg, #0C1A24 0%, #09141C 100%);
  --footer-wave:   #0C1A24;
  --draft-bg:      #3C2F12;
  --draft-ink:     #F0CE8A;
  --on-brand:      #06121B;
  --stat-bg:       rgba(255, 255, 255, .06);
  --stat-border:   rgba(255, 255, 255, .10);
  --stat-inset:    rgba(255, 255, 255, .05);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-900);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 420px at 85% -140px, var(--glow-1), transparent 65%),
    radial-gradient(900px 380px at -10% 4%, var(--glow-2), transparent 60%);
  background-repeat: no-repeat;
  transition: background-color .45s ease, color .3s ease;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--brand-700); text-decoration: none; }
img, svg { max-width: 100%; }
button { font-family: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--warm-300); color: var(--ink-900); }

::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 9px 16px;
  background: var(--brand-600);
  color: var(--on-brand);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  transition: top .2s ease;
}
.skip-link:focus { top: 10px; color: var(--on-brand); }

.container {
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: 22px;
}

.noscript-tip {
  margin: 20px auto;
  max-width: 560px;
  padding: 16px 20px;
  background: var(--warm-100);
  border: 1px solid var(--warm-300);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--warm-600);
}

.ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 3. 顶部导航（对应频道条位置，风格为鲸鱼） ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color .45s ease;
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.logo__mark { display: inline-flex; align-items: center; }
.logo__mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(45, 106, 180, .16));
}
.logo__text { display: flex; flex-direction: column; line-height: 1.25; }
.logo__name { font-size: 18px; font-weight: 800; letter-spacing: .5px; color: var(--ink-900); }
.logo__tag { font-size: 11px; color: var(--ink-400); letter-spacing: 2px; }

.header__channel {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-700);
  transition: background .15s ease, transform .15s ease;
}
.header__channel:hover { background: var(--brand-100); transform: translateY(-1px); }
.header__channel .ic { width: 15px; height: 15px; }

/* 水面线：顶栏下缘一条缓慢漂移的浅浪（顶栏随之成为“水面”）
   外层裁切、内层加宽漂移：铺满整行，又不会把页面撑出横向滚动 */
.header-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 7px;
  overflow: hidden;
  color: var(--wave-color);
  transition: color .45s ease;
  pointer-events: none;
}
.header-wave svg {
  display: block;
  width: 110%;
  max-width: none;
  height: 100%;
  margin-left: -5%;
  animation: header-drift 19s ease-in-out infinite alternate;
}
@keyframes header-drift {
  from { transform: translateX(-7px); }
  to   { transform: translateX(7px); }
}

/* 品牌鲸鱼：呼吸起伏 + 定时从头顶吐两个泡泡（只复用 logo，不新增图形） */
.logo__mark {
  position: relative;
  animation: whale-breathe 7.5s ease-in-out infinite;
}
.logo__mark::before,
.logo__mark::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 2px;
  width: 5px;
  height: 5px;
  border: 1.4px solid var(--brand-300);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  opacity: 0;
  pointer-events: none;
  animation: whale-spout 9s ease-out infinite;
}
.logo__mark::after {
  top: 2px;
  right: 11px;
  width: 3.5px;
  height: 3.5px;
  animation-delay: 4.5s;
}
.logo__mark img { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.logo:hover .logo__mark img { transform: rotate(-5deg) scale(1.04); }
@keyframes whale-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-1px) scale(1.025); }
}
@keyframes whale-spout {
  0%        { opacity: 0; transform: translate(0, 4px) scale(.6); }
  14%       { opacity: .85; }
  55%       { opacity: .4; }
  80%, 100% { opacity: 0; transform: translate(5px, -13px) scale(1.05); }
}

/* ---------- 4. 布局：消息流 + 频道信息侧栏 ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 28px;
  align-items: start;
  margin-top: 20px;
}
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 16px;
}

/* 移动端频道条（<1080px 时显示） */
.channel-strip { display: none; }

/* 站点公告（后台可配置） */
.announce {
  margin-top: 14px;
  padding: 9px 16px;
  background: var(--warm-100);
  border: 1px solid var(--warm-300);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--warm-600);
  overflow-wrap: break-word;
}

/* ---------- 5. 频道信息卡（侧栏） ---------- */
.chan-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 20px;
  border: 1px solid var(--chan-border);
  border-radius: var(--radius-lg);
  background: var(--chan-grad);
  transition: background-color .45s ease, border-color .45s ease;
  text-align: center;
}
.chan-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--chan-dot) 1.6px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(118deg, transparent 40%, #000 92%);
  mask-image: linear-gradient(118deg, transparent 40%, #000 92%);
  pointer-events: none;
}
.chan-card > * { position: relative; z-index: 1; }
.chan-card__name { font-size: 16px; font-weight: 800; line-height: 1.5; color: var(--ink-900); }
.chan-card__bio {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-500);
  text-align: left;
  overflow-wrap: break-word;
}
.chan-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.chan-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px 6px;
  border: 1px solid var(--stat-border);
  border-radius: 12px;
  background: var(--stat-bg);
  box-shadow: inset 0 1px 0 var(--stat-inset);
}
.chan-stat b {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
}
.chan-stat em { font-style: normal; font-size: 10.5px; line-height: 1.4; color: var(--ink-500); white-space: nowrap; }
.chan-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  transition: background .15s ease, transform .15s ease;
}
.chan-card__btn:hover { background: var(--brand-100); transform: translateY(-1px); }
.chan-card__btn .ic { width: 13px; height: 13px; }
.chan-card__logo { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.chan-card:hover .chan-card__logo { transform: translateY(-3px) rotate(-3deg); }

.chan-tip {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-500);
}
.chan-tip code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--brand-700);
  white-space: nowrap;
}

/* ---------- 5.5 今日鲸语：频道卡下方的气泡卡 ---------- */
.quote-card {
  position: relative;
  padding: 13px 15px 14px;
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: background-color .45s ease, border-color .45s ease;
}
/* 朝上翘起的小尾巴，让这张卡像是上面的鲸鱼在说话 */
.quote-card__tail {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--surface);
  border-left: 1px solid var(--brand-100);
  border-top: 1px solid var(--brand-100);
  border-top-left-radius: 3px;
  transform: rotate(45deg);
  transition: background-color .45s ease, border-color .45s ease;
}
.quote-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.quote-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--brand-700);
}
/* 眉标前的一小截水线，呼应页头的水面 */
.quote-card__eyebrow::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: .5;
}
.quote-card__refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 11.5px;
  color: var(--ink-400);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.quote-card__refresh:hover { background: var(--brand-50); color: var(--brand-700); }
.quote-card__refresh .ic { width: 12px; height: 12px; }
.quote-card__refresh:disabled { cursor: default; color: var(--ink-400); }
.quote-card__refresh:disabled .ic { animation: quote-spin .9s linear infinite; }
.quote-card__text {
  margin-top: 7px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-900);
  overflow-wrap: break-word;
}
.quote-card__sub {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-400);
  overflow-wrap: break-word;
}
@keyframes quote-spin { to { transform: rotate(360deg); } }
.quote-strip { display: none; }

/* ---------- 6. 工具条：搜索 + 话题 ---------- */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}
.searchbox { position: relative; width: 100%; }
.searchbox input {
  width: 100%;
  padding: 11px 42px 11px 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.searchbox input::placeholder { color: var(--ink-400); }
.searchbox input:focus {
  outline: none;
  border-color: var(--brand-300);
  box-shadow: 0 0 0 4px rgba(124, 198, 226, .18);
}
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-400);
  pointer-events: none;
}
.searchbox__clear {
  position: absolute;
  right: 10px;
  top: 50%;
  translate: 0 -50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-500);
  cursor: pointer;
}
.searchbox__clear:hover { background: var(--brand-100); color: var(--brand-700); }
.searchbox__clear .ic { width: 12px; height: 12px; }

.tag-chips {
  display: flex;
  gap: 8px;
  padding: 2px 2px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tag-chips::-webkit-scrollbar { display: none; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.tag-chip:hover { border-color: var(--brand-300); color: var(--brand-700); transform: translateY(-1px); }
.tag-chip.is-active {
  background: var(--brand-100);
  border-color: var(--brand-300);
  color: var(--brand-700);
  font-weight: 600;
}

/* 当前筛选摘要（归档 / 话题 / 搜索） */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--brand-100);
  border-radius: 12px;
  background: var(--brand-50);
  font-size: 13px;
  color: var(--ink-700);
}
.filter-bar[hidden] { display: none; }
.filter-bar__label { font-weight: 700; color: var(--brand-700); }
.filter-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-700);
}
.filter-bar__item b { color: var(--brand-700); font-weight: 700; }
.filter-bar__item button {
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--ink-500);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.filter-bar__item button:hover { color: var(--brand-700); }
.filter-bar__count { color: var(--ink-500); }
.filter-bar__clear {
  margin-left: auto;
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.filter-bar__clear:hover { color: var(--brand-700); text-decoration: underline; }

/* ---------- 7. 消息气泡流（布局同构于频道预览，视觉为鲸鱼） ---------- */
.feed { scroll-margin-top: 84px; }
.feed__list { padding-top: 6px; }

/* 打捞日志：日期分隔 */
.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 14px;
}
.day-divider:first-child { margin-top: 4px; }
.day-divider__line {
  flex: 1;
  min-width: 24px;
  height: 10px;
  display: flex;
  color: var(--brand-300);
  overflow: hidden;
}
.day-divider__line svg {
  width: calc(100% + 12px);
  height: 10px;
  margin-left: -6px;
  display: block;
  animation: wave-drift 9s ease-in-out infinite alternate;
}
.day-divider__line:last-child svg { animation-delay: -4.5s; }
@keyframes wave-drift {
  from { transform: translateX(-4px); }
  to   { transform: translateX(4px); }
}
.day-divider__label {
  flex: none;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .5px;
  color: var(--ink-500);
  white-space: nowrap;
}

/* 单条消息：头像 + 气泡 */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.msg__avatar {
  flex: none;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg__avatar svg { width: 28px; height: auto; margin-top: 5px; }

.msg--no-avatar { padding-left: 54px; }

.msg__bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 12px 16px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 6px rgba(62, 141, 181, .05);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease, background-color .45s ease;
}
.msg__bubble:hover {
  transform: translateY(-1px);
  border-color: var(--brand-100);
  box-shadow: var(--shadow-lift);
}

/* 新消息“浮出水面”：只在真正新增时触发，筛选与翻页回流不重复播放 */
.msg--new {
  animation: msg-surface .52s cubic-bezier(.22, .8, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes msg-surface {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

/* 转发标记 */
.msg__forward {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  padding: 2px 10px;
  border: 1px solid var(--warm-300);
  border-radius: var(--radius-pill);
  background: var(--warm-100);
  font-size: 12px;
  font-weight: 600;
  color: var(--warm-600);
}
.msg__forward .ic { width: 12px; height: 12px; }

/* 消息正文（来自频道的安全化 HTML） */
.msg__text {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-700);
  overflow-wrap: break-word;
}
.msg__text p { margin: 0 0 .6em; }
.msg__text p:last-child { margin-bottom: 0; }
.msg__text a {
  color: var(--brand-700);
  text-decoration: underline;
  text-decoration-color: var(--brand-100);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: text-decoration-color .15s ease;
}
.msg__text a:hover { text-decoration-color: var(--brand-500); }
.msg__text b, .msg__text strong { color: var(--ink-900); }
.msg__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.msg__tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  font-size: 13px;
  line-height: 1.7;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.msg__tag:hover { background: var(--brand-100); color: var(--brand-700); }
.msg__text pre {
  margin: .6em 0;
  padding: 12px 14px;
  background: var(--code-bg);
  border: 1px solid var(--brand-100);
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-900);
}
.msg__text code {
  font-family: var(--font-mono);
  font-size: .92em;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--brand-700);
}
.msg__text pre code { background: transparent; padding: 0; color: inherit; }
.msg__text blockquote {
  margin: .6em 0;
  padding: 4px 14px;
  border-left: 3px solid var(--brand-300);
  color: var(--ink-500);
}
.msg__text hr { border: none; border-top: 1px dashed var(--line); margin: 1em 0; }
.msg__text u { text-underline-offset: 3px; }
.msg__text s { color: var(--ink-400); }

/* 图片 / 视频缩略图：多图统一限高拼图，避免长截图撑满整屏 */
.msg__photos { margin-top: 10px; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.msg__photos--multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  aspect-ratio: 16 / 10;
  max-height: 400px;
}
.msg__photos--two { grid-template-rows: minmax(0, 1fr); }
.msg__photos--three { grid-template-columns: 1.35fr 1fr; }
.msg__photos--three .msg__photo:first-child { grid-row: span 2; }
.msg__photo {
  position: relative;
  display: block;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.msg__photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  transition: transform .25s ease;
}
/* 详情页单图：按原图比例展示，小图不放大、长图不裁剪，居中完整可见 */
.msg__photos--single {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.msg__photos--single .msg__photo {
  width: auto;
  max-width: 100%;
  background: transparent;
  overflow: visible;
  border-radius: 14px;
}
.msg__photos--single .msg__photo img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 14px;
  margin: 0 auto;
}
.msg__photos--multi .msg__photo { min-height: 0; }
.msg__photos--multi .msg__photo img { height: 100%; max-height: none; }
.msg__photo--more { cursor: pointer; }
.msg__photo-more {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(7, 16, 32, .58);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
}
.msg__photo-more em { font-style: normal; font-size: 12px; font-weight: 500; opacity: .88; }
.msg__photo:hover img { transform: scale(1.015); }
.msg__video-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(31, 58, 79, .72);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.msg__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.msg__title a {
  color: var(--ink-900);
  text-decoration: none;
}
.msg__title a:hover {
  color: var(--brand-600);
  text-decoration: underline;
  text-decoration-color: var(--brand-300);
  text-underline-offset: 4px;
}
.msg__more {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
}
.msg__more:hover { color: var(--brand-700); }

/* 置顶：暖纸便利贴 + 胶带 + 小标签 */
.msg--pinned .msg__bubble {
  padding-top: 20px;
  border-color: var(--pinned-border);
  background: var(--pinned-grad);
  box-shadow: var(--pinned-shadow);
}
.msg--pinned .msg__bubble::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 20px;
  width: 58px;
  height: 15px;
  border: 1px solid var(--tape-border);
  border-radius: 2px;
  background: var(--tape-bg);
  transform: rotate(-4deg);
  pointer-events: none;
}
.msg__pinned {
  position: absolute;
  top: -10px;
  right: 14px;
  padding: 2px 10px;
  border: 1px solid var(--warm-300);
  border-radius: 3px;
  background: var(--warm-100);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.6;
  color: var(--warm-600);
  transform: rotate(1.5deg);
  box-shadow: 0 1px 2px rgba(143, 95, 13, .10);
}
.arch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  color: var(--ink-700);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.arch-item:hover { background: var(--surface-2); }
.arch-item.is-active {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand-500);
}
.arch-item.is-active .arch-count { background: var(--surface); color: var(--brand-700); }
.arch-count {
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--ink-400);
}
.side-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-900);
}

/* 详情页 */
.post-page { padding: 26px 4px 10px; }
.post-page__title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink-900);
}
.post-page__flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }

/* 打捞小票：作者名/时间/阅读，用虚线票根呈现 */
.post-ticket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 12px 0 20px;
  padding: 11px 16px;
  border: 1px dashed var(--ticket-border);
  border-radius: 12px;
  background: var(--ticket-grad);
}
.post-ticket__cell { display: flex; align-items: baseline; gap: 7px; }
.post-ticket__cell em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ticket-ink);
}
.post-ticket__cell b {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ticket-strong);
  font-variant-numeric: tabular-nums;
}
.post-ticket__cell + .post-ticket__cell { padding-left: 20px; border-left: 1px dashed var(--ticket-border); }
.post-ticket__serial {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ticket-ink);
}
.post-page__text { font-size: 15.5px; }
.msg__text img, .post-page__text img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: .7em 0;
  border-radius: 12px;
  cursor: zoom-in;
}
.post-page__draft {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--draft-bg);
  color: var(--draft-ink);
  font-size: 12px;
  font-weight: 600;
}
.post-page__forward {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warm-100);
  color: var(--warm-600);
  font-size: 12px;
  font-weight: 600;
}
.post-page__back { margin-top: 28px; font-size: 14px; }
.post-page__back a { color: var(--brand-700); font-weight: 600; }
.post-page .msg__photos { margin-top: 16px; }

/* 详情页图片轮播 */
.gallery {
  position: relative;
  margin-top: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1220;
}
.gallery__viewport {
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.gallery__viewport::-webkit-scrollbar { display: none; }
.gallery__viewport:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-500); }
.gallery__slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery__slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72vh;
  cursor: zoom-in;
}
.gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding-bottom: 3px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #111;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  transform: translateY(-50%);
}
.gallery__nav:disabled { opacity: .35; cursor: default; }
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  background: #0b1220;
}
.gallery__dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.gallery__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.gallery__dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
}
.gallery__dot.is-active::before { background: #fff; }
.gallery__dot:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.gallery__count {
  color: rgba(255, 255, 255, .75);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 引用块（回复/引用某条消息，可点击站内跳转） */
.msg__quote {
  display: block;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--brand-500);
  border-radius: 10px;
  background: var(--brand-50);
  transition: background .15s ease;
}
.msg__quote:hover { background: var(--brand-100); }
.msg__quote-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-700);
}
.msg__quote-text {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-500);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 文件附件卡片（预览页无直链，点击去 Telegram 获取） */
.msg__files { margin-top: 10px; display: grid; gap: 8px; }
.msg__file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px dashed var(--brand-100);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
}
.msg__file:hover { border-color: var(--brand-300); background: var(--brand-50); }
.msg__file-ic { width: 20px; height: 20px; flex: none; color: var(--brand-500); }
.msg__file-main { min-width: 0; display: flex; flex-direction: column; }
.msg__file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
  overflow-wrap: anywhere;
}
.msg__file-size { font-size: 12px; color: var(--ink-400); }
.msg__file-go {
  margin-left: auto;
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-600);
}

/* 引用跳转命中高亮 */
@keyframes msg-flash {
  0%   { background: var(--warm-100); }
  100% { background: var(--surface); }
}
.msg.flash .msg__bubble { animation: msg-flash 1.6s ease both; }

/* 气泡内底栏：浏览数 + 时间（时间为原帖链接） */
.msg__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ink-400);
}
.msg__meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.msg__meta .ic { width: 13px; height: 13px; }
.msg__time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-400);
}

/* ---------- 8. 空状态 / 加载更多 ---------- */
.empty { text-align: center; padding: 40px 20px 54px; }
.empty__bubble {
  position: relative;
  display: inline-block;
  padding: 9px 18px;
  border: 1.5px solid var(--brand-100);
  border-radius: 16px;
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-500);
  box-shadow: var(--shadow-soft);
}
.empty__bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-right: 1.5px solid var(--brand-100);
  border-bottom: 1.5px solid var(--brand-100);
  transform: translateX(-50%) rotate(45deg);
}
.empty__title { margin-top: 10px; font-size: 15.5px; font-weight: 700; color: var(--ink-700); }
.empty__desc { margin-top: 4px; font-size: 13px; color: var(--ink-400); }
.empty .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
  cursor: pointer;
  transition: background .15s ease;
}
.empty .btn:hover { background: var(--brand-100); }

/* 空状态：鲸鱼吐泡泡（基于 logo，仅做位移与气泡） */
.empty__whale {
  position: relative;
  display: inline-block;
  margin: 12px auto 4px;
}
.empty__whale .empty__logo { margin: 0; animation: whale-bob 4.8s ease-in-out infinite; }
.empty__breath {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--brand-300);
  background: var(--breath-bg);
  opacity: 0;
  pointer-events: none;
}
.empty__breath.b1 { width: 10px; height: 10px; left: 62%; top: 8%; animation: breath 4.4s ease-out .2s infinite; }
.empty__breath.b2 { width: 7px; height: 7px; left: 71%; top: 2%; animation: breath 4.4s ease-out 1.6s infinite; }
.empty__breath.b3 { width: 5px; height: 5px; left: 57%; top: 2%; animation: breath 4.4s ease-out 3s infinite; }

@keyframes whale-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes breath {
  0% { opacity: 0; transform: translateY(6px) scale(.75); }
  20% { opacity: .85; }
  70% { opacity: .5; }
  100% { opacity: 0; transform: translateY(-30px) scale(1.2); }
}

.feed__more { text-align: center; }
.load-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 10px 22px;
  border: 1.5px solid var(--brand-100);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-700);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.load-more:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); background: var(--brand-50); }
.load-more .fish { width: 34px; height: auto; }
.feed__end {
  margin-top: 18px;
  padding: 12px 0 4px;
  font-size: 12.5px;
  color: var(--ink-400);
  letter-spacing: 2px;
}

/* ---------- 品牌图形（鲸鱼 logo） ---------- */
.logo__mark { display: inline-flex; align-items: center; }
.logo__mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(45, 106, 180, .16));
}
.logo__img { display: block; }
.chan-card__logo { width: 92px; height: auto; margin: 0 auto 4px; display: block; }
.msg__avatar-img { width: 34px; height: 34px; object-fit: contain; margin-top: 2px; }
.empty__logo { width: 150px; height: auto; display: block; margin: 12px auto 4px; }
.feed__loading .fish { width: 34px; height: auto; }
.load-more .fish { width: 30px; height: auto; }

/* 捞鱼中 / 再捞一网：鲸鱼轻轻游动 */
.feed__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 0 34px;
  font-size: 13px;
  color: var(--ink-400);
}
.feed__loading .fish { animation: fish-swim 1.8s ease-in-out infinite; }
@keyframes fish-swim {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}
.load-more .fish { transition: transform .25s ease; }
.load-more:hover .fish { transform: translateX(3px) rotate(-8deg); }
.admin-fish { width: 40px; height: auto; }
.admin-fish, .login-fish { object-fit: contain; }

.logo__footer-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(45, 106, 180, .16));
}
.login-fish { width: 62px; height: auto; margin: 0 auto 4px; display: block; }

/* ---------- 彩色标签云（跑马灯） ---------- */
.tag-chips.is-marquee {
  overflow: hidden;
  padding-bottom: 2px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.tag-chips.is-marquee:hover .tag-cloud__track {
  animation-play-state: paused;
}
.tag-chips.is-static {
  display: flex;
  overflow-x: auto;
}
.tag-cloud__track {
  display: flex;
  width: max-content;
  animation: tag-marquee 46s linear infinite;
}
.tag-cloud__group {
  display: flex;
  flex: none;
  gap: 8px;
  padding-right: 8px;
}
@keyframes tag-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* 标签四族：按名称哈希落到水蓝/薄荷/暖沙/石墨，夜晚换成同族的夜光色 */
.tag-chip.tc--a { --tc-bg: #E3F2FB; --tc-fg: #1F5F86; }
.tag-chip.tc--b { --tc-bg: #DFF4EA; --tc-fg: #1F6E54; }
.tag-chip.tc--c { --tc-bg: #FFF1D0; --tc-fg: #7A5410; }
.tag-chip.tc--d { --tc-bg: #EEF3F6; --tc-fg: #44606F; }
html[data-theme="night"] .tag-chip.tc--a { --tc-bg: #123246; --tc-fg: #9BD7F2; }
html[data-theme="night"] .tag-chip.tc--b { --tc-bg: #10352C; --tc-fg: #8FE0C0; }
html[data-theme="night"] .tag-chip.tc--c { --tc-bg: #38301A; --tc-fg: #F0CE8A; }
html[data-theme="night"] .tag-chip.tc--d { --tc-bg: #1C2E3A; --tc-fg: #B7CBD6; }
.tag-chip.tc {
  flex: none;
  white-space: nowrap;
  font-size: 11.5px;
  padding: 3px 9px;
  gap: 4px;
  border: 1px solid var(--tc-bg);
  background: var(--tc-bg);
  color: var(--tc-fg);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.tag-chip.tc .tag-chip__count {
  font-family: var(--font-num);
  font-weight: 500;
  font-size: 10px;
  opacity: .8;
  background: var(--chip-count-bg);
  padding: 0 5px;
  border-radius: var(--radius-pill);
}
.tag-chip.tc.is-active,
.tag-chip.tc[data-active="1"] {
  outline: 2px solid currentColor;
  outline-offset: -1px;
  font-weight: 700;
  background: var(--tc-fg);
  border-color: var(--tc-fg);
  color: var(--tc-bg);
}

/* ---------- 图片灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 35, 48, .88);
  cursor: zoom-out;
  animation: lb-in .18s ease;
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink-900);
  font-size: 15px;
  cursor: pointer;
}
.lightbox__close .ic { width: 18px; height: 18px; }
.msg__photo:not(.msg__photo--more) { cursor: zoom-in; }

@media (prefers-reduced-motion: reduce) {
  .tag-chips.is-marquee { overflow-x: auto; }
  .tag-cloud__track { animation: none; }
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  margin-top: 36px;
  background: var(--footer-grad);
  transition: background-color .45s ease;
}
.footer-wave {
  display: block;
  width: 100%;
  height: 20px;
  margin-top: 10px;
  margin-bottom: -1px;
  color: var(--footer-wave);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  padding: 34px 22px 22px;
}
.logo--footer { margin-bottom: 10px; }
.footer__desc { font-size: 13px; color: var(--ink-500); max-width: 32em; }
.footer__desc a { text-decoration: underline; text-underline-offset: 3px; }
.footer__col h3 { margin-bottom: 10px; font-size: 13.5px; font-weight: 800; color: var(--ink-900); }
.footer__col li { margin-bottom: 8px; }
.footer__col a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-500);
  transition: color .15s ease;
}
.footer__col a:hover { color: var(--brand-700); }
.footer__col a .ic { width: 12px; height: 12px; }
.footer__hint { font-size: 12.5px; color: var(--ink-500); line-height: 1.9; }
.footer__hint code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--brand-700);
  white-space: nowrap;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding-top: 13px;
  padding-bottom: 22px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-400);
}

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1079px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .channel-strip {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--chan-grad);
    border: 1px solid var(--chan-border);
    border-radius: var(--radius-md);
  }
  .channel-strip__fish { width: 34px; height: auto; flex: none; }
  .channel-strip__main { min-width: 0; }
  .channel-strip__name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .channel-strip__meta { font-size: 11.5px; color: var(--ink-500); }
  .channel-strip__open {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--brand-100);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-700);
  }
  .channel-strip__open:hover { background: var(--surface-2); }
  .channel-strip__open .ic { width: 12px; height: 12px; }

  .quote-strip:not([hidden]) { display: block; margin-top: 10px; }
  .quote-card--strip { padding: 11px 14px 12px; border-color: var(--line); box-shadow: none; }
  .quote-card--strip .quote-card__tail { display: none; }
  .quote-card--strip .quote-card__text { margin-top: 5px; font-size: 13px; line-height: 1.8; }
}

@media (max-width: 720px) {
  .container { padding-inline: 14px; }
  .header__channel span { display: none; }
  .header__channel { padding: 9px; border-radius: 50%; }
  .header__inner .logo { flex: 0 1 auto; min-width: 0; }
  .header__inner .logo__text { min-width: 0; }
  .header__inner .logo__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header__inner .logo__tag { display: none; }

  .layout { margin-top: 14px; gap: 0; }
  .msg { gap: 9px; }
  .msg--no-avatar { padding-left: 43px; }
  .msg__avatar { width: 34px; height: 34px; }
  .msg__avatar svg { width: 23px; margin-top: 4px; }
  .msg__bubble { padding: 11px 13px 7px; }
  .msg--pinned .msg__bubble { padding-top: 19px; }
  .msg--pinned .msg__bubble::after { left: 14px; width: 50px; height: 14px; }
  .msg__pinned { right: 10px; }
  .post-ticket { gap: 8px 14px; padding: 10px 14px; }
  .post-ticket__cell + .post-ticket__cell { padding-left: 14px; }
  .post-ticket__serial { display: none; }
  .msg__photos--multi { aspect-ratio: 4 / 3; max-height: 340px; }
  .msg__photo-more { font-size: 19px; }
  .msg__photo-more em { font-size: 11px; }
  .gallery__slide img { max-height: 60vh; }
  .gallery__nav { width: 32px; height: 32px; font-size: 21px; }
  .gallery__nav--prev { left: 6px; }
  .gallery__nav--next { right: 6px; }

  .footer__inner { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- 10.5 时段切换（右上角） ---------- */
.header__tools { margin-left: auto; position: relative; flex: none; }

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.theme-btn:hover { border-color: var(--brand-300); color: var(--brand-700); transform: translateY(-1px); }
.theme-btn[aria-expanded="true"] { border-color: var(--brand-300); color: var(--brand-700); }
.theme-btn .ic { width: 15px; height: 15px; }
.theme-btn__dot {
  width: 5px;
  height: 5px;
  margin-left: -1px;
  border-radius: 50%;
  background: var(--mint-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint-500) 22%, transparent);
}
.theme-btn[data-mode="auto"] .theme-btn__dot { background: var(--mint-500); }
.theme-btn[data-mode="manual"] .theme-btn__dot { background: var(--warm-500); box-shadow: none; }

.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 208px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  animation: theme-menu-in .16s ease-out;
}
@keyframes theme-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.theme-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-700);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.theme-menu__item:hover { background: var(--surface-2); color: var(--ink-900); }
.theme-menu__item[aria-checked="true"] { color: var(--brand-700); font-weight: 700; }
.theme-menu__item .ic { width: 15px; height: 15px; }
.theme-menu__hint { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--ink-400); }
.theme-menu__sep { height: 1px; margin: 5px 8px; background: var(--line); }

/* 夜晚：深海里的一点生物荧光，鲸鱼本身不换 */
html[data-theme="night"] .logo__mark img {
  filter: drop-shadow(0 0 14px rgba(111, 194, 226, .45)) saturate(1.08) brightness(1.06);
}
html[data-theme="night"] .logo__mark::before,
html[data-theme="night"] .logo__mark::after {
  background: rgba(120, 205, 240, .22);
  border-color: rgba(150, 220, 248, .55);
}
html[data-theme="night"] .site-footer { border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .theme-btn { padding: 7px 10px; }
  .theme-btn__label { display: none; }
  .quote-card__refresh { padding: 6px; }
  .quote-card__refresh-label { display: none; }
}

/* ---------- 11. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* 延迟归零，避免错峰入场变成“先空白后闪现” */
  .msg--new { animation-delay: 0s !important; }
  .logo__mark::before, .logo__mark::after { animation-delay: 0s !important; }
  .header-wave svg, .day-divider__line svg, .feed__loading .fish { animation: none; }
}
