/* =========================================================
   嗯行网 帖子详情页专用样式（仅 post.html 引入）
   按真站 view-source DOM + 手机截图仿写；作用域限定 .post-view，
   不污染其余 29 页的通用类（.title / .list / .footer 等）。
   亮/暗双主题通过全局 CSS 变量自动适配。
   ========================================================= */
:root {
  --pv-link:      #2b6cb0;   /* 亮色：链接蓝 */
  --pv-panel:     #ffffff;   /* 浮层/输入框底 */
  --pv-panel-2:   #f4f5f7;
  --pv-line:      #e4e7eb;
  --pv-bubble:    #cdd9e5;   /* 右下角回复气泡 */
  --pv-emoji-bg:  #eef0f2;
  --pv-shadow:    0 10px 30px rgba(0, 0, 0, .14);
}
html.yh-theme-dark {
  --pv-link:      #6fa8dc;
  --pv-panel:     #242424;
  --pv-panel-2:   #2e2e2e;
  --pv-line:      #333333;
  --pv-bubble:    #3b4a5a;
  --pv-emoji-bg:  #3a3a3a;
  --pv-shadow:    0 10px 30px rgba(0, 0, 0, .55);
}

.post-view { background: var(--yh-bg); color: var(--yh-text); }
.post-view a { color: var(--pv-link); text-decoration: none; }
.post-view .newMessage:empty { display: none; }

/* ---------- 面包屑 / 功能条 ---------- */
.post-view .title {
  background: transparent;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--yh-text-2);
  border-bottom: 1px solid var(--pv-line);
  border-top: 0;
}
.post-view .title a { margin: 0 3px; }
.post-view .subtitle2 {
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--pv-line);
  display: flex;
  gap: 16px;
}
.post-view .subtitle2 a { color: var(--pv-link); }

/* ---------- 主帖 ---------- */
.post-view .content { background: transparent; padding: 0; }
.post-view .Postinfo { padding: 14px 12px 10px; font-size: 18px; line-height: 1.7; font-weight: 600; }
.post-view .biaotiwenzi, .post-view .Postime { color: var(--yh-muted); font-size: 13px; font-weight: 400; margin-right: 6px; }
.post-view .yueduliang { color: var(--yh-muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.post-view .DateAndTime { color: var(--yh-text-2); font-size: 13px; font-weight: 400; }
.post-view .dashed { border-top: 1px dashed var(--pv-line); margin: 0 12px; }
.post-view .bbscontent {
  padding: 14px 12px 18px;
  font-size: 16px;
  line-height: 1.95;
  white-space: pre-wrap;
  word-break: break-word;
}
.post-view .louzhuxinxi {
  background: transparent;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--pv-line);
  border-bottom: 1px solid var(--pv-line);
  font-size: 13px;
  line-height: 2.1;
}
.post-view .louzhuxinxi a { color: var(--pv-link); }
.post-view .louzhu { color: var(--yh-muted); margin-right: 4px; }
.post-view .louzunicheng a { color: var(--pv-link); font-weight: 600; }
.post-view .louzhudengji { color: var(--yh-muted); margin-left: 4px; }
.post-view .dengji { color: var(--yh-primary); }
.post-view .touxian { color: var(--yh-text-2); margin-left: 4px; }
.post-view .online img { height: 15px; vertical-align: -3px; margin-left: 3px; }
.post-view .xunzhang { display: block; }
.post-view .rongyuwenzi { color: var(--yh-muted); }
.post-view .xunzhangtupian img { height: 26px; vertical-align: -8px; margin: 0 3px; }
.post-view .view-pad-right-2 { padding-right: 4px; }
.post-view .link-btn {
  border: 0; background: transparent; color: var(--pv-link);
  font-size: 13px; padding: 0; cursor: pointer; font-family: inherit;
}
.post-view .subtitle .op-links { color: var(--yh-muted); }

/* ---------- 打赏弹层（简化，复用 theme.css 的 popup-overlay） ---------- */
.post-view #RewardCoins .popup-content-area { color: var(--yh-text-2); font-size: 14px; }
.post-view .rw-balance { color: var(--yh-muted); font-size: 13px; }
.post-view .rw-balance b { color: var(--yh-primary); }
.post-view .rw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.post-view .rw-tile {
  display: block; text-align: center; padding: 10px 4px;
  border: 1px solid var(--pv-line); border-radius: 8px;
  font-size: 13px; color: var(--yh-text); cursor: pointer;
}
.post-view .rw-radio { position: absolute; opacity: 0; }
.post-view .rw-radio:checked + .rw-tile { border-color: var(--yh-primary); background: var(--yh-primary-soft); color: var(--yh-primary); }
.post-view .rw-cta {
  width: 100%; padding: 10px; border: 0; border-radius: 8px;
  background: var(--yh-primary); color: #fff; font-size: 14px; cursor: pointer;
}

/* ---------- 回复框 / UBB 编辑器 ---------- */
.post-view .viewContent { background: transparent; }
.post-view .necro-container { padding: 12px; }
.post-view .custom-form { margin: 0; }
.post-view .reply-options { display: flex; align-items: center; gap: 16px; margin-bottom: 9px; }
.post-view .face-select {
  appearance: none; -webkit-appearance: none;
  padding: 6px 30px 6px 12px; border: 1px solid var(--pv-line);
  border-radius: 7px; background: var(--pv-panel); color: var(--yh-text-2);
  font-size: 13px; font-family: inherit; position: relative; cursor: pointer;
  background-image: none;
}
.post-view .face-select-wrap { position: relative; display: inline-block; }
.post-view .face-select-wrap::after {
  content: ''; position: absolute; right: 11px; top: 13px;
  width: 7px; height: 7px; border-right: 1.5px solid var(--yh-muted);
  border-bottom: 1.5px solid var(--yh-muted); transform: rotate(45deg); pointer-events: none;
}
.post-view .tongzhi { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--yh-text-2); cursor: pointer; }
.post-view .tongzhi input { width: 15px; height: 15px; accent-color: var(--yh-primary); cursor: pointer; }

