/* ==========================================================
   帖子详情页 (Viewthread) & Discuz 代码解析 专属样式
   ========================================================== */

/* 1. 终极图文混排工具类 (通过在 HTML 中包裹文本和图标实现完美居中) */
.flex-icon-text {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    vertical-align: middle !important;
}
.flex-icon-text i.fas, .flex-icon-text i.far {
    width: 1em !important;   
    height: 1em !important;  
    margin: 0 !important; 
    position: relative !important;
}

/* ★★★ 拆分组 1 (黄框)：顶部操作大按钮 (发新帖、回复) ★★★ */
.by-pt-actions .btn.flex-icon-text i.fas,
.by-pt-actions .btn.flex-icon-text i.far {
    width: 1.1em !important; 
    height: 1.1em !important;
    top: -1px !important; 
}

/* ★★★ 拆分组 2 (红框)：帖子信息区 (时间、浏览量、回复数等小文本) ★★★ */
.post-header .flex-icon-text {
    gap: 4px !important; 
}
.post-header .flex-icon-text i.fas,
.post-header .flex-icon-text i.far {
    width: 0.9em !important;   
    height: 0.9em !important;  
    top: 0 !important; 
}

/* 针对非 .flex-icon-text 包裹的普通内联图标 (兜底处理) */
.by-ptwrap i.fas:not(.flex-icon-text i), .by-ptwrap i.far:not(.flex-icon-text i),
.thread-layout i.fas:not(.flex-icon-text i), .thread-layout i.far:not(.flex-icon-text i) {
    width: 1em !important;   
    height: 1em !important;
    vertical-align: -0.1em !important; 
    position: relative !important;
    top: -1px !important; 
}

