/*!
 * 万能墙（lhuiye.cn） — SPDX-License-Identifier: LicenseRef-Proprietary
 * Copyright (c) 2026 辉夜 <18759765356@163.com> 保留所有权利
 * 第三方组件保留各自许可（见 THIRD_PARTY_NOTICES.md）
 */
/* ============================================================================
 * 全站 UI 打磨层（ui_polish.css）
 * ----------------------------------------------------------------------------
 * 定位：**只做加法**的统一样式层，由 inc/device_css.php 在全站 <head> 统一引入
 *      （紧跟 app.css / mobile.css / desktop.css 之后，所以同权重下它会胜出）。
 *
 * 设计目标（不改变任何页面结构与 JS 行为）：
 *   1) 统一视觉语言：圆角、阴影、间距、层级、动效节奏；
 *   2) 可读性优先：正文行高 1.75、弱化文字对比度提到 4.5:1 以上、长串自动换行；
 *   3) 交互反馈：hover / active / focus-visible 三态齐全，键盘可见焦点；
 *   4) 手机优先：可点区域 ≥44px、FAB 与底部导航不打架、安全区留白；
 *   5) 尊重系统偏好：prefers-reduced-motion 关闭动效。
 *
 * 注意：新拟态主题（body.scheme-neo）已有自己的卡片阴影/圆角，本文件对"卡片外观"
 *      的部分只作用于非 neo 主题，避免互相覆盖；间距、排版、交互反馈对两套主题通用。
 * ========================================================================== */

