/*
 * 海内存知 官网样式。
 *
 * 配色全部取自图标：天蓝瓶身、深海蓝水与海浪、琥珀瓶塞。B 站粉不出现在网站上——
 * 它在扩展里只留给「缓存」这一个动作。诗句用系统衬线体、界面用系统无衬线体，
 * 不加载网络字体：和扩展一样，访问者的请求不离开这一个域名。
 */
:root {
  color-scheme: light dark;
  --bg: #f6fafc;
  --tint: #eaf4f9;
  --surface: #ffffff;
  --line: rgba(18, 48, 61, 0.1);
  --ink: #12303d;
  --ink-soft: #4f6b79;
  --accent: #0b7fae;
  --sky: #2bb3e6;
  --sea: #0d425d;
  --sea-deep: #08283a;
  --water: #1587c6;
  --amber: #e9a15b;
  /* 琥珀色用作文字时加深一档：瓶塞色 #e9a15b 在白底上只有约 2.3:1。 */
  --amber-ink: #a35c12;
  --verse-soft: #9cc3d6;
  /* 顶栏进入正文后的描边与悬停底色：浅色正文上用深色细线，深色模式见下方。 */
  --bar-edge-body: rgba(18, 48, 61, 0.22);
  --bar-hover-body: rgba(18, 48, 61, 0.06);
  /* 进度条三色与扩展默认配色一致：已播放 / 播放器缓冲 / 提前加载。 */
  --played: #00aeec;
  --buffer: #b9c3cc;
  --preload: #f59a23;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 14px;
  --gutter: clamp(16px, 5vw, 48px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1620;
    --tint: #0e1f2b;
    --surface: #12283a;
    --line: rgba(255, 255, 255, 0.09);
    --ink: #e3eef4;
    --ink-soft: #9db5c2;
    --accent: #6fd0f5;
    --buffer: #5b6874;
    --amber-ink: #f0b27a;
    --bar-edge-body: rgba(255, 255, 255, 0.3);
    --bar-hover-body: rgba(255, 255, 255, 0.1);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 20; padding: 8px 14px; border-radius: 8px; background: var(--surface); color: var(--ink); }
.skip-link:focus { top: 12px; }

/* ---------- 顶栏 ---------- */
/* 不用半透明 + backdrop-filter：下方一直有动画（漂流瓶、海浪、进度条）和演示 iframe，
   毛玻璃每帧都要重新采样，Chrome 合成时会闪，偶尔把下方合成层画到顶栏上面。
   改成不透明底色；正文 main 单独隔离成一个层叠上下文，里面再怎么提层也越不过顶栏。
   颜色随滚动变化：site.js 按首屏底边的位置写入 --bar-mix（正文底色所占比例）并在过半时加 .is-light。
   - 底色混合（深海蓝 → 正文底色），只占首屏底部约 120px 的滚动距离；两端都不透明，混合结果也不透明；
   - 文字与描边不跟着混合：底色与文字同时渐变会在中段一起变成灰色、几乎看不见。改为过半时一次切到深字；
   - 底色跳过 45%–75% 这段中灰：45% 以内白字对比度仍 ≥ 3，75% 起深色导航字 ≥ 3，中间没有两者都够读的颜色。
     跳变本身由 160ms 过渡抹平，其余时候颜色紧跟滚动位置。
   深色模式下 --surface / --ink 本身是深底浅字，顶栏自然保持深色。没有脚本时 --bar-mix 为 0%，退回原来的深色顶栏。 */
.topbar {
  --bar-mix: 0%;
  --bar-ink: #ffffff;
  /* 导航文字比品牌名弱一档；用不透明色而不是半透明白，对比度可算、可测。 */
  --bar-ink-soft: #c9d0d4;
  --bar-edge: rgba(255, 255, 255, 0.3);
  --bar-hover: rgba(255, 255, 255, 0.1);
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--sea-deep), var(--surface) var(--bar-mix));
  transition: background-color 160ms ease;
  box-shadow: 0 1px 0 var(--line), 0 6px 18px -12px rgba(0, 0, 0, 0.5);
  color: var(--bar-ink);
}
.topbar.is-light {
  --bar-ink: var(--ink);
  --bar-ink-soft: var(--ink-soft);
  --bar-edge: var(--bar-edge-body);
  --bar-hover: var(--bar-hover-body);
}
.topbar-brand, .topbar-links a, .github-link, .lang-switch { transition: color 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
main { isolation: isolate; }
.topbar-brand { display: flex; align-items: center; gap: 8px; color: var(--bar-ink); text-decoration: none; font-weight: 650; letter-spacing: 0.06em; white-space: nowrap; }
/* 顶栏小瓶：水位随阅读进度上涨（--read 0→1），滚动时轻轻摇一下。水面是一块整矩形，被瓶身轮廓裁剪。 */
.bar-bottle { flex: none; overflow: visible; transform-origin: 50% 80%; }
.bar-water { transform: translateY(calc(29px - var(--read, 0) * 24px)); transition: transform 200ms ease-out; }
.bar-bottle.is-rocking { animation: rock 1.1s ease-in-out; }
@keyframes rock { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-9deg); } 65% { transform: rotate(5deg); } }
.topbar-links { display: flex; gap: 22px; margin-left: auto; margin-right: 14px; }
.topbar-links a { color: var(--bar-ink-soft); text-decoration: none; font-size: 15px; }
.topbar-links a:hover { color: var(--bar-ink); }