/* UBB 编辑器容器：浮层定位基准 */
.post-view .ubb-editor { position: relative; }
.post-view .ubb-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 7px; border: 1px solid var(--pv-line);
  border-radius: 10px; background: var(--pv-panel);
  transition: border-color .15s;
}
.post-view .ubb-toolbar.is-active { border-color: var(--yh-primary); }
.post-view .ubb-toolbar button {
  flex: 0 0 auto; width: 32px; height: 32px;
  border: 0; background: transparent; color: var(--yh-text-2);
  border-radius: 7px; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0;
}
.post-view .ubb-toolbar button i { font-size: 19px; font-style: normal; }
.post-view .ubb-toolbar button.txt-bold { font-weight: 700; }
.post-view .ubb-toolbar button.txt-italic { font-style: italic; font-family: Georgia, serif; }
.post-view .ubb-toolbar button.txt-underline { text-decoration: underline; }
.post-view .ubb-toolbar button:hover { background: var(--pv-panel-2); }
.post-view .ubb-toolbar button.active { background: var(--yh-primary); color: #fff; }
.post-view .ubb-toolbar button.active:hover { background: var(--yh-primary); }
.post-view .ubb-sep { flex: 0 0 auto; width: 1px; height: 18px; background: var(--pv-line); margin: 0 5px; }

/* 浮层：表情面板 / 菜单 / 对话框 */
.post-view .ubb-popover, .post-view .ubb-dialog {
  position: absolute; z-index: 60; display: none;
  background: var(--pv-panel); border: 1px solid var(--pv-line);
  border-radius: 12px; box-shadow: var(--pv-shadow);
}
.post-view .ubb-popover.show, .post-view .ubb-dialog.show { display: block; }
/* 浮层从工具栏正下方开始，覆盖 textarea（与真站一致），而非编辑器底部 */
.post-view .ubb-popover { top: 46px; }
.post-view #popEmotion { left: 0; width: 100%; }
.post-view .emoji-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 6px; padding: 10px;
}
.post-view .emoji-cell {
  aspect-ratio: 1 / 1; background: var(--pv-emoji-bg);
  border: 1px solid transparent; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; cursor: pointer; overflow: hidden;
}
.post-view .emoji-cell svg { width: 100%; height: 100%; display: block; }
.post-view .emoji-cell:hover { border-color: var(--yh-primary); }
.post-view .ubb-menu { min-width: 168px; padding: 6px; }
.post-view .ubb-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; color: var(--yh-text); font-size: 14px;
  border-radius: 8px; cursor: pointer;
}
.post-view .ubb-menu a:hover { background: var(--pv-panel-2); }
.post-view .ubb-menu a i { font-style: normal; font-size: 16px; color: var(--yh-text-2); }
.post-view #popImage { left: 76px; }
.post-view #popVideo { left: 114px; }

