/* ========== 小黄书 - 完整样式表 ========== */
* { margin:0; padding:0; box-sizing:border-box; }

/* 【已移除网页字体】
   这里原本有 @font-face 指向 fonts/msyh.ttf（微软雅黑，2.1MB）。
   但它只被 .marquee-content span（首页顶部滚动横幅）用到，
   而 body 的字体栈早就用的是系统字体，等于每打开一个页面
   都要白下载 2MB 只为了给一行跑马灯换个字形，得不偿失。
   现在整站走系统字体（Windows 的微软雅黑 / macOS 的苹方，
   本身就是同一个字形），省下 2.1MB 的下载量。

   注意：fonts/msyh.ttf 这个文件本身要保留 —— image_utils.php
   的服务端水印（Imagick/GD 渲染中文字）还在用它。 */

:root {
  /* 小红书原版风格：纯白卡片 + 浅灰背景 + 大圆角 + 淡阴影。
     【注意】--glass-* 这组变量名是历史遗留（毛玻璃时代），现在语义上就是
     「卡片底色 / 卡片描边 / 卡片阴影」，theme-*.css 只覆盖这 11 个颜色变量，
     改变量名会导致 7 套主题全部失效，所以名字保留、值改为实色。 */
  --primary: #ff2442;
  --primary-dark: #e61f3c;
  --primary-light: #fff0f2;
  --bg: #f8f8f8;
  --card-bg: #ffffff;
  --text: #333333;
  --text-secondary: #666;
  --text-light: #999;
  --border: rgba(0,0,0,0.06);
  --glass-bg: #ffffff;
  --glass-border: rgba(0,0,0,0.05);
  --glass-shadow: none;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ========== 顶部导航 ========== */
.navbar {
  background: var(--glass-bg);
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }

/* Logo 图片 */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 10px;
}
/* 没有 logo.webp 时的文字兜底（header.php 里 file_exists 判断后输出） */
.logo-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .5px;
  line-height: 40px;
}

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { font-size: 15px; color: var(--text-secondary); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }
.user-menu {
  display: flex; align-items: center; gap: 12px; padding: 4px 12px; border-radius: 20px;
  background: #f5f5f5;
  border: 1px solid transparent;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.user-menu span { font-size: 14px; font-weight: 500; color: var(--text); }
@media (max-width: 768px) { .nav-links, .nav-search { display: none; } .navbar .container { justify-content: space-between; } }

/* ========== 页面标题（原先 16 处使用却没有任何规则，一直裸奔着浏览器默认 h2）========== */
.page-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 18px 0 12px; line-height: 1.3; }

/* ========== 导航搜索框（小红书桌面端：居中灰底胶囊）========== */
.nav-search {
  flex: 1; max-width: 360px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  background: #f5f5f5; border-radius: 19px; border: 1px solid transparent;
  transition: var(--transition);
}
.nav-search:focus-within { background: #fff; border-color: #d9d9d9; }
.nav-search svg { width: 16px; height: 16px; color: #999; flex-shrink: 0; }
.nav-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text); min-width: 0;
}
.nav-search input::placeholder { color: #aaa; }
/* 移动端隐藏导航搜索框 —— 必须写在 .nav-search 定义之后，
   否则会被上面的 display:flex 以「同特异性、后出现者胜」覆盖掉 */
@media (max-width: 768px) { .nav-search { display: none; } }

/* ========== 汉堡按钮 ========== */
.hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  width: 40px; height: 40px; background: #f5f5f5;
  border: none; border-radius: 50%; cursor: pointer;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); margin: 2.5px 0; border-radius: 2px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 768px) { .hamburger { display: flex; } }

/* ========== 移动端菜单 ========== */
.mobile-menu {
  display: block; max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease; opacity: 0;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
}
.mobile-menu.open { max-height: 80vh; opacity: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mobile-menu-item { display: block; padding: 14px 24px; font-size: 16px; color: var(--text); border-bottom: 1px solid rgba(0,0,0,0.05); }
.mobile-menu-item:hover { background: #fff; color: var(--primary); }
.menu-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 6px 0; }

/* ========== 用户下拉菜单 ========== */
.dropdown { position: relative; }
.dropdown-toggle { background: transparent; border: none; cursor: pointer; font-size: 12px; color: var(--text-secondary); padding: 0 2px; }
.dropdown-content {
  display: none; position: absolute; right: 0; top: 100%;
  background: #fff;
  border: 1px solid var(--glass-border); border-radius: 12px;
  box-shadow: var(--shadow-md); min-width: 160px; padding: 5px 0; z-index: 1000;
  max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { display: block; padding: 10px 16px; font-size: 13px; color: var(--text); white-space: nowrap; }
.dropdown-content a:hover { background: rgba(255,46,77,0.05); color: var(--primary); }

/* ========== 分类卡片 ========== */
.category-filter {
  display: flex; flex-wrap: nowrap; gap: 10px; margin: 14px 0 12px; padding: 4px 2px 8px 2px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.category-filter::-webkit-scrollbar { display: none; }
.filter-item {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  min-width: 64px; height: 36px; padding: 0 16px; background: #fff; border-radius: 18px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; text-decoration: none; border: 1px solid #ebebeb;
  transition: var(--transition);
}
.filter-item:hover { border-color: #d9d9d9; color: var(--text); }
/* 小红书的分类选中态是「黑底白字」胶囊，不是主题色 —— 保持一致 */
.filter-item.active { background: #333; color: #fff; font-weight: 600; border-color: #333; }
.filter-item:active { transform: scale(0.94); }

/* ========== 猜你喜欢横滑区 ========== */
.rec-section { margin-bottom: 20px; }
.rec-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.rec-row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rec-row::-webkit-scrollbar { display: none; }
.rec-card {
  flex: 0 0 auto; width: 140px; text-decoration: none;
  background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 6px rgba(0,0,0,0.04); transition: transform 0.2s, box-shadow 0.2s;
}
.rec-card:hover { transform: none; box-shadow: 0 8px 24px rgba(0,0,0,0.09); }
.rec-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; transition: transform 0.45s cubic-bezier(.22,.61,.36,1); }
@media (hover: hover) {
  .rec-card:hover img { transform: scale(1.045); }
}
.rec-cover-empty { width: 100%; aspect-ratio: 3/4; background: #f0f0f0; display: flex; align-items: center; justify-content: center; color: #ccc; }
.rec-cover-empty svg { width: 32px; height: 32px; }
.rec-body { padding: 8px 10px 10px; }
.rec-name {
  font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--text);
  height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rec-meta { font-size: 10px; color: var(--text-light); margin-top: 4px; display: flex; justify-content: space-between; align-items: center; }
.rec-meta .note-likes { font-size: 10px; gap: 2px; }
.rec-meta .note-likes svg { width: 12px; height: 12px; }

/* ========== 笔记卡片（小红书瀑布流样式）========== */
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.note-card {
  background: var(--card-bg);
  border: none; border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 0 6px rgba(0,0,0,0.04);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column;
}
/* 【原版精修】卡片 hover 从「整卡上移」改为原版网页的「封面图轻微放大」：
   图不动结构、只动视觉 —— 卡片本身几乎不飘，封面在原位慢慢放大一点点，
   阴影同步加深。hover 效果包在 @media (hover:hover) 里，触屏设备不生效。 */
.note-cover { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #f0f0f0; }
.note-card:hover { transform: none; box-shadow: 0 8px 24px rgba(0,0,0,0.09); }
.note-cover-wrapper { position: relative; overflow: hidden; }
img.note-cover { transition: transform 0.45s cubic-bezier(.22,.61,.36,1); }
@media (hover: hover) {
  .note-card:hover img.note-cover { transform: scale(1.045); }
}
/* 封面左下角的分类半透明胶囊（小红书式的角标位置） */
.cover-category-badge {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px);
  padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
/* 封面左上角「置顶」角标 */
.cover-top-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--primary); color: #fff;
  font-size: 11px; line-height: 1.3;
  pointer-events: none;
}
/* 视频角标：圆形半透明底 + SVG 播放三角（不依赖 emoji 字体） */
.video-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff; background: rgba(0,0,0,0.4); border-radius: 50%;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.video-overlay svg { width: 22px; height: 22px; margin-left: 2px; }
/* 视频无封面时占位区自带一个 ▶ 字符，与 SVG 播放角标叠成双层 —— 隐藏字符版，只留 SVG */
.video-cover-placeholder .video-play-icon { display: none; }
.note-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
/* 【原版精修】标题字重从 600 降到 500：原版卡片标题没有这么重，
   500 在浅灰背景下层次感更接近原版 */
.note-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-content { font-size: 13px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
/* 小红书式作者行：左「头像+昵称」右「心形+点赞数」 */
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-light); margin-top: auto; }
.note-author { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--text-secondary); font-size: 12px; }
.note-author .author-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.note-stats-mini { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text-light); font-size: 12px; }
.note-views, .note-likes { display: flex; align-items: center; gap: 3px; }
.note-likes svg { width: 15px; height: 15px; }
.note-views svg { width: 15px; height: 15px; color: var(--text-light); }
.author { display: flex; align-items: center; gap: 5px; min-width: 0; }
.avatar-placeholder { width: 18px; height: 18px; border-radius: 50%; background: #f0f0f0; flex-shrink: 0; }
.stats { white-space: nowrap; font-size: 12px; }
.level-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-weight: 600; font-size: 12px; }

@media (min-width: 768px) { .notes-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .notes-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1440px) { .notes-grid { grid-template-columns: repeat(5, 1fr); } }

/* ========== 按钮 ========== */
.btn {
  display: inline-block; padding: 11px 24px; background: var(--primary); color: #fff;
  border: none; border-radius: 24px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: var(--transition); text-align: center; box-shadow: none;
}
.btn:hover { background: var(--primary-dark); }
/* 【原版精修】按压时轻微缩回，松手回弹 —— 原版的按钮手感 */
.btn:active { transform: scale(0.97); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-outline:active { transform: scale(0.97); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 20px; }
.btn-block { width: 100%; }

/* ========== 表单 ========== */
.form-container {
  max-width: 420px; margin: 24px auto; background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--glass-shadow);
}
.form-container h2 { text-align: center; margin-bottom: 20px; font-size: 22px; color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm); font-size: 15px;
  background: #fff; color: var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,46,77,0.1); outline: none; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input[type="file"] { padding: 8px; background: #fff; }

/* ========== 笔记详情 ========== */
/* 详情页：移动端整块白底卡片；桌面（≥1024px）左右分栏 —— 左媒体 sticky、右侧信息+评论（小红书网页版布局） */
.note-detail {
  background: var(--card-bg);
  border: none; border-radius: var(--radius);
  padding: 16px; margin-top: 12px; box-shadow: 0 0 6px rgba(0,0,0,0.04);
  /* 移动端也要是 flex 容器：媒体列的 order:-1 才能把图片顶到最上面（小红书移动端是图在上） */
  display: flex; flex-direction: column;
}
.note-media-col { order: -1; } /* 移动端图片在最上 */
@media (min-width: 1024px) {
  .note-detail {
    background: transparent; padding: 0; box-shadow: none; border-radius: 0;
    display: flex; flex-direction: row; gap: 20px; align-items: flex-start;
    /* flex-direction 必须显式写 row：基础规则里的 column 会沿用到这里（媒体查询只覆盖声明了的属性） */
  }
  .note-media-col {
    order: -1; flex: 1.15; min-width: 0; /* 桌面端媒体在左（小红书网页版布局） */
    position: sticky; top: 76px;
    background: var(--card-bg); border-radius: var(--radius);
    padding: 12px; box-shadow: 0 0 6px rgba(0,0,0,0.04);
  }
  .note-info-col {
    flex: 1; min-width: 0;
    background: var(--card-bg); border-radius: var(--radius);
    padding: 20px; box-shadow: 0 0 6px rgba(0,0,0,0.04);
  }
}
/* 点赞 / 收藏的图标按钮（小红书操作对） */
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 20px; border: 1px solid #ebebeb;
  background: #fff; color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: var(--transition);
}
.action-btn svg { width: 17px; height: 17px; }
.action-btn:hover { border-color: #d9d9d9; color: var(--text); }
.action-btn.active { color: var(--primary); border-color: var(--primary-light); background: var(--primary-light); }
/* 【原版精修】字重 600（原版详情标题是 semibold 不是浏览器默认的 bold）、行高放宽 */
.note-detail h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; line-height: 1.45; color: var(--text); }
.note-detail .author { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; flex-wrap: wrap; }
.note-detail .author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.content-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; margin: 14px 0; color: var(--text); }
.note-stats { display: flex; gap: 20px; font-size: 14px; color: var(--text-secondary); margin: 10px 0; }
/* 浏览 / 点赞计数行：SVG 图标 + 数字，垂直居中对齐 */
.note-stats .stat-item { display: inline-flex; align-items: center; gap: 6px; }
.note-stats .stat-item svg { width: 17px; height: 17px; color: var(--text-light); }
.note-actions { display: flex; gap: 16px; margin: 14px 0; align-items: center; }

