/* ChatMiao 主站 —— 猫猫主题 · 樱花粉 · 苹果风
 * 主色：樱花粉 · 点缀：淡紫 · 背景：奶粉白 · 大圆角大留白 */
:root {
  --primary: #f78fbf;        /* 樱花粉主色 */
  --primary-dark: #e56ea8;   /* 深粉 */
  --primary-light: #ffe4f0;  /* 粉底 */
  --primary-soft: #fff0f5;   /* 更浅粉（模板常用，避免深色下退回硬编码） */
  --accent: #a99bf0;         /* 淡紫点缀 */
  --accent-light: #efeafe;
  --bg: #fdf3f8;             /* 奶粉粉背景 */
  --card: #ffffff;
  --text: #3d3440;
  --text-light: #9a8f9c;
  --border: #f5e3ee;
  --ok: #6fbd95;
  --warn: #e6b463;
  --danger: #e8807c;
  --link: #2f6fd0;           /* 正文里的链接色：明确的蓝，和粉底对比清楚 */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 34px rgba(247, 143, 191, .14);
  --shadow-hover: 0 16px 44px rgba(247, 143, 191, .22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航 —— 粉紫渐变，圆润 */
.topnav {
  background: linear-gradient(135deg, #f78fbf, #b3a3f5);
  color: #fff;
  box-shadow: 0 4px 20px rgba(247, 143, 191, .25);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topnav .brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: .5px;
  text-shadow: 0 1px 4px rgba(229, 110, 168, .35);
}
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: #fff8fb;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 22px;
  font-size: .92rem;
  transition: background .2s, transform .2s;
}
.nav-links a:hover { background: rgba(255, 255, 255, .25); transform: translateY(-1px); }

/* 导航用户区 */
.nav-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-user a {
  color: #fff8fb;
  text-decoration: none;
  font-size: .88rem;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background .2s;
}
.nav-user a:hover { background: rgba(255, 255, 255, .25); }
.nav-user .nav-register { background: rgba(255, 255, 255, .22); }
.nav-user .nav-register:hover { background: rgba(255, 255, 255, .35); }
.nav-user-name { color: #fff; font-size: .88rem; font-weight: 600; }
.nav-user-link { text-decoration: none; padding: 4px 8px; border-radius: 16px; transition: background .2s; }
.nav-user-link:hover { background: rgba(255, 255, 255, .22); }
.nav-logout {
  background: none;
  border: 1px solid rgba(255, 255, 255, .5);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s;
}
.nav-logout:hover { background: rgba(255, 255, 255, .2); }

/* 手机端导航紧凑布局：第一行 品牌+用户区，第二行 链接居中（小号） */
@media (max-width: 640px) {
  .nav-inner { flex-wrap: wrap; padding: 10px 12px 6px; row-gap: 6px; }
  .topnav .brand { font-size: 1.02rem; }
  .nav-user { margin-left: auto; }
  .nav-user a { padding: 4px 9px; font-size: .78rem; }
  .nav-user-name { font-size: .78rem; }
  .nav-logout { padding: 3px 9px; font-size: .75rem; }
  .nav-links { order: 3; width: 100%; justify-content: center; gap: 3px; }
  .nav-links a { padding: 4px 9px; font-size: .78rem; border-radius: 14px; }
}

/* 学习程度卡片：可点击 */
.learn-tile { cursor: pointer; transition: transform .15s, box-shadow .2s; }
.learn-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.learn-item { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.learn-item:last-child { border-bottom: none; }
.muted { color: var(--text-light); font-size: .82rem; }

/* 手机端用户管理表 → 卡片式（防挤压） */
@media (max-width: 640px) {
  #user-list thead { display: none; }
  #user-list tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--card);
  }
  #user-list td {
    display: block;
    border: none;
    padding: 3px 0;
    font-size: .85rem;
    white-space: normal; /* 卡片模式允许换行 */
  }
  #user-list td[data-label]::before {
    content: attr(data-label) "：";
    color: var(--text-light);
    font-size: .78rem;
  }
}

/* 用户管理表：列不换行，按钮紧凑（防挤压） */
#user-table th, #user-table td { white-space: nowrap; }
#user-table td[data-label="用户"] { white-space: normal; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#user-table .btn { padding: 4px 9px; font-size: .78rem; margin: 2px 5px 2px 0; }
#user-table .mono { font-variant-numeric: tabular-nums; }

/* 邀请码表 + 留言表：手机端卡片化（防溢出） */
#invite-table th, #invite-table td { white-space: nowrap; }
#invite-table .btn { padding: 4px 9px; font-size: .78rem; margin: 2px 5px 2px 0; }
@media (max-width: 640px) {
  #invite-table thead, .msg-table thead { display: none; }
  #invite-table tr, .msg-table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--card);
  }
  #invite-table td, .msg-table td {
    display: block;
    border: none;
    padding: 3px 0;
    font-size: .85rem;
    white-space: normal;
  }
  #invite-table td[data-label]::before, .msg-table td[data-label]::before {
    content: attr(data-label) "：";
    color: var(--text-light);
    font-size: .78rem;
  }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---------- 苹果风 Hero（滚动分屏版：内容居中，背景由 .hero-screen 提供） ---------- */
.hero {
  position: static;
  overflow: visible;
  text-align: center;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: none;
  border: none;
}
.hero .eyebrow {
  margin: 0 0 16px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--primary-dark);
  text-transform: uppercase;
}
.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}
.hero-title em { font-style: normal; color: var(--primary-dark); }
.hero-sub {
  margin: 0 auto 26px;
  max-width: 560px;
  font-size: 1.05rem;
  color: var(--text-light);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 建站小故事 ---------- */
.story-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin-bottom: 34px;
}
.story-card h2 { margin: 0 0 10px; font-size: 1.25rem; color: var(--primary-dark); }
.story-card p { margin: 7px 0; color: var(--text); }
.story-card .story-sign {
  margin-top: 12px;
  color: var(--text-light);
  font-size: .9rem;
  font-weight: 600;
}

/* 通用卡片（笔记 / 联系 / 文件 / 后台等页面） */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card h2 { margin-top: 0; color: var(--primary-dark); }

/* 区块标题（苹果风：小字、字距） */
.section-title {
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 16px 4px;
}