/* ---------------------------------------------------------------- 设计变量 */
:root {
    --ui-radius: 16px;                 /* 由页面内联脚本按用户偏好覆盖 */
    --ui-radius-lg: var(--ui-radius);
    --ui-radius-md: calc(var(--ui-radius) * 0.75);
    --ui-radius-sm: calc(var(--ui-radius) * 0.5);
    --ui-gap: 14px;
    --ui-gap-sm: 10px;
    --ui-line: rgba(var(--primary-rgb, 126, 87, 194), 0.16);
    --ui-line-soft: rgba(var(--primary-rgb, 126, 87, 194), 0.09);
    --ui-muted: #5b6b7f;               /* 比原来的 #9ca3af 更深，保证 4.5:1 对比度 */
    --ui-muted-soft: #7b8a9c;
    --ui-surface: rgba(255, 255, 255, 0.92);
    --ui-surface-2: rgba(255, 255, 255, 0.72);
    --ui-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 18px rgba(15, 23, 42, 0.06);
    --ui-shadow-2: 0 10px 30px rgba(15, 23, 42, 0.10);
    --ui-shadow-press: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    --ui-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------------------------------------------- 基础排版 */
html { scroll-behavior: smooth; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
/* 长串（网址、连续英文）不撑破卡片 */
.post-card, .card, .profile-card, .comment-item, .msg-content, .ct-cm-text, .card-body {
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* 正文行高与段落间距：阅读更舒服 */
.post-content, .comment-content, .msg-content, .ct-cm-text, .card p, .md-body p {
    line-height: 1.78;
}
/* 弱化文字统一提亮对比度（Tailwind 的 gray-400/500 在浅底上偏浅） */
.text-gray-400 { color: #7b8a9c !important; }
.text-gray-500 { color: #5b6b7f !important; }
.text-gray-300 { color: #94a3b8 !important; }
/* 图片统一圆角与防溢出 */
.post-content img, .comment-content img, .msg-content img { max-width: 100%; height: auto; border-radius: var(--ui-radius-sm); }

/* 选中态与滚动条（细节但明显提升"精致度"） */
::selection { background: rgba(var(--primary-rgb, 126, 87, 194), 0.22); }
* { scrollbar-width: thin; scrollbar-color: rgba(var(--primary-rgb, 126, 87, 194), 0.35) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--primary-rgb, 126, 87, 194), 0.45); background-clip: content-box; }

/* ---------------------------------------------------------------- 无障碍 */
/* 键盘可见焦点（鼠标点击不出现，键盘 Tab 才出现） */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible, .pill:focus-visible {
    outline: 2px solid var(--primary, #7e57c2);
    outline-offset: 2px;
    border-radius: var(--ui-radius-sm);
}
/* 可点区域最小值（手机端尤其重要） */
@media (max-width: 767px) {
    .like-btn, .coin-btn, .comment-entry, .report-btn, .del-own-comment,
    .nav-item, .ad-nav-item, .nav-sheet-item {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }
    .like-btn, .coin-btn, .comment-entry, .report-btn { padding: 4px 6px; margin: -4px -2px; }
}
/* 触摸高亮统一（避免安卓上出现难看的蓝框） */
a, button, .media-item, .comment-item { -webkit-tap-highlight-color: rgba(var(--primary-rgb, 126, 87, 194), 0.12); }

/* ------------------------------------------------------- 统一卡片外观（非 neo） */
body:not(.scheme-neo) .post-card,
body:not(.scheme-neo) .card,
body:not(.scheme-neo) .profile-card,
body:not(.scheme-neo) .ct-plan,
body:not(.scheme-neo) .rk-card,
body:not(.scheme-neo) .ctm-head {
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-line-soft);
    box-shadow: var(--ui-shadow-1);
}
/* 可点卡片才有悬浮反馈（纯展示卡片抬起来反而干扰阅读） */
body:not(.scheme-neo) .post-card,
body:not(.scheme-neo) a.card,
body:not(.scheme-neo) .ct-plan:hover {
    transition: transform 0.28s var(--ui-ease), box-shadow 0.28s var(--ui-ease), border-color 0.28s var(--ui-ease);
}
body:not(.scheme-neo) .post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ui-shadow-2);
    border-color: var(--ui-line);
}
.post-card:active { transform: translateY(-1px) scale(0.998); }

/* 卡片头部：标题更醒目、与内容留白统一 */
.card > .card-header, .card-header {
    font-weight: 700;
    letter-spacing: 0.01em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ui-line-soft);
    margin-bottom: var(--ui-gap);
}
.card h2, .card > h2 { letter-spacing: 0.01em; }

/* --------------------------------------------------------------- 帖子卡片 */
.pc-head { gap: 12px; }
.pc-head .avatar { flex: 0 0 auto; }
/* 昵称行：徽章不换行、昵称过长省略 */
.pc-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    font-weight: 650;
}
.pc-name > .pc-nick {
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pc-meta { color: var(--ui-muted); font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.pc-meta i { opacity: 0.75; }

/* 正文：首行略缩进更利于扫读；"点击查看全文"做成按钮感 */
.pc-content { font-size: 0.98rem; color: #334155; }
.pc-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.10);
    color: var(--primary, #7e57c2) !important;
    transition: background 0.2s var(--ui-ease), transform 0.2s var(--ui-ease);
}
.pc-more:hover { background: rgba(var(--primary-rgb, 126, 87, 194), 0.18); transform: translateX(2px); }

/* 媒体九宫格：按张数自适应（1 张大图 / 2 张两列 / ≥3 张三列），悬浮轻微放大 */
.pc-media { margin: 12px 0 14px; }
.pc-media[data-count="1"] { grid-template-columns: 1fr; }
.pc-media[data-count="1"] .media-item { aspect-ratio: 4 / 3; max-height: 420px; }
.pc-media[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.pc-media[data-count="1"] .media-item img,
.pc-media[data-count="1"] .media-item video { object-fit: cover; }
.media-item { transition: transform 0.25s var(--ui-ease), box-shadow 0.25s var(--ui-ease); }
.media-item:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--ui-shadow-2); }
.media-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    pointer-events: none;
}

/* 操作栏：把点赞/投币/评论/举报做成等距圆角按钮，命中率更高 */
.pc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.pc-actions > .like-btn,
.pc-actions > .coin-btn,
.pc-actions > .comment-entry,
.pc-actions > .report-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.06);
    border: 1px solid transparent;
    font-size: 0.86rem;
    transition: background 0.2s var(--ui-ease), color 0.2s var(--ui-ease), transform 0.15s var(--ui-ease);
}
.pc-actions > .like-btn:hover,
.pc-actions > .coin-btn:hover,
.pc-actions > .comment-entry:hover,
.pc-actions > .report-btn:hover {
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.13);
    transform: translateY(-1px);
}
.pc-actions > .like-btn:active,
.pc-actions > .coin-btn:active,
.pc-actions > .comment-entry:active,
.pc-actions > .report-btn:active { transform: scale(0.96); box-shadow: var(--ui-shadow-press); }
.pc-actions > .like-btn[disabled],
.pc-actions > .coin-btn[data-done="1"] { opacity: 0.85; cursor: default; }