/* ========== 评论区域 ========== */
.comments-section { margin-top: 20px; }
.comments-section h3 { font-size: 16px; margin-bottom: 10px; color: var(--text); }
.comment-item { display: flex; align-items: flex-start; gap: 8px; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.comment-item img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-content { flex: 1; font-size: 14px; color: var(--text); }
.comment-user { font-weight: 600; margin-right: 4px; }
.comment-time { color: var(--text-light); font-size: 11px; margin-left: 6px; }
/* 相对时间（.c-time-rel）是给移动端 App 版式用的，桌面端一律不显示。
   默认隐藏、移动端 CSS 再打开 —— 这样桌面端行为与加 c-time-rel 之前
   完全一致，不会凭空多出一段时间。 */
.c-time-rel { display: none; }
.no-comments { text-align: center; padding: 24px 0; color: var(--text-light); font-size: 14px; }
.top-comments { background: var(--primary-light); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.top-label { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.comment-item.top { background: #fff; border-radius: 8px; padding: 8px; }

/* ========== 表格 ========== */
.table {
  width: 100%; border-collapse: collapse; background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--glass-shadow); font-size: 14px;
}
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.05); }
.table th { background: #fff; font-weight: 600; color: var(--text-secondary); }
.table img { width: 50px; height: 38px; object-fit: cover; border-radius: 6px; }
.status-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; display: inline-block; font-weight: 500; }
.status-0 { background: var(--primary-light); color: var(--primary); }
.status-1 { background: #e8f5e9; color: #2e7d32; }
.status-2 { background: #fff3e0; color: #f57c00; }
.badge-video { display: inline-block; margin-left: 4px; padding: 1px 5px; font-size: 10px; background: var(--primary); color: #fff; border-radius: 4px; }

/* ========== 图片轮播 ========== */
.image-carousel { position: relative; max-width: 100%; margin: 14px 0; overflow: hidden; border-radius: var(--radius); background: rgba(0,0,0,0.03); }
.carousel-track { display: flex; transition: transform 0.3s ease; }
.carousel-slide { min-width: 100%; display: none; }
.carousel-slide.active { display: block; }
.carousel-slide img { width: 100%; max-height: 400px; object-fit: contain; border-radius: var(--radius); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: #fff; border: none; padding: 6px 10px; cursor: pointer; font-size: 16px; border-radius: 50%; }
.carousel-btn.prev { left: 6px; }
.carousel-btn.next { right: 6px; }
.carousel-indicators { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.indicator { width: 7px; height: 7px; border-radius: 50%; background: #fff; cursor: pointer; }
.indicator.active { background: #fff; width: 18px; border-radius: 3px; }

/* ========== 公告弹窗 ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-card { width: 90%; max-width: 360px; background: #fff; border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); padding: 20px; transform: scale(0.8); transition: transform 0.3s; }
.modal-overlay.show .modal-card { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.modal-close { background: #f0f0f0; border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; color: #666; display: flex; align-items: center; justify-content: center; }
.modal-body { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.modal-item { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.modal-label { flex-shrink: 0; background: var(--primary-light); color: var(--primary); padding: 2px 10px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.modal-text { color: var(--text); }
.modal-footer .btn { width: 100%; }

/* ========== 视频容器 ========== */
.video-container { margin: 14px 0; position: relative; }
.video-cover-placeholder { background: #333; display: flex; align-items: center; justify-content: center; aspect-ratio: 3/4; }
.video-play-icon { font-size: 40px; color: rgba(255,255,255,0.8); }
.video-thumb { width: 50px; height: 38px; background: #333; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }

/* ========== 头像 ========== */
.note-author img.avatar-img { width: 16px !important; height: 16px !important; }
img.avatar-img { width: 28px !important; height: 28px !important; border-radius: 50% !important; object-fit: cover !important; flex-shrink: 0 !important; display: inline-block !important; }
.user-menu img.avatar-img { width: 32px !important; height: 32px !important; }
.note-detail .author img.avatar-img { width: 36px !important; height: 36px !important; }
.comment-item img.avatar-img { width: 30px !important; height: 30px !important; }

/* ========== 提示消息 ========== */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13px; background: #fff; }
.alert-error { background: rgba(255,46,77,0.1); color: #c62828; }
.alert-success { background: rgba(46,125,50,0.1); color: #2e7d32; }
.alert-info { background: rgba(21,101,192,0.1); color: #1565c0; }

/* ========== 分页 ========== */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 30px 0 20px; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--text);
}
.page-link:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; font-weight: 700; border-color: transparent; }
.page-dots { color: var(--text-light); font-size: 16px; padding: 0 4px; }

/* ========== 全屏/下载按钮 ========== */
.fullscreen-btn { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.4); color: #fff; border: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; z-index: 10; }
.download-buttons { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.download-buttons a { flex: 1 1 auto; text-align: center; min-width: 120px; }

/* ========== 打卡区域 ========== */
.checkin-box { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; text-align: center; box-shadow: var(--glass-shadow); }

/* ========== 主题选择卡片 ========== */
.theme-card { background: #fff; border-radius: 14px; padding: 16px; text-align: center; box-shadow: var(--shadow-sm); cursor: pointer; transition: var(--transition); }
.theme-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ========== 页脚 ========== */
.footer { background: transparent; padding: 20px 0; text-align: center; color: var(--text-light); font-size: 13px; }

/* ========== 收藏本站引导 ========== */
.fav-guide {
  margin: 16px 0 8px;
  background: linear-gradient(135deg, rgba(255,46,77,0.08), rgba(255,107,129,0.12));
  border: 1px solid rgba(255,46,77,0.15);
  border-radius: 16px;
  padding: 14px 16px;
}
.fav-guide-content { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fav-guide-icon { font-size: 28px; flex-shrink: 0; }
.fav-guide-text { flex: 1; min-width: 160px; }
.fav-guide-title { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 3px; }
.fav-guide-desc { font-size: 12px; color: var(--text-secondary); }
.fav-guide-desc kbd { display: inline-block; padding: 1px 6px; background: #fff; border: 1px solid #ddd; border-radius: 4px; font-size: 11px; font-family: monospace; color: #333; font-weight: 600; }
.fav-guide-btn { background: var(--primary); color: #fff; border: none; padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.fav-guide-btn:hover { background: var(--primary-dark); }
.fav-guide-close { background: transparent; border: none; color: var(--text-light); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.fav-guide-close:hover { color: var(--primary); }

/* ========== 上传进度条 ========== */
.progress-wrap { display: none; margin: 15px 0; padding: 14px 18px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); }
.progress-label { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; display: flex; justify-content: space-between; }
.progress-bar-bg { width: 100%; height: 10px; background: rgba(0,0,0,0.08); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 10px; transition: width 0.2s ease; }
.progress-bar.success { background: linear-gradient(90deg, #4caf50, #388e3c); }
.progress-bar.error { background: linear-gradient(90deg, #f44336, #c62828); }

/* ========== 滚动横幅（跑马灯） ========== */
.marquee-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  margin: 12px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.marquee-content {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  animation-name: marqueeScroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
.marquee-content span {
  display: block;
  flex-shrink: 0;
  color: #000000 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 0 60px;
  white-space: nowrap;
  line-height: 44px;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== 首页广告位 ==========
   位置：顶部滚动横幅下方、内容瀑布流上方（在 .container 内）。

   【为什么不用固定高度】
   广告图的比例由管理员自己定（可能是 6:1 的扁条，也可能是方图）。
   写死高度会导致：扁图上下留白、方图被裁掉。所以让高度跟着图片
   的原始比例走，只限制一个最大高度防止超长图把首屏挤满。

   【为什么图片要 width:100% + height:auto】
   不写死高度的情况下，这是唯一能让图片自适应各种宽度的组合。
   同时给 max-height 兜底，避免纵向长图占据整屏。 */
.ad-slot {
  position: relative;
  width: 100%;
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f6f7f9;                    /* 图片加载前的占位底色，避免白闪 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ad-slide {
  display: none;                          /* 默认全部隐藏，由 .is-active 控制显示 */
}
.ad-slide.is-active { display: block; }

.ad-slide a {
  display: block;
  line-height: 0;                         /* 干掉 <a> 包裹 <img> 时底部多出的几个像素 */
}
.ad-slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;                      /* 超长图不至于占满首屏 */
  object-fit: contain;                    /* 达到 max-height 时完整缩放，不裁切 */
  background: #f6f7f9;
}
.ad-slide a.is-linkless { cursor: default; }

/* 淡入切换。用 opacity 而不是位移 —— 轮播的位移很容易让人误以为
   页面在滚动，而广告位是横向静态区块，淡入更安静。 */
.ad-slide.is-active {
  animation: adFadeIn .45s ease;
}
@keyframes adFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 圆点指示器。只有多条广告时才渲染。
   定位在图片右下角，压在图上 —— 避免占据额外高度。 */
.ad-dots {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);        /* 深色底保证在浅色图上也能看清 */
  backdrop-filter: blur(4px);
  z-index: 2;
}
.ad-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background .2s, transform .2s;
  /* 触摸热区：视觉 7px，实际可点区域靠 padding 外扩 */
  box-sizing: content-box;
  touch-action: manipulation;
}
.ad-dot:hover { background: rgba(255, 255, 255, 0.8); }
.ad-dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

/* ---- 广告位②：抽屉菜单底部 ----------------------------------
   抽屉容器（.drawer）自带 padding: 12px 0 30px，左右没有留白，
   所以横向边距靠这里的 margin 控制。
   去掉 box-shadow：菜单里的扁平卡片压着阴影很突兀。
   抽屉窄（max 320px），图片 max-height 收到 180px，避免一张竖图
   把菜单撑到要滚半天。 */
.ad-slot-drawer {
  width: auto;
  margin: 16px 14px 8px;
  box-shadow: none;
  border-radius: 10px;
}
.ad-slot-drawer .ad-slide img { max-height: 180px; }

/* ---- 广告位③：首页底部（分页之后、页脚之前）------------------
   收窄居中，和页面主栏视觉对齐；上下留白比顶部大，
   因为它下面紧接着页脚，需要呼吸空间。 */
.ad-slot-bottom {
  max-width: 560px;
  margin: 24px auto 8px;
}

/* ========== 移动端优化 ========== */
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .navbar .container { height: 54px; }
  .logo img { height: 34px; }
  .hamburger { width: 38px; height: 38px; }
  .hamburger span { width: 18px; margin: 2px 0; }
  .category-filter { gap: 8px; margin: 12px 0 10px; padding: 2px 2px 6px 2px; }
  .filter-item { min-width: 68px; height: 38px; padding: 0 14px; font-size: 13px; border-radius: 13px; }
  .notes-grid { gap: 8px; }
  .note-card { border-radius: 14px; }
  .note-body { padding: 8px 10px 10px; }
  .note-title { font-size: 13px; }
  .note-content { font-size: 11px; }
  .note-meta { font-size: 10px; }
  .page-link { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
  .dropdown-content { max-height: 60vh; min-width: 140px; }
  .marquee-banner { height: 40px; border-radius: 10px; }
  .marquee-content span { font-size: 14px; padding: 0 40px; line-height: 40px; }

  /* 广告位：手机上留白和圆角都收一点，跟卡片保持一致 */
  .ad-slot { border-radius: 10px; margin: 10px 0; }
  .ad-slide img { max-height: 200px; }
  .ad-dots { right: 8px; bottom: 8px; padding: 4px 8px; gap: 5px; }
  .ad-dot { width: 6px; height: 6px; }
}

/* ========== 主题定义（8套） ========== */


/* ========== SVG 图标导航样式 ========== */
.nav-item,
.mobile-menu-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-item svg,
.mobile-menu-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.nav-item:hover svg {
    transform: scale(1.15);
}

.nav-item.nav-icon {
    position: relative;
    padding: 4px;
}

.icon-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    background: #ff2e4d;
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    line-height: 1.3;
}

/* 下拉菜单图标 */
.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-content a svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.dropdown-content a:hover svg {
    color: var(--primary);
}

/* 下拉箭头按钮 */
.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dropdown-toggle svg {
    width: 14px;
    height: 14px;
}

/* 移动端菜单图标 */
.mobile-menu-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.mobile-menu-item:hover svg {
    color: var(--primary);
}

/* ========== 群聊 ========== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 400px;
    max-height: 720px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: #fff;
}
.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.chat-title svg { color: var(--primary); }
.chat-online {
    font-size: 12px;
    color: var(--text-light);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
.chat-empty {
    text-align: center;
    color: var(--text-light);
    padding: 60px 20px;
    font-size: 14px;
}
.chat-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-start;
}
.chat-msg.self {
    flex-direction: row-reverse;
}
.chat-msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #eee;
}
/* 头像可点 -> 跳对方主页。用 flex 布局让链接本身不撑高，
   并且把圆角/裁切交给链接，避免 hover 时露出方角。 */
.chat-msg-avatar-link {
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
    line-height: 0;
    text-decoration: none;
    transition: opacity .18s, transform .18s;
}
.chat-msg-avatar-link:hover {
    opacity: .85;
    transform: scale(1.05);
}
.chat-msg-avatar-link:active {
    transform: scale(.96);
}
.chat-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}
.chat-msg-body {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}
.chat-msg.self .chat-msg-body {
    align-items: flex-end;
}
.chat-msg-meta {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-msg-name {
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .18s;
}
/* 昵称可点 -> 跳对方主页 */
a.chat-msg-name:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.chat-msg-rank {
    background: var(--primary-light);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 10px;
}
.chat-msg-bubble {
    padding: 10px 14px;
    background: #fff;
    border-radius: 16px;
    border-top-left-radius: 4px;
    border: 1px solid rgba(0,0,0,0.05);
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.chat-msg.self .chat-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
    border-top-left-radius: 16px;
    border-top-right-radius: 4px;
}
.chat-msg-time {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 4px;
    padding: 0 4px;
}

/* 分享的笔记卡片 */
.chat-note-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    min-width: 220px;
}
.chat-msg.self .chat-note-card {
    background: rgba(255,255,255,0.15);
}
.chat-note-card:hover {
    background: #f0f0f0;
}
.chat-msg.self .chat-note-card:hover {
    background: rgba(255,255,255,0.25);
}
.chat-note-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}
.chat-note-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #fff;
    font-size: 18px;
}
.chat-note-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
}
.chat-note-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.chat-note-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    color: var(--text);
}
.chat-msg.self .chat-note-title { color: #fff; }
.chat-note-meta {
    font-size: 11px;
    color: #999;
}
.chat-msg.self .chat-note-meta { color: rgba(255,255,255,0.75); }
.chat-text {
    font-size: 14px;
    line-height: 1.5;
}

/* 输入区域 */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: #fff;
}
.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input-area input:focus {
    border-color: var(--primary);
}
.chat-input-area button {
    flex-shrink: 0;
    padding: 8px 20px;
    border-radius: 20px;
}

/* 移动端 */
@media (max-width: 480px) {
    .chat-container {
        height: calc(100vh - 200px);
        min-height: 350px;
        border-radius: 12px;
    }
    .chat-msg-body { max-width: 78%; }
    .chat-msg-avatar { width: 34px; height: 34px; }
    .chat-note-card { min-width: 180px; }
    .chat-input-area input { padding: 9px 12px; font-size: 14px; }
    .chat-input-area button { padding: 8px 16px; }
}

/* ========== 移动端底部导航 ========== */
.bottom-tabbar {
    display: none;
}

@media (max-width: 768px) {
    .bottom-tabbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 58px;
        background: #fff;
        border-top: 1px solid rgba(0,0,0,0.06);
        z-index: 200;
        align-items: center;
        justify-content: space-around;
        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -1px 6px rgba(0,0,0,0.03);
    }

    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0)) !important;
    }

    .tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        flex: 1;
        height: 100%;
        text-decoration: none;
        color: #666;
        position: relative;
        transition: color 0.2s;
    }
    .tab-item svg {
        width: 22px;
        height: 22px;
        transition: transform 0.2s;
    }
    .tab-item span {
        font-size: 10px;
        font-weight: 500;
        line-height: 1;
    }
    .tab-item.active {
        color: #1a1a1a;
    }
    .tab-item.active svg {
        transform: scale(1.05);
    }

    .tab-publish {
        flex: 1;
        color: #666;
    }
    .publish-btn {
        width: 44px;
        height: 34px;
        background: #ff2e4d;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        transition: transform 0.15s, background 0.2s;
        margin-bottom: 2px;
    }
    .publish-btn svg {
        width: 22px;
        height: 22px;
        stroke: #fff;
    }
    .tab-publish:active .publish-btn {
        transform: scale(0.92);
    }

    .tab-icon-wrap {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .tab-badge {
        position: absolute;
        top: -4px;
        right: -10px;
        background: #ff2e4d;
        color: #fff;
        font-size: 10px;
        font-weight: 600;
        padding: 1px 5px;
        border-radius: 8px;
        min-width: 16px;
        height: 16px;
        line-height: 14px;
        text-align: center;
        box-sizing: border-box;
    }
    .tab-badge-large {
        padding: 1px 4px;
        font-size: 9px;
    }

    .tab-me-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        transition: transform 0.2s;
    }
    .tab-me-avatar-text {
        background: var(--primary);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 600;
    }
    .tab-item.active .tab-me-avatar {
        transform: scale(1.05);
        box-shadow: 0 0 0 2px rgba(255,46,77,0.2);
    }
}

/* ========== 评论回复 + 评论点赞 ========== */
.comment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
}
.comment-text {
    word-break: break-word;
}
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
}
.comment-like-btn,
.comment-reply-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
    transition: color 0.2s;
}
.comment-like-btn:hover,
.comment-reply-btn:hover {
    color: var(--primary);
}
.comment-like-btn.liked {
    color: var(--primary);
}
.comment-like-count:empty {
    display: none;
}
.comment-replies {
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    border-left: 2px solid var(--primary-light);
}
.comment-reply-item {
    font-size: 13px;
    padding: 4px 0;
    line-height: 1.5;
}
.comment-reply-item .reply-name {
    font-weight: 600;
    color: var(--text-secondary);
}
.comment-reply-item .reply-text {
    color: var(--text);
}
.reply-form-wrap {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
}
.reply-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
    background: #fff;
}
.reply-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========== 顶部 Tab（发现 / 关注） ========== */
.top-tabs {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 12px 0 8px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 0;
}
.top-tab {
    padding: 8px 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
}
.top-tab:hover { color: var(--text); }
.top-tab.active {
    color: var(--text);
    font-weight: 700;
}
.top-tab.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* ========== 用户主页 ========== */
.user-profile-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
    box-shadow: var(--glass-shadow);
}
.user-profile-main {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}
.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.user-avatar-placeholder {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
}
.user-profile-info {
    flex: 1;
    min-width: 0;
}
.user-profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.user-rank-tag {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
}
.user-level-tag {
    font-size: 12px;
    padding: 2px 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 10px;
    font-weight: 600;
}
.user-profile-username {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}
.user-profile-stats {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.user-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.user-stat strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.user-stat span {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}
.user-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.user-profile-date {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-light);
}
.user-notes-title {
    margin: 28px 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

@media (max-width: 480px) {
    .user-profile-card { padding: 18px; }
    .user-avatar-large { width: 64px; height: 64px; }
    .user-avatar-placeholder { font-size: 26px; }
    .user-profile-name { font-size: 17px; }
    .user-profile-stats { gap: 16px; }
    .user-stat strong { font-size: 15px; }
}

/* ========== 图片缩放 ========== */
.zoom-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.zoomable-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    touch-action: none;
}

.zoom-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin: 8px 0 12px;
}

/* 图片轮播容器防止溢出 */
.carousel-slide {
    overflow: hidden;
}

@media (max-width: 480px) {
    .zoomable-image {
        max-height: 400px;
    }
}

/* ========== 设置页面 ========== */
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
}
.settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.settings-header svg {
    color: var(--primary);
}
.settings-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 18px;
}
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}
.theme-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.theme-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,46,77,0.15);
}
.theme-preview {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}
.theme-color {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.05);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.theme-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.theme-check {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}
.theme-card.active .theme-check {
    display: flex;
}
.settings-menu {
    display: flex;
    flex-direction: column;
}
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: color 0.2s;
}
.settings-item:last-child {
    border-bottom: none;
}
.settings-item:hover {
    color: var(--primary);
}
.settings-item svg {
    color: var(--text-light);
    flex-shrink: 0;
}
.settings-item:hover svg {
    color: var(--primary);
}

