@charset "UTF-8";
/* ==========================================================================
   讨论区首页 discuss/index
   --------------------------------------------------------------------------
   页头、卡片、键值表、分页、右侧栏全部复用 problem-sub.css 的 .pd- 类，
   本文件只写「主题列表」特有的部分（.dl-），两份样式由 index.php 一起注册。
   作用域：全部以 .dl- 起头，不碰任何全局选择器。
   ========================================================================== */

/* 页头右侧的「N 个主题」：跟标题同一行，比标题淡一档 */
.dl-head-count {
    flex: none;
    color: var(--muted);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ 骨架 */
/* 与讨论详情页同一套栅格（1fr + 286px），从列表点进帖子时版心不跳 */
.dl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 286px;
    align-items: start;
    gap: 18px;
    padding-top: 18px;
}
.dl-main {
    min-width: 0;
}
.dl-side {
    position: sticky;
    top: 16px;
}

/* ------------------------------------------------------------- 排序工具条 */
.dl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    background: #FCFDFC;
    border-radius: 4px 4px 0 0;
}

.dl-sort {
    display: flex;
    align-items: center;
    gap: 2px;
}
.dl-sort-label {
    margin-right: 6px;
    color: var(--muted);
    font-size: 11.5px;
}
/* 两个排序方式做成轻量页签，不用 select：少一次交互，也不用写 JS */
.dl-sort-item {
    padding: 3px 9px;
    border-radius: 3px;
    color: var(--ink-3);
    font-size: 12px;
    text-decoration: none;
}
.dl-sort-item:hover,
.dl-sort-item:focus {
    background: var(--line-soft);
    color: var(--brand);
    text-decoration: none;
}
.dl-sort-item.is-on {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.dl-toolbar-hint {
    color: var(--muted);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ 列表 */
.dl-list {
    border-radius: 0 0 4px 4px;
}

.dl-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    transition: background .12s;
}
.dl-item:last-child {
    border-bottom: 0;
}
.dl-item:hover {
    background: #FBFCFB;
}

.dl-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--line-soft);
    object-fit: cover;
}

.dl-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* 一行小字：题目标签 + 发布时间 */
.dl-item-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 9px;
    margin-bottom: 4px;
    font-size: 11.5px;
}

/* 题目标签：[P1101 加与乘]，题名过长时省略，不占满整行 */
.dl-problem {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 3px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
    line-height: 1.6;
    text-decoration: none;
}
.dl-problem:hover,
.dl-problem:focus {
    background: #DDEBE9;
    color: var(--brand);
    text-decoration: none;
}
.dl-problem b {
    flex: none;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.dl-problem-t {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-3);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-when {
    color: var(--muted);
    white-space: nowrap;
}

/* 标题：比列表外的正文重一档，hover 只是换色，不位移 */
.dl-item-title {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.5;
    /* 学生帖里常有 "dmfkbvubfvguvotigpdn" 这种无空格长串 */
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.dl-item-title a {
    color: inherit;
    text-decoration: none;
}
.dl-item-title a:hover,
.dl-item-title a:focus {
    color: var(--brand);
    text-decoration: none;
}

/* 摘要两行截断：多了会把一屏挤成三条，少了又看不出在问什么 */
.dl-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 6px;
    max-height: 3.3em;
    color: var(--ink-3);
    font-size: 12.5px;
    line-height: 1.65;
    overflow-wrap: break-word;
    word-wrap: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
    color: var(--muted);
    font-size: 11.5px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.dl-author {
    color: var(--ink-2);
    font-weight: 500;
    text-decoration: none;
}
a.dl-author:hover {
    color: var(--brand);
    text-decoration: none;
}

/* 右侧回复数：列表里最需要一眼看到的数字 */
.dl-count {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 46px;
    padding: 3px 0 2px 12px;
    color: var(--muted);
    text-decoration: none;
}
.dl-count b {
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.dl-count span {
    font-size: 10.5px;
    line-height: 1.2;
}
/* 0 回复不抢眼：整列 12 条里大部分是 0，全部用墨色反而糊成一片 */
.dl-count.is-zero b {
    color: var(--muted);
    font-weight: 400;
}
.dl-count:hover {
    text-decoration: none;
}
.dl-count:hover b {
    color: var(--brand);
}

/* ------------------------------------------------------------ 侧栏：榜单 */
.dl-ranks,
.dl-users {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dl-ranks li + li,
.dl-users li + li {
    margin-top: 1px;
}

.dl-ranks a,
.dl-users a,
.dl-user-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
    color: var(--ink-2);
    font-size: 12.5px;
    text-decoration: none;
}
.dl-ranks a:hover,
.dl-users a:hover {
    color: var(--brand);
    text-decoration: none;
}

/* 名次：等宽数字，第一名用强调色 */
.dl-ranks i {
    flex: none;
    width: 13px;
    color: var(--muted);
    font-size: 10.5px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.dl-ranks li:first-child i {
    color: var(--brand);
    font-weight: 600;
}

.dl-rank-t {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dl-rank-t b {
    margin-right: 4px;
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dl-ranks em,
.dl-users em {
    flex: none;
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.dl-users img {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--line-soft);
    object-fit: cover;
}
.dl-user-n {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 侧栏「更多」：28x 窄栏里三个链接横排会挤成一行两截，
   改成竖排，同时去掉 .pd-side-links 自带的上边框 ——
   卡片小标题底下已经有一条分隔线，两条线隔 22px 看着像画歪了 */
.dl-side .pd-side-links {
    flex-direction: column;
    gap: 7px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* -------------------------------------------------------------- 响应式 */
@media (max-width: 991px) {
    .dl-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    /* 单列后侧栏跟在列表下面，吸顶反而会盖住内容 */
    .dl-side {
        position: static;
    }
}

@media (max-width: 600px) {
    .dl-item {
        gap: 10px;
        padding: 13px 12px;
    }
    .dl-avatar {
        width: 28px;
        height: 28px;
    }
    .dl-count {
        min-width: 38px;
        padding-left: 8px;
    }
    .dl-excerpt {
        max-height: 3.3em;
        -webkit-line-clamp: 2;
    }
    .dl-problem-t {
        max-width: 150px;
    }
    .dl-toolbar {
        padding: 8px 12px;
    }
}