/* 评论预览：左侧主题色描边 + 楼层徽章统一 */
.pc-comments { border-top: 1px dashed var(--ui-line) !important; padding-top: 12px !important; }
.pc-comments .comment-item {
    border-radius: var(--ui-radius-md);
    padding: 10px 12px !important;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.05);
    transition: background 0.2s var(--ui-ease);
}
.pc-comments .comment-item:hover { background: rgba(var(--primary-rgb, 126, 87, 194), 0.10); }
.pc-floor {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.14);
    color: var(--primary, #7e57c2);
}
.pc-comments-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* 话题标签、置顶徽章：统一胶囊质感 */
.tag, .pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: transform 0.2s var(--ui-ease), box-shadow 0.2s var(--ui-ease);
}
.tag:hover { transform: translateY(-1px); }

/* ------------------------------------------------------- 顶部栏（滚动状态）
 * 两个问题一起修：
 *   ① 以前首页用内联 `background: transparent !important` 把顶栏压成永久透明，
 *      帖子滚到顶栏下面时会和按钮/搜索框**叠在一起**（看不清、很乱）——现在顶栏始终不透明；
 *   ② 顶栏在手机上曾高达 132px（品牌行 + 搜索行 + 一排按钮），滚动时占掉小半屏、观感很挤——
 *      现在压到约 65px，并且「贴顶无阴影、滚动后才出现细描边 + 轻阴影」，边界干净不抢内容。
 * 注意：app.css 里有全局 `*{backdrop-filter:none!important}`（站长为省性能全局禁用毛玻璃），
 *      所以这里不再依赖毛玻璃，直接用主题面色 + 描边/阴影做层次。 */