@media (max-width: 480px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .theme-card {
        padding: 12px;
    }
    .theme-color {
        width: 22px;
        height: 22px;
    }
}

/* ========== 顶部导航（调整：汉堡在左） ========== */
.hamburger {
    display: flex; /* 移动端显示，桌面端隐藏 */
}
.logo { margin: 0 auto; }
.mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 40px;
    justify-content: flex-end;
}
.top-icon {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}
.top-icon svg { width: 20px; height: 20px; }
.top-icon .icon-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff2e4d;
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

/* 桌面端：隐藏汉堡和右侧快捷图标，恢复原布局 */
@media (min-width: 769px) {
    .hamburger { display: none; }
    .mobile-top-actions { display: none; }
    .logo { margin: 0; }
}

/* ========== 侧边抽屉 ========== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    background: #f5f5f7;
    z-index: 999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 0 30px;
    -webkit-overflow-scrolling: touch;
}
.drawer.open { transform: translateX(0); }

.drawer::-webkit-scrollbar { width: 0; }

/* 用户信息区 */
.drawer-user {
    background: #fff;
    border-radius: 16px;
    margin: 8px 12px 12px;
    padding: 16px;
}
.drawer-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.drawer-user-link > svg {
    color: #ccc;
    flex-shrink: 0;
}
.drawer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.drawer-avatar-text {
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
}
.drawer-user-info { flex: 1; min-width: 0; }
.drawer-nickname {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.drawer-rank {
    font-size: 10px;
    padding: 1px 6px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
}
.drawer-username {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-stats {
    display: flex;
    gap: 24px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.drawer-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex: 1;
}
.drawer-stat strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.drawer-stat span {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* 分组 */
.drawer-group {
    background: #fff;
    border-radius: 16px;
    margin: 0 12px 12px;
    overflow: hidden;
}
.drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    font-size: 15px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
    position: relative;
}
.drawer-item:active { background: #f5f5f5; }
.drawer-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #333;
    stroke-width: 1.8;
}
.drawer-item span {
    flex: 1;
    text-align: left;
}
.drawer-badge {
    background: #ff2e4d;
    color: #fff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* ============================================================
   报障：抽屉入口按钮
   ============================================================ */

/* 抽屉里那个报障入口是 <button>（打开弹窗，不跳转），
   浏览器默认样式会带边框/背景/字体，这里对齐成 <a> 的样子。 */
.drawer-item-btn {
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
/* 报障入口的文字不许折行 ——「遇到问题 / 报障」在 390 宽的老手机上
   会被右边的次数角标挤成两行，看着像个 bug。
   flex:1 已经在 .drawer-item span 里给了，这里只补不换行。
   min-width:0 是配套的：没有它，flex 子项在某些浏览器下不肯收缩，
   nowrap 会把角标顶出容器。 */
.drawer-item-btn span {
    white-space: nowrap;
    min-width: 0;
}

/* 剩余次数角标。复用 .drawer-badge 的位置逻辑，但换成
   「额度感」更强的样式 —— 红底（有额度）/ 灰底（用完）。 */
.drawer-badge-quota {
    background: var(--primary-light, #ffe8ec);
    color: var(--primary, #ff2e4d);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex: 0 0 auto;
    white-space: nowrap;
}
.drawer-badge-quota.is-empty {
    background: #f0f0f0;
    color: #999;
}

/* ============================================================
   报障弹窗
   ============================================================
   层级说明（和抽屉配套，改动前务必一起看）：
     drawer-overlay 998 < drawer 999 < report-mask 1100 < report-modal 1101
       < report-confirm-mask 1200 < report-confirm 1201
   弹窗必须在抽屉之上，否则打开时会被抽屉盖住。
   ============================================================ */

.report-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}
.report-mask.show { opacity: 1; visibility: visible; }
/* 二次确认的遮罩再深一点，视觉上「退到更后面一层」 */
.report-mask-2 { z-index: 1200; background: rgba(0, 0, 0, 0.5); }

.report-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    width: min(92vw, 460px);
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
    z-index: 1101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.34, 1.3, 0.64, 1), visibility 0.24s;
    -webkit-overflow-scrolling: touch;
}
.report-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
}
.report-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.report-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f4f4f6;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.report-close:hover { background: #ececef; color: #555; }
.report-close svg { width: 15px; height: 15px; }

/* 额度提示条 */
.report-quota {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 20px 6px;
    padding: 9px 12px;
    background: var(--primary-light, #fff0f3);
    color: var(--primary, #ff2e4d);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 500;
}
.report-quota svg { width: 15px; height: 15px; flex-shrink: 0; }
.report-quota.is-empty {
    background: #f5f5f7;
    color: #999;
}

.report-body {
    padding: 8px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.report-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.report-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.report-label em {
    color: var(--primary, #ff2e4d);
    font-style: normal;
    margin-left: 2px;
}
.report-hint {
    font-size: 11.5px;
    color: var(--text-light, #999);
}
.report-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 11.5px;
    color: #bbb;
    pointer-events: none;
}

.report-field select,
.report-field input[type="text"],
.report-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e6e6e9;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fafafa;
    transition: border-color 0.16s, background 0.16s;
    -webkit-appearance: none;
    appearance: none;
}
.report-field select {
    /* 自绘下拉箭头，避免各平台原生样式差异太大 */
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 34px;
}
.report-field textarea {
    resize: vertical;
    min-height: 92px;
    line-height: 1.55;
    padding-bottom: 24px;   /* 给右下角字数让位 */
}
.report-field input:focus,
.report-field select:focus,
.report-field textarea:focus {
    outline: none;
    border-color: var(--primary, #ff2e4d);
    background: #fff;
}
/* 只读的「出问题页面」：灰底、不可编辑，一眼看出不是让填的 */
.report-field input[readonly] {
    background: #f5f5f7;
    color: #888;
    cursor: default;
}
.report-field input[readonly]:focus {
    border-color: #e6e6e9;
    background: #f5f5f7;
}

/* 截图上传 */
.report-upload { display: flex; flex-direction: column; gap: 10px; }
.report-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px;
    border: 1px dashed #d8d8dd;
    border-radius: 10px;
    background: #fafafa;
    color: #888;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.report-upload-btn:hover {
    border-color: var(--primary, #ff2e4d);
    color: var(--primary, #ff2e4d);
    background: var(--primary-light, #fff5f7);
}
.report-upload-btn svg { width: 17px; height: 17px; }

.report-shot-preview {
    position: relative;
    display: inline-block;
    line-height: 0;
    align-self: flex-start;
}
/* 【必须显式处理 hidden】
 * 类选择器（.report-shot-preview）的优先级高于浏览器给 [hidden] 的
 * 默认样式（display: none），所以只写 hidden 属性是**不生效**的 ——
 * 元素照样以 inline-block 显示出来，于是没选图时也会看到一个
 * 空的预览框和那个 × 按钮，跟下面的提示文字叠在一起。
 * 这一行把 hidden 的语义补回来。 */
.report-shot-preview[hidden] { display: none; }
.report-shot-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    border: 1px solid #e6e6e9;
    object-fit: cover;
}
.report-shot-del {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.report-shot-del svg { width: 12px; height: 12px; }

.report-foot {
    display: flex;
    gap: 10px;
    padding: 16px 20px 18px;
}
.report-btn-main,
.report-btn-ghost {
    flex: 1;
    padding: 12px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s, transform 0.1s;
}
.report-btn-main {
    border: none;
    background: var(--primary, #ff2e4d);
    color: #fff;
}
.report-btn-main:hover { opacity: 0.9; }
.report-btn-main:active { transform: scale(0.985); }
.report-btn-main:disabled { opacity: 0.55; cursor: not-allowed; }
.report-btn-ghost {
    border: 1px solid #e6e6e9;
    background: #fff;
    color: #666;
}
.report-btn-ghost:hover { background: #f7f7f9; }

/* 二次确认框 */
.report-confirm {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -46%) scale(0.94);
    width: min(88vw, 340px);
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px 18px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    z-index: 1201;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.3, 0.64, 1), visibility 0.2s;
}
.report-confirm.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.report-confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--primary-light, #fff0f3);
    color: var(--primary, #ff2e4d);
    display: flex;
    align-items: center;
    justify-content: center;
}
.report-confirm-icon svg { width: 24px; height: 24px; }
.report-confirm-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.report-confirm-text {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #777;
    text-align: left;
    /* 描述是用户自己写的，可能含长串英文/URL，要能断行 */
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 30vh;
    overflow-y: auto;
}
.report-confirm-foot { display: flex; gap: 10px; }
.report-confirm-foot button { flex: 1; padding: 11px; font-size: 14px; }

/* 轻提示 */
.report-toast {
    position: fixed;
    left: 50%;
    bottom: 12%;
    transform: translate(-50%, 14px);
    max-width: 84vw;
    padding: 11px 18px;
    background: rgba(28, 28, 32, 0.92);
    color: #fff;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 11px;
    z-index: 1300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.report-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.report-toast.is-error { background: rgba(200, 38, 60, 0.95); }

/* 移动端：弹窗贴底弹出（比居中更符合手机习惯，也更好点） */
@media (max-width: 640px) {
    .report-modal {
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
    }
    .report-modal.show { transform: translateY(0); }
    .report-head { padding: 16px 16px 10px; }
    .report-quota { margin: 0 16px 6px; }
    .report-body { padding: 8px 16px 4px; }
    .report-foot { padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
    .report-confirm { width: 90vw; }
}

/* 开关样式 */
.settings-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    font-size: 15px;
    color: var(--text);
}
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider {
    background-color: var(--primary);
}
.switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* 关闭横幅后隐藏上下横幅 */
body.banner-hidden .marquee-banner {
    display: none !important;
}

@media (max-width: 480px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .theme-card {
        padding: 12px;
    }
    .theme-color {
        width: 22px;
        height: 22px;
    }
}

/* ========== 小红书个人主页 ========== */
.profile-hero {
    background: linear-gradient(135deg, #d4a373 0%, #8b6f47 50%, #3d2f1f 100%);
    border-radius: 0 0 20px 20px;
    padding: 16px 20px 24px;
    color: #fff;
    margin: -16px -16px 16px;
    position: relative;
    overflow: hidden;
}
.profile-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15), transparent 60%);
    pointer-events: none;
}
.profile-top-bar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.profile-menu-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.profile-menu-btn svg { width: 24px; height: 24px; }

.profile-info-row {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
}
.profile-avatar-wrap {
    flex-shrink: 0;
    text-decoration: none;
}
.profile-avatar-img {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.4);
    background: #fff;
}
.profile-avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 10px;
    gap: 2px;
}
.profile-avatar-placeholder svg { width: 28px; height: 28px; }
.profile-avatar-placeholder span { line-height: 1; }

.profile-info-text {
    flex: 1;
    min-width: 0;
    color: #fff;
}
.profile-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.profile-edit-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    opacity: 0.9;
}
.profile-edit-btn svg { width: 16px; height: 16px; }
.profile-xhsid {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}
.copy-id-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    display: flex;
    align-items: center;
}
.copy-id-btn:hover { opacity: 1; }

.profile-stats {
    display: flex;
    gap: 24px;
    position: relative;
    z-index: 1;
}
.profile-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.profile-stat strong {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.profile-stat span {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

/* 快捷卡片 */
.profile-quick-actions {
    margin-bottom: 16px;
}
.quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.quick-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,46,77,0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quick-icon svg { width: 20px; height: 20px; }
.quick-text { flex: 1; }
.quick-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.quick-desc {
    font-size: 12px;
    color: var(--text-light);
}

/* 编辑面板 */
.edit-panel {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}
.edit-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.edit-panel-close {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}
.edit-form .form-group { margin-bottom: 12px; }
.checkin-box-small {
    background: rgba(255,46,77,0.05);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.checkin-box-small h4 { font-size: 14px; margin-bottom: 8px; color: var(--primary); }

/* Tab 栏 */
.profile-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border-radius: 14px 14px 0 0;
    padding: 0 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
    background: transparent;
    border: none;
    padding: 14px 12px;
    font-size: 15px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.profile-tab svg { opacity: 0.7; }
.profile-tab.active {
    color: var(--text);
    font-weight: 700;
}
.profile-tab.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}
.profile-tab-icon {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 12px;
    margin-left: auto;
    display: flex;
    align-items: center;
}
.profile-tab-icon svg { width: 18px; height: 18px; }

/* Tab 内容 */
.profile-tab-content {
    min-height: 300px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 20px 0;
}
.empty-state .btn {
    padding: 8px 28px;
    border-radius: 20px;
    background: #fff;
    color: var(--text);
    border: 1px solid #ddd;
    box-shadow: none;
}
.empty-state .btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .profile-hero {
        padding: 12px 16px 20px;
        margin: -12px -12px 12px;
    }
    .profile-avatar-img { width: 68px; height: 68px; }
    .profile-name { font-size: 18px; }
    .profile-stat strong { font-size: 16px; }
    .profile-stat span { font-size: 12px; }
    .profile-tab { font-size: 14px; padding: 12px 10px; }
}

/* ========== 个人主页背景图 ========== */
.profile-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bg);
    padding: 16px 16px 24px;
    margin-bottom: 16px;
    transition: background 0.3s;
}

.profile-hero.has-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.5));
    z-index: 0;
    pointer-events: none;
}