/* ---------- 按钮 ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease;
}
.button:active { transform: scale(0.98); }
.button-primary { background: var(--sky); color: #04263a; }
.button-primary:hover { background: #4cc4ef; }
.button-ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.button-small { min-height: 36px; padding: 0 16px; font-size: 14px; background: var(--sky); color: #04263a; }
/* GitHub 入口：顶栏里与「添加到 Chrome」并列，图标 + 文字；窄屏只留图标。 */
.github-link { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--bar-ink); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--bar-edge); }
.github-link:hover { background: var(--bar-hover); }
/* 语言切换：与 GitHub 入口同一种描边胶囊，文字短，窄屏也保留。 */
.lang-switch { display: inline-flex; align-items: center; white-space: nowrap; min-height: 36px; padding: 0 12px; border-radius: 999px; color: var(--bar-ink); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--bar-edge); }
.lang-switch:hover { background: var(--bar-hover); }
/* 中文首页给不读中文的访客的英文入口：默认隐藏，site.js 按浏览器语言决定是否显示。 */
.lang-hint { margin: 0 auto 18px; font-size: 15px; }
.lang-hint a { color: var(--sky); }
.gh { width: 18px; height: 18px; flex: none; }
.button .gh { margin-right: 8px; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 10vh, 112px) var(--gutter) 150px;
  background: linear-gradient(160deg, var(--sea-deep) 0%, var(--sea) 62%, #11557a 100%);
  color: #fff; text-align: center;
}
.hero-inner { max-width: 880px; margin: 0 auto; }
.hero-bottle { width: clamp(132px, 22vw, 200px); height: auto; margin: 0 auto 18px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.3)); animation: bob 6s ease-in-out infinite; }
.eyebrow { font-size: 14px; letter-spacing: 0.2em; color: var(--verse-soft); margin-bottom: 14px; }
/* 诗句：主名加粗，其余减弱；两半各自不折行，窄屏时在「，」后整体换行。 */
.verse { font-family: var(--serif); font-size: clamp(38px, 7.4vw, 76px); line-height: 1.25; font-weight: 400; letter-spacing: 0.04em; }
.verse-line { display: inline-block; white-space: nowrap; }
.verse-name { font-weight: 700; }
.verse-soft { color: var(--verse-soft); font-weight: 400; }
.lead { max-width: 34em; margin: 22px auto 0; font-size: clamp(17px, 2.2vw, 20px); color: rgba(255, 255, 255, 0.88); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
/* 每一项整体不折行，窄屏时按项换行，不会把「据」单独挤到下一行。 */
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; margin-top: 18px; font-size: 14px; color: var(--verse-soft); }
.hero-meta span { white-space: nowrap; }
.hero-meta span + span::before { content: "·"; margin: 0 8px; }
.hero-waves { position: absolute; left: 0; bottom: -1px; width: 100%; height: 110px; }
.wave { animation: drift 14s linear infinite; }
.wave-back { fill: color-mix(in srgb, var(--bg) 35%, transparent); animation-duration: 22s; }
.wave-front { fill: var(--bg); }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(-3deg); } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 通用区块 ---------- */
.section { padding: clamp(64px, 10vw, 112px) var(--gutter); }
.section-tint { background: var(--tint); }
.section-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-head-left { margin: 0 0 32px; text-align: left; }
.section-head p:last-child { margin-top: 14px; color: var(--ink-soft); font-size: 17px; }
/* 标题里的关键字（与顶栏导航同名：天涯 / 存 / 比邻 / 知己 / 投喂）只换颜色，标题保持一行。 */
.key { font-style: normal; color: var(--accent); }
h2 { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.25; font-weight: 700; letter-spacing: 0.02em; }
h3 { font-size: 18px; line-height: 1.45; font-weight: 650; }
.section-foot { max-width: 680px; margin: 32px auto 0; text-align: center; color: var(--ink-soft); }