.site-header {
    background: var(--neo-surface, #ffffff);   /* 始终不透明：任何主题/模式都不会透出帖子 */
    border-bottom: 1px solid transparent;
    transition: box-shadow 0.25s var(--ui-ease), border-color 0.25s var(--ui-ease);
}
/* 顶部：干净，不要浮层阴影 */
.site-header:not(.is-scrolled) {
    box-shadow: none !important;
    border-bottom-color: transparent !important;
}
/* 滚动后：一条细描边 + 轻阴影，明确"内容从下面过" */
.site-header.is-scrolled {
    background: var(--neo-surface, #ffffff) !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08) !important;
    border-bottom-color: rgba(15, 23, 42, 0.06) !important;
}
/* 顶栏紧凑化：滚动时占屏更少，内容区可用高度更多
 * 说明：这里不改用 Tailwind 的响应式工具类（md:px-4 / md:text-2xl 之类），
 *       因为 tailwind.purged.css 是按站点实际用到的类裁剪出来的，新增工具类会导致
 *       "页面用到的图标/类未覆盖" 的审计失败；顶栏这几处响应式样式直接写在这里最稳。 */
.site-header-inner { padding-top: 10px; padding-bottom: 10px; }
/* 站点名永远不能被挤没：给品牌区一个"要得到"的基础宽度（11rem），
 * 一行放不下时让操作按钮换行，而不是把名字压缩到看不见（站长反馈过"首页看不到网站名字"）。 */
.site-header .site-brand { flex: 1 1 11rem; min-width: 0; }
.site-header .site-actions { order: 2; gap: 8px; flex: 0 0 auto; }
.site-header .site-search { min-width: 0; order: 3; }
.site-header .site-chip { padding: 6px 12px; }
/* 顶栏「硬币商城」入口：金色强调，与其它白色功能入口形成区分。
 * 用 .site-header .site-chip.site-chip-shop（三选器）压过 Tailwind 的 bg-white/80 与 hover:bg-gray-50（同为两选器但顺序更早）。 */
.site-header .site-chip.site-chip-shop {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, .35);
}
.site-header .site-chip.site-chip-shop:hover { background: linear-gradient(135deg, #fbbf24, #fb923c); }
.site-header .site-chip.site-chip-shop > i { color: #fff; }
.site-chip-coin {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, .24);
    border-radius: 999px;
    padding: 0 7px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.75;
    font-variant-numeric: tabular-nums;
    color: #fff;
}
.site-chip-coin i { font-size: 0.66rem; color: #fff2c9; }
@media (max-width: 767px) {
    .site-header .site-chip.site-chip-shop { padding: 6px 10px; }
}
/* 站点名：用纯主题色，**不再用「渐变文字」**（bg-clip-text + text-transparent）。
 * 渐变文字依赖 background-image 生效：极速模式会把渐变替换成纯色、部分封装壳/老内核根本不给渐变，
 * 这时透明填充 = 名字直接看不见（站长反馈"首页顶栏没有网站名字"就是这个）。纯色任何模式都稳。 */
.site-header .site-title {
    font-size: 1.125rem;
    line-height: 1.6rem;
    color: var(--primary, #059669);
    -webkit-text-fill-color: currentColor;
}
@media (min-width: 768px) {
    .site-header .site-search { order: 0; width: 16rem; flex: 0 0 auto; }
    .site-header .site-actions { gap: 12px; margin-left: auto; }
    .site-header .site-chip { padding: 8px 16px; }
    .site-header .site-title { font-size: 1.5rem; line-height: 2rem; }
}
@media (max-width: 767px) {
    .site-header-inner { padding-top: 6px; padding-bottom: 6px; }
    .site-header-row { gap: 6px 8px; }
    .site-header .site-actions { gap: 6px; }
    .site-header .site-search input { font-size: 16px; }   /* 防 iOS 聚焦缩放 */
}
/* 顶部搜索框：更柔和的描边与聚焦反馈 */
.site-header input[type="text"],
.site-header input[type="search"] {
    background: rgba(255, 255, 255, 0.9);
    transition: box-shadow 0.2s var(--ui-ease), border-color 0.2s var(--ui-ease);
}
.site-header input[type="text"]:focus,
.site-header input[type="search"]:focus {
    border-color: rgba(var(--primary-rgb, 126, 87, 194), 0.45);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 126, 87, 194), 0.12);
    outline: none;
}
/* 吸顶锚点偏移（站内跳转不被顶栏遮住） */
:target, .md-body h1, .md-body h2, .md-body h3 { scroll-margin-top: 84px; }

/* --------------------------------------------------------------- 筛选胶囊 */
.pill-group, .rk-tabs, .ct-tabs { gap: 8px; }
.pill-group > a, .rk-tab, .ct-tab { transition: transform 0.2s var(--ui-ease), box-shadow 0.2s var(--ui-ease), background 0.2s var(--ui-ease); }
.pill-group > a:hover, .rk-tab:hover, .ct-tab:hover { transform: translateY(-1px); }

/* --------------------------------------------------------------- 输入与按钮 */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select, .form-input {
    transition: box-shadow 0.2s var(--ui-ease), border-color 0.2s var(--ui-ease), background 0.2s var(--ui-ease);
}
input:focus, textarea:focus, select:focus {
    border-color: rgba(var(--primary-rgb, 126, 87, 194), 0.45);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 126, 87, 194), 0.12);
}
.gradient-btn, .btn-primary {
    transition: transform 0.18s var(--ui-ease), box-shadow 0.18s var(--ui-ease), filter 0.18s var(--ui-ease);
    box-shadow: 0 6px 18px rgba(var(--primary-rgb, 126, 87, 194), 0.28);
}
.gradient-btn:hover, .btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.gradient-btn:active, .btn-primary:active { transform: translateY(0); box-shadow: var(--ui-shadow-press); }
.gradient-btn[disabled], .btn[disabled], button[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* --------------------------------------------------------------- 列表与表格 */
/* 列表行统一：hover 轻微高亮 + 分割线更柔 */
.rk-row, .msg-item, .ct-cm-item, .cm-item, .comment-item {
    transition: background 0.18s var(--ui-ease);
}
.rk-row:hover, .ct-cm-item:hover { background: rgba(var(--primary-rgb, 126, 87, 194), 0.05); }
.ct-plan-table th { font-weight: 700; }
.ct-plan-table tbody tr { transition: background 0.18s var(--ui-ease); }

/* --------------------------------------------------------- 空状态 / 骨架屏 */
.ui-empty {
    text-align: center;
    padding: 44px 18px;
    color: var(--ui-muted);
    line-height: 1.9;
}
.ui-empty .ui-empty-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; opacity: 0.85; }
.ui-skeleton { display: flex; flex-direction: column; gap: var(--ui-gap); }
.ui-skeleton-card {
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    border: 1px solid var(--ui-line-soft);
    padding: 18px;
}
.ui-skeleton-line, .ui-skeleton-avatar, .ui-skeleton-media {
    background: linear-gradient(90deg,
        rgba(var(--primary-rgb, 126, 87, 194), 0.07) 25%,
        rgba(var(--primary-rgb, 126, 87, 194), 0.16) 37%,
        rgba(var(--primary-rgb, 126, 87, 194), 0.07) 63%);
    background-size: 400% 100%;
    animation: ui-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--ui-radius-sm);
}
.ui-skeleton-line { height: 12px; margin-bottom: 10px; }
.ui-skeleton-line.w60 { width: 60%; }
.ui-skeleton-line.w40 { width: 40%; }
.ui-skeleton-line.w85 { width: 85%; }
.ui-skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; }
.ui-skeleton-media { height: 140px; margin-top: 12px; border-radius: var(--ui-radius-md); }
@keyframes ui-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* --------------------------------------------------------------- 回到顶部 */
.ui-to-top {
    position: fixed;
    right: 18px;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-line);
    border-radius: 50%;
    background: var(--ui-surface);
    color: var(--primary, #7e57c2);
    box-shadow: var(--ui-shadow-1);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s var(--ui-ease), transform 0.25s var(--ui-ease), visibility 0.25s;
    z-index: 900;
}
.ui-to-top.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.ui-to-top:hover { background: #fff; box-shadow: var(--ui-shadow-2); }
@media (min-width: 768px) { .ui-to-top { right: 28px; bottom: 108px; width: 46px; height: 46px; } }
/* 【避让悬浮发布按钮】页面存在 .fab-btn（首页/法庭/趣事/风纪…）时，
 * 「回到顶部」必须让开它 —— 两者原来都贴在右下角同一位置，在手机上完全重叠。
 * 规则：同一条右边线（两钮圆心对齐）、上下堆叠，回到顶部在发布按钮正上方 12px。
 * 手机：fab-btn = right 16 / bottom 84 / 54px  →  回到顶部 44px：right 21、bottom 150。
 * 桌面：fab-btn = right 30 / bottom 30 / 60px  →  回到顶部 46px：right 37、bottom 104。 */
.ui-to-top.has-fab {
    right: 21px;
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) {
    .ui-to-top.has-fab { right: 37px; bottom: 104px; }
}

/* --------------------------------------------------------------- 手机优化 */
@media (max-width: 767px) {
    :root { --ui-gap: 12px; }
    .post-card { padding: 16px 14px !important; }
    .pc-actions { gap: 4px; }
    .pc-actions > .like-btn, .pc-actions > .coin-btn,
    .pc-actions > .comment-entry, .pc-actions > .report-btn { padding: 6px 10px; font-size: 0.82rem; }
    .pc-name > .pc-nick { max-width: 52%; }
    /* 悬浮发布按钮让开底部导航与安全区 */
    .fab-btn { bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; right: 16px !important; width: 54px !important; height: 54px !important; }
    /* 正文与评论字号略提，减少"字太小看不清" */
    .post-content, .pc-content { font-size: 1rem; }
    .comment-content, .pc-comments .comment-item { font-size: 0.95rem; }
    body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
/* 小屏下表格横向滚动更顺手（含滚动提示阴影） */
.card table { border-radius: var(--ui-radius-sm); }
div[style*="overflow-x:auto"], .adm-table-wrap, .ct-plan-table-wrap { scrollbar-width: thin; }

/* --------------------------------------------------------------- 动效偏好 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .post-card:hover, .media-item:hover, .gradient-btn:hover { transform: none !important; }
}

/* 打印：去掉阴影与悬浮按钮，正文更省墨 */
@media print {
    .site-header, .fab-btn, .ui-to-top, .bottom-nav, .nav-sheet, .nav-sheet-mask, .site-loader { display: none !important; }
    .post-card, .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    body { background: #fff !important; }
}

/* ============================================================================
 * 模块组件统一（必吃榜 / 趣事 / 豪王榜 / 集市 / 聊天室 / 个人中心）
 * ----------------------------------------------------------------------------
 * 这些页面各自的卡片类名不同，这里统一"圆角 + 描边 + 阴影 + 悬浮反馈 + 标题层级"，
 * 让全站看起来是同一套设计语言；只调外观，不动布局尺寸。
 * ========================================================================== */

/* ---- 列表卡片通用 ---- */
.food-card, .shop-card, .event-card, .hero-card, .listing-card, .room-card, .msg-card {
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-line-soft);
    box-shadow: var(--ui-shadow-1);
    transition: transform 0.26s var(--ui-ease), box-shadow 0.26s var(--ui-ease), border-color 0.26s var(--ui-ease);
    overflow: hidden;
}
body:not(.scheme-neo) .food-card:hover,
body:not(.scheme-neo) .shop-card:hover,
body:not(.scheme-neo) .event-card:hover,
body:not(.scheme-neo) .hero-card:hover,
body:not(.scheme-neo) .listing-card:hover,
body:not(.scheme-neo) .room-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ui-shadow-2);
    border-color: var(--ui-line);
}
.food-card:active, .shop-card:active, .event-card:active, .hero-card:active,
.listing-card:active, .room-card:active { transform: translateY(-1px) scale(0.997); }