.profile-hero.has-cover .profile-top-bar,
.profile-hero.has-cover .profile-info-row,
.profile-hero.has-cover .profile-stats {
    position: relative;
    z-index: 1;
}

.profile-hero.has-cover .profile-name,
.profile-hero.has-cover .profile-xhsid,
.profile-hero.has-cover .profile-stat strong,
.profile-hero.has-cover .profile-stat span {
    color: #fff;
}

.profile-hero.has-cover .profile-name {
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.profile-hero.has-cover .profile-stat strong,
.profile-hero.has-cover .profile-stat span {
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 顶部栏布局 */
.profile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    min-height: 32px;
}

.profile-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text);
    width: 32px;
    height: 32px;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}
.profile-menu-btn:hover { background: rgba(0,0,0,0.05); }
.profile-menu-btn svg { width: 20px; height: 20px; }

.profile-hero.has-cover .profile-menu-btn {
    background: rgba(0,0,0,0.3);
    color: #fff;
}
.profile-hero.has-cover .profile-menu-btn:hover {
    background: rgba(0,0,0,0.5);
}

/* 背景图编辑按钮 */
.profile-cover-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.05);
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}
.profile-cover-edit-btn:hover {
    background: rgba(255,46,77,0.1);
    color: var(--primary);
}
.profile-hero.has-cover .profile-cover-edit-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.profile-hero.has-cover .profile-cover-edit-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* 头像 */
.profile-avatar-wrap {
    display: inline-block;
    position: relative;
}
.profile-avatar-img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.profile-avatar-placeholder {
    background: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 600;
}
.profile-avatar-placeholder svg { width: 26px; height: 26px; }

