/* ============================================================
 * 睡个好觉³³ · 全局样式 v2 —— 暖纸 · 衬线 · 编辑排版
 * 设计基调：奶油纸底 + 墨色衬线大字 + 一点玫瑰色
 * 页头页脚是框架主角：页脚为深墨色块，LBS 是管理入口
 * ============================================================ */
:root {
  --bg: #f7f3ec;
  --bg-soft: #efe9df;
  --ink: #2c2924;
  --ink-deep: #211e1a;
  --ink-soft: #6d675c;
  --ink-faint: #a39b8d;
  --accent: #b96d7d;
  --accent-deep: #a55a6b;
  --accent-soft: #f3e2e5;
  --sage: #7d8f81;
  --sage-soft: #e9efe9;
  --line: #e3dccc;
  --line-dark: rgba(243, 239, 231, 0.16);
  --card: #fffdf8;
  --cream: #f3efe7;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow:
    0 1px 2px rgba(44, 41, 36, 0.05), 0 10px 30px rgba(44, 41, 36, 0.07);
  --shadow-hover:
    0 2px 6px rgba(44, 41, 36, 0.07), 0 18px 44px rgba(44, 41, 36, 0.13);
  --serif:
    "Noto Serif SC", "Source Han Serif SC", "STZhongsong", SimSun, Georgia,
    serif;
  --sans:
    -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.19, 0.66, 0.22, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
em {
  font-style: normal;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
}
.wrap-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- 全站纸纹颗粒（极淡） ---- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ===== 页头 ===== */
/* sticky 挂在外层 #site-header 上：sticky 只能在父元素盒内吸附，
   挂在 .site-header 上会被只有自身高度的父 div 限制住而失效 */
#site-header {
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header {
  background: rgba(247, 243, 236, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.site-title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 2px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  line-height: 1.2;
}
.site-title em {
  color: var(--accent);
}
.site-title .en {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: var(--ink-faint);
  text-transform: uppercase;
  transform: translateY(-2px);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.site-nav a {
  font-size: 14.5px;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transition: right 0.3s var(--ease);
}
.site-nav a:hover {
  color: var(--ink);
}
.site-nav a:hover::after {
  right: 0;
}
.site-nav a.active {
  color: var(--accent);
  font-weight: 500;
}
.site-nav a.active::after {
  right: 0;
}
/* LBS：导航末尾的管理入口（弱化显示，竖线与导航区隔） */
.site-nav .lbs {
  margin-left: 14px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0.55;
  transition:
    opacity 0.2s,
    color 0.2s;
}
.site-nav .lbs:hover {
  opacity: 1;
  color: var(--accent-deep);
}

/* ===== 主体通用 ===== */
main {
  padding: 0 0 96px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.35;
}

/* 页面标题头（文章/相册/友链等内页统一用） */
.page-head {
  padding: clamp(56px, 10vh, 96px) 0 0;
}
.page-head .eyebrow {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-head .eyebrow::after {
  content: "";
  flex: 1;
  max-width: 72px;
  height: 1px;
  background: var(--line);
}
.page-head h1 {
  font-size: clamp(44px, 8vw, 76px);
  letter-spacing: 0.02em;
  line-height: 1.08;
}
.page-head .en {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: clamp(14px, 2.2vw, 19px);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-faint);
}
.page-head .sub {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 34em;
}
.page-head .sub em {
  color: var(--accent);
}

.section-label {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.3em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-transform: uppercase;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ===== 按钮 ===== */
.btn {
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 999px;
  padding: 12px 34px;
  transition:
    background 0.2s,
    transform 0.2s var(--ease),
    box-shadow 0.2s;
}
.btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(165, 90, 107, 0.25);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
  box-shadow: none;
}
.btn-danger {
  background: #a8524b;
}
.btn-danger:hover {
  background: #8f423c;
  box-shadow: none;
}

.tag {
  display: inline-block;
  font-size: 12px;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 2px 12px;
  border-radius: 999px;
}

/* ===== 首页 ===== */
.home-hero {
  padding: clamp(72px, 14vh, 140px) 0 clamp(48px, 8vh, 80px);
  position: relative;
}
.home-hero .hero-id {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 26px);
}
.home-hero .hero-avatar {
  width: clamp(72px, 9vw, 92px);
  aspect-ratio: 1;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 5px var(--card);
}
.home-hero h1 {
  font-size: clamp(40px, 7.4vw, 84px);
  letter-spacing: 0.01em;
  line-height: 1.18;
  max-width: 12em;
}
.home-hero h1 em {
  color: var(--accent);
}
.home-hero .lead {
  margin-top: 30px;
  color: var(--ink-soft);
  font-size: 16.5px;
  max-width: 32em;
}
.home-hero .lead a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s;
}
.home-hero .lead a:hover {
  border-color: var(--accent);
}
.home-hero .hero-rule {
  margin-top: 44px;
  height: 1px;
  background: var(--line);
  position: relative;
}
.home-hero .hero-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 64px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* 快捷入口：三行大列表（替代卡片） */
.home-menu {
  display: flex;
  flex-direction: column;
  margin-bottom: clamp(56px, 10vh, 88px);
}
.home-menu a {
  display: grid;
  grid-template-columns: 64px 1fr auto 28px;
  align-items: center;
  gap: 22px;
  padding: clamp(18px, 3.4vh, 28px) 10px;
  border-top: 1px solid var(--line);
  transition:
    background 0.25s,
    padding-left 0.3s var(--ease);
}
.home-menu a:last-child {
  border-bottom: 1px solid var(--line);
}
.home-menu .no {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-faint);
  transition: color 0.25s;
}
.home-menu .name {
  font-family: var(--serif);
  font-size: clamp(22px, 3.6vw, 32px);
  font-weight: 600;
  transition:
    color 0.25s,
    transform 0.3s var(--ease);
  display: inline-block;
}
.home-menu .hint {
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.home-menu .arrow {
  color: var(--ink-faint);
  font-size: 18px;
  transition:
    transform 0.3s var(--ease),
    color 0.25s;
}
.home-menu a:hover {
  background: rgba(185, 109, 125, 0.045);
  padding-left: 22px;
}
.home-menu a:hover .name {
  color: var(--accent);
}
.home-menu a:hover .no {
  color: var(--accent);
}
.home-menu a:hover .arrow {
  transform: translateX(6px);
  color: var(--accent);
}

/* ===== 文章列表（编辑式行，替代卡片堆） ===== */
.post-list {
  display: flex;
  flex-direction: column;
}
.post-item {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 26px;
  padding: clamp(20px, 3.6vh, 30px) 8px;
  border-top: 1px solid var(--line);
  transition:
    background 0.25s,
    padding-left 0.3s var(--ease);
}
.post-item:last-child {
  border-bottom: 1px solid var(--line);
}
.post-item .meta {
  font-size: 12.5px;
  color: var(--ink-faint);
  padding-top: 7px;
}
.post-item .meta time {
  display: block;
  letter-spacing: 0.04em;
}
.post-item .meta .tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.post-item .meta .tag {
  font-size: 11px;
  padding: 1px 10px;
}
.post-item h2 {
  font-size: clamp(19px, 2.8vw, 25px);
  margin-bottom: 6px;
  transition: color 0.25s;
}
.post-item p {
  color: var(--ink-soft);
  font-size: 14.5px;
}
.post-item:hover {
  background: rgba(185, 109, 125, 0.04);
  padding-left: 20px;
}
.post-item:hover h2 {
  color: var(--accent);
}

.list-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: clamp(56px, 12vh, 96px) 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    170deg,
    rgba(243, 226, 229, 0.25),
    rgba(233, 239, 233, 0.3)
  );
}
.list-empty .big {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--ink);
  margin-bottom: 8px;
}
.list-empty p {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ===== 文章正文 ===== */
.prose {
  font-size: 16.5px;
  line-height: 2;
}
.prose p {
  margin: 1.15em 0;
}
.prose h2 {
  font-size: 23px;
  margin: 1.9em 0 0.8em;
}
.prose h3 {
  font-size: 18.5px;
  margin: 1.5em 0 0.7em;
}
.prose ul,
.prose ol {
  padding-left: 1.6em;
  margin: 1em 0;
}
.prose li {
  margin: 0.35em 0;
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 22px;
  margin: 1.3em 0;
  color: var(--ink-soft);
  background: rgba(243, 226, 229, 0.3);
  border-radius: 0 12px 12px 0;
}
.prose img {
  border-radius: var(--radius);
  margin: 1.4em auto;
}
.prose code {
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.88em;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
.prose a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
}

.post-cover {
  border-radius: var(--radius-lg);
  margin: 12px 0 32px;
  width: 100%;
}
.post-meta {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.back-link {
  margin-top: 36px;
  font-size: 14px;
}
.back-link a {
  color: var(--accent);
}
.back-link a:hover {
  border-bottom: 1px solid var(--accent);
}

/* ===== 相册 ===== */
.gal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 34px 0 30px;
}
.gal-tab {
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  transition: all 0.2s;
}
.gal-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gal-tab.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.gal-tab .n {
  font-size: 11px;
  opacity: 0.55;
  margin-left: 6px;
}

.gallery-grid {
  columns: 2;
  column-gap: 16px;
}
.gallery-grid figure {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  cursor: zoom-in;
  position: relative;
  box-shadow: var(--shadow);
}
.gallery-grid img {
  width: 100%;
  transition: transform 0.35s var(--ease);
}
.gallery-grid figure:hover img {
  transform: scale(1.035);
}
.gallery-grid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 12px;
  color: #fff;
  font-size: 13px;
  background: linear-gradient(transparent, rgba(33, 30, 26, 0.6));
  opacity: 0;
  transition: opacity 0.25s;
}
.gallery-grid figure:hover figcaption {
  opacity: 1;
}