/* 卡片主图统一比例与圆角（避免各页图片高低不一） */
.event-banner img, .listing-card img, .shop-img, .hero-photo, .room-avatar img {
    border-radius: var(--ui-radius-md);
}
.event-banner img, .shop-img img { transition: transform 0.3s var(--ui-ease); }
.event-card:hover .event-banner img, .shop-card:hover .shop-img img { transform: scale(1.03); }

/* 卡片内标题 / 元信息层级统一 */
.event-name, .listing-name, .shop-name, .hero-name, .room-name {
    letter-spacing: 0.01em;
    font-weight: 700;
}
.event-meta, .event-foot, .listing-foot, .hero-foot, .room-meta, .shop-addr, .food-meta {
    color: var(--ui-muted);
    font-size: 0.82rem;
    line-height: 1.7;
}
.event-desc, .listing-desc, .hero-deeds, .shop-desc, .food-desc {
    line-height: 1.78;
    color: #334155;
}

/* ---- 页面级标题区（"hero" 头部） ---- */
.hero {
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-line-soft);
    box-shadow: var(--ui-shadow-1);
}
.hero h1 { letter-spacing: 0.01em; }
.hero-stats > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.08);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ui-muted);
}

/* ---- 聊天室 ---- */
.room-card { display: flex; align-items: center; }
.msg-bubble {
    border-radius: var(--ui-radius-md);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    line-height: 1.7;
}
.msg.mine .msg-bubble { box-shadow: 0 1px 2px rgba(var(--primary-rgb, 126, 87, 194), 0.18); }
.room-badge, .msg-badge, .ct-cm-count, .rk-no {
    font-variant-numeric: tabular-nums;
}