.post-view .ubb-dialog { left: 50%; top: 46px; transform: translateX(-50%); width: 88%; max-width: 340px; padding: 14px 14px 0; }
.post-view .ubb-dlg-title { font-size: 14px; color: var(--yh-text); margin-bottom: 10px; }
.post-view .ubb-dialog input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; margin-bottom: 9px;
  border: 1px solid var(--pv-line); border-radius: 9px;
  background: var(--pv-panel-2); color: var(--yh-text);
  font-size: 14px; font-family: inherit; outline: none;
}
.post-view .ubb-dialog input:focus { border-color: var(--yh-primary); }
.post-view .ubb-dlg-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 4px 0 14px; }
.post-view .ubb-btn {
  padding: 8px 18px; border: 1px solid var(--pv-line); border-radius: 8px;
  background: var(--pv-panel-2); color: var(--yh-text-2);
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.post-view .ubb-btn.primary { background: var(--yh-primary); color: #fff; border-color: var(--yh-primary); }

.post-view .centered-container { padding: 0; margin-top: 9px; }
.post-view .retextarea {
  width: 100% !important; box-sizing: border-box; min-height: 108px;
  margin: 0; padding: 11px 12px;
  border: 1px solid var(--pv-line); border-radius: 10px;
  background: var(--pv-panel); color: var(--yh-text);
  font-size: 15px; line-height: 1.7; font-family: inherit;
  resize: vertical; outline: none;
}
.post-view .retextarea:focus { border-color: var(--yh-primary); }
.post-view .retextarea::placeholder { color: var(--yh-muted-2); }
.post-view #replyActions { display: flex; align-items: center; gap: 14px; padding-top: 10px; }
/* theme.css 的 .kuaisuhuifu 带 width:100% + 边框 + 背景，会把整行撑满，
   这里全部复位；按钮选择器提高特异性，避免被 .kuaisuhuifu input[type=submit] 覆盖 */
.post-view .kuaisuhuifu {
  width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; display: inline-flex; align-items: center; gap: 0;
}
.post-view .kuaisuhuifu input[type="submit"].reply-submit-btn {
  padding: 7px 14px; border: 1px solid var(--pv-line); border-radius: 7px;
  background: transparent; color: var(--yh-text); font-size: 13px;
  cursor: pointer; font-family: inherit; min-height: 0;
}
.post-view .kuaisuhuifu input[type="submit"].reply-submit-btn:active { background: var(--pv-panel-2); }
.post-view .reply-file-link { color: var(--yh-text-2); font-size: 13px; }
.post-view .reply-order-slot { margin-left: auto; }
.post-view .reply-order-btn {
  color: var(--yh-text-2); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.post-view .reply-order-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.post-view #reply-submit-feedback { padding: 0 12px; font-size: 13px; color: var(--yh-primary); }

/* ---------- 回帖列表 ---------- */
.post-view .recontent { background: transparent; }
.post-view .reline {
  position: relative;
  padding: 12px 12px 16px;
  border-bottom: 1px solid var(--pv-line);
}
.post-view .reline-head { display: flex; align-items: baseline; gap: 4px; }
.post-view .reuser { font-size: 15px; }
.post-view .renick a { color: var(--pv-link); font-weight: 600; }
.post-view .renickid { color: var(--yh-muted); font-size: 13px; margin-left: 3px; }
.post-view .floornumber { margin-left: auto; color: var(--yh-muted); font-size: 13px; }
.post-view .retime { display: block; color: var(--yh-muted); font-size: 12px; margin-top: 5px; }
.post-view .retext {
  display: block; font-size: 16px; line-height: 1.75;
  margin-top: 9px; padding-right: 34px;
  white-space: pre-wrap; word-break: break-word;
}
.post-view .reother { color: var(--pv-link); margin-right: 6px; }
.post-view .recolon { display: none; }
.post-view .replyicon {
  position: absolute; right: 12px; bottom: 14px;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--pv-bubble); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.post-view .replyicon i { font-style: normal; font-size: 15px; }
.post-view .replyicon:hover { filter: brightness(1.12); }

/* ---------- 底部分页 / 最新帖 / 导航 / 页脚 ---------- */
.post-view .more { padding: 16px 12px; text-align: center; }
.post-view .more a {
  display: inline-block; padding: 8px 20px;
  border: 1px solid var(--pv-line); border-radius: 9px;
  color: var(--pv-link); font-size: 14px;
}
.post-view .list {
  background: transparent; padding: 4px 12px 14px;
  font-size: 14px; line-height: 2.15; color: var(--yh-text-2);
}
.post-view .list a { color: var(--pv-link); }
.post-view .nexttitle {
  padding: 13px 12px; text-align: center;
  border-top: 1px solid var(--pv-line);
  font-size: 14px; color: var(--yh-muted);
}
.post-view .nexttitle a { color: var(--pv-link); margin: 0 5px; }
.post-view .separate2 { color: var(--yh-muted); }
.post-view .footer {
  padding: 18px 12px 46px; text-align: center;
  color: var(--yh-muted); font-size: 12px;
}
.post-view .footer a { color: var(--pv-link); }
.post-view .footer img { display: none; }

/* 正序模式（默认倒序：高楼在前） */
.post-view .recontent.is-asc { display: flex; flex-direction: column-reverse; }

/* 帖子页把全站悬浮主题按钮并入功能条内联显示，
   彻底避免悬浮按钮遮挡右下角回帖气泡或正文 */
.post-view #yh-theme-toggle {
  position: static; width: 28px; height: 28px; margin-left: auto;
  opacity: 1; box-shadow: none; border-radius: 7px; flex: 0 0 auto;
}
html.yh-theme-dark .post-view #yh-theme-toggle { opacity: 1; }
