/* 深蓝 · 读者端样式 —— 只引用 design-tokens.css 里的角色色，不写裸 hex */
@import url('./design-tokens.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性必须赢过任何作者 display（flex/grid 会顶掉默认的 [hidden]{display:none}）*/
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 20px 72px; }

/* ---- 头部 banner：蓝调时刻。容器锁定 750:400，图始终完整 ---- */
.hero {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  aspect-ratio: 750 / 400;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: clamp(12px, 4vw, 28px) clamp(16px, 5vw, 32px);
  color: var(--inverse-on-surface);
  background:
    linear-gradient(180deg, rgba(11,41,61,.10) 0%, rgba(11,41,61,.45) 62%, rgba(0,26,60,.72) 100%),
    url('../assets/banner2-750x400.jpg') center center / cover no-repeat,
    var(--night-deep);
}
.hero .lamp {
  position: absolute; top: 22px; right: 24px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lamp-glow);
  box-shadow: 0 0 10px 3px rgba(255,222,179,.55);
}
.hero .site {
  position: absolute; top: 18px; left: 22px;
  font-size: 13px; letter-spacing: 6px; opacity: .85;
}
.hero .tonight {
  font-size: 21px; font-weight: 500; letter-spacing: 2px;
  line-height: 1.6; text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
.hero.is-post .tonight { font-size: 17px; }

/* ---- 值守记录列表 ---- */
.logbook { padding-top: 30px; }
.logbook .sec-note {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 18px; letter-spacing: 1px;
}
/* ---- 卡片式列表（手机大热点）----
   分隔只用一种语言：白卡 + 一层柔影浮起，不描边（底色与纸底太近，描边+投影叠加会脏）。 */
.entry {
  display: block;
  background: #fff;
  border: 0;
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  min-height: 48px; /* 整块都够拇指点（iOS 44 / 安卓 48）*/
  box-shadow: 0 1px 2px rgba(0, 26, 60, .04), 0 6px 16px rgba(0, 26, 60, .06);
  transition: transform .14s ease, box-shadow .14s ease;
  -webkit-tap-highlight-color: transparent;
  animation: card-in .42s cubic-bezier(.22,.61,.36,1) backwards;
}
.entry:active {
  transform: scale(.98);
  box-shadow: 0 1px 2px rgba(0, 26, 60, .05); /* 按下时影子收下去，像被按到纸里 */
}
.entry .top { display: flex; align-items: center; gap: 10px; }
.entry .t {
  font-size: 20px; font-weight: 500; color: var(--night);
  letter-spacing: 2px; line-height: 1.2;
}
.entry .k {
  font-size: 11px; line-height: 1; color: var(--warm-accent);
  background: var(--warm-accent-container);
  border-radius: 999px; padding: 4px 9px;   /* 填充胶囊比描边更稳，重心与标题对齐 */
  flex: none;
}
.entry .ex {
  font-size: 14px; line-height: 1.6; color: var(--ink); opacity: .85;
  margin-top: 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry .d { font-size: 12px; color: var(--ink-soft); margin-top: 11px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .entry, .post-body { animation: none; }
}
.empty { color: var(--ink-soft); font-size: 14px; padding: 48px 0; text-align: center; line-height: 2; }

/* ---- 手机习惯的顶部返回 ---- */
.back-top {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 16px;
  z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 26, 60, .32);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}
.back-top svg { width: 20px; height: 20px; display: block; }
.back-top:active { background: rgba(0, 26, 60, .5); }

/* ---- 详情 ---- */
.post-header { padding: 26px 0 6px; }
.post-header .top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post-header .t { font-size: 29px; font-weight: 500; color: var(--night); letter-spacing: 3px; line-height: 1.1; }
/* 短标题（8–16 字）不能沿用时间戳那套大字+宽字距，否则被挤成难看的两行 */
.post-header .t.is-headline { font-size: 22px; font-weight: 600; letter-spacing: .4px; line-height: 1.4; }
.post-header .k {
  font-size: 11px; line-height: 1; color: var(--warm-accent);
  background: var(--warm-accent-container);
  border-radius: 999px; padding: 4px 9px; flex: none;
}
.post-header .d { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; }
.post-body { padding: 24px 0 8px; animation: card-in .42s cubic-bezier(.22,.61,.36,1) backwards; }
.post-body p { margin: 0 0 1.1em; }
.post-body h2 { font-size: 18px; color: var(--night); margin: 1.4em 0 .7em; font-weight: 600; }
.post-body blockquote {
  border-left: 3px solid var(--primary-container);
  padding-left: 14px; color: var(--ink-soft); margin: 1em 0;
}
.post-body em { color: var(--tertiary); font-style: normal; }
.post-body strong { color: var(--night); }
.sign {
  text-align: right; color: var(--warm-accent);
  font-size: 13.5px; margin-top: 30px; letter-spacing: 2px;
}
.visitors {
  text-align: center; color: var(--ink-soft);
  font-size: 12.5px; margin: 40px 0 4px; letter-spacing: 1px;
}
.back { display: inline-block; font-size: 13px; color: var(--ink-soft); margin-top: 18px; }

/* ---- 评论：扁平一层，只有深蓝能回 ---- */
.comments { padding-top: 36px; border-top: 1px solid var(--outline-variant); margin-top: 20px; }
.comments h3 { font-size: 15px; color: var(--night); font-weight: 600; margin-bottom: 16px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--outline-variant); }
.comment .who { font-size: 13px; color: var(--night); font-weight: 600; }
.comment .when { font-size: 11.5px; color: var(--ink-soft); margin-left: 8px; font-weight: 400; }
.comment .txt { font-size: 14.5px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.comment .del { float: right; font-size: 11.5px; color: var(--error); }
/* 深蓝的回复：不是二楼，是同一条评论下官方唯一的回答 */
.reply {
  margin-top: 10px; padding: 11px 13px;
  background: var(--surface-container-low);
  border-left: 3px solid var(--warm-accent-container);
  border-radius: 0 10px 10px 0;
}
.reply .who { color: var(--warm-accent); font-size: 12.5px; }
.reply .txt { font-size: 14px; }
/* ---- 手机原生 composer：一条输入栏，聚焦才展开，发送键在栏内 ---- */
.comment-form { margin-top: 4px; }
.comment-form .hint { font-size: 12px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 10px; }
.composer {
  position: relative;
  display: flex; align-items: flex-end;
  width: 100%; min-width: 0;
  background: #fff;
  border: 1px solid var(--outline-variant);
  border-radius: 20px;
  padding: 6px 6px 6px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.composer:focus-within {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(46, 94, 158, .12); /* 用自己的柔焦圈接住焦点，不要浏览器粗黑框 */
}
.composer textarea {
  flex: 1; min-width: 0; width: 100%;
  display: block;
  border: 0; outline: none; background: transparent; resize: none;
  font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--ink);
  max-height: 120px; /* 约 5 行，再多内部滚动 */
  /* 兜底一行高度：22.5 行高 + 上下 7 padding = 36.5，与 36 圆钮+容器 padding 对齐。
     JS 自动长高若在隐藏时跑出 0，这条保证框不塌、占位字不被下边框裁掉 */
  min-height: 36.5px;
  padding: 7px 0;
}
.composer textarea::placeholder { color: #8A8F99; }
.composer .send {
  flex: none;
  width: 36px; height: 36px; min-height: 36px; padding: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--warm-accent-container); color: var(--warm-accent);
  margin-left: 8px;
}
.composer .send svg { width: 19px; height: 19px; }
.composer .send:disabled { background: var(--surface-container-high); color: #9AA0AB; }
button {
  border: none; border-radius: 999px; padding: 10px 24px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--primary); color: var(--on-primary); min-height: 44px;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
button:active { transform: scale(.97); }
button.warm { background: var(--warm-accent-container); color: var(--warm-accent); }
button:disabled { opacity: .55; cursor: default; }
.login-tip {
  font-size: 13px; color: var(--ink-soft);
  background: var(--surface-container-low); border-radius: 12px;
  padding: 12px 14px; margin-top: 12px;
}

/* ---- 账号弹层（登录/注册/夜里的名字）---- */
.sl-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 26, 60, .42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
  animation: sl-fade .16s ease;
}
.sl-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border-radius: 18px;
  padding: 26px 22px 20px;
  box-shadow: 0 12px 40px rgba(0, 26, 60, .22);
  animation: card-in .22s cubic-bezier(.22,.61,.36,1);
}
.sl-card h3 { font-size: 19px; color: var(--night); font-weight: 600; text-align: center; }
.sl-sub { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 8px 0 20px; line-height: 1.6; }
.sl-fields label {
  display: block; font-size: 12.5px; color: var(--ink-soft);
  margin: 12px 0 6px; letter-spacing: .5px;
}
.sl-fields label:first-child { margin-top: 0; }
.sl-fields input {
  width: 100%; min-height: 44px;
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sl-fields input:focus {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(46, 94, 158, .12);
}
.sl-err { min-height: 20px; font-size: 12.5px; color: var(--error); margin-top: 10px; text-align: center; }
.sl-btns { display: flex; gap: 10px; margin-top: 4px; }
.sl-btns button { flex: 1; }
.sl-btn-ghost {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--outline-variant);
}
@keyframes sl-fade { from { opacity: 0; } to { opacity: 1; } }