/* ---- 个人中心 ---- */
.profile-card { border-radius: var(--ui-radius-lg); }
.stats, .stat-item, .stat-card {
    border-radius: var(--ui-radius-md);
    transition: transform 0.22s var(--ui-ease), box-shadow 0.22s var(--ui-ease);
}
.stat-item:hover, .stat-card:hover { transform: translateY(-2px); }

/* ---- 详情页评论 / 留言统一 ---- */
.comment-item, .msg-item, .cm-item {
    border-radius: var(--ui-radius-md);
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.05);
    padding: 12px 14px;
    margin-bottom: 10px;
}
.comment-item .comment-nick, .msg-nick, .ct-cm-nick { font-weight: 650; }
.comment-item .comment-time, .msg-time, .ct-cm-time { color: var(--ui-muted-soft); font-size: 0.76rem; }

/* ---- 数字统一等宽（排行榜 / 票数 / 硬币，避免跳动） ---- */
.rk-val, .ct-detail-stats b, .coin-count, .like-count, .stat-value, .scd-cell b {
    font-variant-numeric: tabular-nums;
}

/* ---- 表格（后台与前台通用） ---- */
table { font-variant-numeric: tabular-nums; }
.adm-table tbody tr:hover, .ct-plan-table tbody tr:hover { background: rgba(var(--primary-rgb, 126, 87, 194), 0.045); }

/* ============================================================================
 * 首页专属打磨（信息流容器 / 评比入口卡 / 开学倒计时 / 加载与空状态）
 * ========================================================================== */