/* ---------- 天涯：时差钟 ---------- */
.clock { max-width: 760px; margin: -12px auto 28px; text-align: center; }
.clock-pair { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 40px; }
.clock-item { display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.clock-label { font-size: 14px; color: var(--ink-soft); }
.clock-time { font-family: var(--serif); font-size: clamp(30px, 4vw, 40px); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.clock-item + .clock-item .clock-time { color: var(--accent); }
.clock-note { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }

/* ---------- 天涯：进度条对比 ---------- */
.compare { max-width: 760px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 36px); border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 24px 48px -32px rgba(8, 40, 58, 0.35); }
.compare-row { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; align-items: center; gap: 16px; padding: 12px 0; }
.compare-label { font-size: 15px; color: var(--ink-soft); }
.bar { position: relative; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.bar-played { width: 32%; background: var(--played); }
.bar-buffer { width: 38%; background: var(--buffer); }
.bar-preload { width: 82%; background: var(--preload); }
.bar-smooth .bar-played { animation: play 9s linear infinite; }
.bar-smooth .bar-buffer { animation: buffer 9s linear infinite; }
.bar > .bar-spinner { position: absolute; left: 32%; top: 50%; bottom: auto; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink) 18%, transparent); border-top-color: var(--ink-soft); background: var(--surface); animation: spin 0.9s linear infinite; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 0; padding: 0 0 0 136px; list-style: none; font-size: 13px; color: var(--ink-soft); }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-played { background: var(--played); }
.dot-buffer { background: var(--buffer); }
.dot-preload { background: var(--preload); }
@keyframes play { from { width: 32%; } to { width: 74%; } }
@keyframes buffer { from { width: 38%; } to { width: 80%; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 存：瓶中水位 + 功能 ---------- */
.keep-grid, .near-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: center; max-width: 1080px; margin: 0 auto; }
.keep-bottle { width: min(100%, 320px); height: auto; margin: 0 auto; overflow: visible; }
.keep-bottle .glass { fill: var(--sky); }
.keep-bottle .water { transform: translateY(calc(108px - var(--level, 0.5) * 82px)); transition: transform 240ms ease-out; }
.keep-bottle .water-wave { fill: var(--water); animation: drift 5s linear infinite; }
.keep-bottle .glint { fill: #fff; fill-opacity: 0.4; }
.keep-bottle .cork { fill: var(--amber); }
.keep-bottle .play { fill: #fff; stroke: #fff; stroke-width: 5; stroke-linejoin: round; }
.features { display: grid; gap: 16px; }
.feature, .promise { padding: 22px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.feature p, .promise p { margin-top: 6px; color: var(--ink-soft); font-size: 15px; }
/* 标题前的小图标：淡色方块托底。功能卡片够宽，图标放在标题左侧、和首行居中；
   隐私卡片四列并排、每张只有两百来像素宽，图标放左侧会把「登录态只看「有没有」」挤成两行，所以叠在标题上方。 */
.feature h3 { display: flex; align-items: flex-start; gap: 12px; }
.feature .card-icon { margin-top: -4px; }
.promise .card-icon { display: block; margin-bottom: 12px; }
.card-icon { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 比邻：真实弹窗演示 ---------- */
.near-grid { grid-template-columns: minmax(0, 1fr) auto; }
.checks { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--sky); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--sky) 30%, var(--bg)); }
.demo { margin: 0; }
.demo-frame { display: block; width: 360px; height: 560px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 34px 70px -28px rgba(8, 40, 58, 0.45); }
.demo figcaption { margin-top: 12px; text-align: center; font-size: 13px; color: var(--ink-soft); }

/* ---------- 知己 ---------- */
/* 知己：三条弹幕轨道从右往左飘，速度各不相同；两端渐隐，避免弹幕在容器边缘被硬切。 */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.friend { overflow: hidden; }
/* 自己发的弹幕：像 B 站一样给自己的弹幕加一圈描边，飘一次就消失。--distance 由脚本按轨道宽度写入。 */
.danmaku { position: relative; }
.danmaku-mine { position: absolute; left: 100%; z-index: 1; padding: 0 8px; border: 1px solid var(--accent); border-radius: 4px; background: var(--bg); box-shadow: 0 0 0 3px var(--bg); font-size: 15px; font-weight: 600; line-height: 1.6; white-space: nowrap; color: var(--ink); animation: fly 9s linear forwards; }
.danmaku-mine.is-static { left: 50%; transform: translateX(-50%); animation: none; }
@keyframes fly { to { transform: translateX(calc(-1 * var(--distance, 1200px))); } }
.danmaku-send { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 520px; margin: 28px auto 0; }
.danmaku-send[hidden] { display: none; }
.danmaku-send input { flex: 1 1 220px; min-width: 0; min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; }
.danmaku-send input:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.button-send { background: var(--sky); color: #04263a; border: 0; cursor: pointer; font-family: inherit; }
.danmaku-hint { flex-basis: 100%; text-align: center; font-size: 13px; color: var(--ink-soft); }
.friend .section-head { margin-bottom: 0; }
.danmaku { display: grid; gap: 10px; max-width: 1080px; margin: 0 auto 36px; -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.danmaku-lane { overflow: hidden; }
.danmaku-track { display: flex; width: max-content; animation: drift 38s linear infinite; }
.danmaku-lane-2 .danmaku-track { animation-duration: 52s; animation-delay: -17s; }
.danmaku-lane-3 .danmaku-track { animation-duration: 44s; animation-delay: -29s; }
.danmaku-track span { padding-right: 28px; font-size: 15px; white-space: nowrap; color: var(--ink-soft); }
.danmaku-lane-1 span:nth-child(3n + 1), .danmaku-lane-3 span:nth-child(4n + 2) { color: var(--accent); }
.danmaku-lane-2 span:nth-child(3n + 2) { color: var(--amber-ink); }

.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 1080px; margin: 0 auto; }

/* ---------- 投喂 ---------- */
.tip-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 80px); align-items: center; max-width: 960px; margin: 0 auto; }
/* 菜单式参考价：像小票一样左右对齐，点线连接。 */
.tip-note { margin-top: 22px; max-width: 30em; font-size: 14px; color: var(--ink-soft); }
.tip-card { width: 240px; margin: 0; padding: 14px 14px 18px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(8, 40, 58, 0.45); text-align: center; }
.tip-card img { width: 100%; height: auto; }
.tip-card figcaption { display: none; }
/* 打开支付宝的按钮只在手机上显示：电脑上点它没有意义，扫码即可。 */
.button-alipay { display: none; width: 100%; margin-top: 12px; background: #1677ff; color: #fff; }
.button-alipay:hover { background: #3a8bff; }

/* ---------- 适用范围 / 页脚 ---------- */
.scope { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; padding: 0; list-style: none; }
.scope li { padding: 18px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink-soft); }
.scope b { color: var(--ink); margin-right: 4px; }
.footer { padding: 56px var(--gutter) 64px; background: var(--sea-deep); color: rgba(255, 255, 255, 0.8); text-align: center; }
/* 页尾靠岸：一整片沙滩横在页尾，沙色取瓶塞琥珀的浅调。中间那只是首屏出发的瓶子，.is-waiting 时停在左上的海里，
   进入视口后被推上岸。访客扔的瓶子（.pile-bottle）散落在沙上，位置由序号决定（site.js），越靠前的越大、层级越高。
   沙滩图形用 preserveAspectRatio="none" 拉伸铺满宽度，浪线用 non-scaling-stroke 保持线宽；沙底向页脚底色渐隐。 */
.shore { margin: -8px calc(-1 * var(--gutter)) 22px; }
/* 沙滩横贯整个页脚（抵消页脚左右留白）。左右两端用缓入缓出的多段遮罩渐隐进深海蓝（直线渐变在拐点处会被看成一条竖线）；底边由沙子自身的渐变（#beach-sand）淡出，
   不叠第二层遮罩：两层遮罩求交在 Chrome 里会在渐隐边界留下竖直接缝。 */
.beach { position: relative; height: 150px; -webkit-mask: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12) 3%, rgba(0, 0, 0, 0.4) 7%, rgba(0, 0, 0, 0.72) 11%, rgba(0, 0, 0, 0.92) 15%, #000 19%, #000 81%, rgba(0, 0, 0, 0.92) 85%, rgba(0, 0, 0, 0.72) 89%, rgba(0, 0, 0, 0.4) 93%, rgba(0, 0, 0, 0.12) 97%, transparent); mask: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12) 3%, rgba(0, 0, 0, 0.4) 7%, rgba(0, 0, 0, 0.72) 11%, rgba(0, 0, 0, 0.92) 15%, #000 19%, #000 81%, rgba(0, 0, 0, 0.92) 85%, rgba(0, 0, 0, 0.72) 89%, rgba(0, 0, 0, 0.4) 93%, rgba(0, 0, 0, 0.12) 97%, transparent); }
.beach-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shore-sand { fill: url(#beach-sand); }
.beach-sand-top { stop-color: #d9b98a; stop-opacity: 0.85; }
.beach-sand-mid { stop-color: #d9b98a; stop-opacity: 0.55; }
.beach-sand-end { stop-color: #d9b98a; stop-opacity: 0; }
.shore-foam { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.shore-foam-2 { stroke-opacity: 0.6; animation: lap 4s ease-in-out infinite; }
.beach-pile { position: absolute; inset: 0; }
.shore-bottle { position: absolute; left: 50%; bottom: 46px; z-index: 60; width: 88px; height: auto; margin-left: -44px; transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease; }
.shore.is-waiting .shore-bottle { transform: translate(-200px, -46px) rotate(-14deg); opacity: 0; }
.shore-caption { margin-top: -6px; padding: 0 var(--gutter); font-size: 13px; letter-spacing: 0.06em; color: var(--verse-soft); }
.shore-caption[hidden] { display: none; }
/* 沙滩上的瓶子：left / bottom / 宽度 / 角度由脚本按序号写入；新扔的那只从按钮的方向划一道弧落下（--from-x / --from-y）。 */
.pile-bottle { position: absolute; height: auto; transform: translateX(-50%) rotate(var(--tilt, 0deg)) scaleX(var(--flip, 1)); filter: drop-shadow(0 2px 1px rgba(80, 52, 20, 0.28)); }
.pile-bottle.is-new { animation: bottle-land 1.3s cubic-bezier(0.3, 0.5, 0.35, 1) both; }
@keyframes bottle-land {
  0% { transform: translate(calc(-50% + var(--from-x, 0px)), var(--from-y, -120px)) rotate(0deg) scaleX(var(--flip, 1)); }
  55% { transform: translate(calc(-50% + var(--from-x, 0px) * 0.4), calc(var(--from-y, -120px) * 0.4 - 90px)) rotate(200deg) scaleX(var(--flip, 1)); }
  85% { transform: translate(-50%, -6px) rotate(calc(var(--tilt, 0deg) + 340deg)) scaleX(var(--flip, 1)); }
  100% { transform: translateX(-50%) rotate(calc(var(--tilt, 0deg) + 360deg)) scaleX(var(--flip, 1)); }
}

/* 扔瓶子的控件跟在沙滩下面，页脚是深海蓝，文字一律用浅色。数字用等宽数码，增加时不抖动。 */
.bottles[hidden] { display: none; }
.bottles { max-width: 640px; margin: -10px auto 0; padding: 0 var(--gutter); }
.bottles-count { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; }
.bottles-count strong { font-family: var(--serif); font-size: 34px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: #fff; }
.bottles-count span { white-space: nowrap; color: var(--verse-soft); }
.bottles-lead { margin-top: 4px; font-size: 14px; color: var(--verse-soft); }
.bottles-form { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 8px; margin-top: 16px; }
.bottles-tags { display: contents; }
.bottles-tag { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); color: #fff; font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; transition: background 0.15s ease; }
.bottles-tag:hover { background: rgba(255, 255, 255, 0.14); }
.bottles-tag[aria-pressed="true"] { background: rgba(43, 179, 230, 0.22); box-shadow: inset 0 0 0 1px var(--sky); }
.bottles-tag:disabled { cursor: default; opacity: 0.6; }
.bottles-tag span { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.bottles-tag span:empty { display: none; }
.bottles-throw { min-height: 36px; padding: 0 18px; border: 0; background: var(--sky); color: #04263a; font-family: inherit; font-size: 14px; cursor: pointer; }
.bottles-throw:hover { background: #4cc4ef; }
.bottles-throw:disabled { cursor: default; background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.75); }
.bottles-throw.is-pending { cursor: progress; }
.bottles-status { flex-basis: 100%; min-height: 1.6em; font-size: 13px; color: rgba(255, 255, 255, 0.86); }
.bottles-status:empty { min-height: 0; }
.bottles-review { flex-basis: 100%; margin-top: -6px; font-size: 13px; color: var(--verse-soft); }
.bottles-review[hidden] { display: none; }
.bottles-review a { color: var(--sky); }
@keyframes lap { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.footer-verse { font-family: var(--serif); font-size: 24px; letter-spacing: 0.04em; color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 18px; }
.footer-links a { color: #fff; }
.footer-note { margin-top: 18px; font-size: 13px; color: var(--verse-soft); }
.footer-github { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 页尾：折叠的更新记录 ---------- */
.changelog { max-width: 560px; margin: 22px auto 0; font-size: 13px; color: var(--verse-soft); }
.changelog summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; cursor: pointer; list-style: none; box-shadow: inset 0 0 0 1px rgba(156, 195, 214, 0.35); }
.changelog summary::-webkit-details-marker { display: none; }
.changelog summary::after { content: "▾"; font-size: 11px; transition: transform 160ms ease; }
.changelog[open] summary::after { transform: rotate(180deg); }
.changelog summary:hover { color: #fff; }
.changelog-list { margin: 14px 0 0; padding: 0; list-style: none; text-align: left; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.release { display: flex; align-items: baseline; gap: 14px; padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.release-version { flex: none; min-width: 4.5em; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--sky); }
.release-title { color: rgba(255, 255, 255, 0.86); }
.release-title code { font-size: 0.95em; }
.changelog-more { margin-top: 10px; }
.changelog-more a { color: #fff; }


/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .topbar-links { display: none; }
  .lang-switch { margin-left: auto; }
  .github-link { padding: 0 9px; }
  .github-link span { display: none; }
  .keep-grid, .near-grid { grid-template-columns: minmax(0, 1fr); }
  .keep-bottle { width: 200px; }
  .demo { justify-self: center; }
  .tip-grid { grid-template-columns: minmax(0, 1fr); }
  .tip-card { justify-self: center; }
}
/* 最窄的手机上顶栏放不下「名字 + 语言 + GitHub + 添加」，名字只留图标（链接仍有 aria-label，首屏紧接着就是名字）。 */
@media (max-width: 420px) {
  .topbar-brand span { display: none; }
}
@media (max-width: 560px) {
  .compare-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .legend { padding-left: 0; }
}

@media (hover: none) and (pointer: coarse) {
  .button-alipay { display: flex; }
}

/* 减少动态：停掉漂浮、海浪、进度条与转圈；水位固定在半瓶。 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bar-smooth .bar-played { width: 52%; }
  .bar-smooth .bar-buffer { width: 58%; }
}

/* 投喂菜单：四张小卡片，图标是自绘的通用食物插画（不使用任何品牌标识）。 */
.food { display: block; width: 44px; height: 44px; flex: none; }
.food-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 460px; margin: 0; padding: 0; list-style: none; }
.food-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 6px 12px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 10px 24px -18px rgba(8, 40, 58, 0.5); text-align: center; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.food-card .food { width: 48px; height: 48px; margin-bottom: 6px; transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.food-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line), 0 16px 30px -18px rgba(8, 40, 58, 0.55); }
.food-card:hover .food { transform: translateY(-3px) rotate(-6deg); }
.food-card.is-popular { box-shadow: 0 0 0 2px var(--amber), 0 10px 24px -18px rgba(8, 40, 58, 0.5); }
.food-card.is-free { background: transparent; box-shadow: none; outline: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent); outline-offset: -1px; }
.food-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: var(--amber); color: #3b2108; font-size: 11px; font-weight: 600; white-space: nowrap; }
.food-name { font-size: 14px; white-space: nowrap; }
.food-price { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--amber-ink); }
.food-card.is-free .food-price { color: var(--ink-soft); }
@media (max-width: 560px) {
  .food-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .food-card, .food-card .food { transition: none; }
  .food-card:hover, .food-card:hover .food { transform: none; }
}

/* ---------- 404：瓶子漂丢了 ---------- */
.lost { min-height: 100vh; display: grid; place-content: center; padding-bottom: 150px; }
.lost h1 { font-family: var(--serif); font-size: clamp(34px, 6vw, 56px); line-height: 1.25; }
.lost .hero-bottle { animation: bob 6s ease-in-out infinite, wander 18s ease-in-out infinite; }
@keyframes wander { 0%, 100% { translate: -24px 0; } 50% { translate: 24px 0; } }
