/* ===========================================================================
   项目讨论页（/project/{标识}/discussions，Views/Code/Discussions.cshtml，2026-10-29）
   ---------------------------------------------------------------------------
   跟详情页（codedetail-v6.css 的 cd- 那一套）同一个样子：一行小字的面包屑、白卡片、品牌绿、价格红。
   类名一律 pd- 开头、自给自足 —— 不引 codedetail-v6.css（那一份大半是首屏和页内导航，这一页用不上），
   也不碰老的 codethreadlist.css（「所有评论」那一页还在用）。讨论列表本身是 comment-board.css 那一份。
   =========================================================================== */

.pd-page { padding: 20px 0 32px; --pd-accent: #278426; --pd-accent-hover: #216f21; --pd-accent-soft: #edf8ef;
           --pd-line: #e5ece8; --pd-ink: #1f2933; --pd-ink-strong: #172333; --pd-muted: #5f6b76;
           color: var(--pd-ink); font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif; }
body.rwd:has(.pd-page) { background-color: #f5f7f6; }
.pd-page .ui-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.pd-page ul { list-style: none; margin: 0; padding: 0; }
.pd-page h1, .pd-page h2, .pd-page h3 { margin: 0; padding: 0; border: 0; }

/* ---- 面包屑 ---- */
.pd-crumb { font-size: 13px; color: var(--pd-muted); margin-bottom: 12px; line-height: 1.6; }
.pd-crumb a { color: var(--pd-muted); }
.pd-crumb a:hover { color: var(--pd-accent); }
.pd-crumb-sep { margin: 0 6px; color: #b9c2ca; }
.pd-crumb-cur { color: #4b5563; }

/* ---- 卡片 ---- */
.pd-card { background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; }

/* ---- 首屏：这是哪个项目的讨论、有多少、问作者 ---- */
.pd-hero { display: flex; align-items: center; gap: 20px; padding: 20px 24px; margin-bottom: 20px; }
.pd-hero-thumb { flex: 0 0 88px; width: 88px; height: 88px; display: flex; align-items: center; justify-content: center;
                 border: 1px solid var(--pd-line); border-radius: 10px; overflow: hidden; background: #f3f6f3; color: #9aa8a0; }
.pd-hero-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-hero-thumb .ui-icon { width: 32px; height: 32px; }
.pd-hero-main { flex: 1 1 auto; min-width: 0; }
.pd-title { font-size: 22px; line-height: 1.4; font-weight: 700; color: var(--pd-ink-strong); word-break: normal; overflow-wrap: anywhere; }
.pd-intro { margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--pd-muted);
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 这一行是 AI 定位时前面挂 AI 标识（ProjectCardIntro.Badge） */
.pd-intro > .ai-badge { margin-right: 6px; }
.pd-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: #5b6670; }
.pd-stats b { margin: 0 3px; font-size: 15px; color: var(--pd-ink-strong); }
.pd-hero-act { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; }

/* ---- 按钮：主操作绿底，次操作白底描边（跟详情页 cd-btn-go / cd-btn-sub 一个意思） ---- */
.pd-btn-go, .pd-btn-sub { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 18px;
                          border-radius: 8px; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
                          box-sizing: border-box; text-decoration: none; }
.pd-btn-go { border: 1px solid var(--pd-accent); background: var(--pd-accent); color: #fff; }
.pd-btn-go:hover, .pd-btn-go:focus-visible { background: var(--pd-accent-hover); border-color: var(--pd-accent-hover); color: #fff; }
.pd-btn-go[disabled] { opacity: .6; cursor: default; }
.pd-btn-go.action-pay { border-color: #c2410c; background: #c2410c; }
.pd-btn-go.action-pay:hover, .pd-btn-go.action-pay:focus-visible { border-color: #9a3412; background: #9a3412; }
.pd-btn-sub { border: 1px solid #cfdad3; background: #fff; color: var(--pd-ink); font-weight: 500; }
.pd-btn-sub:hover, .pd-btn-sub:focus-visible { border-color: var(--pd-accent); color: var(--pd-accent); }
.pd-btn-block { display: flex; width: 100%; }

/* ---- 两栏：讨论在左，项目和「提问之前」在右 ---- */
.pd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.pd-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pd-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; position: sticky; top: 76px; }

.pd-panel { padding: 20px 24px 22px; }
.pd-panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.pd-panel-head h2 { font-size: 18px; font-weight: 700; color: var(--pd-ink-strong); }
.pd-count { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--pd-muted); }
.pd-page-of { margin-left: auto; font-size: 13px; color: var(--pd-muted); }

/* 讨论列表顶上那一行的几个数，首屏已经摆了（N 条讨论 / 几个提问 / 作者回复几个），这一页只留那句打码说明 */
#pd_board .cb-sum-stat { display: none; }
#pd_board .cb-sum-note { margin-left: 0; }

/* ---- 翻页 ---- */
.pd-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #eef2ef; }
.pd-pager a, .pd-pager span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
                              border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.pd-pager a { border: 1px solid var(--pd-line); color: var(--pd-ink); }
.pd-pager a:hover, .pd-pager a:focus-visible { border-color: var(--pd-accent); color: var(--pd-accent); }
.pd-pager .pd-pager-cur { background: var(--pd-accent); color: #fff; font-weight: 600; }
.pd-pager .pd-pager-gap { min-width: 20px; padding: 0; color: var(--pd-muted); }

/* ---- 问作者 ---- */
.pd-compose textarea { display: block; width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid #d5ded8; border-radius: 8px;
                       font: inherit; font-size: 14px; line-height: 1.7; color: var(--pd-ink); resize: vertical; box-sizing: border-box; }
.pd-compose textarea:focus { outline: none; border-color: var(--pd-accent); box-shadow: 0 0 0 3px rgba(39, 132, 38, .12); }
.pd-err { margin: 6px 0 0; font-size: 13px; color: #c62828; }
.pd-compose-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.pd-chars { margin-right: auto; font-size: 12.5px; color: var(--pd-muted); }
.pd-chars.is-over { color: #c62828; }
.pd-code { display: inline-flex; align-items: center; gap: 8px; }
.pd-code[hidden] { display: none; }
.pd-code input { width: 96px; height: 38px; padding: 0 10px; border: 1px solid #d5ded8; border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.pd-code img { height: 34px; border-radius: 6px; cursor: pointer; }
.pd-tip { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: #8a949e; }

/* ---- 右栏：这个项目 ---- */
.pd-project { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.pd-project-title { font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--pd-ink-strong); word-break: normal; overflow-wrap: anywhere; }
.pd-project-title:hover { color: var(--pd-accent); }
.pd-project-facts { margin: 0 0 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pd-project-facts div { padding: 8px 10px; border-radius: 8px; background: #f6f9f7; }
.pd-project-facts dt { font-size: 12px; font-weight: 400; color: var(--pd-muted); }
.pd-project-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--pd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-project-facts dd .f20 { font-size: 14px; }

/* ---- 右栏：提问之前 ---- */
.pd-tips { padding: 18px 20px; background: #f3faf4; border-color: #d7e9dc; }
.pd-tips h3 { margin-bottom: 8px; font-size: 14px; font-weight: 700; color: #1f6b1f; }
.pd-tips li { position: relative; padding-left: 12px; font-size: 13px; line-height: 1.75; color: #4b5563; }
.pd-tips li + li { margin-top: 4px; }
.pd-tips li::before { content: ""; position: absolute; left: 0; top: .8em; width: 4px; height: 4px; border-radius: 2px; background: var(--pd-accent); }
.pd-tips a { color: var(--pd-accent); }

/* ---- 拆单栏：右栏（项目卡、提问之前）挪到讨论下面 ---- */
@media (max-width: 1219.98px) {
    .pd-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 899.98px) {
    .pd-layout { grid-template-columns: minmax(0, 1fr); }
    .pd-side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 760px) {
    .pd-page { padding: 12px 0 20px; }
    .pd-hero { flex-wrap: wrap; align-items: flex-start; gap: 12px 14px; padding: 16px; margin-bottom: 12px; }
    .pd-hero-thumb { flex-basis: 64px; width: 64px; height: 64px; }
    .pd-hero-main { flex: 1 1 0; }
    .pd-title { font-size: 18px; }
    .pd-hero-act { flex-direction: row; width: 100%; }
    .pd-hero-act > a { flex: 1 1 0; }
    .pd-layout, .pd-main { gap: 12px; }
    .pd-panel { padding: 16px; }
    .pd-side { grid-template-columns: minmax(0, 1fr); }
    .pd-compose-bar .pd-btn-go { flex: 1 1 auto; }
}
