/* 诗人广场 /poets/
 *
 * 纸卡视觉：与首页、intro、stats、作者页保持一致（深色底 + rgba(255,255,255,.9)
 * 卡片 + 1.5em 圆角）。本页只新增筛选条、名片栅格和 select2 的纸面化皮肤。
 */

html.poets-page .main-container {
    max-width: 64em; /* 名片栅格比默认 48em 宽，3–4 列 */
}

/* --- 页头 --- */
.poets-hero {
    margin-bottom: 1.2em;
}

.poets-hero h1 {
    margin: 0 0 0.2em;
    font-size: 1.6em;
    font-weight: 600;
    color: #f2f2f2;
    letter-spacing: 0.04em;
}

.poets-lede {
    margin: 0 0 1em;
    color: #a8a8a8;
    font-size: 0.85em;
    letter-spacing: 0.04em;
}

/* --- 筛选条（一张纸卡：搜索 + 勾选 + 排序） --- */
.poets-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em 0.9em;
    padding: 0.85em 1em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1.2em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.poets-search {
    position: relative;
    display: flex;
    flex: 1 1 14em;
    min-width: 0;
}

.poets-filter input[type="search"] {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 0.9em;
    color: #1c1917;
    background: #f7f5f2;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.6em;
    padding: 0.5em 2.8em 0.5em 0.7em;
}

/* 搜索图标按钮：贴着输入框右侧，可点可回车 */
.poets-search-go {
    position: absolute;
    right: 0.3em;
    top: 50%;
    transform: translateY(-50%);
    width: 2em;
    height: 2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 0.45em;
    background: none;
    color: #57534e;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.poets-search-go svg {
    width: 1.1em;
    height: 1.1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.poets-search-go:hover,
.poets-search-go:focus-visible {
    color: #995577;
    background: rgba(153, 85, 119, 0.1);
    outline: none;
}

.poets-search-go:active {
    transform: translateY(-50%) scale(0.94);
}

.poets-filter input[type="search"]::placeholder {
    color: #a8a29e;
}

.poets-filter input[type="search"]:focus {
    outline: none;
    border-color: #995577;
    box-shadow: 0 0 0 3px rgba(153, 85, 119, 0.12);
}

.poets-checks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9em;
}

.poets-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-size: 0.85em;
    color: #57534e;
    cursor: pointer;
    white-space: nowrap;
}

.poets-clear {
    font-size: 0.8em;
    color: #78716c;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* 排序：明确标注，独立成组，推到筛选条右侧 */
.poets-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin-left: auto;
}

.poets-sort-label {
    font-size: 0.8em;
    color: #78716c;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.poets-sort select {
    width: 8.5em;
}

.poets-count {
    margin: 0.9em 0 0;
    font-size: 0.85em;
    color: #a8a8a8;
}

/* --- select2，纸面化（与 /collections 的皮肤同源，这里按暗底纸卡调色） --- */
.poets-filter .select2-container {
    width: 8.5em !important;
    vertical-align: middle;
}

.poets-page .select2-container--default .select2-selection--single {
    height: 2.45em;
    background: #f7f5f2;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.6em;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.poets-page .select2-container--default .select2-selection--single:hover {
    border-color: #c9c5b5;
}

.poets-page .select2-container--default.select2-container--focus .select2-selection--single,
.poets-page .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #995577;
    box-shadow: 0 0 0 3px rgba(153, 85, 119, 0.12);
}

.poets-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.35em;
    padding-left: 0.7em;
    padding-right: 1.8em;
    color: #1c1917;
    font-size: 0.9em;
}

.poets-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.35em;
    right: 0.4em;
}

.poets-page .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #78716c transparent transparent;
}

.poets-page .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #78716c;
}

.poets-page .select2-dropdown {
    background: #fffefb;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.poets-page .select2-dropdown--below {
    border-radius: 0 0 0.6em 0.6em;
}

.poets-page .select2-dropdown--above {
    border-radius: 0.6em 0.6em 0 0;
}

.poets-page .select2-container--default .select2-results__option {
    padding: 0.5em 0.8em;
    font-size: 0.9em;
    color: #1c1917;
}

.poets-page .select2-container--default .select2-results__option[aria-selected=true] {
    background: #f2eee8;
    font-weight: 600;
}

.poets-page .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #995577;
    color: #fff;
}

.poets-page .select2-results__options {
    max-height: 260px;
}

/* --- 名片栅格 --- */
.poets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15.5em, 1fr));
    gap: 0.9em;
    align-items: stretch;
    margin-top: 0.4em;
}

.poet-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1.1em;
    padding: 0.95em 1em 0.95em 1.15em;
    color: #1c1917;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
    min-width: 0;
}

/* 左侧作者主题色竖条 */
.poet-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--poet-color, #995577);
    opacity: 0.75;
}

.poet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18);
    text-decoration: none;
}

.poet-card:hover::before {
    opacity: 1;
}

.poet-avatar {
    position: relative;
    flex: none;
    width: 2.5em;
    height: 2.5em;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05em;
    line-height: 1;
    color: #1c1917;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.poet-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poet-card-main {
    display: flex;
    flex-direction: column;
    gap: 0.32em;
    min-width: 0;
    flex: 1;
}

.poet-card-head {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    min-width: 0;
}

