/* 泰州回音堂 - 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f0e8;
    color: #3a3226;
    line-height: 1.7;
}
a { color: #8b4513; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0; border-bottom: 2px solid #d4c5a9;
    margin-bottom: 20px;
}
.logo {
    font-size: 24px; font-weight: bold; color: #5c3d1a;
    text-decoration: none; letter-spacing: 2px;
}
.logo:hover { text-decoration: none; }
.header-right { display: flex; gap: 12px; align-items: center; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #d4c5a9; }
.user-info { font-size: 14px; color: #5c3d1a; }

/* Layout */
.main-layout { display: grid; grid-template-columns: 180px 1fr 200px; gap: 24px; }
.main-layout > * { min-width: 0; }

/* 顶栏 slogan（公共 header 用，原 index.php 内联样式公共化） */
.slogan{font-size:12px;color:#8b7355;font-family:'KaiTi','STKaiti',serif}
@media(min-width:768px){.slogan{font-size:15px;letter-spacing:2px}}
@media(max-width:767px){.header-right{gap:4px}.header-right a{font-size:11px}.user-info{font-size:12px;max-width:80px}}

/* Sidebar */
.sidebar {
    align-self: start;
    position: sticky; top: 16px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.sidebar-title { font-weight: bold; margin-bottom: 8px; color: #5c3d1a; padding-left: 10px; }
.board-link {
    display: block; padding: 6px 10px; border-radius: 6px;
    margin-bottom: 2px; transition: background .2s;
    text-decoration: none;
}
.board-link:hover { background: #e8dcca; text-decoration: none; }
.board-link.active { background: #d4c5a9; font-weight: bold; }
/* 侧边栏图标统一宽度，右侧文字左对齐 */
.board-link .sb-ico, .sidebar-title .sb-ico {
    display: inline-block; width: 22px; margin-right: 6px; text-align: center;
}
/* 🔴 2026.8.9 频道LOGO（七牛 logos/）：侧边栏/FAB/频道头统一圆形小图标 */
.board-link .sb-ico img, .sidebar-title .sb-ico img, .fab-icon img {
    width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: -4px; display: inline-block;
}
.ch-logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; vertical-align: -5px; margin-right: 6px; }

/* 侧边栏分组折叠（知识斋/名贤堂） */
.sidebar-group-title { cursor: pointer; user-select: none; display: flex; align-items: center; }
.sidebar-group-title .sb-arrow { margin-left: auto; font-size: 10px; color: #a08c6a; transition: transform .25s; }
.sidebar-group.collapsed .sb-arrow { transform: rotate(-90deg); }
.sidebar-group.collapsed .sidebar-sub { display: none; }
.sidebar-sub { overflow: hidden; }

/* 全站底部 */
.site-footer { border-top: 1px solid #e0d5c0; margin-top: 40px; padding: 18px 0 30px; text-align: center; }
.site-footer .footer-inner { font-size: 12px; color: #a08c6a; line-height: 1.9; }
.site-footer .footer-inner a { color: #8b7355; text-decoration: none; }
.site-footer .footer-inner a:hover { text-decoration: underline; }
.site-footer .footer-sep { margin: 0 10px; color: #d4c5a9; }
@media (max-width: 767px) {
    .site-footer { margin-top: 24px; padding: 14px 16px 26px; }
    .site-footer .footer-inner { font-size: 11px; }
    .site-footer .footer-sep { margin: 0 6px; }
}

/* Breadcrumb */
.breadcrumb { margin-bottom: 16px; color: #8b7355; font-size: 14px; }
.breadcrumb a { color: #8b7355; }

/* Post layout + 注释栏 */
.post-layout { display: flex; gap: 24px; align-items: flex-start; }
.post-main { flex: 1; min-width: 0; }
.annotation-sidebar { width: 220px; flex-shrink: 0; position: sticky; top: 16px; align-self: flex-start; }
.annotation-sidebar .sidebar-title { font-weight: bold; color: #5c3d1a; margin-bottom: 12px; font-size: 15px; }
.anno-source { font-size: 12px; color: #8b4513; margin: 10px 0 4px; border-bottom: 1px solid #e0d5c0; padding-bottom: 2px; }
.anno-item { margin-bottom: 6px; font-size: 13px; }
.anno-term { font-weight: bold; color: #3a3226; }
.anno-term::after { content: ''; }
.anno-pinyin { font-size: 11px; color: #8b7355; margin: 0 2px; }
.anno-exp { color: #666; }
.anno-empty { color: #999; font-size: 13px; }
@media (max-width: 860px) { .post-layout { flex-direction: column; } .annotation-sidebar { width: 100%; position: static; } }

/* Post */
.post-card {
    background: #fff; border: 1px solid #e0d5c0; border-radius: 8px;
    padding: 16px; margin-bottom: 12px; cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.post-card:hover { border-color: #c4a87c; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.post-meta { font-size: 13px; color: #8b7355; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.post-meta .avatar { font-size: 18px; }
/* 🔴 2026.8.8 先贤头像 URL 模式：img 跟随容器（emoji 尺寸 ≈ 1em，img 用 1.4em 圆角） */
.fig-avatar { width: 1.4em; height: 1.4em; border-radius: 50%; object-fit: cover; vertical-align: -0.3em; display: inline-block; }
.post-meta .avatar .fig-avatar, .reply-meta .avatar .fig-avatar { width: 22px; height: 22px; }
.fig-av-wrap .fig-avatar { width: 18px; height: 18px; vertical-align: middle; }
/* 大字号容器内的头像图片：固定尺寸铺满（覆盖 40-60px emoji 容器） */
.moment-avatar .fig-avatar, .mc-avatar .fig-avatar, .rank-avatar .fig-avatar,
.speech-avatar .fig-avatar, .fh-avatar .fig-avatar, .rec-avatar .fig-avatar,
.result-avatar .fig-avatar, .tt-avatar .fig-avatar, .summon-avatar .fig-avatar,
.mc-fa .fig-avatar, .mc-ra .fig-avatar, .si-ico .fig-avatar,
.mfi-avatar .fig-avatar, .mc-friend-item .mc-fa .fig-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.mfi-avatar .fig-avatar, .mc-friend-item .mc-fa .fig-avatar { display: block; }
.post-meta .author { font-weight: bold; color: #5c3d1a; }
.post-title { font-size: 18px; margin-bottom: 6px; }
.post-title a { color: #3a3226; }
.post-excerpt { font-size: 14px; color: #666; margin-bottom: 8px; }
.post-stats { font-size: 13px; color: #999; display: flex; gap: 16px; }

/* Badges */
.badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.badge-ai { background: #e8d5b0; color: #8b6914; }
.board-tag { font-size: 12px; color: #999; }

/* Hot sidebar */
.sidebar-right { }
.hot-item {
    display: block; padding: 6px 0; font-size: 13px;
    border-bottom: 1px dashed #e0d5c0; color: #3a3226;
}
.hot-item:hover { color: #8b4513; text-decoration: none; }
.hot-stats { display: block; font-size: 11px; color: #999; }

/* Post Detail */
.post-detail {
    background: #fff; border: 1px solid #e0d5c0; border-radius: 8px;
    padding: 24px; margin-bottom: 20px;
}
.post-detail h1 { font-size: 24px; margin: 12px 0 16px; }
.post-content { font-size: 15px; line-height: 1.8; }
.post-content br + br { content: ''; display: block; margin-bottom: 0.3em; }
.post-actions { margin-top: 16px; display: flex; gap: 16px; color: #999; font-size: 14px; }

/* Replies */
.replies { margin-bottom: 20px; }
.replies h3 { margin-bottom: 12px; color: #5c3d1a; }
.reply-card {
    background: #fff; border: 1px solid #e0d5c0; border-radius: 8px;
    padding: 14px; margin-bottom: 8px;
}
.reply-card.ai-reply { background: #faf7f0; border-color: #d4c5a9; }
.reply-meta { font-size: 13px; color: #8b7355; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.reply-content { font-size: 14px; }
.reply-content br + br { content: ''; display: block; margin-bottom: 0.2em; }

/* AI Trigger */
.ai-trigger-box {
    background: #faf7f0; border: 1px dashed #d4c5a9; border-radius: 8px;
    padding: 16px; margin-bottom: 16px;
}
.figures-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.figure-tag {
    background: #e8dcca; padding: 3px 10px; border-radius: 20px;
    font-size: 13px;
}
.fig-incense { font-size: 11px; color: #8b4513; margin-left: 2px; }
.fig-offer-btn {
    background: none; border: none; cursor: pointer; font-size: 13px;
    padding: 0 0 0 2px; vertical-align: middle; opacity: .75; transition: opacity .15s, transform .15s;
}
.fig-offer-btn:hover { opacity: 1; transform: scale(1.15); }
.offer-type {
    flex: 1; max-width: 100px; padding: 12px 8px; border: 2px solid #d4c5a9;
    border-radius: 12px; background: #faf7f0; cursor: pointer; font-family: inherit;
    color: #5c3d1a; transition: all .15s;
}
.offer-type:hover { border-color: #8b4513; background: #fef9f0; transform: translateY(-2px); }
.msg-dot {
    position:absolute; top:-4px; right:-8px; background:#c0392b; color:#fff;
    border-radius:10px; font-size:10px; padding:0 5px; line-height:16px; min-width:16px; text-align:center;
}
.msg-link { font-size:12px; margin-left:4px; text-decoration:none; opacity:.8; }
.msg-link:hover { opacity:1; }

/* Forms */
.form-container {
    max-width: 500px; margin: 40px auto; background: #fff;
    border: 1px solid #e0d5c0; border-radius: 8px; padding: 24px;
}
.form-container h2 { margin-bottom: 20px; color: #5c3d1a; }
label { display: block; margin: 10px 0 4px; font-size: 14px; color: #666; }
input, textarea, select {
    width: 100%; padding: 8px 12px; border: 1px solid #d4c5a9;
    border-radius: 6px; font-size: 14px; font-family: inherit;
    background: #fdfaf5;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #8b4513; }
textarea { resize: vertical; }
.reply-form textarea { width: 100%; }

/* Buttons */
.btn {
    display: inline-block; padding: 8px 20px; background: #e0d5c0;
    color: #5c3d1a; border: 1px solid #d4c5a9; border-radius: 6px;
    cursor: pointer; font-size: 14px; margin-top: 8px;
}
.btn:hover { background: #d4c5a9; text-decoration: none; }
.btn-primary { background: #8b4513; color: #fff; border-color: #6b3410; }
.btn-primary:hover { background: #6b3410; }

/* Messages */
.success-msg { color: #2d8a4e; margin-top: 8px; }
.error-msg { color: #c0392b; margin: 8px 0; }
.msg-box { background: #e8f5e9; padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; }
.empty-state { text-align: center; padding: 40px; color: #999; }
.login-hint { text-align: center; padding: 16px; color: #999; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-card {
    background: #fff; border: 1px solid #e0d5c0; border-radius: 8px;
    padding: 20px;
}
.admin-card h3 { margin-bottom: 16px; color: #5c3d1a; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { background: #f5f0e8; padding: 8px 12px; text-align: left; border-bottom: 2px solid #d4c5a9; }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid #e0d5c0; }

/* Responsive - 手机端自适应 */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .sidebar-right { display: none; }

    /* 帖子卡片 */
    .post-card { padding: 12px; }
    .post-title { font-size: 16px; }
    .post-excerpt { font-size: 13px; }
    .post-meta { font-size: 12px; flex-wrap: wrap; gap: 4px; }
    .board-tag { font-size: 11px; }

    /* 帖子详情页 */
    .post-detail { padding: 16px; }
    .post-detail h1 { font-size: 20px; }
    .post-content { font-size: 14px; }
    .post-actions { font-size: 13px; }

    /* 回复 */
    .reply-card { padding: 10px; }
    .reply-content { font-size: 13px; }
    .reply-card.depth-1 { margin-left: 12px; }
    .reply-card.depth-2 { margin-left: 8px; }

    /* AI召唤区 */
    .ai-trigger-box { padding: 12px; }
    .figure-tag { font-size: 12px; padding: 2px 8px; }

    /* 表单 */
    .form-container { margin: 16px auto; padding: 16px; max-width: 100%; }
    input, textarea, select { font-size: 16px; } /* 防止iOS自动缩放 */

    /* 后台 */
    .admin-grid { grid-template-columns: 1fr; }
    .admin-card { padding: 12px; overflow-x: auto; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 6px 8px; }

    /* 弹窗 */
    .modal-box { padding: 20px; margin: 12px; }

    /* 召唤弹窗人物卡片 */
    .summon-card { padding: 10px 12px; }
    .summon-avatar { font-size: 28px; }

    /* Header */
    .logo { font-size: 20px; }
    .header-right { gap: 8px; }
    .header { padding: 12px 0; margin-bottom: 12px; }
    .user-info { font-size: 13px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* 热门帖子 */
    .hot-item { font-size: 12px; }

    /* 发帖按钮 */
    .btn-primary { padding: 8px 16px; font-size: 13px; }
    /* 移动端浮动发帖按钮 */
    .fab-post {
        position: fixed; bottom: 20px; right: 20px; z-index: 999;
        width: 52px; height: 52px; border-radius: 50%;
        background: #8b4513; color: #fff; border: none;
        font-size: 28px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        display: flex; align-items: center; justify-content: center;
        text-decoration: none; transition: transform 0.2s;
    }
    .fab-post:hover { transform: scale(1.1); text-decoration: none; color: #fff; }
    .breadcrumb { font-size: 13px; }

    /* 注释侧栏 */
    .post-layout { flex-direction: column; }
    .annotation-sidebar { width: 100%; position: static; }
    .anno-item { font-size: 12px; }

    /* Tooltip手机适配 */
    .fig-tooltip { max-width: 240px; font-size: 13px; }

    /* 表情选择器 */
    .emoji-btn { padding: 4px 12px; font-size: 18px; }
    .emoji-picker { width: calc(100vw - 20px); left: 10px !important; max-height: 220px; }
    .emoji-grid { max-height: 160px; }
}

/* ---------- 召唤弹窗 ---------- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fffef9; border: 2px solid #d4c5a9; border-radius: 12px;
    padding: 28px 32px; max-width: 460px; width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-box h3 { font-size: 20px; color: #5c3d1a; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.summon-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.summon-card {
    display: flex; align-items: center; gap: 12px;
    background: #faf7f0; border: 1px solid #e0d5c0; border-radius: 8px;
    padding: 12px 16px;
}
.summon-avatar { font-size: 32px; flex-shrink: 0; }
.summon-info { display: flex; flex-direction: column; }
.summon-info strong { font-size: 16px; color: #3a3226; }
.summon-dynasty { font-size: 13px; color: #8b7355; }
.summon-identity { font-size: 12px; color: #999; }
.reply-actions { margin-top: 8px; }
.btn-reply {
    background: none; border: 1px solid #d4c5a9; border-radius: 4px;
    padding: 3px 10px; font-size: 13px; color: #8b7355; cursor: pointer;
}
.btn-reply:hover { background: #f5f0e8; }
.btn-delete { background: none; border: none; cursor: pointer; font-size: 14px; opacity: 0.5; padding: 2px 4px; }
.btn-delete:hover { opacity: 1; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.round-warn-inline { font-size: 12px; color: #c0392b; margin-left: 8px; }
.round-exhausted { font-size: 13px; color: #999; }
.inline-reply-form {
    margin-top: 10px; padding: 12px; background: #faf7f0;
    border: 1px solid #e0d5c0; border-radius: 6px;
}
.inline-reply-form textarea {
    width: 100%; min-height: 50px; padding: 8px 10px;
    border: 1px solid #d4c5a9; border-radius: 4px; font-family: inherit; font-size: 14px;
}
.inline-form-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.user-reply { border-left: 3px solid #8b4513; }
/* 嵌套回复 */
.reply-card.nested { margin-left: 0; border-left-width: 2px; }
.reply-card.depth-1 { margin-left: 28px; border-left-color: #c9a96e; }
.reply-card.depth-2 { margin-left: 24px; border-left-color: #b8c9a0; }
.reply-children { margin-top: 4px; }
.nested .reply-content { font-size: 14px; }
.nested .reply-meta { font-size: 12px; }
.ai-loading { background: #faf7f0; border: 2px dashed #d4c5a9; }
.loading-indicator { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.loading-phase { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.loading-phase .phase-icon { font-size: 22px; }
.loading-phase .phase-text { font-size: 14px; color: #5c3d1a; }
.loading-phase .phase-dots span { animation: dotBounce 1.4s infinite; font-size: 16px; color: #8b7355; }
.loading-phase .phase-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-phase .phase-dots span:nth-child(3) { animation-delay: 0.4s; }

/* 打字机效果 */
.typewriter-cursor { animation: blink 0.7s infinite; color: #8b4513; font-weight: bold; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.loading-indicator { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.loading-avatar { font-size: 20px; animation: pulse 1.2s ease-in-out infinite; }
.loading-text { font-size: 14px; }
.loading-dots span { animation: dotBounce 1.4s infinite; font-size: 18px; color: #8b7355; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes dotBounce { 0%,80%,100%{opacity:0} 40%{opacity:1} }
.btn-like { cursor: pointer; user-select: none; transition: transform .15s; display: inline-block; }
.btn-like:hover { transform: scale(1.15); }
.btn-like.liked { color: #e74c3c; }

/* ---------- Emoji 选择器 ---------- */
.emoji-btn { background: none; border: 1px solid #d4c5a9; border-radius: 4px; cursor: pointer; font-size: 16px; padding: 2px 8px; color: #8b7355; }
.emoji-btn:hover { background: #f5f0e8; }
.emoji-picker { display: none; position: fixed; z-index: 9999; background: #fff; border: 1px solid #d4c5a9; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); width: 300px; max-height: 260px; overflow: hidden; }
.emoji-picker.show { display: block; }
.emoji-tabs { display: flex; border-bottom: 1px solid #e0d5c0; background: #faf7f0; }
.emoji-tab { flex: 1; padding: 6px 0; text-align: center; cursor: pointer; font-size: 12px; color: #8b7355; border: none; background: none; }
.emoji-tab.active { background: #fff; color: #5c3d1a; font-weight: bold; border-bottom: 2px solid #8b4513; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; overflow-y: auto; max-height: 200px; }
.emoji-item { cursor: pointer; font-size: 20px; padding: 4px; text-align: center; border-radius: 4px; transition: background .1s; }
.emoji-item:hover { background: #f5f0e8; transform: scale(1.2); }
.emoji-picker-wrapper { position: relative; display: inline-block; }
.round-warn-msg {
    background: #fef9e7; border: 1px solid #f0c040; border-radius: 6px;
    padding: 10px 16px; margin-bottom: 12px; font-size: 14px; color: #8b6914;
}
.round-limit-msg {
    background: #fdf0ed; border: 1px solid #e0b4a0; border-radius: 6px;
    padding: 12px 16px; margin-bottom: 12px; font-size: 14px; color: #8b4513;
}

/* ---------- 人物身份Tooltip ---------- */
.fig-name {
    cursor: pointer; border-bottom: 1px dashed #c9b896; position: relative;
}
.fig-name:hover { color: #8b4513; }
.fig-tooltip {
    position: fixed; z-index: 2000; max-width: 280px;
    background: #fffef9; border: 2px solid #8b4513; border-radius: 10px;
    padding: 14px 16px; box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    pointer-events: none; opacity: 0; transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
}
.fig-tooltip.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fig-tooltip .tt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fig-tooltip .tt-avatar { font-size: 24px; }
.fig-tooltip .tt-name { font-size: 15px; font-weight: bold; color: #3a3226; }
.fig-tooltip .tt-dynasty { font-size: 12px; color: #8b7355; }
.fig-tooltip .tt-conn { font-size: 13px; color: #5c3d1a; line-height: 1.6; margin-top: 6px; border-top: 1px solid #e0d5c0; padding-top: 6px; }
.fig-tooltip .tt-conn::before { content: '📍 泰州关联：'; font-weight: bold; color: #8b4513; }

/* 通知徽章 */
.notif-badge {
    font-size: 12px; background: #e74c3c; color: #fff !important;
    padding: 2px 8px; border-radius: 20px; font-weight: bold;
    text-decoration: none !important; display: inline-block;
}

/* ====== 暗黑模式 ====== */
[data-theme="dark"] {
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --bg-sidebar: #0f3460;
    --text: #e0e0e0;
    --text-muted: #8899aa;
    --text-dim: #556677;
    --border: #2a3a5c;
    --accent: #e8a87c;
    --accent-light: #3a5a8c;
    --highlight: #f5cba7;
}
[data-theme="dark"] body {
    background: var(--bg); color: var(--text);
}
[data-theme="dark"] .container { }
[data-theme="dark"] .header { border-color: var(--border); }
[data-theme="dark"] .logo { color: var(--accent); }
[data-theme="dark"] .post-card,
[data-theme="dark"] .post-detail,
[data-theme="dark"] .reply-card,
[data-theme="dark"] .form-container,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .modal-box {
    background: var(--bg-card); border-color: var(--border); color: var(--text);
}
[data-theme="dark"] .reply-card.ai-reply,
[data-theme="dark"] .ai-trigger-box { background: var(--bg-sidebar); border-color: var(--border); }
[data-theme="dark"] .post-meta,
[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .board-tag { color: var(--text-muted); }
[data-theme="dark"] .post-stats,
[data-theme="dark"] .hot-stats { color: var(--text-dim); }
[data-theme="dark"] .board-link:hover { background: var(--accent-light); }
[data-theme="dark"] .board-link.active { background: var(--accent-light); }
[data-theme="dark"] .sidebar-title { color: var(--accent); }
[data-theme="dark"] .sidebar { background: var(--bg-card); }
[data-theme="dark"] .post-title a { color: var(--text); }
[data-theme="dark"] .post-excerpt { color: var(--text-dim); }
[data-theme="dark"] .hot-item { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .hot-item:hover { color: var(--accent); }
[data-theme="dark"] a { color: var(--accent); }
[data-theme="dark"] .btn { background: var(--accent-light); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-primary { background: #8b4513; color: #fff; }
[data-theme="dark"] .figure-tag { background: var(--accent-light); }
[data-theme="dark"] .fig-name:hover { color: var(--accent); }
[data-theme="dark"] .fig-tooltip { background: var(--bg-card); border-color: var(--accent); }
[data-theme="dark"] .fig-tooltip .tt-name { color: var(--text); }
[data-theme="dark"] .user-info { color: var(--text); }
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select {
    background: var(--bg-sidebar); color: var(--text); border-color: var(--border);
}
[data-theme="dark"] .admin-table th { background: var(--bg-sidebar); border-color: var(--border); color: var(--accent); }
[data-theme="dark"] .admin-table td { border-color: var(--border); }
[data-theme="dark"] .admin-card h3 { color: var(--accent); }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .summon-card { background: var(--bg-sidebar); border-color: var(--border); }
[data-theme="dark"] .summon-info strong { color: var(--text); }
[data-theme="dark"] .breadcrumb a { color: var(--text-muted); }
[data-theme="dark"] .user-reply { border-left-color: var(--accent); }
[data-theme="dark"] .emoji-picker { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .emoji-tab { color: var(--text-muted); }
[data-theme="dark"] .emoji-tab.active { background: var(--bg-card); color: var(--accent); }
[data-theme="dark"] .daily-figure-card { background: linear-gradient(135deg,var(--bg-sidebar),var(--bg-card)); border-color: var(--border); }

/* 暗黑模式切换按钮 */
.theme-toggle {
    background: none; border: 1px solid var(--border, #d4c5a9); border-radius: 50%;
    width: 32px; height: 32px; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.theme-toggle:hover { background: rgba(128,128,128,0.15); }

/* 悬浮球默认隐藏（PC端不显示） */
.fab-menu-btn, .fab-overlay, .fab-close-hint { display: none; }

/* ===== 手机端悬浮球菜单 ===== */
@media (max-width: 768px) {
    .fab-menu-btn { display: flex; }
    .fab-overlay { display: block; }
    /* 隐藏侧栏 */
    .sidebar { display: none; }
    .main-layout { grid-template-columns: 1fr; }

    /* 悬浮球按钮 */
    .fab-menu-btn {
        position: fixed; bottom: 76px; right: 24px; z-index: 3001;
        width: 56px; height: 56px; border-radius: 50%;
        background: #8b4513; color: #fff; border: none;
        font-size: 28px; cursor: pointer;
        box-shadow: 0 4px 16px rgba(139,69,19,0.4);
        display: flex; align-items: center; justify-content: center;
        transition: transform 0.3s ease, border-radius 0.3s ease;
    }
    .fab-menu-btn:active { transform: scale(0.92); }
    .fab-menu-btn.open {
        transform: rotate(45deg);
        border-radius: 50%;
    }

    /* 全屏遮罩 */
    .fab-overlay {
        position: fixed; top: 0; left: 0; z-index: 3000;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0);
        pointer-events: none;
        transition: background 0.35s ease;
    }
    .fab-overlay.show {
        background: rgba(0,0,0,0.75);
        pointer-events: auto;
    }

    /* 菜单网格 */
    .fab-menu-grid {
        position: absolute; top: 50%; left: 50%;
        transform: translate(-50%, -50%) scale(0.5);
        display: grid;
        grid-template-columns: repeat(3, 80px);
        grid-auto-rows: 80px;
        gap: 16px;
        opacity: 0;
        transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), opacity 0.25s ease;
    }
    .fab-overlay.show .fab-menu-grid {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    /* 菜单项 */
    .fab-menu-item {
        width: 80px; height: 80px; border-radius: 20px;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        text-decoration: none; color: #3a3226;
        gap: 2px; cursor: pointer;
        transition: transform 0.2s, background 0.2s;
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    }
    .fab-menu-item:active { transform: scale(0.9); background: #f0e8d8; }
    .fab-menu-item .fab-icon { font-size: 28px; line-height: 1; }
    .fab-menu-item .fab-label { font-size: 11px; font-weight: 600; color: #5c3d1a; }
    .fab-menu-item.fab-back { background: rgba(255,255,255,0.6); }
    .fab-menu-item.fab-back .fab-label { color: #8b7355; }

    /* 关闭提示 */
    .fab-close-hint {
        position: absolute; bottom: 100px; left: 50%;
        transform: translateX(-50%);
        color: rgba(255,255,255,0.6); font-size: 13px;
        opacity: 0; transition: opacity 0.3s 0.2s ease;
    }
    .fab-overlay.show .fab-close-hint { opacity: 1; }
}

/* ===== 置顶徽章（2026.8.4：置顶帖标题旁标注） ===== */
.pin-badge{display:inline-block;background:#a8322c;color:#fff;font-size:11px;line-height:1;padding:2px 6px;border-radius:3px;margin-left:6px;vertical-align:2px;font-weight:normal}