/* 信息行 */
.profile-info-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.profile-info-text { flex: 1; min-width: 0; }

.profile-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.profile-edit-btn svg { width: 16px; height: 16px; }
.profile-edit-btn:hover { color: var(--primary); background: rgba(255,46,77,0.1); }

.profile-xhsid {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    background: rgba(0,0,0,0.03);
    padding: 4px 10px;
    border-radius: 12px;
}
.profile-hero.has-cover .profile-xhsid {
    background: rgba(255,255,255,0.15);
}
.copy-id-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 2px;
    display: inline-flex;
}

/* 数据统计 */
.profile-stats {
    display: flex;
    gap: 28px;
    padding: 12px 0 0;
}
.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-stat strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.profile-stat span {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

/* 背景图预览 */
.cover-preview {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}
.cover-preview img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

/* 编辑面板（保证背景面板在顶栏下） */
.cover-panel {
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .profile-avatar-img {
        width: 72px;
        height: 72px;
    }
    .profile-name { font-size: 18px; }
    .profile-stats { gap: 20px; }
    .profile-stat strong { font-size: 16px; }
}
/* ============================================================
   搜索页：分类 tab（笔记 / 用户）+ 用户列表
   仿小红书搜索页
   ============================================================ */
.search-type-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border, #eee);
    margin-bottom: 18px;
}
.search-type-tab {
    position: relative;
    padding: 10px 2px 12px;
    font-size: 15px;
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-weight: 500;
    transition: color .18s;
}
.search-type-tab:hover { color: var(--text); }
.search-type-tab.active {
    color: var(--text);
    font-weight: 700;
}
.search-type-tab.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
}