/* 信息流：卡片间距随屏幕自适应，首屏更紧凑 */
#postsContainer { display: flex; flex-direction: column; gap: var(--ui-gap); }
@media (min-width: 768px) { #postsContainer { gap: 18px; } }

/* 校草校花入口卡：一条更"可点"的横幅 */
.contest-pin {
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-line-soft);
    box-shadow: var(--ui-shadow-1);
    transition: transform 0.26s var(--ui-ease), box-shadow 0.26s var(--ui-ease);
}
.contest-pin:hover { transform: translateY(-2px); box-shadow: var(--ui-shadow-2); }
.contest-pin-title { letter-spacing: 0.01em; }
.contest-pin-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.14);
    color: var(--primary, #7e57c2);
}
.contest-pin-arrow { transition: transform 0.26s var(--ui-ease); }
.contest-pin:hover .contest-pin-arrow { transform: translateX(3px); }

/* 开学倒计时：数字等宽、格子统一 */
.school-countdown {
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-line-soft);
    box-shadow: var(--ui-shadow-1);
}
.scd-cell {
    border-radius: var(--ui-radius-md);
    transition: transform 0.2s var(--ui-ease);
}
.scd-cell b { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.scd-label { letter-spacing: 0.02em; }

/* 加载 / 空状态更友好 */
#loadingIndicator { color: var(--ui-muted); font-size: 0.9rem; }
#noMoreIndicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb, 126, 87, 194), 0.07);
    color: var(--ui-muted);
}
#noMoreIndicator::before, #noMoreIndicator::after {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--ui-line);
}
#emptyIndicator .ui-empty-icon, #emptyIndicator i { opacity: 0.9; }

/* 页面级容器：统一左右留白，窄屏不贴边 */
@media (max-width: 480px) {
    .max-w-4xl { padding-left: 14px; padding-right: 14px; }
}

/* ==================== 【评论区优化】信息流评论预览 ==================== */
.pc-cmt-row { display: flex; gap: 8px; align-items: flex-start; }
.pc-cmt-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 26px; background: #f1f5f9; }
.pc-cmt-av.is-text {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; user-select: none;
}
.pc-cmt-main { flex: 1; min-width: 0; }
.pc-cmt-like { margin-left: 6px; font-size: 11.5px; color: #ef4444; }
.pc-cmt-at { color: var(--primary, #7e57c2); font-weight: 600; }
.pc-comments .comment-item.pc-cmt { background: rgba(0, 0, 0, .015); border-radius: 10px; }
html[data-perf="lite"] .pc-cmt-av { border-radius: 6px; }

/* ==================== 【评论区优化】趣事 / 必吃 / 豪王 留言区的统一观感 ====================
   这几个模块的评论结构各自独立（comment-item / msg-item），这里只做"视觉与触控"层面的统一：
   圆角卡片、头像色块、楼层与时间层级、移动端大触控目标；交互（点赞/回复）在帖子评论区实现。
*/
.comment-item, .msg-item { border-radius: var(--ui-radius-sm, 12px); }
.comment-item { padding: 12px; }
.comment-item + .comment-item, .msg-item + .msg-item { border-top: 1px solid rgba(0, 0, 0, .05); }
.comment-item:hover, .msg-item:hover { background: rgba(var(--primary-rgb, 126, 87, 194), .03); }
.comment-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--primary, #7e57c2), var(--secondary, #ba68c8));
  color: #fff; font-weight: 700; font-size: 14px; user-select: none;
}
.comment-head, .msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-head .comment-nick, .msg-nick { font-weight: 600; color: #334155; }
.comment-time, .msg-time { font-size: 11.5px; color: #a0aec0; }
.comment-body .comment-content, .msg-content { font-size: 14px; line-height: 1.75; color: #374151; word-break: break-word; }
.comment-form textarea, .msg-input {
  border-radius: var(--ui-radius-sm, 12px) !important;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.comment-form textarea:focus, .msg-input:focus {
  outline: none; border-color: var(--primary, #7e57c2) !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 126, 87, 194), .14);
}
.comment-submit, .msg-send-btn { min-height: 40px; border-radius: 999px !important; font-weight: 600; }
.comment-submit:disabled, .msg-send-btn:disabled { opacity: .6; cursor: default; }
.empty-comments, .msg-empty { text-align: center; color: #a0aec0; padding: 26px 0; font-size: 13.5px; }
.empty-comments .big { display: block; font-size: 30px; margin-bottom: 6px; }
@media (max-width: 767px) {
  .comment-item, .msg-item { padding: 11px 9px; }
  .comment-submit, .msg-send-btn { min-height: 44px; }
}
html[data-perf="lite"] .comment-item, html[data-perf="lite"] .msg-item { transition: none !important; }