.poet-name {
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poet-flag {
    flex: none;
    align-self: center;
    font-size: 0.65em;
    line-height: 1.7;
    padding: 0 0.4em;
    border-radius: 0.3em;
    color: #7a4160;
    background: rgba(153, 85, 119, 0.14);
    white-space: nowrap;
}

/* 代表作 badge：同形状，换成中性色，避免和「社员」抢注意力 */
.poet-flag-soft {
    color: #57534e;
    background: rgba(0, 0, 0, 0.06);
}

/* 右上角作品总数：数字大，"篇"小 */
.poet-total {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 0.1em;
    padding-left: 0.4em;
    flex: none;
}

.poet-total b {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.poet-total i {
    font-style: normal;
    font-size: 0.6em;
    color: #78716c;
}

.poet-desc {
    margin: 0;
    font-size: 0.8em;
    line-height: 1.6;
    color: #57534e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poet-work {
    display: flex;
    align-items: center;
    gap: 0.35em;
    min-width: 0;
    font-size: 0.85em;
    color: #1c1917;
}

.poet-work-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poet-meta {
    /* 同一行卡片等高时，把分类数量压到卡片底部，行内看起来才齐 */
    margin: auto 0 0;
    font-size: 0.75em;
    color: #78716c;
    letter-spacing: 0.02em;
}

.poet-empty {
    margin: auto 0 0;
    font-size: 0.8em;
    color: #a8a29e;
}

.poet-card.is-empty {
    background: rgba(255, 255, 255, 0.72);
}

.poet-card.is-empty::before {
    opacity: 0.3;
}

/* --- 空态与页脚 --- */
.poets-empty {
    margin: 2em 0;
    padding: 2.5em 1em;
    text-align: center;
    color: #a8a8a8;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1.2em;
    font-size: 0.9em;
}

.poets-empty a {
    color: #cc99bb;
}

/* --- 移动端 --- */
@media (max-width: 600px) {
    html.poets-page .main-container {
        max-width: none;
    }

    .poets-hero h1 {
        font-size: 1.35em;
    }

    .poets-filter {
        padding: 0.7em 0.8em;
        gap: 0.55em;
        border-radius: 1em;
    }

    .poets-search {
        flex: 1 1 100%;
    }

    /* iOS 对 <16px 的输入框会强制放大页面 */
    .poets-filter input[type="search"] {
        font-size: 16px;
    }

    /* 触控目标至少 40px */
    .poets-search-go {
        width: 2.5em;
        height: 2.5em;
    }

    .poets-checks {
        gap: 0.8em;
    }

    .poets-sort {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .poets-page .select2-container {
        flex: 1;
        width: auto !important;
    }

    .poets-grid {
        grid-template-columns: 1fr;
        gap: 0.7em;
    }

    .poet-card {
        padding: 0.8em 0.9em 0.8em 1em;
    }

    .poet-total b {
        font-size: 1.35em;
    }
}

/* --- 视图切换 --- */
.poets-views {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 1em;
}

.poets-view {
    font-size: 0.82em;
    color: #57534e;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.55em;
    padding: 0.4em 0.95em;
    text-decoration: none;
}

.poets-view:hover {
    text-decoration: none;
    border-color: rgba(153, 85, 119, 0.4);
}

.poets-view.is-on {
    color: #fff;
    background: #995577;
    border-color: #995577;
}

/* --- 表格视图 --- */
.poets-table-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1.5em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 1.2em 1.3em;
    margin-top: 1em;
}

.poets-table-wrap {
    overflow-x: auto;
}

.poets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
    white-space: nowrap;
    color: #44403c;
}

.poets-table td {
    color: #3f3a35;
}

.poets-table th,
.poets-table td {
    /* 横向内边距用 rem：表头与单元格字号不同，用 em 会算不出同一个起点 */
    padding: 0.55em 0.7rem;
    text-align: right;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.poets-table th {
    font-weight: 600;
    color: #57534e;
    font-size: 0.92em;
    border-bottom-color: rgba(0, 0, 0, 0.12);
}

.poets-table tbody tr:hover {
    background: rgba(153, 85, 119, 0.04);
}

.poets-td-author {
    text-align: left;
}

/* 表头「作者」要对到作者名的第一个字，而不是前面的颜色圆点：
   圆点和间距都用 rem，表头 padding 用同一个值，字号不同也不会错位 */
/* 需要压过 .poets-table th 的 padding/text-align（同权重靠后不够，得提权重） */
.poets-table th.poets-th-author {
    /* 单元格左内边距 0.7rem + 圆点 0.6rem + 间距 0.5rem */
    padding-left: 1.8rem;
    text-align: left;
}

.poets-td-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.poets-td-author a {
    color: #1c1917;
    font-weight: 600;
}

.poets-dot {
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
}

/* 「主页」表头对到「查看 →」的查字，其他列保持右对齐 */
.poets-table th.poets-th-link,
.poets-table td.poets-td-link {
    text-align: left;
}

.poets-row-link {
    color: #7a4160;
    font-size: 0.92em;
}

/* --- 关系图视图 --- */
.poets-graph {
    margin-top: 1em;
    border-radius: 1.5em;
    overflow: hidden;
    background: #1a1a1a;
}

.poets-graph .graph-header {
    background: rgba(255, 255, 255, 0.92);
    padding: 1em;
    text-align: center;
}

.poets-graph .graph-header h2 {
    margin: 0;
    font-size: 1.05em;
    color: #1c1917;
}

.poets-graph .graph-header p {
    margin: 0.45em 0 0;
    font-size: 0.82em;
    color: #78716c;
}

.poets-graph svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 800px;
    background: #1a1a1a;
}