/* ---------- 用户列表 ---------- */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 12px;
    transition: background .18s;
}
.user-list-item:hover { background: var(--hover-bg, #fafafa); }

.user-list-avatar-link { flex-shrink: 0; }
.user-list-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.user-list-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.user-list-info {
    flex: 1;
    min-width: 0;
}
.user-list-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-list-name:hover { color: var(--primary); }
.user-list-id {
    font-size: 12px;
    color: var(--text-light, #999);
    margin-top: 2px;
}
.user-list-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-light, #999);
    margin-top: 5px;
}
.user-list-meta strong {
    color: var(--text);
    font-weight: 600;
}

.user-list-item .user-follow-btn {
    flex-shrink: 0;
    min-width: 68px;
}

@media (max-width: 480px) {
    .user-list-avatar { width: 46px; height: 46px; }
    .user-list-meta { gap: 10px; font-size: 11px; }
    .user-list-item { padding: 12px 6px; }
}

/* ============================================================
   关注 / 粉丝 列表页
   ============================================================ */
.follow-list-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 20px 0 4px;
}
.follow-list-count {
    font-size: 13px;
    color: var(--text-light, #999);
}

.follow-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border, #eee);
    margin-bottom: 16px;
}
.follow-tab {
    position: relative;
    padding: 10px 2px 12px;
    font-size: 15px;
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-weight: 500;
    transition: color .18s;
}
.follow-tab:hover { color: var(--text); }
.follow-tab.active {
    color: var(--text);
    font-weight: 700;
}
.follow-tab.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
}

