/**
 * QAPress 论坛 OPC 视觉一致性样式（轻量覆盖）。
 *
 * 策略：保持 QAPress 插件原版 HTML 结构与布局不变，仅注入 OPC 配色令牌
 * （主蓝 --accent、文本 --text、次级 --muted 等）与全站字体间距，确保
 * 论坛页面与 OPC 其他模块保持视觉一致性。
 *
 * 不重构任何 QAPress 原生类名（.q-content/.q-header/.topic-tab/.q-topic-item 等），
 * 不改动 JS 绑定选择器（.j-reply/.btn-vote-up 等），避免影响插件交互功能。
 *
 * 作用域：.qapress-list（列表页）/ .qapress-single（详情页）body class。
 */

/* ============================================================= *
 *  全局字体与配色
 * ============================================================= */
.qapress-list,
.qapress-single {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
}

.qapress-list .q-content,
.qapress-single .q-content {
  color: var(--text, #333);
}

.qapress-list a,
.qapress-single a {
  text-decoration: none;
}

/* ============================================================= *
 *  列表页 - 顶部分类 tab 导航
 * ============================================================= */
.qapress-list .q-header-tab .topic-tab {
  color: var(--muted, #666);
  transition: color .18s ease;
}

.qapress-list .q-header-tab .topic-tab:hover {
  color: var(--text, #333);
}

.qapress-list .q-header-tab .topic-tab.current-tab {
  color: var(--accent, #4d6bfe);
  border-bottom-color: var(--accent, #4d6bfe);
  font-weight: 600;
}

/* ============================================================= *
 *  列表页 - 话题列表卡片
 * ============================================================= */
.qapress-list .q-topic-item .topic-title {
  color: var(--text, #333);
}

.qapress-list .q-topic-item .topic-title:hover {
  color: var(--accent, #4d6bfe);
}

.qapress-list .q-topic-item .topic-cat:hover,
.qapress-list .q-topic-item .topic-last-reply a:hover {
  color: var(--accent, #4d6bfe);
}

.qapress-list .q-topic-item .put-top {
  background: var(--accent, #4d6bfe);
}

/* ============================================================= *
 *  列表页 - 两栏容器间距（仅覆盖论坛列表页，不影响全站 .container）
 *  ① .container 左右内边距 32px；② main 与 sidebar 间距 50px。
 *  用三类选择器 .qapress-list .wrap.container（特异性 0,3,0）稳压
 *  style.css 中各响应档单 .container / .wrap 规则。
 * ============================================================= */
.qapress-list .wrap.container {
  padding-left: 32px;
  padding-right: 32px;
  gap: 0 50px;
}

/* ============================================================= *
 *  详情页 - 全局容器（宽度由 .wrap>.main 两栏布局约束，此处仅留垂直间距）
 * ============================================================= */
.qapress-single .q-content {
  margin: 24px 0 48px;
}

/* ============================================================= *
 *  详情页 - 话题头部
 * ============================================================= */
.qapress-single .q-title {
  font-family: var(--font-display, -apple-system);
  font-size: 26px;
  font-weight: 700;
  color: var(--text, #333);
}

.qapress-single .topic-header .put-top {
  background: var(--accent-soft, rgba(77, 107, 254, 0.1));
  color: var(--accent, #4d6bfe);
}

.qapress-single .q-info a:hover,
.qapress-single .qa-manage a:hover {
  color: var(--accent, #4d6bfe);
}

/* ============================================================= *
 *  详情页 - 正文区域
 * ============================================================= */
.qapress-single .q-entry {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text, #333);
}

/* ============================================================= *
 *  详情页 - 回复列表
 * ============================================================= */
.qapress-single .as-title h3 {
  font-family: var(--font-display, -apple-system);
  color: var(--text, #333);
}

.qapress-single .as-user {
  color: var(--text, #333);
}

.qapress-single .as-user a:hover {
  color: var(--accent, #4d6bfe);
}

.qapress-single .as-content {
  color: var(--text, #333);
}

.qapress-single .btn-vote:hover {
  color: var(--accent, #4d6bfe);
  border-color: var(--accent, #4d6bfe);
}

.qapress-single .btn-vote.active {
  background: var(--accent-soft, rgba(77, 107, 254, 0.1));
  color: var(--accent, #4d6bfe);
  border-color: var(--accent, #4d6bfe);
}

.qapress-single .as-action a:hover,
.qapress-single .as-best a:hover {
  color: var(--accent, #4d6bfe);
}

/* ============================================================= *
 *  详情页 - 表单与按钮
 * ============================================================= */
.qapress-single .btn-submit {
  background: var(--accent, #4d6bfe);
  transition: opacity .18s ease;
}

.qapress-single .btn-submit:hover {
  opacity: .9;
}

.qapress-single .as-login-notice a {
  color: var(--accent, #4d6bfe);
  font-weight: 600;
}

/* ============================================================= *
 *  分页器
 * ============================================================= */
.qapress-list .q-pagination a:hover,
.qapress-single .q-pagination a:hover {
  color: var(--accent, #4d6bfe);
  border-color: var(--accent, #4d6bfe);
}

.qapress-list .q-pagination .current,
.qapress-single .q-pagination .current {
  background: var(--accent, #4d6bfe);
  border-color: var(--accent, #4d6bfe);
}

/* ============================================================= *
 *  提问页（qapress-new）- 右栏去除原生 widget，注入"最热提问"列表。
 *  wpcom_get_sidebar 过滤器返回哨兵 id，dynamic_sidebar_before 注入内容
 *  （见 opc-functions.php）。此处仅补充列表视觉，对齐列表页右栏观感。
 * ============================================================= */
.qapress-new .opc-qa-hot-widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.qapress-new .opc-qa-hot-widget li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #eee);
  font-size: 14px;
  line-height: 1.5;
}
/* 去除主题原生 .widget ul li::before 三角标记（其 left:0 会与文字重叠） */
.qapress-new .opc-qa-hot-widget li::before {
  display: none;
}
.qapress-new .opc-qa-hot-widget li:last-child {
  border-bottom: none;
}
/* 序号徽标：默认灰底，前三名高亮（对齐主题原生热榜观感） */
.qapress-new .opc-qa-hot-widget .opc-qa-rank {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: #999;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.qapress-new .opc-qa-hot-widget li:nth-child(1) .opc-qa-rank {
  background: linear-gradient(135deg, #f84975 10%, #ff3366);
  color: #fff;
}
.qapress-new .opc-qa-hot-widget li:nth-child(2) .opc-qa-rank {
  background: linear-gradient(135deg, #ff7a66 10%, #ff2d2d);
  color: #fff;
}
.qapress-new .opc-qa-hot-widget li:nth-child(3) .opc-qa-rank {
  background: linear-gradient(135deg, #ffa940 10%, #ff7a00);
  color: #fff;
}
.qapress-new .opc-qa-hot-widget li a {
  flex: 1;
  min-width: 0;
  color: var(--text, #333);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.qapress-new .opc-qa-hot-widget li a:hover {
  color: var(--accent, #4d6bfe);
}

/* ============================================================= *
 *  响应式
 * ============================================================= */
@media (max-width: 768px) {
  .qapress-list .q-content,
  .qapress-single .q-content {
    margin: 20px auto 40px;
    padding: 0 16px;
  }

  .qapress-single .q-title {
    font-size: 21px;
  }
}