/* 窄屏微调 */
@media (max-width: 380px) {
  .hero .tonight { font-size: 19px; }
  .post-header .t { font-size: 26px; }
}

/* ---- 右下角悬浮账户入口（2026-09-12 定，读者端唯一悬浮钮）---- */
.acct-fab {
  position: fixed; right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 50;                 /* 低于弹层 100，登录卡永远在它上面 */
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(0, 26, 60, .22), 0 1px 3px rgba(0, 26, 60, .18);
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, box-shadow .14s ease;
}
.acct-fab svg { width: 24px; height: 24px; display: block; }
.acct-fab:active {
  transform: scale(.93);
  box-shadow: 0 2px 6px rgba(0, 26, 60, .2);
}
@media (prefers-reduced-motion: reduce) { .acct-fab { transition: none; } }

/* ---- 账户页：我的角落 ---- */
.acct-block { padding-top: 28px; }
.acct-block:first-of-type { padding-top: 26px; }
.acct-card {
  background: #fff; border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 26, 60, .04), 0 6px 16px rgba(0, 26, 60, .06);
}
.acct-hint { font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 12px; }
/* 定下后锁定的夜名：静态文本，不给修改入口 */
.name-fixed { margin: 2px 0; }
.name-fixed span {
  display: inline-block; font-size: 17px; font-weight: 600;
  color: var(--night); letter-spacing: .5px;
  padding: 6px 2px 8px;
}
.name-row { display: flex; gap: 10px; }
.name-input {
  flex: 1; min-width: 0; min-height: 44px;
  border: 1px solid var(--outline-variant);
  border-radius: 12px; padding: 10px 14px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.name-input:focus {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 3px rgba(46, 94, 158, .12);
}
.name-save {
  flex: none; padding: 0 22px; min-height: 44px;
  border-radius: 12px;
  background: var(--primary); color: var(--on-primary);
  font-size: 14px;
}
.acct-msg { font-size: 12.5px; color: var(--warm-accent); margin-top: 10px; min-height: 18px; }
.acct-msg.is-err { color: var(--error); }

/* 回复卡片：与列表卡同一语言（白卡浮起，不描边）*/
.rc {
  background: #fff; border-radius: 16px;
  padding: 16px 18px 12px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 26, 60, .04), 0 6px 16px rgba(0, 26, 60, .06);
}
.rc-post {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; color: var(--night);
  letter-spacing: .5px; line-height: 1.4;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--outline-variant);
}
.rc-post-title { flex: 1; min-width: 0; }
.rc-post svg { flex: none; width: 15px; height: 15px; color: var(--ink-soft); }
.rc-post:active .rc-post-title { color: var(--primary); }
.rc-mine, .rc-reply { font-size: 14px; }
.rc-reply {
  margin-top: 10px; padding: 11px 13px;
  background: var(--surface-container-low);
  border-left: 3px solid var(--warm-accent-container);
  border-radius: 0 10px 10px 0;
}
.rc-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink-soft); margin-bottom: 4px;
}
.rc-tag {
  font-size: 11px; line-height: 1; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-container-high); color: var(--ink-soft);
}
.rc-tag.is-shenlan {
  background: var(--warm-accent-container); color: var(--warm-accent);
}
.rc-body { white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.rc-pending {
  margin-top: 10px; font-size: 13px; color: var(--ink-soft);
  padding: 9px 13px; background: var(--surface-container-low); border-radius: 10px;
}
.rc-actions { text-align: right; margin-top: 10px; }
.rc-del { font-size: 12px; color: var(--error); }
.acct-logout {
  width: 100%; margin-top: 28px;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--outline-variant);
}