/* 关注/粉丝数字可点（对齐小红书的交互） */
.user-stat-link,
.profile-stat-link {
    text-decoration: none;
    color: inherit;
    transition: opacity .18s;
}
.user-stat-link:hover,
.profile-stat-link:hover { opacity: .68; }

/* ============================================================
   通知中心：分类 tab（全部 / 赞和收藏 / 评论 / 新增关注）
   ============================================================ */
.notif-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 18px 0 14px;
}
.notif-tabs::-webkit-scrollbar { display: none; }

.notif-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 7px 15px;
    border-radius: 18px;
    background: var(--hover-bg, #f2f2f2);
    color: var(--text-secondary, #666);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all .18s;
    white-space: nowrap;
}
.notif-tab:hover { color: var(--text); }
.notif-tab.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.notif-tab-count {
    font-size: 11px;
    padding: 0 5px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, .08);
}
.notif-tab.active .notif-tab-count {
    background: rgba(255, 255, 255, .28);
}

/* 私聊标题里的对方昵称可点 -> 跳对方主页 */
.chat-title-link {
    color: inherit;
    text-decoration: none;
    transition: color .18s;
}
.chat-title-link:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ============================================================
   首页 / 列表页动画
   设计取向：克制细腻。只做「入场」这一件事，时长短、位移小、
   不循环、不抢注意力 —— 目标是有生气，而不是有存在感。
   全部动画都放在 prefers-reduced-motion 的豁免范围内。
   ============================================================ */

/* ---------- 1. 卡片入场：淡入 + 轻微上浮 ----------
   用 .is-in 由 IntersectionObserver 触发，而不是页面加载就全播完 ——
   否则首屏外的卡片在用户滚到之前动画已经结束，等于没有。
   每张卡片由 JS 写 --i（序号），靠它错开 40ms，形成流动感。
   序号做了截断，长列表不会出现「第 40 张等 1.6 秒」的情况。 */
@keyframes noteCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.note-card.anim-ready {
    opacity: 0;
    transform: translateY(14px);
}
.note-card.is-in {
    animation: noteCardIn .42s cubic-bezier(.22, .61, .36, 1) both;
    /* --i 是 JS 给的卡片序号，最多算 8 档，避免长列表末尾等太久 */
    animation-delay: calc(var(--i, 0) * 40ms);
}

/* ---------- 2. 封面图淡入 ----------
   图片加载完成前是灰底，直接「啪」地出现比较生硬。
   JS 在 img.onload 时加 .is-loaded，淡入过去。
   注意只对真实 <img> 生效 —— 占位块（无图/视频占位）没有加载态，
   不该被按住透明度。 */
img.note-cover {
    opacity: 0;
    transition: opacity .38s ease;
}
img.note-cover.is-loaded {
    opacity: 1;
}

/* ---------- 3. 点赞红心：轻轻一跳 ----------
   只在「数值变化」时由 JS 加 .is-beat（动画结束即移除，
   这样连点也能反复触发）。幅度 1.28 倍、220ms，
   是「注意到了」而不是「被吓了一跳」。 */
@keyframes heartBeat {
    0%   { transform: scale(1); }
    38%  { transform: scale(1.28); }
    70%  { transform: scale(.94); }
    100% { transform: scale(1); }
}
.note-likes svg.is-beat,
.note-likes.is-beat svg {
    transform-origin: 50% 55%;
    animation: heartBeat .22s ease-out;
}

/* ---------- 4. 页面标题：跟着卡片一起入场 ----------
   单独给标题一点入场，让整页是「一起浮上来」而不是
   只有卡片在动、标题杵在那里。 */
@keyframes titleIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-title.anim-ready {
    opacity: 0;
}
.page-title.is-in {
    animation: titleIn .34s ease-out both;
}

/* ---------- 5. 尊重「减少动态效果」----------
   系统开启该偏好时，一律退化为「瞬间到位」：
   不加动画、不留位移，但内容必须完整可见（opacity 强制为 1）。 */
@media (prefers-reduced-motion: reduce) {
    .note-card.anim-ready,
    .page-title.anim-ready,
    img.note-cover {
        opacity: 1;
        transform: none;
    }
    .note-card.is-in,
    .page-title.is-in,
    .note-likes svg,
    .note-likes.is-beat svg {
        animation: none;
    }
}


/* ================================================================================
   原版精修（全站前台）—— 与小红书网页版对齐的全局细节
   两条铁律：
   1. 颜色一律 var() 引用或中性灰，theme-*.css 七套主题换色不受影响；
   2. 只动观感不动结构，页面 HTML 零改动。
================================================================================ */

/* 桌面端滚动条：原版网页是细灰圆角条，浏览器默认的宽条太笨重。
   只在桌面媒体查询里生效；border+background-clip 让灰条两侧留出呼吸空隙。 */
@media (min-width: 769px) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.14); border-radius: 4px;
    border: 2px solid transparent; background-clip: content-box;
  }
  ::-webkit-scrollbar-thumb:hover { background-color: rgba(0,0,0,0.26); }
}
/* Firefox 走标准属性；特异性低于各处已有的 scrollbar-width:none，互不干扰 */
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.14) transparent; }

/* 文字选中色：品牌红的淡底，替代浏览器默认的蓝 */
::selection { background: rgba(255,36,66,0.15); color: var(--text); }

/* 触屏点按高亮：原版没有蓝色闪烁，统一去掉（交互反馈由 :active 样式承担） */
a, button, .note-card, .filter-item, .tab-item, .top-tab { -webkit-tap-highlight-color: transparent; }

/* 图片 hover 放大后的圆角保护：封面容器裁剪已加 overflow:hidden，
   这里给无图占位块同样的过渡，缩放观感一致 */
.note-cover { transition: transform 0.45s cubic-bezier(.22,.61,.36,1); }


/* ================================================================================
   桌面端原版布局（≥1024px）：左侧固定侧边栏 + 顶部搜索栏 + 多高度瀑布流
   —— 仿小红书官网电脑版
   断点与 note-app.css 的 App 版式分界（1023px）对齐：
     ≤768    移动端（navbar + 底部 tab，原有）
     769-1023 平板（navbar 桌面样式，原有）
     ≥1024   本区块：侧边栏接管导航，navbar 隐藏
   防护：body.admin-page（管理后台）与 body.feed-page（沉浸视频流）不走侧边栏。
   ================================================================================ */
.desk-sidebar, .desk-topbar, .back-to-top { display: none; }