/* 功能入口卡片 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}
.tile {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform .25s, box-shadow .25s;
}
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.tile .icon { font-size: 1.8rem; }
.tile h3 { margin: 10px 0 6px; font-size: 1.08rem; color: var(--text); }
.tile p { margin: 0; font-size: .88rem; color: var(--text-light); }

/* ---------- 宣传画廊 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}
.gallery-item {
  margin: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 19 / 10; /* 匹配截图比例：同比例下 cover 不裁剪，整齐和谐 */
  object-fit: cover;
  background: var(--primary-light);
}
.gallery-item figcaption {
  padding: 10px 14px;
  font-size: .85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 26px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(247, 143, 191, .30);
}
.btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(229, 110, 168, .35); }
.btn.ghost {
  background: rgba(255, 255, 255, .65);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(8px);
}
.btn.ghost:hover { background: #fff; }
.btn.danger { background: var(--danger); box-shadow: 0 6px 18px rgba(232, 128, 124, .30); }
.btn.danger:hover { background: #d9625d; }
.btn.small { padding: 5px 14px; font-size: .82rem; border-radius: 999px; }

/* ---------- 表单 ---------- */
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
label { font-weight: 600; font-size: .9rem; display: block; margin: 14px 0 6px; }
.form-row { margin-bottom: 6px; }

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.badge.ok { background: #e2f4ea; color: var(--ok); }
.badge.off { background: #fde9e7; color: var(--danger); }
.badge.wait { background: #fdf3dd; color: var(--warn); }

/* ---------- 服务器卡片 ---------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 34px; }
.server-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; transition: transform .25s, box-shadow .25s; }
.server-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.server-card .name { font-weight: 800; font-size: 1.05rem; color: var(--primary-dark); }
.server-card .addr { color: var(--text-light); font-size: .82rem; }
.server-card .big-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.server-card .meta { font-size: .85rem; color: var(--text-light); margin-top: 6px; }
.server-card .motd { font-size: .9rem; margin: 8px 0 0; }

/* 服务器卡片：3D 翻转（正面人数 / 背面折线图） */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
  min-height: 210px;
}
.flip-card .flip-inner {
  position: relative;
  width: 100%;
  height: 210px;
  transition: transform .6s ease;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
  overflow: hidden;
}
.flip-back {
  transform: rotateY(180deg);
  text-align: center;
}
.flip-back-title { font-size: .85rem; color: var(--primary-dark); font-weight: 700; margin-bottom: 6px; }
.mini-chart {
  min-height: 84px;
  max-width: 240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.flip-hint {
  font-size: .75rem;
  color: var(--text-light);
  margin: 8px 0 0;
  opacity: .75;
}

/* 极简折线图居中 */
.chart-center { max-width: 680px; margin: 0 auto; }

/* ---------- 照片墙 Lightbox（点击放大 + 轮播） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(42, 30, 40, .9);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox img {
  max-width: 88vw;
  max-height: 84vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  transform: scale(.92);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.lightbox.open img { transform: scale(1); opacity: 1; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .32); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .85);
  font-size: .9rem;
}
@media (max-width: 520px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 1.2rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ---------- 折线图 ---------- */
.chart-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.chart-wrap h3 { margin: 0 0 4px; color: var(--primary-dark); }
.chart-wrap .sub { color: var(--text-light); font-size: .85rem; margin-bottom: 10px; }
.chart-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-toolbar button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  transition: all .2s;
}
.chart-toolbar button:hover { border-color: var(--primary); color: var(--primary-dark); }
.chart-toolbar button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chart-svg { width: 100%; height: auto; display: block; }

/* ---------- 列表 ---------- */
.list-item {
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-item .title { font-weight: 600; text-decoration: none; color: var(--text); transition: color .15s; }
.list-item .title:hover { color: var(--primary); }
.list-item .meta { font-size: .82rem; color: var(--text-light); }

/* ---------- 笔记正文 ---------- */
/* 笔记正文与文件库正文（.md-body）用同一套排版参数：
   行距 1.75 + 段间距 1em，两处看起来才一致（原来 .note-body 连行高都没设，
   用浏览器默认值，中文长文偏挤）。 */
.note-body, .md-body { overflow-wrap: break-word; line-height: 1.75; }
.note-body p, .md-body p { margin: 0 0 1em; }
.note-body > :first-child, .md-body > :first-child { margin-top: 0; }
.note-body > :last-child, .md-body > :last-child { margin-bottom: 0; }
/* 正文里的链接：笔记与文件库统一成同一套。
   原来两处不一致 —— 笔记没设样式（浏览器默认蓝）、文件库是深粉**且无下划线**，
   看上去根本不像能点的。现在统一成 --link 色 + 下划线，一眼能认出是链接。 */
.note-body a, .md-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;   /* 长链接要能断行，否则窄屏会把整行撑破 */
}
.note-body a:hover, .md-body a:hover { text-decoration-thickness: 2px; }
.note-body h1, .note-body h2, .note-body h3 { color: var(--primary-dark); }
.note-body pre {
  background: #33303d;
  color: #f5eef6;
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.note-body code { background: var(--primary-light); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.note-body pre code { background: none; padding: 0; }
.note-body img { max-width: 100%; border-radius: var(--radius-sm); }
.note-body blockquote { border-left: 4px solid var(--primary); margin: 10px 0; padding: 4px 14px; color: var(--text-light); background: var(--primary-light); border-radius: 0 12px 12px 0; }
.note-body table { border-collapse: collapse; width: 100%; }
.note-body th, .note-body td { border: 1px solid var(--border); padding: 6px 10px; }

/* ---------- 提示条 ---------- */
.alert { border-radius: var(--radius-sm); padding: 11px 16px; margin-bottom: 14px; font-size: .92rem; }
.alert.ok { background: #e2f4ea; color: #2e6b46; }
.alert.warn { background: #fdf3dd; color: #7a5c16; }
.alert.err { background: #fde9e7; color: #7a2e2a; }

/* ---------- 管理表格 ---------- */
table.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.admin-table th { color: var(--primary-dark); background: var(--primary-light); }
.msg-content { white-space: pre-wrap; }

.footer {
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--text-light);
  font-size: .85rem;
}
.footer a { color: var(--text-light); text-decoration: none; }
.footer a:hover { color: var(--primary); }

.empty { color: var(--text-light); text-align: center; padding: 30px 0; }
.mono { font-family: Consolas, Monaco, monospace; font-size: .88rem; }

/* ---------- 社区广场（xyebbs 式板块内容流） ---------- */
.board-wrap { margin-top: 6px; }
.board {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 22px;
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.board-head h2 { margin: 0; font-size: 1.12rem; color: var(--primary-dark); }
.board-more {
  color: var(--text-light);
  font-size: .85rem;
  text-decoration: none;
  transition: color .2s;
}
.board-more:hover { color: var(--primary); }

.item-list { display: flex; flex-direction: column; }
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .15s, padding-left .2s;
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--bg); padding-left: 14px; }
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 600; font-size: .98rem; }
.item-desc {
  color: var(--text-light);
  font-size: .85rem;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.item-meta {
  color: var(--text-light);
  font-size: .8rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.board-empty { color: var(--text-light); text-align: center; padding: 24px 0; }
.board-contact { text-align: center; padding: 12px 0; }
.board-contact p { color: var(--text-light); margin: 0 0 14px; }

/* 分屏里的紧凑列表 */
.mini-list .item-row { padding: 10px 4px; }
.mini-list .item-title { font-size: .95rem; }
.mini-list .item-desc { font-size: .82rem; }

/* ---------- 苹果官网式设计（Apple.com 风格） ---------- */
.apple-hero {
  background:
    radial-gradient(130% 100% at 50% 0%, #ffe9f3 0%, rgba(255, 233, 243, 0) 55%),
    linear-gradient(180deg, #fff6fb 0%, #fdf3f8 100%);
}
.apple-center { text-align: center; }
.apple-eyebrow {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: 0 0 18px;
}
.apple-eyebrow.light { color: #ffd9e8; }
.apple-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0 0 16px;
  color: var(--text);
}
.apple-title-sm { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 12px; }
.apple-title.light, .apple-title-sm.light { color: #fff; }
.apple-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-light);
  margin: 0 auto 22px;
  max-width: 640px;
  line-height: 1.6;
}
.apple-sub.light { color: #e8d9e0; }
.apple-links { margin: 8px 0 0; font-size: 1.05rem; }
.apple-links a {
  color: var(--primary-dark);
  text-decoration: none;
  margin: 0 14px;
  transition: opacity .2s;
}
.apple-links a:hover { text-decoration: underline; opacity: .8; }
.apple-links.light a { color: #ffc7dd; }
.apple-links-sep { display: none; }

/* 浅色屏（服务器也改浅色，不再用深色） */
.apple-section { background: linear-gradient(180deg, #fff 0%, #fdf3f8 100%); }
.apple-section.alt { background: linear-gradient(180deg, #fdf3f8 0%, #fff 100%); }

/* 苹果式：侧边 logo 徽章（每部分的大 emoji 渐变圆角块，比例协调） */
.apple-section .split-media {
  height: 180px;
  width: 180px;
  border-radius: 36px;
  font-size: 4.2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.apple-section .split { gap: 44px; }
.media-monitor { background: linear-gradient(135deg, #ffe4f0, #d8efff); }

/* 苹果式列表（无框、留白） */
.apple-list {
  max-width: 460px;
  margin: 6px 0 0;
  text-align: left;
}
.apple-list .item-row { padding: 11px 2px; }
.apple-list .item-title { font-size: .95rem; }
.apple-list .item-desc { font-size: .82rem; }

/* 服务器卡片（分屏内）微调 */
.apple-section .server-grid { margin-top: 4px; }

/* ---------- 猫猫 AI 聊天悬浮窗 ---------- */
#cat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f78fbf, #b3a3f5);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(247, 143, 191, .45);
  z-index: 1000;
  transition: transform .2s, box-shadow .2s;
}
#cat-fab:hover { transform: scale(1.08); box-shadow: 0 10px 30px rgba(247, 143, 191, .55); }
.cat-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  font-size: .9rem;
}
.cat-header {
  background: linear-gradient(135deg, #f78fbf, #b3a3f5);
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.cat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fdf3f8;
}
.cat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 16px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
.cat-msg-bot { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.cat-msg-me { background: linear-gradient(135deg, #f78fbf, #d9a8f0); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
/* 系统气泡：报错/系统提示独立展示（不参与 AI 上下文，不伪装成猫猫回复） */
.cat-msg-sys {
  align-self: center;
  background: #f3f0f7;
  color: #8a7f9b;
  font-size: .78rem;
  padding: 5px 12px;
  border-radius: 12px;
  max-width: 88%;
  text-align: center;
  border: 1px dashed #ddd4e6;
}
.cat-msg-sys a { color: var(--primary-dark); }
.cat-header { display: flex; align-items: center; gap: 8px; }
.cat-header > span { flex: 1; }
.cat-new {
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: .75rem;
  cursor: pointer;
}
.cat-new:hover { background: rgba(255,255,255,.32); }
.cat-quick { display: flex; gap: 6px; padding: 8px 12px; background: #fff; flex-wrap: wrap; }
.cat-quick button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .78rem;
  cursor: pointer;
  color: var(--primary-dark);
  transition: background .2s;
}
.cat-quick button:hover { background: var(--primary-light); }
.cat-input { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--border); }
.cat-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .88rem;
  outline: none;
}
.cat-input input:focus { border-color: var(--primary); }
.cat-input button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .85rem;
  cursor: pointer;
}
.cat-input button:disabled { opacity: .5; cursor: not-allowed; }

/* ===========================================================================
   显隐控制：**只要元素写了 hidden 属性，就不允许被 display 覆盖。**
   ---------------------------------------------------------------------------
   为什么需要这条全局规则（同一个坑踩过两次，别再踩第三次）：
   1. 聊天窗 `.cat-chat` 声明了 `display: flex`，把 UA 样式表里的
      `[hidden] { display: none }` 盖掉了 → 面板关不掉。
   2. 评论区的颜文字分组 `.cm-kao-group` 声明了 `display: flex`，
      同样把 `[hidden]` 盖掉 → **面板一打开就把 7 个分类的颜文字全显示出来**，
      分类标签点了像没反应。
   原因是：UA 的 `[hidden]` 规则优先级极低，任何作者样式表里的
   `display: xxx`（哪怕只是 `.类名`）都能盖过它。
   所以这里用「属性选择器 + !important」一次兜住所有元素，
   而不是给每个新组件都补一条 —— 补漏的方式必然会漏。
   =========================================================================== */
[hidden] { display: none !important; }

/* ---------- 聊天窗响应式：桌面悬浮 / 平板适中 / 手机全屏 ---------- */
@media (min-width: 521px) and (max-width: 820px) {
  .cat-chat { width: 360px; height: 480px; right: 18px; bottom: 18px; }
}
@media (max-width: 520px) {
  .cat-chat {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;   /* 兜底：不支持 dvh 的老浏览器 */
    height: 100dvh;  /* 动态视口：键盘弹出时自动缩小 */
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    font-size: .95rem;
    /* 键盘弹出时的精确贴合由 chat.js 的 visualViewport 适配接管（inline 覆盖） */
  }
  #cat-fab {
    right: 14px;
    bottom: 14px;
    width: 52px;
    height: 52px;
    font-size: 24px;
  }
  .cat-body { padding: 12px; }
  .cat-msg { max-width: 88%; padding: 10px 14px; }
  .cat-input { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .cat-input input { font-size: 1rem; }
  .cat-input button { padding: 10px 18px; }
}

/* ========== 主页滚动分屏（苹果式叙事） ========== */
html.snap-scroll { scroll-snap-type: y proximity; }

.snap-screen {
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  padding: 40px 0;
}
.screen-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  /* 注：这里原先默认 opacity:0、靠 JS 加 .visible 才显示 —— 与本次「移动端整页空白」
     是同一类坑（内容可见性依赖 JS）。已改为默认可见，.visible 保留兼容旧样式。 */
}
.screen-inner.visible { opacity: 1; transform: none; }

/* Hero 屏：背景从中心粉色向外渐变到页面底色，边缘无边框线、缩放自适应 */
.hero-screen {
  background: radial-gradient(115% 115% at 50% 28%, #ffe2ee 0%, #fdf3f8 74%, #fdf3f8 100%);
}
.hero {
  text-align: center;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.scroll-hint {
  margin-top: 36px;
  color: var(--text-light);
  font-size: .9rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* 故事屏 */
.story-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 40px;
}
.story-card .eyebrow { margin: 0 0 10px; }

/* 左右分栏屏 */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split-reverse .split-media { order: 2; }
.split-reverse .split-text { order: 1; }
.split-media {
  height: 320px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.5rem;
  box-shadow: var(--shadow);
}
.media-note { background: linear-gradient(135deg, #ffe4f0, #efeafe); }
.media-files { background: linear-gradient(135deg, #efeafe, #d8efff); }
.media-contact { background: linear-gradient(135deg, #fff1e0, #ffe4f0); }
.split-text .eyebrow { margin: 0 0 10px; }
.split-text h2 { font-size: 2rem; margin: 0 0 12px; color: var(--text); }
.split-text p { color: var(--text-light); font-size: 1.02rem; margin: 0 0 22px; }

/* 服务器屏 */
.screen-inner .server-grid { margin-bottom: 20px; }

/* 图片轮播（宣传图自动切换）：contain 完整展示，容器比例匹配截图（约 1.9:1） */
.carousel {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 19 / 10; /* 匹配 1920x1009 截图，contain 后撑满无留白 */
  margin: 10px auto 6px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--primary-light);
}
.carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 完整显示整张图，不裁剪 */
  opacity: 0;
  transition: opacity .9s ease;
}
.carousel img.active { opacity: 1; }

/* 移动端适配 */
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split-reverse .split-media { order: 0; }
  .split-reverse .split-text { order: 1; }
  .split-media { height: 220px; }
  .snap-screen { padding: 28px 0; }
}

/* ---------- 背景碎碎念（猫猫的絮叨 & 颜文字） ---------- */
.snap-screen { position: relative; overflow: hidden; }
.bg-quote {
  position: absolute;
  pointer-events: none;
  user-select: none;
  color: var(--primary-dark);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 1px;
  opacity: .13;
  animation: breathe 4.5s ease-in-out infinite;
  white-space: nowrap;
}
.bg-quote .kao {
  color: var(--accent);
  font-weight: 700;
}
@keyframes breathe {
  0%, 100% { opacity: .10; transform: translateY(0) rotate(var(--tilt, 0deg)); }
  50%      { opacity: .20; transform: translateY(-6px) rotate(var(--tilt, 0deg)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   夜间模式 —— 跟随系统（prefers-color-scheme: dark），页面上不需要任何切换按钮
   ───────────────────────────────────────────────────────────────────────────
   对齐 Material 3 / Apple HIG / GitHub Primer 的共识，五条原则：

   1. 不用纯黑。底色用 #121212，避免纯黑与内容之间的硬边和眩光。
   2. 层级靠「亮度分层」而不是色相：底 #121212 → 卡片 #1E1E1E → 内嵌面 #262626
      → 次级面 #2A2A2A。深色模式里用颜色区分层级是最容易翻车的做法。
   3. 正文不用纯白。用 #E6E6E6（约 87% 白），长文阅读时不刺眼。
   4. 深色下不用彩色（站长确认）。品牌粉 / 淡紫 / 薄荷一律停用，
      强调改由「亮度 + 字重」承担：--primary 变成浅灰底（配深色文字），
      --primary-dark 变成更亮的灰（用于需要被看见的文字/圆点/链接）。
      语义色（成功/警告/离线）也压到低饱和，避免深底上「发光」。
   5. 投影改纯黑低透明。浅色模式那套粉色投影放在深底上会发脏。

   注意：SVG 里的 stroke / fill 已改成 `style="stroke:var(--primary)"` 的写法
   （见 home.js / monitor.js），所以折线图在这里自动跟随明暗，无需单独处理。
   ═══════════════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root {
    /* 深色模式「去彩色」：品牌粉/紫全部让位给中性灰阶，
       强调不再靠色相，而靠亮度与字重（详见本段开头的五条原则）。 */
    --primary: #cfcfcf;        /* 填充按钮底色（配深色文字） */
    --primary-dark: #efefef;   /* 需要被强调的文字/圆点/链接 */
    --primary-light: #2a2a2a;  /* 淡色底（胶囊、chip） */
    --primary-soft: #262626;
    --accent: #c4c4c4;
    --accent-light: #2a2a2a;
    --bg: #121212;
    --card: #1e1e1e;
    --text: #e6e6e6;
    --text-light: #a3a3a3;
    --border: #2e2e2e;
    /* 语义色也压到低饱和，避免深底上「发光」 */
    --ok: #93b3a5;
    --warn: #c2b18d;
    --danger: #c69a98;
    /* 深色下不引入色相（本站既定规则），链接靠「亮灰 + 下划线」区分 */
    --link: #efefef;
    --shadow: 0 10px 34px rgba(0, 0, 0, .55);
    --shadow-hover: 0 16px 44px rgba(0, 0, 0, .68);
  }

  /* 主按钮：浅灰底 + 深色字（Material 3 深色方案里 primary 是亮色调） */
  .btn { color: #1c1c1c; }
  .btn.ghost { background: transparent; color: var(--primary-dark); }

  /* ---------- 顶部导航：粉紫渐变收成中性灰阶 ---------- */
  .topnav {
    background: linear-gradient(135deg, #262626, #1c1c1c);
    color: #e6e6e6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
  }
  .topnav .brand { text-shadow: none; }
  .nav-links a,
  .nav-user a,
  .nav-user-name,
  .nav-logout { color: #e6e6e6; }
  .nav-links a:hover,
  .nav-user a:hover,
  .nav-user-link:hover { background: rgba(255, 255, 255, .10); }
  .nav-user .nav-register { background: rgba(255, 255, 255, .10); }
  .nav-user .nav-register:hover { background: rgba(255, 255, 255, .18); }
  .nav-logout { border-color: rgba(255, 255, 255, .28); }
  .nav-logout:hover { background: rgba(255, 255, 255, .10); }

  /* ---------- 按钮：浅粉底上用深字，白字对比度不够 ---------- */
  .btn { color: #1a1a1a; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
  .btn:hover { background: #cf94b4; box-shadow: 0 10px 26px rgba(0, 0, 0, .55); }
  .btn.ghost {
    background: rgba(255, 255, 255, .06);
    color: var(--primary);
    border-color: var(--border);
  }
  .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
  .btn.danger { background: #9e514e; color: #f4e9e8; }
  .btn.danger:hover { background: #b25d59; }

  /* ---------- 徽章 / 提示条：彩色淡底换成深色低饱和 ---------- */
  .badge.ok { background: #1b2622; color: var(--ok); }
  .badge.off { background: #2a1f1e; color: var(--danger); }
  .badge.wait { background: #2a2418; color: var(--warn); }
  .alert.ok { background: #1b2622; color: #9fd8c6; }
  .alert.warn { background: #2a2418; color: #e0c38f; }
  .alert.err { background: #2a1f1e; color: #eaa6a2; }

  /* ---------- 页脚 ---------- */
  .footer { background: var(--card); }

  /* ---------- 首屏光晕：粉色径向渐变 → 中性灰 ---------- */
  .hero-screen {
    background: radial-gradient(115% 115% at 50% 28%, #1f1f1f 0%, #121212 74%, #121212 100%);
  }

  /* ---------- 分屏的 emoji 媒体块：三色渐变收成中性 ---------- */
  .media-note { background: linear-gradient(135deg, #262626, #2a2a2a); }
  .media-files { background: linear-gradient(135deg, #2a2a2a, #262626); }
  .media-contact { background: linear-gradient(135deg, #2a2a2a, #262626); }
  .media-monitor { background: linear-gradient(135deg, #262626, #2a2a2a); }

  /* ---------- 苹果风区块底色 ---------- */
  .apple-hero {
    background:
      radial-gradient(130% 100% at 50% 0%, #1f1f1f 0%, rgba(31, 31, 31, 0) 55%),
      linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
  }
  .apple-section { background: linear-gradient(180deg, #1a1a1a 0%, #121212 100%); }
  .apple-section.alt { background: linear-gradient(180deg, #121212 0%, #1a1a1a 100%); }

  /* ---------- 图表 / 代码块 ---------- */
  .chart-toolbar button { background: var(--card); }
  .chart-toolbar button.active { color: #1a1a1a; }
  .note-body pre { background: #0f0f0f; color: #dcdcdc; }

  /* ---------- 表单聚焦环：粉底换成低透明粉边 ---------- */
  input:focus,
  textarea:focus { box-shadow: 0 0 0 4px rgba(224, 166, 194, .18); }

  /* ---------- 列表 hover ---------- */
  .item-row:hover { background: rgba(255, 255, 255, .04); }
  .admin-table th { background: #242424; }

  /* ---------- 灯箱 ---------- */
  .lightbox { background: rgba(0, 0, 0, .9); }

  /* ---------- 背景碎碎念：深底上稍微加一点存在感 ---------- */
  .bg-quote { animation-name: breathe-dark; }

  /* ---------- 猫猫 AI 聊天悬浮窗 ---------- */
  #cat-fab {
    background: linear-gradient(135deg, #6e5566, #565073);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
  }
  #cat-fab:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
  .cat-chat { background: var(--card); box-shadow: 0 18px 50px rgba(0, 0, 0, .7); }
  .cat-header { background: linear-gradient(135deg, #6e5566, #565073); color: #f0eaee; }
  .cat-body { background: var(--bg); }
  .cat-msg-bot {
    background: #262626;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  }
  .cat-msg-me { background: linear-gradient(135deg, #8b6076, #6b5b8a); color: #f4eef1; }
  .cat-msg-sys { background: #232323; color: #a3a3a3; border-color: #333333; }
  .cat-quick,
  .cat-input { background: var(--card); }
  .cat-quick button { background: #262626; border-color: var(--border); color: var(--primary); }
  .cat-quick button:hover { background: #2e2e2e; }
  .cat-input input { background: #1a1a1a; color: var(--text); }
}

/* 深色专用呼吸动画（浅色用 @keyframes breathe 的 .10→.20） */
@keyframes breathe-dark {
  0%, 100% { opacity: .12; transform: translateY(0) rotate(var(--tilt, 0deg)); }
  50%      { opacity: .22; transform: translateY(-6px) rotate(var(--tilt, 0deg)); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   新版顶部导航 + 四列页脚（实验室版式 · 定稿）
   放在文件最后，覆盖上面旧版的「粉紫渐变导航 / 单行页脚」规则。
   导航：白底 + 底部 1px 细线（深色下同层级灰）；页脚：品牌 + 两列链接 + 版权行。
   ═══════════════════════════════════════════════════════════════════════════ */
.topnav {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}
.nav-inner { max-width: 1080px; padding: 16px 20px; }
.topnav .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .2px;
  text-shadow: none;
}
.topnav .brand-icon { color: var(--primary); flex-shrink: 0; }
.nav-links { gap: 4px; }
.nav-links a {
  color: var(--text);
  opacity: .72;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: .93rem;
}
.nav-links a:hover { background: var(--primary-soft); opacity: 1; transform: none; }
.nav-links a.active { color: var(--primary-dark); opacity: 1; font-weight: 600; }
.nav-user a {
  color: var(--text);
  opacity: .82;
  font-size: .9rem;
  padding: 7px 11px;
  border-radius: 10px;
}
.nav-user a:hover { background: var(--primary-soft); opacity: 1; }
.nav-user .nav-register {
  background: var(--primary);
  color: #fff;
  opacity: 1;
  padding: 7px 17px;
  border-radius: 999px;
  font-weight: 500;
}
.nav-user .nav-register:hover { background: var(--primary-dark); }
.nav-user-name { color: var(--text); font-weight: 600; }
.nav-user-link:hover { background: var(--primary-soft); }
.nav-logout {
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: .82rem;
}
.nav-logout:hover { background: var(--primary-soft); color: var(--text); }

.footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--text-light);
  font-size: .9rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 46px 20px 30px;
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 34px;
}
.footer-brand-name { font-weight: 700; font-size: 1.06rem; color: var(--text); }
.footer-brand-line {
  margin: 9px 0 0;
  font-size: .88rem;
  line-height: 1.75;
  color: var(--text-light);
  max-width: 32em;
}
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h4 {
  margin: 0 0 3px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-light);
}
.footer-col a,
.footer-col span {
  color: var(--text);
  opacity: .78;
  text-decoration: none;
  font-size: .9rem;
}
.footer-col a:hover { color: var(--primary-dark); opacity: 1; }
.footer-bottom {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text-light);
}
.footer-bottom a { color: var(--text-light); text-decoration: none; }
.footer-bottom a:hover { color: var(--primary-dark); }
.footer-bottom-right { display: inline-flex; gap: 14px; align-items: center; flex-wrap: wrap; }

@media (max-width: 780px) {
  .nav-inner { flex-wrap: wrap; row-gap: 6px; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; padding: 34px 20px 22px; }
  .footer-bottom { padding: 14px 20px 24px; }
}

/* 深色模式：导航改半透明深灰玻璃 + 同层级分隔线 */
@media (prefers-color-scheme: dark) {
  .topnav { background: rgba(18, 18, 18, .86); border-bottom-color: var(--border); }
  .topnav .brand { color: var(--text); }
  .nav-links a:hover,
  .nav-user a:hover,
  .nav-user-link:hover,
  .nav-logout:hover { background: #2a2a2a; }
  .nav-links a.active { color: var(--primary); }
  .nav-user .nav-register { background: var(--primary); color: #1c1c1c; }
  .nav-user .nav-register:hover { background: #d694b3; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   共享小组件（首页与内页都会用到：分类胶囊 / 标签 chip / 笔记页搜索条）
   ═══════════════════════════════════════════════════════════════════════════ */
.cat-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-pill {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  opacity: .82;
  font-size: .86rem;
  text-decoration: none;
  transition: background .2s, color .2s, opacity .2s, border-color .2s;
}
.cat-pill:hover { opacity: 1; border-color: var(--primary); }
.cat-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; opacity: 1; }
.chip {
  display: inline-block;
  font-size: .74rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.notes-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  margin: 14px 0 18px;
  max-width: 560px;
}
.notes-filter input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: .95rem;
  color: var(--text);
  font-family: inherit;
}
.notes-filter input::placeholder { color: var(--text-light); }

@media (prefers-color-scheme: dark) {
  .cat-pill.active { color: #1c1c1c; }
  .chip { background: #2a2a2a; color: var(--primary); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   手机端汉堡菜单（纯 CSS，无需 JS）
   桌面：品牌 + 链接行 + 登录/注册；手机：品牌 + 汉堡，点开是竖排菜单（含登录/注册）
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-toggle-cb {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.nav-toggle { display: none; }          /* 桌面不显示汉堡 */
.nav-inner { position: relative; }

@media (max-width: 780px) {
  .nav-inner { flex-wrap: wrap; row-gap: 8px; padding: 12px 16px; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
  }
  .nav-toggle-cb:focus-visible + .nav-toggle { outline: 2px solid var(--primary); outline-offset: 2px; }
  /* 收起状态：链接与用户区都不显示 */
  .nav-links { display: none; }
  .nav-user { display: none; }
  /* 展开状态 */
  .nav-toggle-cb:checked ~ .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    gap: 2px;
    padding: 6px 0 2px;
  }
  .nav-toggle-cb:checked ~ .nav-links a {
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 1rem;
  }
  .nav-toggle-cb:checked ~ .nav-user {
    display: flex;
    width: 100%;
    order: 4;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   头像 / 封面 / 碎碎念页 / 时间轴故事行
   这些组件首页与内页（/account、/fragments、/notes/…/edit）都会用到，
   所以放在共享样式里；只属于首页版式的部分留在 home.css。
   ═══════════════════════════════════════════════════════════════════════════ */

/* ---------- 头像（无头像时回退成「首字圆圈」） ---------- */
.about-avatar,
.gb-avatar {
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.about-avatar { width: 54px; height: 54px; font-size: 1.2rem; }
.gb-avatar { width: 36px; height: 36px; font-size: .9rem; }
.about-avatar.big { width: 64px; height: 64px; font-size: 1.4rem; }
.about-avatar.img,
.gb-avatar.img { background: var(--border); padding: 0; }
.about-avatar.img img,
.gb-avatar.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-avatar-me { background: var(--primary); color: #fff; }
.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.avatar-row input[type="file"] { font-size: .88rem; color: var(--text-light); max-width: 100%; }

/* ---------- 笔记封面 ---------- */
.cover-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.cover-title { margin: 0 0 6px; font-size: 1.02rem; color: var(--primary-dark); }
.cover-preview {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 420px;
}
.cover-preview img { width: 100%; display: block; }

/* 首页文章卡里的封面（16:9） */
.post-cover {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--primary-soft);
  aspect-ratio: 16 / 9;
  margin-bottom: 4px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 未设置封面时的占位观感：保持卡片高度一致 */
.post-card:has(.post-cover) .post-excerpt { min-height: 0; }

/* ---------- 时间轴里的「建站故事」第一条 ---------- */
.timeline .tl-story .tl-body h4 { font-size: 1.12rem; }
.timeline .tl-story-text {
  margin: 6px 0 0;
  font-size: .96rem;
  line-height: 1.85;
  color: var(--text);
  opacity: .82;
  white-space: pre-line;
}
.timeline .tl-story-sign {
  margin: 10px 0 0;
  font-size: .84rem;
  color: var(--text-light);
}

/* ---------- 碎碎念页 /fragments ---------- */
.frag-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  margin: 14px 0 18px;
}
.frag-form input[type="text"]:first-of-type { flex: 1; min-width: 200px; }
.frag-form input {
  border: none;
  outline: none;
  background: transparent;
  font-size: .98rem;
  color: var(--text);
  font-family: inherit;
}
.frag-form .frag-tag-input {
  width: 140px;
  flex: 0 0 auto;
  border-left: 1px solid var(--border);
  padding-left: 12px;
  font-size: .9rem;
}
.frag-form input::placeholder { color: var(--text-light); }
.frag-list { display: flex; flex-direction: column; gap: 14px; }
.frag-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.frag-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
  color: var(--text-light);
}
.frag-text {
  margin: 8px 0 0;
  font-size: .98rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-line;
}
.frag-actions { display: flex; gap: 8px; margin-top: 12px; }

@media (max-width: 680px) {
  .frag-form { padding: 12px; border-radius: 16px; }
  .frag-form input[type="text"]:first-of-type { flex-basis: 100%; min-width: 0; }
  .frag-form .frag-tag-input {
    width: auto;
    flex: 1;
    border-left: none;
    padding-left: 0;
  }
  .frag-item { padding: 14px 16px; }
}

/* 深色模式：一律中性灰，不引入色相 */
@media (prefers-color-scheme: dark) {
  .about-avatar,
  .gb-avatar { color: var(--primary-dark); background: #2a2a2a; }
  .about-avatar.img,
  .gb-avatar.img { background: #2e2e2e; }
  .cover-title { color: var(--primary-dark); }
  .post-cover { background: #262626; }
  .frag-form,
  .frag-item { box-shadow: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   内页统一版式（与首页同一套语言）
   ───────────────────────────────────────────────────────────────────────────
   目标：所有子页共用一套「眉题 + 大标题 + 说明」的页头、同一套卡片与网格、
   同一套小标题层级；并且**在手机上一律不挤**（网格塌成单列、按钮可换行、
   表格横滑或卡片化、触控目标 ≥ 40px）。
   ═══════════════════════════════════════════════════════════════════════════ */

.page { padding: 0 0 34px; }

/* ---------- 页头 ---------- */
.page-head { margin: 0 0 26px; }
.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.page-eyebrow {
  margin: 0 0 8px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary-dark);
}
.page-title {
  margin: 0;
  font-size: 2.05rem;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -.028em;
  color: var(--text);
}
.page-desc {
  margin: 10px 0 0;
  font-size: .96rem;
  line-height: 1.8;
  color: var(--text-light);
  white-space: pre-line;
  max-width: 46em;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- 页面内小标题（替代散落的 inline style） ---------- */
.sec-h {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 30px 0 14px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}
.sec-h:first-child { margin-top: 0; }
.sec-h .muted { font-weight: 400; }

/* ---------- 卡片：与首页卡片同一套（圆角/描边/阴影） ---------- */
.card {
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card h2 { font-size: 1.2rem; font-weight: 600; }
.card h3 { font-size: 1.04rem; }

/* ---------- 网格：语义化替代 inline grid-template-columns ---------- */
.grid { gap: 16px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.grid-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.grid-2 > *, .grid-3 > * { min-width: 0; }   /* 防止长内容把格子撑破 */

/* ---------- 表格容器（横滑兜底） ---------- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 18px;
}

/* ---------- 手机端：一律不挤 ---------- */
@media (max-width: 780px) {
  .container { padding: 20px 16px 56px; }
  .page-title { font-size: 1.6rem; letter-spacing: -.02em; }
  .page-desc { font-size: .92rem; }
  .sec-h { margin: 24px 0 12px; font-size: 1.08rem; }
  .card { padding: 16px; border-radius: 14px; margin-bottom: 14px; }
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .grid-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 16px; }
  .tile h3 { font-size: 1rem; }
  .table-wrap { padding: 4px 12px; border-radius: 14px; }
}

@media (max-width: 420px) {
  .grid-tiles { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { gap: 12px; }
}

/* 表单：手机上按钮不跟输入框抢宽度 */
@media (max-width: 560px) {
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row .btn { width: 100%; }
}
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-hint { font-size: .84rem; color: var(--text-light); }

/* 深色模式：内页卡片与表格跟着走（不引入色相） */
@media (prefers-color-scheme: dark) {
  .card,
  .table-wrap,
  .tile { box-shadow: none; }
  .admin-table th { background: #2a2a2a; color: var(--text); }
  .badge.ok { background: #223028; color: #a8c7b6; }
  .badge.off { background: #2e2323; color: #c9a3a1; }
  .badge.wait { background: #2c2721; color: #c2b18d; }
  .alert.ok { background: #223028; color: #b6d2c1; }
  .alert.warn { background: #2c2721; color: #cbbd97; }
  .alert.err { background: #2e2323; color: #d3acaa; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   内页组件补充（后台 / 联系页 / 各列表页共用）
   ───────────────────────────────────────────────────────────────────────────
   重点解决手机端的「挤在一起」：表格在窄屏改成卡片式（并强制解除 min-width），
   瓷砖可点区域 ≥ 44px，进度条/详情块自适应。
   ═══════════════════════════════════════════════════════════════════════════ */
.tile-hl { border: 2px solid var(--primary); }
.tile { cursor: pointer; }
.stat-link { text-decoration: none; color: inherit; display: block; }

/* 表格横滑容器（放在卡片里用） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 手机端把表格变成卡片：必须解除 min-width，否则仍然横向溢出 */
@media (max-width: 640px) {
  .table-cards { min-width: 0 !important; width: 100%; }
  .table-cards thead { display: none; }
  .table-cards tbody tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .table-cards tbody td {
    display: block;
    border: none !important;
    padding: 3px 0;
    white-space: normal !important;
    word-break: break-word;
  }
  .table-cards tbody td[data-label]::before {
    content: attr(data-label) "：";
    color: var(--text-light);
    font-size: .78rem;
    margin-right: 4px;
  }
  .table-cards tbody td[data-label="操作"] { margin-top: 6px; }
  .table-cards tbody td[data-label="操作"] .btn { margin: 2px 6px 2px 0; }
  .table-cards tbody tr.row-unread { background: var(--primary-soft); }
}
@media (min-width: 641px) {
  .table-cards tr.row-unread { background: var(--primary-soft); }
}

/* 心情进度条 */
.mood-track {
  height: 14px;
  background: var(--primary-soft);
  border-radius: 999px;
  margin: 10px 0;
  overflow: hidden;
}
.mood-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width .6s;
}

/* 自学习详情条目 */
.learn-tile { user-select: none; }
.learn-item {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: .9rem;
  line-height: 1.7;
}
.learn-item:last-child { border-bottom: none; }

@media (prefers-color-scheme: dark) {
  .mood-track { background: #262626; }
  .mood-fill { background: linear-gradient(90deg, #9a9a9a, #cfcfcf); }
  .table-cards tbody tr.row-unread { background: #262626; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   在页面上直接改（✎）+ 「站点内容」页的标签/搜索/分组
   ═══════════════════════════════════════════════════════════════════════════ */

/* ✎ 按钮：只对站长渲染，尽量不打扰阅读 —— 平时很淡，悬停才明显 */
.inline-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--text-light);
  font-size: .72rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  opacity: .45;
  transition: opacity .15s, color .15s, border-color .15s, transform .15s;
}
.inline-edit:hover {
  opacity: 1;
  color: var(--primary-dark);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.inline-edit-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary-dark);
  font-size: .7rem;
}

/* 编辑弹层 */
.ie-mask {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(30, 20, 28, .45);
}
.ie-mask.open { display: flex; }
.ie-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  padding: 18px 20px;
}
.ie-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 1.02rem;
}
.ie-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 0 4px;
}
.ie-key { font-size: .72rem; color: var(--text-light); margin-bottom: 8px; word-break: break-all; }
.ie-input { width: 100%; box-sizing: border-box; }
.ie-tip { margin: 8px 0 0; }
.ie-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.ie-msg { font-size: .84rem; color: var(--primary-dark); }

/* 「站点内容」页：页面标签 */
.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  position: sticky;
  top: 62px;
  z-index: 20;
  padding: 8px 0;
  background: var(--bg);
}
.stab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  transition: background .2s, color .2s, border-color .2s;
}
.stab span { font-size: .74rem; color: var(--text-light); }
.stab:hover { border-color: var(--primary); }
.stab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.stab.active span { color: rgba(255, 255, 255, .85); }
.stab.dim { opacity: .55; }

/* 「站点内容」页：搜索条 */
.settings-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 18px;
  color: var(--text-light);
}
.settings-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: .96rem;
  color: var(--text);
  font-family: inherit;
}

/* 「站点内容」页：字段行 */
.settings-group .field { margin-bottom: 14px; }
.settings-group .field label { margin-top: 0; }
.field-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.field-row > input[type="text"],
.field-row > textarea { flex: 1; min-width: 200px; }
.field-row .js-restore-one { flex: 0 0 auto; }
.settings-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.switch input { width: 18px; height: 18px; }

@media (max-width: 780px) {
  .settings-tabs { top: 56px; overflow-x: auto; flex-wrap: nowrap; }
  .stab { flex: 0 0 auto; }
  .field-row > input[type="text"],
  .field-row > textarea { min-width: 0; flex-basis: 100%; }
  .ie-dialog { padding: 16px; }
}

@media (prefers-color-scheme: dark) {
  .inline-edit { background: #262626; border-color: #2e2e2e; color: var(--text-light); }
  .inline-edit:hover { color: var(--text); border-color: #4a4a4a; }
  .ie-mask { background: rgba(0, 0, 0, .6); }
  .stab.active { background: var(--primary); color: #1c1c1c; }
  .stab.active span { color: rgba(28, 28, 28, .7); }
  .settings-tabs { background: var(--bg); }
}

/* 窄卡片（登录 / 注册）：居中且不设最小宽度，手机上自然收缩 */
.card.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   前台「编辑模式」工具条（只有站长在后台点过「直接编辑」才会出现）
   ═══════════════════════════════════════════════════════════════════════════ */
.edit-bar {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 20px;
  background: var(--primary);
  color: #fff;
  font-size: .88rem;
}
.edit-bar-tip b { font-size: 1rem; }
.edit-bar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.edit-bar-actions a { color: #fff; text-decoration: none; opacity: .92; }
.edit-bar-actions a:hover { opacity: 1; text-decoration: underline; }
.edit-bar-exit {
  background: rgba(255, 255, 255, .22);
  border: none;
  color: #fff;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: .84rem;
  cursor: pointer;
  font-family: inherit;
}
.edit-bar-exit:hover { background: rgba(255, 255, 255, .34); }

/* 时间线后台页里的「现有建站故事」预览 */
.story-preview {
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: .92rem;
  line-height: 1.8;
}
.story-preview p { margin: 6px 0 0; white-space: pre-line; }

/* 深色下的编辑条：用中性面，不刺眼 */
@media (prefers-color-scheme: dark) {
  .edit-bar { background: #2a2a2a; color: var(--text); }
  .edit-bar-actions a { color: var(--text); }
  .edit-bar-exit { background: #3a3a3a; color: var(--text); }
  .story-preview { background: #262626; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   页脚 · 备案信息（法规要求放在主页底部中央位置并链接工信部备案系统）
   ═══════════════════════════════════════════════════════════════════════════ */
.footer-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 26px;
  font-size: .8rem;
  color: var(--text-light);
}
.footer-beian a {
  color: var(--text-light);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.footer-beian a:hover { color: var(--primary-dark); text-decoration: underline; }

@media (max-width: 780px) {
  .footer-beian { gap: 10px; padding: 0 16px 22px; font-size: .76rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   头像裁剪弹层（拖动 / 双指捏合 / 滚轮 / ± 按钮缩放 / 旋转，裁成正方形再上传）
   ───────────────────────────────────────────────────────────────────────────
   这里**没有缩放滑块**：滑块版本站长反馈「手机上滑不到头、一拖就跳很大」，撤掉了。
   现在缩放 = 手机两指捏合 / 电脑滚轮 / − ＋ 按钮，三个入口都不依赖精确拖动。
   ═══════════════════════════════════════════════════════════════════════════ */
.ac-mask {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(30, 20, 28, .5);
}
.ac-mask.open { display: flex; }
.ac-dialog {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  padding: 18px 20px 20px;
}
.ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1.02rem;
}
.ac-close {
  border: none; background: none; font-size: 1.4rem; line-height: 1;
  color: var(--text-light); cursor: pointer; padding: 0 4px;
}
.ac-hint { margin: 6px 0 12px; font-size: .82rem; line-height: 1.6; color: var(--text-light); }

/* 取景框：正方形 + 圆形遮罩，圈内即最终头像 */
.ac-stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: var(--primary-soft);
}
.ac-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;               /* 拖动/捏合时不要跟着滚页面、也不触发浏览器缩放 */
  user-select: none;
  -webkit-user-select: none;
}
.ac-viewport.dragging { cursor: grabbing; }
.ac-img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  display: block;
  transform: translate(-50%, -50%);
  -webkit-user-drag: none;
}
.ac-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38);
  outline: 2px solid rgba(255, 255, 255, .75);
  pointer-events: none;
}

/* 工具栏：按钮一行，滑块独占一行 */
.ac-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.ac-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ac-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.ac-zoom-label { font-size: .82rem; color: var(--text-light); margin-right: 2px; }
.ac-step {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ac-step:hover { border-color: var(--primary); color: var(--primary-dark); }
.ac-zoom-val {
  flex: 0 0 auto;
  min-width: 3.4em;
  text-align: right;
  font-size: .8rem;
  color: var(--text-light);
}
.ac-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.ac-msg { color: var(--primary-dark); }

@media (max-width: 420px) {
  .ac-dialog { padding: 16px; }
  .ac-stage { width: 100%; max-width: 260px; height: auto; aspect-ratio: 1 / 1; }
  .ac-zoom { gap: 8px; }
  .ac-step { width: 34px; height: 34px; }
}

@media (prefers-color-scheme: dark) {
  .ac-mask { background: rgba(0, 0, 0, .65); }
  .ac-stage { background: #262626; }
  .ac-ring { outline-color: rgba(255, 255, 255, .55); }
  .ac-step { background: #262626; border-color: #2e2e2e; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   上传：拖拽区 + 多文件 + 每个文件独立进度条
   下载：右下角进度卡（流式读取，边下边显示）
   ═══════════════════════════════════════════════════════════════════════════ */

/* ---------- 上传 ---------- */
/* 原生 file input：铺满整块拖拽区、透明 —— 点哪儿都是点 input，
   手机上（iOS Safari / 各家内置浏览器）都能可靠拉起选择器。
   不要用 label+for 转发点击：input 没 id 时 label 会指向不存在的元素，点了完全没反应。 */
.up-native {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
}
.up-native input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 100px;     /* 老浏览器的兼容技巧：让原生按钮的命中区足够大 */
}

.up-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 20px;
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: var(--primary-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.up-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.up-zone.over { border-color: var(--primary); background: var(--primary-light); transform: scale(1.01); }
.up-zone-icon { color: var(--primary); line-height: 0; }
.up-zone-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.up-zone-sub { font-size: .82rem; color: var(--text-light); }
.up-zone-pick {
  margin-top: 6px;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
}

.up-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.up-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "name size pct" "bar bar bar";
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.up-name { grid-area: name; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-size { grid-area: size; font-size: .78rem; color: var(--text-light); }
.up-pct { grid-area: pct; font-size: .78rem; color: var(--text-light); white-space: nowrap; }
.up-track {
  grid-area: bar;
  height: 6px;
  border-radius: 999px;
  background: var(--primary-light);
  overflow: hidden;
}
.up-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--primary);
  transition: width .15s linear;
}
.up-del {
  border: none; background: none; color: var(--text-light);
  font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0 2px;
}
.up-del:hover { color: var(--danger); }
.up-row.ok { border-color: var(--ok); }
.up-row.ok .up-fill { background: var(--ok); }
.up-row.err { border-color: var(--danger); }
.up-row.err .up-fill { background: var(--danger); }
.up-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 560px) {
  .up-zone { padding: 24px 14px; border-radius: 16px; }
  .up-zone-title { font-size: .94rem; }
  .up-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name size" "pct pct" "bar bar"; }
}

/* ---------- 下载进度卡（右下角堆叠） ---------- */
.dl-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
}
.dl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  padding: 12px 14px;
}
.dl-head { display: flex; align-items: center; gap: 10px; }
.dl-name {
  flex: 1;
  min-width: 0;
  font-size: .9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-x {
  border: none; background: none; color: var(--text-light);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.dl-x:hover { color: var(--danger); }
.dl-track {
  height: 6px;
  border-radius: 999px;
  background: var(--primary-light);
  overflow: hidden;
  margin: 8px 0 6px;
}
.dl-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--primary);
  transition: width .15s linear;
}
.dl-fill.indeterminate { background: linear-gradient(90deg, var(--primary) 40%, var(--primary-light) 0); background-size: 24px 100%; }
.dl-meta { font-size: .76rem; color: var(--text-light); }
.dl-card.done { border-color: var(--ok); }
.dl-card.done .dl-fill { background: var(--ok); }
.dl-card.err { border-color: var(--danger); }
.dl-card.err .dl-fill { background: var(--danger); }

/* 深色模式：中性灰，不引入色相 */
@media (prefers-color-scheme: dark) {
  .up-zone { background: #262626; border-color: #3a3a3a; }
  .up-zone:hover, .up-zone.over { background: #2a2a2a; border-color: var(--primary); }
  .up-zone-pick { color: #1c1c1c; }
  .up-track, .dl-track { background: #2a2a2a; }
  .dl-card { box-shadow: none; }
}

/* ===========================================================================
   社区评论区（笔记详情页 / 文件库项目页 / 碎碎念列表 三处共用）
   样式全部走 CSS 变量 → 深色模式自动跟随，不需要在这里再写一遍深色覆盖。
   =========================================================================== */
.cm-section { margin-top: 24px; }

.cm-title {
  color: var(--primary-dark);
  font-size: 1.05rem;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cm-n {
  font-size: .78rem;
  font-weight: 400;
  color: var(--text-light);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 1px 9px;
}
.cm-desc { color: var(--text-light); font-size: .86rem; margin: 0 0 12px; line-height: 1.6; }
.cm-empty, .cm-login-hint {
  color: var(--text-light);
  font-size: .88rem;
  margin: 10px 0 0;
}
.cm-login-hint a { color: var(--primary-dark); }

/* ---- 发表表单 ---- */
.cm-form { margin: 0 0 18px; }
.cm-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: .92rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 56px;
}
.cm-form textarea:focus { outline: none; border-color: var(--primary); }
/* flex-wrap 必须写：窄屏下这三个元素挤一行会把「发表」压出屏幕 */
.cm-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.cm-form-row .btn { margin-left: auto; }

.cm-kao-btn {
  border: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.cm-kao-btn:hover, .cm-kao-btn.active { border-color: var(--primary); color: var(--primary-dark); }
.cm-count { font-size: .78rem; color: var(--text-light); font-variant-numeric: tabular-nums; }
.cm-count.warn { color: var(--warn); }

/* ---- 颜文字面板 ---- */
.cm-kao-panel {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px;
}
.cm-kao-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cm-kao-tab {
  border: 1px solid transparent;
  background: var(--primary-soft);
  color: var(--text-light);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.cm-kao-tab.active { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary); }
.cm-kao-group { display: flex; flex-wrap: wrap; gap: 4px; }
.cm-kao {
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  border-radius: 8px;
  padding: 3px 6px;
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
  line-height: 1.4;
}
.cm-kao:hover { background: var(--primary-soft); border-color: var(--border); }

/* 回复框里的「常用颜文字」一排：永远可见（不依赖 JS）。
   只放 12 个，避免每条评论都内嵌一整套 68 个按钮把页面撑爆。 */
.cm-kao-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.cm-kao-mini {
  font-size: .8rem;
  padding: 1px 5px;
  color: var(--text-light);
  border-color: var(--border);
}
.cm-kao-mini:hover { color: var(--primary-dark); }

/* ---- 评论列表（递归嵌套） ---- */
.cm-list { list-style: none; margin: 0; padding: 0; }
/* 缩进只在 depth < 4 的层生效（层级由模板传下来的 class 控制）。
   无限嵌套 + 无限缩进 = 手机上深回复被挤成一条竖线，所以必须封顶。 */
.cm-list.cm-sub.cm-indent {
  margin: 10px 0 0 14px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.cm-list.cm-sub:not(.cm-indent) { margin-top: 10px; }

.cm-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px 12px;
  margin-top: 10px;
}
.cm-list > .cm-item:first-child { margin-top: 0; }
/* 从 #cm-<id> 跳过来时闪一下，让用户找到自己刚发的那条 */
.cm-item.cm-hi { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); transition: box-shadow .2s, border-color .2s; }

.cm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cm-av {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-av-txt { color: var(--primary-dark); font-size: .8rem; font-weight: 600; }
.cm-name { color: var(--primary-dark); font-size: .88rem; font-weight: 600; }
.cm-time { color: var(--text-light); font-size: .76rem; margin-left: auto; }

.cm-body {
  margin-top: 6px;
  color: var(--text);
  font-size: .92rem;
  line-height: 1.7;
  /* 用户可能写多行，保留换行；同时长串（URL）要能断行 */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cm-gone { color: var(--text-light); font-style: italic; }

.cm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.cm-replybox > summary {
  cursor: pointer;
  color: var(--text-light);
  font-size: .82rem;
  list-style: none;
  user-select: none;
}
.cm-replybox > summary::-webkit-details-marker { display: none; }
.cm-replybox > summary::before { content: "↩ "; }
.cm-replybox[open] > summary { color: var(--primary-dark); }
.cm-replybox .cm-form { margin: 10px 0 0; }
.cm-delform { margin: 0; }
.cm-del {
  border: none;
  background: none;
  color: var(--text-light);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  padding: 0;
}
.cm-del:hover { color: var(--danger); }

/* ---- 碎碎念列表里的折叠评论区 ---- */
.cm-fold { margin-top: 10px; }
.cm-fold > summary {
  cursor: pointer;
  color: var(--text-light);
  font-size: .82rem;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cm-fold > summary::-webkit-details-marker { display: none; }
.cm-fold[open] > summary { color: var(--primary-dark); }
.cm-fold .cm-section { margin-top: 10px; }

@media (max-width: 560px) {
  /* 窄屏收窄缩进，给正文留出宽度 */
  .cm-list.cm-sub.cm-indent { margin-left: 8px; padding-left: 8px; }
  .cm-form-row .btn { margin-left: 0; }
}

/* ===========================================================================
   置顶（笔记 / 文件库项目 / 文件库散文件 共用）
   颜色全部走 CSS 变量 → 深色模式自动跟随（深色下是中性灰，符合本站「深色不用彩色」的规则）
   =========================================================================== */
.pin-badge {
  display: inline-block;
  font-size: .72rem;
  line-height: 1.55;
  padding: 0 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  white-space: nowrap;
  vertical-align: middle;
}

/* 标题行：置顶标记和标题排一行。
   flex-wrap 必须写 —— 长标题 + 标记挤一行会把标题压爆（本站窄屏踩过这类坑）。 */
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}
.title-row .title { min-width: 0; overflow-wrap: anywhere; }

/* 列表项右侧那一组小按钮（置顶 / 编辑 / 删除） */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.row-actions form { margin: 0; }

/* 项目卡片：底部操作行与主体留一点距离 */
.proj-card .row-actions { margin-top: 2px; }

.pin-hint { font-size: .82rem; margin: -6px 0 14px; }

/* ===========================================================================
   Markdown 里的「手打空行」占位块（见 app/md_render.py）
   Markdown 会把任意多个空行压成一个段间距，于是用户在输入框里敲的
   「3 个空行」和「1 个空行」渲染出来一模一样 —— 用它来分组的大间隔就丢了。
   渲染器把多出来的空行换成这个等高占位块，高度由行内 style 给出。
   =========================================================================== */
.md-gap {
  display: block;
  height: 1.7em;      /* 兜底值；实际由行内 style 覆盖 */
  line-height: 0;     /* 别让空 div 自己再撑出一行字高 */
}

/* ===========================================================================
   消息通知（导航红点 + 消息页）
   颜色一律走 CSS 变量 → 深色模式自动跟随，不出现「深色下还是一片粉底」。
   =========================================================================== */

/* ---- 导航栏铃铛 + 红点 ---- */
.nav-notif {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  transition: background .15s ease;
}
.nav-notif:hover { background: var(--primary-soft); }

/* ⚠️ 这个铃铛 <a> 也在 .nav-user 里，会被 `.nav-user a { padding: 7px 11px }` 命中。
   本站有全局 `* { box-sizing: border-box }`，所以 30px 的框要**先扣掉左右各 11px**，
   内容区只剩 8px 宽 —— 图标只能往外溢出（现在看着还行，但一旦谁给这里加
   overflow:hidden 就会被裁掉）。这里显式归零。
   注意优先级：`.nav-user a` 是 (0,1,1)，单写 `.nav-notif`(0,1,0) 压不过它，
   必须用两个类。 */
.nav-user .nav-notif { padding: 0; }

/* 铃铛图标的尺寸。
   ⚠️ 必须按 em 定，不要写死 px：导航字号桌面/手机是两个值
   （`.nav-user a` 桌面 .9rem、≤640px .78rem），写死就会有一端不协调。
   另外这个图形在 24 的 viewBox 里只占中间约 72%（四周本来就有留白），
   所以「1.5em 的框」画出来的实际铃铛≈1.1em，正好和旁边用户名一个字高。
   早先写死 19px：实际图形只有 ~13.7px，比用户名还小，看着很憋。 */
.nav-notif svg {
  width: 1.5em;
  height: 1.5em;
  display: block;
}

.nav-notif-dot {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
}

/* ---- 消息页 ---- */
.page-desc { color: var(--text-light); }

.notif-bar {
  display: flex;
  flex-wrap: wrap;              /* 窄屏时按钮行自动换行，不把页面撑宽 */
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
}
.notif-bar-count { color: var(--text-light); font-size: .88rem; }
.notif-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-bar-actions form { margin: 0; }
.notif-hint { color: var(--text-light); font-size: .84rem; margin: -4px 0 12px; }

.notif-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }

.notif-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
/* 未读：左侧一条竖色带 + 淡底，扫一眼就知道哪几条是新的 */
.notif-item.unread {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
}
/* 跳转目标被高亮时（从「去看原处」点回来）给个短暂的视觉落点 */
.notif-item:target { border-color: var(--primary); }

.notif-head { display: flex; align-items: flex-start; gap: 10px; }

.notif-av {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
}
.notif-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.notif-meta { flex: 1; min-width: 0; }  /* min-width:0 让长用户名能省略而不是撑破 */
.notif-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.notif-actor { color: var(--text); overflow-wrap: anywhere; }
.notif-kind { color: var(--text-light); font-size: .86rem; }
.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex: none;
}

.notif-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 2px;
  color: var(--text-light);
  font-size: .8rem;
}
.notif-sep { color: var(--border); }
.notif-src { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

.notif-readform { margin: 0; flex: none; }
.notif-readbtn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
  opacity: .75;
}
.notif-readbtn:hover { opacity: 1; background: var(--primary-light); }

/* 引用的评论原文：左边一条细线 + 淡底，和正文区分开 */
.notif-quote {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-left: 3px solid var(--border);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  color: var(--text-light);
  font-size: .88rem;
  overflow-wrap: anywhere;      /* 长链接/长英文不撑破卡片 */
}

.notif-reply { margin-top: 8px; }
.notif-reply > summary {
  cursor: pointer;
  color: var(--text-light);
  font-size: .84rem;
  list-style: none;
}
.notif-reply > summary::-webkit-details-marker { display: none; }
.notif-reply > summary::before { content: "↩ "; }
.notif-reply[open] > summary { margin-bottom: 8px; }
.notif-reply .cm-form { margin-top: 0; }

.notif-empty { color: var(--text-light); margin: 0; }

@media (max-width: 560px) {
  .notif-item { padding: 10px 12px; border-radius: 12px; }
  .notif-av { width: 30px; height: 30px; }
  .notif-bar { justify-content: flex-start; }
}