.gallery-empty {
  column-span: all; /* 空态横跨照片墙的多列布局，不被拆成两块 */
  text-align: center;
  padding: clamp(64px, 14vh, 110px) 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    170deg,
    rgba(243, 226, 229, 0.28),
    rgba(233, 239, 233, 0.32)
  );
}
.gallery-empty .big {
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 34px);
  color: var(--ink);
  margin-bottom: 12px;
}
.gallery-empty p {
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 30em;
  margin: 0 auto;
}
.gallery-empty a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
}
.gallery-empty a:hover {
  border-color: var(--accent);
}
.gallery-empty code {
  background: var(--card);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(33, 30, 26, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 10px;
}

/* ===== 通用状态 ===== */
.msg-status {
  color: var(--ink-faint);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}
.msg-status.err {
  color: var(--accent);
}
.empty {
  color: var(--ink-faint);
  font-size: 13.5px;
  text-align: center;
  padding: 22px 12px;
}

/* ===== 404 ===== */
.notfound {
  text-align: center;
  padding: 96px 0;
}
.notfound .big {
  font-family: var(--serif);
  font-size: 76px;
  color: var(--accent);
}

/* ===== 滚动入场（页面可选用 .rv） ===== */
.rv {
  opacity: 0;
}
.rv.in {
  animation: rv-rise 0.9s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 90ms);
}
@keyframes rv-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.rv[data-d="1"] {
  --d: 1;
}
.rv[data-d="2"] {
  --d: 2;
}
.rv[data-d="3"] {
  --d: 3;
}
.rv[data-d="4"] {
  --d: 4;
}
.rv[data-d="5"] {
  --d: 5;
}
.rv[data-d="6"] {
  --d: 6;
}
.rv[data-d="7"] {
  --d: 7;
}
.rv[data-d="8"] {
  --d: 8;
}
.rv[data-d="9"] {
  --d: 9;
}