@media (min-width: 1024px) {
  /* ---- 骨架：左侧栏 200px，navbar 让位 ---- */
  body:not(.admin-page):not(.feed-page) { padding-left: 200px; padding-bottom: 32px; }
  body:not(.admin-page) .navbar { display: none; }
  body:not(.admin-page) .container { max-width: 1240px; padding: 0 24px; }
  body:not(.admin-page) main.container { padding-top: 76px; }

  /* ---- 侧边栏 ---- */
  .desk-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 200px;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.05);
    padding: 16px 12px 12px;
    z-index: 95;
  }

  /* 红色 logo 胶囊：原版标志特征
     两种形态 ——
       .dsb-logo-pill               无 logo.webp：红底白字（默认兜底）
       .dsb-logo-pill.dsb-logo-img  有 logo.webp：去掉胶囊容器，直接呈现 logo 图
     为什么图片模式不用胶囊：logo 图自己就带形状和配色（小红书是红色圆角方块），
     再套一层白底圆角框会变成「白框套红块」，比不加容器更闷。
     原版左上角也是「logo 图形裸放」、没有额外容器。
     所以图片模式把底和边框都去掉，只约束一个最大尺寸，
     让 logo 按自身比例展示（宽度自适应，不拉伸）。 */
  .dsb-logo-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 108px; height: 40px;
    margin: 0 0 14px 8px;
    background: var(--primary);
    color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 2px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .dsb-logo-pill:hover { background: var(--primary-dark); }
  /* 有 logo.webp：裸放，不套容器 */
  .dsb-logo-pill.dsb-logo-img {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    /* 关键三点：
       ① width:auto + align-self:flex-start —— 否则在 flex 列容器里会被拉满宽，
          再被基类的 justify-content:center 把图片居中，logo 就漂到中间去了；
       ② 去掉 justify-content 的居中，改成靠左起排；
       ③ margin-left 补 12px，和侧边栏 padding 12px 相加 = 24px，
          正好对齐下方菜单项的图标左缘（12+12）。 */
    width: auto; min-width: 0;
    align-self: flex-start;
    justify-content: flex-start;
    margin-left: 12px;
  }
  .dsb-logo-pill.dsb-logo-img:hover { background: transparent; opacity: 0.85; }
  .dsb-logo-pill.dsb-logo-img img {
    height: 40px; width: auto;
    /* 上限取侧边栏可用宽度（200 − 12 左 − 12 右 = 176），
       防止横版长 logo 溢出侧边栏；纵向 logo 由 height:40px 约束。 */
    max-width: 176px;
    object-fit: contain;
    display: block;
  }

  /* 菜单项：图标 + 文字，原版是「图标20px + 15px文字」、行高约48 */
  .dsb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .dsb-item {
    display: flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 12px;
    border-radius: 10px;
    font-size: 15px; font-weight: 500; color: var(--text);
    text-decoration: none; position: relative;
    border: none; background: none; width: 100%;
    cursor: pointer; font-family: inherit; text-align: left;
    transition: background 0.15s;
  }
  .dsb-item svg { width: 20px; height: 20px; flex-shrink: 0; }
  .dsb-item:hover { background: rgba(0,0,0,0.04); }
  .dsb-item.active { font-weight: 600; }
  .dsb-item.active::before {
    content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 18px; border-radius: 2px; background: var(--primary);
  }
  .dsb-badge {
    margin-left: auto;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--primary); color: #fff;
    border-radius: 9px; font-size: 11px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* 底部：登录按钮 / 用户区 + 更多/下载 */
  .dsb-bottom { display: flex; flex-direction: column; gap: 2px; }
  .dsb-login-btn {
    display: flex; align-items: center; justify-content: center;
    height: 44px; margin: 0 4px 10px;
    background: var(--primary); color: #fff;
    font-size: 16px; font-weight: 600;
    border-radius: 22px;
    transition: background 0.2s;
  }
  .dsb-login-btn:hover { background: var(--primary-dark); }
  .dsb-user { margin: 0 0 8px; padding: 8px 10px; background: #f5f5f5; }
  /* 用户区在侧边栏底部，下拉菜单向上展开 */
  .dropdown-content-up { top: auto; bottom: calc(100% + 8px); right: 0; }

  /* ---- 顶栏：搜索胶囊居中 + 右侧链接 ---- */
  .desk-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 200px; right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0 24px;
    z-index: 95;
  }
  .dtb-search {
    display: flex; align-items: center;
    width: min(420px, 48%); height: 40px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 0 6px 0 18px;
    border: 1px solid transparent;
    transition: var(--transition);
  }
  .dtb-search:focus-within { background: #fff; border-color: #d9d9d9; }
  .dtb-search input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 14px; color: var(--text); min-width: 0;
  }
  .dtb-search input::placeholder { color: #aaa; }
  .dtb-search-btn {
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.06); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #666; flex-shrink: 0;
    transition: background 0.15s;
  }
  .dtb-search-btn:hover { background: rgba(0,0,0,0.12); }
  .dtb-search-btn svg { width: 15px; height: 15px; }
  .dtb-links { display: flex; align-items: center; gap: 20px; }
  .dtb-links a, .dtb-links button {
    font-size: 14px; color: var(--text-secondary); text-decoration: none;
    background: none; border: none; cursor: pointer; font-family: inherit; padding: 0;
    transition: color 0.15s;
  }
  .dtb-links a:hover, .dtb-links button:hover { color: var(--primary); }

  /* ---- 分类 tab：桌面端只保留「全部/美妆/穿搭…」这一行纯文字 ----
     index.php 里上面那行「发现/关注/视频/最新」（.top-tabs）在桌面端隐藏，
     职能交给左侧栏菜单，避免和这行分类上下重复（原版只有一行）。
     用 .desk-hide 而不是直接 .top-tabs，是为了不影响其它页面可能复用的同类结构。 */
  .top-tabs.desk-hide { display: none; }

  body:not(.admin-page) .category-filter {
    gap: 4px; margin: 0 0 8px; padding: 0;
    border-bottom: none;
  }
  body:not(.admin-page) .filter-item {
    background: transparent; border: none; min-width: 0; height: auto;
    padding: 6px 10px; border-radius: 8px;
    font-size: 15px; font-weight: 500; color: var(--text-secondary);
  }
  body:not(.admin-page) .filter-item:hover { border-color: transparent; color: var(--text); background: rgba(0,0,0,0.03); }
  body:not(.admin-page) .filter-item.active {
    background: transparent; color: var(--text); font-weight: 600; border-color: transparent;
  }

  /* ---- 瀑布流：4 列多高度、卡片无白底（原版网页版最大特征） ----
     CSS columns 方案：视觉即瀑布流（顺序是列优先，对「随机发现」无感知差异）。
     column-gap 取 16px，容器 1240-48=1192 → 每列 (1192-48)/4 = 286px，整除无残留。
     卡片去白底：封面图圆角直接露出，标题/作者行落在浅灰页面底上。 */
  .notes-grid {
    display: block;
    columns: 4;
    column-gap: 16px;
    column-fill: balance;
    margin-top: 12px;
  }
  .note-card {
    display: block;
    break-inside: avoid;
    /* 老浏览器兜底：不给 columns 用的内联切割 */
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 16px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .note-card:hover { transform: none; box-shadow: none; }
  .note-card a { display: block; text-decoration: none; color: inherit; }
  .note-cover-wrapper { border-radius: 12px; overflow: hidden; }
  /* 封面保持原始比例（多高度瀑布流的关键）；有背景图就按容器比例铺满。
     注意顺序：img 显式 auto，占位 div 必须放后面覆盖成 3:4，否则占位块会塌成 0 高。 */
  .note-cover { border-radius: 12px; }
  img.note-cover { width: 100%; height: auto; aspect-ratio: auto; object-fit: cover; }
  .note-cover-wrapper > .note-cover:not(img) { aspect-ratio: 3 / 4; height: auto; width: 100%; }
  /* 无白底：正文区直接落在页面底色上 */
  .note-body { padding: 10px 2px 2px; }
  .note-title { margin-bottom: 6px; }

  /* 底部横幅、分页等非卡片元素不要被卷进 columns */
  body:not(.admin-page) .notes-grid > .banner,
  body:not(.admin-page) .notes-grid > .banner-item { column-span: all; }

  /* 分页导航独占一行 */
  body:not(.admin-page) .pagination { column-span: all; }

  /* ---- 回到顶部（右下角圆按钮，原版右下角控件组位置） ---- */
  .back-to-top {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 24px; bottom: 24px; z-index: 90;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, box-shadow 0.15s;
  }
  .back-to-top.show { opacity: 1; visibility: visible; }
  .back-to-top:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.14); }
  .back-to-top svg { width: 20px; height: 20px; color: #666; }
}