/* ===== 面包屑与顶部操作按钮 ===== */
.by-ptwrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding: 12px 0; }
.by-ptwrap__crumb { display: flex; align-items: center; font-size: 0.95rem; color: var(--text-muted); flex-wrap: wrap; }
.by-ptwrap__crumb a { color: var(--primary-color); transition: var(--transition); font-weight: 500; }
.by-ptwrap__crumb a:hover { color: var(--primary-hover); text-decoration: underline; }
.by-ptwrap__crumb em { margin: 0 8px; font-style: normal; color: var(--text-muted); font-family: simsun, sans-serif; font-size: 0.9rem; }
.by-pt-actions { display: flex; align-items: center; gap: 10px; }
.by-act { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); text-decoration: none; font-size: 0.95rem; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow-sm); transition: var(--transition); }
.by-act:hover { background: var(--bg-body); }
.by-act--new { background: var(--primary-color); border-color: transparent; color: #fff; }
.by-act--new:hover { background: var(--primary-hover); filter: brightness(0.98); color: #fff; }

/* ===== 全局卡片化与内边距修复 ===== */
.viewthread-card, .by-fastwrap { background: var(--bg-surface, #fff); border-radius: var(--radius-md, 12px); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06)); border: 1px solid var(--border-color, #e5e7eb); margin-bottom: 24px; padding: 32px 40px; box-sizing: border-box; }
.replies-container { background: var(--bg-surface, #fff); border-radius: var(--radius-md, 12px); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06)); border: 1px solid var(--border-color, #e5e7eb); margin-bottom: 24px; box-sizing: border-box; padding: 0; overflow: hidden; }

/* 主题管理菜单卡片 */
.modmenu-card { background: var(--bg-surface, #fff); border-radius: var(--radius-md, 12px); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06)); border: 1px solid var(--border-color, #e5e7eb); padding: 16px 24px; margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-start; }
.modmenu-card a { padding: 6px 14px; background: var(--bg-surface, #ffffff); border-radius: 4px; font-size: 0.85rem; color: var(--text-main, #374151); font-weight: 500; transition: all 0.3s; border: 1px solid var(--border-color, #e5e7eb); }
.modmenu-card a:hover { color: var(--primary-color, #3b82f6); border-color: var(--primary-color, #3b82f6); background: var(--bg-surface, #ffffff); text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,0.05); transform: translateY(-1px); }

/* 楼主文章标题头部 */
.thread-title-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px dashed var(--border-color, #e5e7eb); line-height: 1.4; text-align: left; }
.thread-type { font-size: 1.8rem; font-weight: 800; color: var(--primary-color, #3b82f6); display: inline; margin-right: 8px; text-decoration: none; }
.thread-type:hover { text-decoration: underline; color: var(--primary-hover, #2563eb); }
.thread-title-main { font-size: 1.8rem; font-weight: 800; color: var(--text-main, #111827); display: inline; margin: 0; padding: 0; border: none; word-break: break-word; }

/* 楼主头像布局 */
.post-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.post-header-left { display: flex; align-items: center; gap: 12px; }
.post-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.post-author { font-size: 1.05rem; font-weight: 700; color: var(--primary-color, #3b82f6); text-decoration:none; }
.post-author:hover { text-decoration:underline; }
.post-time { font-size: 0.85rem; color: var(--text-muted, #6b7280); }
.post-stats { display: flex; align-items: center; gap: 16px; color: var(--text-muted, #6b7280); font-size: 0.9rem; }

/* 编辑与复选框 */
.reply-btn-s { color: var(--text-muted, #6b7280); font-size: 0.85rem; cursor: pointer; transition: color 0.3s; display:inline-flex; align-items:center; gap:4px; font-weight:500; }
.reply-btn-s:hover { color: var(--primary-color, #3b82f6); text-decoration: none; }

/* ===== 正文排版 ===== */
.viewthread-card table, .reply-item table { border: none !important; background: transparent !important; margin: 0; width: 100% !important; }
.viewthread-card table td, .reply-item table td { border: none !important; padding: 0; }
.t_f, .pcb { line-height: 1.8; font-size: 1.05rem; margin-top: 20px; margin-bottom: 20px; color: var(--text-main, #111827); overflow-wrap: break-word; }

/* 引用块 (Quote) */
.quote { background: #f8fafc; border-left: 4px solid var(--primary-color); padding: 12px 16px; border-radius: 4px 8px 8px 4px; margin: 16px 0; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
[data-theme="dark"] .quote { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.05); }
.quote blockquote { margin: 0; }
.quote font { font-weight: 700; color: var(--text-main); display: block; margin-bottom: 8px; font-size: 1rem; }

/* 帖子底部操作区 */
.thread-actions-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; padding-top: 30px; margin-top: 30px; border-top: 1px dashed var(--border-color, #e5e7eb); }
.action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 24px; border-radius: 30px; border: 1px solid var(--border-color, #e5e7eb); background: var(--bg-surface, #fff); color: var(--text-main, #111827); font-weight: 600; transition: all 0.3s; text-decoration: none; }
.action-btn:hover { border-color: var(--primary-color, #3b82f6); color: var(--primary-color, #3b82f6); background: rgba(59,130,246,0.05); transform: translateY(-2px); box-shadow: var(--shadow-sm, 0 4px 8px rgba(0,0,0,0.06)); text-decoration: none; }

/* 上下篇导航卡片 */
.post-nav-cards { display: flex; gap: 20px; margin-top: 30px; }
.nav-card { flex: 1; background: var(--bg-body, #f3f4f6); border: 1px solid var(--border-color, #e5e7eb); border-radius: var(--radius-md, 12px); padding: 16px 20px; display: flex; flex-direction: column; transition: all 0.3s; box-shadow: none; text-decoration: none; min-width: 0;}
.nav-card:hover { border-color: var(--primary-color); transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; background: var(--bg-surface); }
.nav-card__label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; text-transform:uppercase; font-weight:600;}
.nav-card__title { font-size: 1.05rem; font-weight: 700; color: var(--text-main); display: block; white-space:nowrap; overflow: hidden; text-overflow:ellipsis; line-height:1.5; }
.nav-card.text-right { align-items: flex-end; text-align: right; }

/* 回帖列表容器与项 */
.replies-hd { padding: 20px 32px; background: rgba(0,0,0,0.02); border-bottom: 1px solid var(--border-color, #e5e7eb); font-weight: bold; font-size: 1.1rem; color: var(--text-main, #111827); display: flex; align-items: center; gap: 10px; }
.reply-list { list-style: none; margin: 0; padding: 0; }
.reply-item { padding: 24px 32px; border-bottom: 1px solid var(--border-color, #e5e7eb); display: flex; gap: 16px; transition: background 0.3s; }
.reply-item:last-child { border-bottom: none; }
.reply-item:hover { background: rgba(0,0,0,0.01); }

.reply-avatar { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; }
.reply-avatar img { width: 100%; height: 100%; object-fit: cover; }
.reply-main { flex: 1; min-width: 0; }
.reply-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.reply-name { font-weight: 700; color: var(--text-main, #111827); font-size: 1.05rem; margin-right: 12px; text-decoration:none;}
.reply-name:hover { text-decoration:underline; color:var(--primary-color);}
.reply-floor { font-size: 0.85rem; color: var(--text-muted, #6b7280); background: var(--bg-body, #f3f4f6); padding: 2px 10px; border-radius: 12px; font-weight: 600; border:1px solid var(--border-color);}
.reply-body { font-size: 1rem; line-height: 1.8; color: var(--text-main, #111827); margin-bottom: 16px; overflow-wrap: break-word; }
.reply-footer { display: flex; justify-content: flex-end; gap: 16px; align-items: center; border-top:1px solid rgba(0,0,0,0.04); padding-top:12px; margin-top:12px;}

/* ===== 快捷回复样式 ===== */
.fast-reply-box { background: var(--bg-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); padding: 16px 24px; margin-bottom: 16px; box-sizing: border-box; }
.fast-reply-hd { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.fast-reply-hd i { color: var(--primary-color); }
.fastpost-quick-reply { display: flex; align-items: center; gap: 12px; background: var(--bg-body); padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); margin-bottom: 12px;}
.fastpost-quick-reply label { font-weight: 700; color: var(--text-main); white-space: nowrap; }
.fastpost-quick-select { flex: 1; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-main); font-size: 0.95rem; outline: none; transition: border-color 0.3s; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; cursor: pointer; width: 100%; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.fastpost-quick-select:focus { border-color: var(--primary-color); }

.fast-reply-flex { display: flex; flex-direction: row; gap: 16px; align-items: flex-start; width: 100%; }
.fast-reply-avatar { width: 48px; height: 48px; flex-shrink: 0; border-radius:8px; overflow:hidden; background:var(--bg-body); }
.fast-reply-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fast-reply-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; width: 100%; }
.fast-reply-main .tedt { border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-body); transition: all 0.3s; }
.fast-reply-main .tedt:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(59,130,246,0.1); background: var(--bg-surface); }
.fast-reply-main .area textarea { width: 100%; padding: 12px 16px; border: none; outline: none; background: transparent; resize: vertical; min-height: 80px; color: var(--text-main); font-size: 1rem; box-sizing:border-box; overflow-y: auto;}
.fast-reply-ft { display: flex; justify-content: flex-end; margin-top: 0; }
.fast-reply-ft button { display:inline-flex; align-items:center; justify-content:center; padding:8px 24px; border-radius:30px; border:none; background:var(--primary-color); color:#fff; cursor:pointer; font-size:0.95rem; font-weight:700; transition:background 0.2s; }
.fast-reply-ft button:hover { background:var(--primary-hover); }

/* ==========================================================
   帖子内嵌图片与附件专属样式 (气泡菜单)
   ========================================================== */
.pattl { padding: 0 !important; margin: 12px 0 !important; border: none !important; background: transparent !important; }
.pattl .attnm { display: none !important; }

.savephotop { position: relative; display: inline-block; margin: 4px 4px 4px 0; }
.savephotop .dz-att { border-radius: 4px; display: block; transition: transform 0.3s ease; box-shadow: var(--shadow-sm); cursor: pointer !important; max-width:100%; height:auto;}
.savephotop:hover .dz-att { transform: scale(1.01); z-index: 2; position: relative; }

/* 纯CSS悬浮菜单：绝对定位在图片左上角 */
.aimg_tip { display: none; position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, 0.7); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; backdrop-filter: blur(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 10; pointer-events: none; }
.savephotop:hover .aimg_tip { display: block; pointer-events: auto; }
.aimg_tip p { margin: 0 0 6px 0; }
.aimg_tip p:last-child { margin: 0; }
.aimg_tip strong { color: #f3f4f6; font-size: 13px; font-weight:500; display:block; max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.aimg_tip a.set-cover-btn { color: #fff; background: var(--primary-color); padding: 4px 10px; border-radius: 4px; display: inline-block; text-decoration: none; font-size: 12px; font-weight:bold; transition: filter 0.2s; }
.aimg_tip a.set-cover-btn:hover { filter: brightness(1.1); text-decoration: none; }


/* ==========================================================
   ！！！终极核心修复：图片放大器(Zoom)安全美化！！！
   ========================================================== */
/* 1. 恢复盒模型：Discuz 原生 JS 必须基于 content-box 才能准确计算坐标和宽高，消除滚轮缩放错位的致命 BUG */
#imgzoom_zoomlayer, #imgzoom_zoomlayer * {
    box-sizing: content-box !important;
}

/* 2. 外部相框美化：完全保留原生 padding 结构，不加任何宽高限制和内外边距修改 */
#imgzoom_zoomlayer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.zoominner {
    background: var(--bg-surface) !important;
    padding: 10px !important; /* 原生画框般的白色留白 */
    border-radius: 12px !important;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3) !important;
    border: 1px solid var(--border-color) !important;
}
.zoominner table, .zoominner td {
    background: transparent !important;
    border: none !important;
}

/* 3. 顶部工具栏：不改变 DOM 的实际占据高度，只通过透明化隐藏原本的文字 */
.zoominner p {
    background: transparent !important;
    color: transparent !important; /* 隐藏提示语：“鼠标滚轮缩放图片” */
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    border: none !important;
    text-align: right !important;
    position: relative !important;
    z-index: 100005 !important;
}
.zoominner p .y {
    float: right !important;
}

/* 将丑陋长文字变为精美的圆角图标按钮 (带纯白底座，不再透明看不清！) */
.zoominner p a {
    display: inline-block !important;
    width: 32px !important;
    height: 32px !important;
    margin-left: 12px !important;
    color: transparent !important; /* 隐藏原生文字 */
    font-size: 0 !important;
    vertical-align: middle !important;
    border-radius: 50% !important; /* 圆形底座 */
    background-color: var(--bg-surface) !important; /* 纯白底色 */
    border: 1px solid var(--border-color) !important; /* 浅灰边框 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important; /* 微浮雕阴影 */
    position: relative !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}
.zoominner p a:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59,130,246,0.3) !important;
}

/* 使用伪元素挂载 Data URI 遮罩，确保图标居中且可变色 */
.zoominner p a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background-color: var(--text-main) !important; /* 默认深灰/黑图标 */
    -webkit-mask-size: contain !important;
    mask-size: contain !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-repeat: no-repeat !important;
    -webkit-mask-position: center !important;
    mask-position: center !important;
    transition: background-color 0.2s ease !important;
}
.zoominner p a:hover::after {
    background-color: #ffffff !important; /* 悬浮时图标变白 */
}

/* --- 挂载超清纯净版 SVG 矢量图标 --- */
.zoominner p a.imglink::after { -webkit-mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.zoominner p a.imgroate::after { -webkit-mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E"); }
.zoominner p a.imgadjust::after { -webkit-mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3Cpath d='M21 3l-7 7'/%3E%3Cpath d='M3 21l7-7'/%3E%3C/svg%3E"); }

/* 关闭按钮专属样式：红底白叉 */
.zoominner p a.imgclose {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
}
.zoominner p a.imgclose::after {
    background-color: #ffffff !important; /* 默认白叉 */
    width: 18px; height: 18px;
    -webkit-mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}
.zoominner p a.imgclose:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* 4. 图片本身安全美化 */
.zoominner img { 
    border-radius: var(--radius-sm) !important; 
    box-shadow: none !important; 
}

/* 5. 左右翻页区悬浮箭头重塑：脱离原生态流，不挤压图片高度，精准覆盖点击热区 */
#imgzoom_picpage, .zimg_p { 
    position: absolute !important; 
    top: 50px !important; /* 避开头部的工具栏 (10px padding + 32px height + ~8px margin) */
    bottom: 10px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important; 
    height: auto !important; 
    z-index: 100002 !important; 
    pointer-events: none !important; /* 容器自身穿透，不挡图片 */
    outline: none !important; 
}

#zimg_prev, #zimg_next { 
    position: absolute !important; 
    top: 0 !important; 
    bottom: 0 !important;
    height: auto !important; 
    width: 50% !important; 
    pointer-events: auto !important; /* 恢复左右半边的精准点击响应 */
    cursor: pointer !important;
    outline: none !important; 
    background: transparent !important;
    -webkit-tap-highlight-color: transparent !important; 
}
#zimg_prev { left: 0 !important; }
#zimg_next { right: 0 !important; }
#zimg_prev strong, #zimg_next strong { display: none !important; } /* 彻底隐藏原生丑陋的文字标签 */

/* 翻页箭头高颜值遮罩UI */
#zimg_prev::after, #zimg_next::after {
    content: ''; 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 54px; 
    height: 72px;
    background-color: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 12px; 
    background-repeat: no-repeat; 
    background-position: center; 
    background-size: 28px;
    opacity: 0; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
#zimg_prev::after { left: 16px; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E"); }
#zimg_next::after { right: 16px; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E"); }

.zimg_p:hover #zimg_prev::after, .zimg_p:hover #zimg_next::after { opacity: 0.6; }
#zimg_prev:hover::after, #zimg_next:hover::after { 
    opacity: 1; 
    background-color: var(--primary-color); 
    border-color: var(--primary-color); 
    box-shadow: 0 8px 24px rgba(59,130,246,0.4); 
}

/* 鼠标悬浮时箭头变成白色 */
#zimg_prev:hover::after { background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E"); }
#zimg_next:hover::after { background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E"); }

/* 移动端特殊调整 */
@media (max-width: 768px) {
    #zimg_prev::after { left: 8px !important; width: 42px !important; height: 56px !important; background-size: 20px !important; }
    #zimg_next::after { right: 8px !important; width: 42px !important; height: 56px !important; background-size: 20px !important; }
}

/* ==========================================================
   侧边栏卡片 (Viewthread 专属)
   ========================================================== */
.author-card { padding: 0 !important; overflow: hidden; position: relative; text-align: center; }
.author-card__avatar { margin-top: -40px; margin-bottom: 12px; }
.author-card__avatar img { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--bg-surface); object-fit: cover; background: var(--bg-surface); }
.author-card__info { padding: 0 20px; margin-bottom: 16px; }
.author-card__info .name a { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.author-card__info .desc { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }
.author-card__action { padding: 0 20px 24px; }

.related-thread-list { list-style: none; padding: 0; margin: 0; }
.related-thread-list li { padding: 12px 0; border-bottom: 1px dashed var(--border-color); }
.related-thread-list li:last-child { border-bottom: none; padding-bottom: 0; }
.related-thread-list a { display: block; color: var(--text-main); font-size: 0.95rem; line-height: 1.5; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; transition: var(--transition); }
.related-thread-list a:hover { color: var(--primary-color); padding-left: 4px; }

/* 侧边栏彩色标签云样式 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; text-align: left; }
.tag-item { 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    transition: var(--transition); 
    border: 1px solid transparent; 
    display: inline-flex; 
    align-items: center; 
    font-weight: 600;
    text-decoration: none !important;
}
.tag-item i { margin-right: 4px; opacity: 0.7; }
.tag-item:hover { filter: brightness(0.95); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-decoration: none; }

/* 纯CSS魔法：利用 :nth-child 自动循环上色，再也不需要 PHP 输出 tagc-x 类名了 */
.tag-cloud a:nth-child(8n+1) { background: rgba(59,130,246,0.1); color: #3b82f6; border-color: rgba(59,130,246,0.2); }
.tag-cloud a:nth-child(8n+2) { background: rgba(16,185,129,0.1); color: #10b981; border-color: rgba(16,185,129,0.2); }
.tag-cloud a:nth-child(8n+3) { background: rgba(245,158,11,0.1); color: #f59e0b; border-color: rgba(245,158,11,0.2); }
.tag-cloud a:nth-child(8n+4) { background: rgba(239,68,68,0.1); color: #ef4444; border-color: rgba(239,68,68,0.2); }
.tag-cloud a:nth-child(8n+5) { background: rgba(139,92,246,0.1); color: #8b5cf6; border-color: rgba(139,92,246,0.2); }
.tag-cloud a:nth-child(8n+6) { background: rgba(236,72,153,0.1); color: #ec4899; border-color: rgba(236,72,153,0.2); }
.tag-cloud a:nth-child(8n+7) { background: rgba(14,165,233,0.1); color: #0ea5e9; border-color: rgba(14,165,233,0.2); }
.tag-cloud a:nth-child(8n+8) { background: rgba(249,115,22,0.1); color: #f97316; border-color: rgba(249,115,22,0.2); }


/* 移动端响应式 (帖子页专属部分) */
@media (max-width: 992px) {
    .by-ptwrap { flex-direction: column; align-items: flex-start; gap: 16px; }
    .post-nav-cards { flex-direction: column; gap: 12px; }
    .nav-card.text-right { align-items: flex-start; text-align: left; }
}
@media (max-width: 768px) {
    .by-ptwrap { padding-left: 16px !important; padding-right: 16px !important; margin-bottom: 0 !important; }
    .viewthread-card, .fast-reply-box { border-radius: 0 !important; border-left: none !important; border-right: none !important; margin-left: 0 !important; margin-right: 0 !important; box-shadow: none !important; padding: 16px !important; border-bottom: 1px solid var(--border-color); margin-bottom: 0 !important; }
    .thread-title-main, .thread-type { font-size: 1.4rem; }
    .replies-container { padding: 16px 0 !important; border-radius: 0 !important; border-left: none !important; border-right: none !important; margin-bottom: 0 !important; box-shadow: none !important;}
    .replies-hd { padding: 0 16px 16px 16px !important; }
    .reply-item { display: block; position: relative; padding: 16px !important; border-bottom: 1px solid var(--border-color); }
    .reply-avatar { position: absolute !important; top: 16px; left: 16px; width: 36px !important; height: 36px !important; display: block !important; }
    .reply-main { display: block; width: 100%; margin-left: 0; }
    .reply-header { margin-left: 48px; min-height: 36px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 8px !important; }
    .reply-header > div:first-child { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
    .reply-name { font-size: 0.95rem !important; }
    .reply-time { font-size: 0.75rem !important; color: var(--text-muted); margin-left: 0 !important; }
    .reply-floor { background: transparent; border: none; padding: 0; color: var(--text-muted); font-size: 0.85rem !important; }
    .reply-body { clear: both; width: 100%; padding-top: 8px; font-size: 1.05rem !important; line-height: 1.6; }
    .quote { margin: 8px 0 !important; padding: 10px 12px !important; font-size: 0.9rem !important; border-radius: 4px !important; }
    .fast-reply-flex { flex-direction: column; align-items: stretch; }
    .fast-reply-avatar { display: none; }
}
@media (max-width: 600px) {
    .fastpost-quick-reply { flex-direction: column; align-items: stretch; gap: 8px; }
    .fastpost-quick-select { width: 100%; }
}


/* ==========================================================
   帖子页隐藏/付费可见区域美化 (.locked / .showhide)
   ========================================================== */

/* 1. 未回复/未获得权限前的隐藏提示框 (.locked) */
.locked {
    background: rgba(59, 130, 246, 0.04); /* 浅蓝色背景 */
    border: 1px solid rgba(59, 130, 246, 0.3); /* 蓝色边框 */
    border-radius: var(--radius-md, 12px);
    padding: 32px 20px;
    margin: 20px 0;
    text-align: center;
    color: var(--text-main, #374151);
    font-size: 1.05rem;
    display: flex;
    flex-direction: column; /* 强制上下竖向排列，让按钮独占一行 */
    align-items: center;
    justify-content: center;
    gap: 16px; /* 文字和按钮的间距 */
}
/* 顶部注入一个锁头图标 */
.locked::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    background-color: var(--primary-color, #3b82f6);
    -webkit-mask: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* 独立一行、宽大版回复按钮 */
.locked a {
    display: inline-block;
    margin: 0;
    padding: 10px 48px; /* 加宽按钮 */
    background: linear-gradient(135deg, var(--primary-hover, #2563eb), var(--primary-color, #3b82f6));
    color: #fff !important;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.05rem;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}
.locked a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
}

/* 2. 已获得权限/回复后可见的内容框 (.showhide) */
.showhide {
    background: rgba(59, 130, 246, 0.03);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md, 12px);
    padding: 24px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    color: var(--text-main, #111827);
    font-size: 1.05rem;
    line-height: 1.8;
}
/* 防止和旧版样式冲突，强制去除左侧加粗线条 */
.showhide::before { display: none !important; }

/* 标题："本帖隐藏的内容" */
.showhide h4 {
    color: var(--primary-color, #3b82f6);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
}
/* 标题前加一个“开锁”图标 */
.showhide h4::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    background-color: var(--primary-color, #3b82f6);
    -webkit-mask: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 9.9-1'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 9.9-1'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ==========================================================
   分类信息 (Thread Sorts) 传统表格展示样式
========================================================== */
.by-threadsort-table {
	width: 100% !important;
	border-collapse: collapse !important;
	margin: 0 0 24px 0 !important;
	border: 1px solid var(--border-color, #e5e7eb) !important;
	font-size: 0.95rem;
}
.by-threadsort-table tr {
	border-bottom: 1px solid var(--border-color, #e5e7eb) !important;
}
.by-threadsort-table tr:last-child {
	border-bottom: none !important;
}
.by-threadsort-table th {
	width: 120px !important;
	background-color: #f3f6f9 !important; /* 经典的浅蓝灰色 */
	color: #6b7280 !important;
	font-weight: 600 !important;
	padding: 12px 16px !important;
	text-align: center !important; /* 表头文字居中 */
	border-right: 1px solid var(--border-color, #e5e7eb) !important;
	vertical-align: middle !important;
	white-space: nowrap;
}
[data-theme="dark"] .by-threadsort-table th {
	background-color: rgba(255, 255, 255, 0.05) !important;
	color: var(--text-muted) !important;
}
.by-threadsort-table td {
	background-color: var(--bg-surface, #ffffff) !important;
	color: var(--text-main, #111827) !important;
	padding: 12px 28px !important; 
	text-align: left !important;
	vertical-align: middle !important;
	word-break: break-word !important;
	line-height: 1.6 !important;
}
/* 针对长文本和图片，表头靠顶部对齐 */
.by-threadsort-table .ts-top {
	vertical-align: top !important;
	padding-top: 16px !important;
}
/* 移动端响应式 */
@media (max-width: 768px) {
	.by-threadsort-table th { width: 90px !important; padding: 10px 12px !important; }
	.by-threadsort-table td { padding: 10px 16px !important; } 
}