/* ===== 留言墙（友链页 GUESTBOOK / 文章页评论 共用组件） ===== */
.gb {
  margin-top: clamp(44px, 8vh, 64px);
}
.gb-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 10px;
}
.gb-form .gb-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.gb-form input,
.gb-form textarea {
  font: inherit;
  font-size: 15px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
}
.gb-form .gb-row input {
  flex: 1 1 170px;
  width: auto;
}
.gb-form input:focus,
.gb-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gb-form textarea {
  min-height: 96px;
  resize: vertical;
}
.gb-form .btn {
  align-self: flex-start;
}
.gb-status {
  color: var(--sage);
  font-size: 13.5px;
  min-height: 1.5em;
  margin: 0 0 6px;
}
.gb-status.err {
  color: var(--accent);
}

.gb-list {
  display: flex;
  flex-direction: column;
}
/* 对话组：主评论白卡 + 内嵌回复块（回复紧跟其下，不再平铺散开） */
.gb-thread {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.gb-thread:first-child {
  border-top: none;
  padding-top: 2px;
}
.gb-item {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.gb-item.is-reply {
  background: var(--bg);
  border: none;
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
}
.gb-replies {
  margin-top: 10px;
  margin-left: 56px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.gb-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.gb-avatar {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent-soft), var(--sage-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--accent);
  overflow: hidden;
}
.gb-body {
  flex: 1;
  min-width: 0;
}
.gb-who {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.gb-url {
  color: var(--accent);
  font-size: 13px;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s;
}
.gb-url:hover {
  border-color: var(--accent);
}
.gb-when {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 400;
}
.gb-say {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.gb-empty {
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
  padding: 34px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: linear-gradient(
    170deg,
    rgba(243, 226, 229, 0.22),
    rgba(233, 239, 233, 0.28)
  );
}

/* ===== 评论/留言组件 CommentBox（friends 同款） ===== */
.cb {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cb-side {
  flex: 0 0 46px;
}
.cb-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--sage-soft));
  font-family: var(--serif);
  font-size: 18px;
  color: var(--accent);
  overflow: hidden;
  flex: none;
}
.cb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cb-main {
  flex: 1;
  min-width: 0;
}
.cb-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cb-fields input {
  font: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  flex: 1 1 150px;
  min-width: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.cb-fields input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cb-text {
  font: inherit;
  font-size: 15px;
  line-height: 1.8;
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.cb-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cb-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.cb-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s;
}
.cb-tool:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.cb-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cb-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.cb-send {
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  background: var(--ink);
  color: var(--cream);
  transition:
    background 0.2s,
    transform 0.2s var(--ease);
}
.cb-send:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.cb-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.cb-status {
  font-size: 13px;
  color: var(--sage);
  min-height: 1.4em;
  margin-top: 6px;
}
.cb-status.err {
  color: var(--accent-deep);
}

/* 回复模式 */
.cb-replying {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 14px;
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--accent-deep);
}
.cb-replying.hidden {
  display: none;
}
.cb-replying-cancel {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--accent-deep);
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.cb-replying-cancel:hover {
  background: rgba(185, 109, 125, 0.18);
}
.cb-reply-btn {
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 14px;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.cb-reply-btn:hover {
  color: var(--accent);
  border-color: rgba(185, 109, 125, 0.5);
  background: var(--accent-soft);
}
.cb-replying-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 10px;
  border-radius: 999px;
  vertical-align: 1px;
}

/* 表情面板 */
.cb-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(342px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  padding: 12px;
}
.cb-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.cb-panel-head span {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.cb-panel-tip {
  padding: 18px 6px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}
.cb-panel-grid {
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cb-emote-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  line-height: 0;
  transition: background 0.15s;
}
.cb-emote-btn:hover {
  background: var(--accent-soft);
}
.cb-emote-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* 评论配图（发表前缩略图 + 列表里的图） */
.cb-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.cb-thumb {
  position: relative;
  width: 64px;
  height: 64px;
}
.cb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.cb-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(33, 30, 26, 0.62);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.cb-thumb-del:hover {
  background: #a8524b;
}
.cb-pics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.cb-pic {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  display: block;
  background: var(--bg-soft);
  transition: opacity 0.2s;
}
.cb-pic:hover {
  opacity: 0.88;
}
.cb-emote {
  /* 全局 img 是 display:block，必须覆盖回行内，否则每个表情独占一行 */
  display: inline-block;
  height: 26px;
  vertical-align: -6px;
  margin: 0 1px;
}

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  .wrap,
  .wrap-wide {
    padding: 0 20px;
  }
  .site-header .wrap {
    min-height: 64px;
  }
  .site-title {
    font-size: 20px;
  }
  .site-title .en {
    display: none;
  }
  .site-nav {
    gap: 16px;
  }
  .site-nav a {
    font-size: 13.5px;
  }
  .home-menu a {
    grid-template-columns: 44px 1fr auto;
  }
  .home-menu .hint {
    display: none;
  }
  .home-menu .arrow {
    justify-self: end;
  }
  .post-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 6px;
  }
  .post-item .meta {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 0;
  }
  .post-item .meta .tags {
    margin-top: 0;
  }
  .gallery-grid {
    columns: 1;
  }
  .gb-replies {
    margin-left: 22px;
  }
  .gb-item {
    padding: 14px;
  }
  .gb-meta {
    margin-left: 0;
  }
  .site-nav {
    gap: 12px;
  }
  .site-nav .lbs {
    margin-left: 8px;
    padding-left: 10px;
  }
  .page-head h1 {
    font-size: 42px;
  }
}

/* 尊重系统减弱动态效果设置 */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  html {
    scroll-behavior: auto;
  }
  .rv {
    opacity: 1 !important;
  }
}
