/* ==========================================================================
   论坛首页 · zw-pc-page-tianya
   视觉走主站设计令牌（--ls-primary / --ls-bg / --ls-border / --ls-text…）：
   白底卡片 + 细边框 + 6~12 圆角，内容一律离卡片边框 16px，和主站同一套观感。
   版块目录按内容分区，帖子列表只留文字列，不放图片。
   ========================================================================== */

.ty {
    --ink: var(--ls-text-primary, #1f2937);
    --text: var(--ls-text-secondary, #4b5563);
    --sub: var(--ls-secondary, #6b7280);
    --mute: var(--ls-text-muted, #9ca3af);
    --line: var(--ls-border, #e5e7eb);
    --line-soft: var(--ls-border-light, #f3f4f6);
    --card: var(--ls-card-bg, #ffffff);
    --page: var(--ls-bg, #f8fafc);
    --hover: var(--ls-bg-hover, #f1f5f9);
    --primary: var(--ls-primary, #3b82f6);
    --primary-d: var(--ls-primary-hover, #2563eb);
    --primary-soft: var(--ls-primary-light, #eff6ff);
    --pad: 16px;

    display: block;
    padding-top: var(--ty-hd-h, 0px);
    padding-bottom: 8px;
    background: var(--page);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}
.ty *, .ty *::before, .ty *::after { box-sizing: border-box; }
.ty a { color: var(--primary); text-decoration: none; }
.ty a:hover { color: var(--primary-d); }
/* 正文里的标题类链接保持正文色，悬停才走主色 */
.ty a.ty-title,
.ty a.ty-block-name,
.ty a.ty-b { color: var(--ink); }
.ty a.ty-b { color: var(--text); font-size: 13.5px; }
.ty a.ty-b:hover { color: var(--primary); }
.ty a.ty-block-more { color: var(--text); }
.ty-row:hover a.ty-title,
.ty a.ty-title:hover { color: var(--primary); }
.ty a.ty-block-name:hover { color: var(--primary); }

/* 用 :where() 把重置权重降到最低，避免盖掉下面卡片自己的内边距 */
.ty :where(ul, ol, dl, dd) { margin: 0; padding: 0; list-style: none; }
.ty h1, .ty h2, .ty h3, .ty p { margin: 0; }
.ty table { border-collapse: collapse; }
.ty img { display: block; }
.ty em { font-style: normal; }

.ty-wrap {
    width: min(var(--ls-width, 1200px), calc(100% - 48px));
    margin: 0 auto;
}

.ty-loading {
    padding: 90px 20px; text-align: center;
    color: var(--mute); font-size: 13px;
}

/* ---------- 顶栏 ---------- */
.ty-topbar {
    display: flex; align-items: center; gap: 20px;
    margin-top: 20px; padding: 0 var(--pad);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--ls-radius-xl, 12px);
    box-shadow: var(--ls-shadow-xs, 0 1px 2px rgba(0, 0, 0, .04));
}
.ty-nav { flex: 1 1 auto; min-width: 0; }
.ty-nav-in { display: flex; flex-wrap: nowrap; height: 56px; overflow: hidden; }
.ty-nav a {
    position: relative; display: flex; align-items: center;
    padding: 0 16px; color: var(--text); font-size: 14px; white-space: nowrap;
}
.ty-nav a:hover { color: var(--primary); }
.ty-nav a.on { color: var(--primary); font-weight: 600; }
.ty-nav a.on::after {
    content: ""; position: absolute; left: 16px; right: 16px; bottom: 0;
    height: 2px; border-radius: 2px 2px 0 0; background: var(--primary);
}
.ty-nav a i { font-size: 14px; margin-right: 5px; opacity: .9; }
.ty-nav a.ty-nav-x { color: var(--mute); cursor: default; }
.ty-nav a.ty-nav-x:hover { color: var(--mute); }

/* ---------- 三栏 ---------- */
.ty-main {
    display: grid;
    grid-template-columns: var(--cat-w, 212px) minmax(0, 1fr) minmax(220px, 288px);
    gap: 14px; align-items: start; padding: 16px 0 36px;
}
.ty-col { min-width: 0; }
/* 站点 base.css 有全局 main{width:var(--ls-width)}，这里把三栏钉回栅格 */
.ty-main > .ty-col { width: auto; margin: 0; float: none; }
.ty-col-l, .ty-col-r { display: grid; gap: 14px; }
.ty-col-l { position: sticky; top: calc(var(--ty-hd-h, 0px) + 14px); }
.ty-col-r { position: sticky; top: calc(var(--ty-hd-h, 0px) + 14px); }

/* ---------- 卡片 ---------- */
.ty-side, .ty-block, .ty-notice {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--ls-radius-xl, 12px);
    box-shadow: var(--ls-shadow-xs, 0 1px 2px rgba(0, 0, 0, .04));
}
.ty-side { overflow: hidden; }
.ty-col-l .ty-side {
    max-height: calc(100vh - var(--ty-hd-h, 0px) - 34px);
    display: flex; flex-direction: column;
}
.ty-side-hd {
    display: flex; align-items: center; gap: 8px;
    height: 48px; padding: 0 var(--pad);
    border-bottom: 1px solid var(--line-soft);
    font-size: 15px; font-weight: 600; color: var(--ink);
}
.ty-side-hd b { font-weight: 600; }
.ty-side-hd span { margin-left: auto; font-size: 12.5px; font-weight: 400; color: var(--mute); }

/* 版块目录：按内容分区 */
.ty-boards {
    padding: 4px 0 10px;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    scrollbar-width: thin;
}
.ty-boards::-webkit-scrollbar { width: 6px; }
.ty-boards::-webkit-scrollbar-thumb { background: #dbe1e8; border-radius: 3px; }
.ty-boards.is-scroll { -webkit-mask-image: linear-gradient(#000 calc(100% - 16px), transparent); mask-image: linear-gradient(#000 calc(100% - 16px), transparent); }
.ty-group + .ty-group { border-top: 1px solid var(--line-soft); }
.ty-group-h {
    display: flex; align-items: center; gap: 6px;
    padding: 9px var(--pad) 3px;
    color: var(--mute); font-size: 12px; letter-spacing: .04em;
}
.ty-g-ic { flex: 0 0 auto; font-size: 13px; color: var(--primary); opacity: .75; line-height: 1; }
.ty-g-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-group-h .ty-g-n {
    flex: 0 0 auto; font-size: 11.5px; color: #c3c9d2;
    font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.ty-group-d {
    padding: 0 var(--pad) 5px;
    color: #b6bcc6; font-size: 11.5px; line-height: 1.5;
}
.ty-b {
    display: flex; align-items: center; gap: 8px;
    height: 29px; padding: 0 var(--pad);
    color: var(--text); font-size: 13.5px;
    transition: background .14s, color .14s;
}
.ty-b:hover { background: var(--hover); color: var(--primary); }
.ty-b-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-b-n { flex: 0 0 auto; color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 目录行距：紧凑 / 标准 / 宽松 */
.ty-boards.ty-cat-compact .ty-b { height: 25px; font-size: 13px; }
.ty-boards.ty-cat-compact .ty-group-h { padding-top: 7px; padding-bottom: 2px; }
.ty-boards.ty-cat-loose .ty-b { height: 34px; font-size: 14px; }
.ty-boards.ty-cat-loose .ty-group-h { padding-top: 12px; padding-bottom: 5px; }

/* 目录不吸顶 */
.ty-no-sticky .ty-col-l { position: static; top: auto; }

/* 榜单 */
.ty-rank-list, .ty-brank { padding: 6px var(--pad) 12px; }
.ty-rank-list li, .ty-brank li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.ty-rank-list li:last-child, .ty-brank li:last-child { border-bottom: 0; padding-bottom: 0; }
.ty-rank-list a, .ty-brank a {
    flex: 1 1 auto; min-width: 0; color: var(--text); font-size: 13.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ty-rank-list a:hover, .ty-brank a:hover { color: var(--primary); }
.ty-rank-n {
    flex: 0 0 auto; width: 18px; text-align: center;
    color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
/* 版块排行：名次做成色块，前三名用实底 */
.ty-brank-n {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 4px;
    background: var(--primary-soft); color: var(--primary-d);
    font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.ty-brank li:nth-child(1) .ty-brank-n { background: var(--primary); color: #fff; }
.ty-brank li:nth-child(2) .ty-brank-n { background: #60a5fa; color: #fff; }
.ty-brank li:nth-child(3) .ty-brank-n { background: #93c5fd; color: #fff; }
.ty-rank-hot { color: var(--primary); font-weight: 600; }
.ty-rank-r, .ty-brank-c {
    flex: 0 0 auto; color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums;
}

/* 统计 */
.ty-stat-list { padding: 14px var(--pad) 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 8px; }
.ty-stat-list > div { display: flex; align-items: baseline; gap: 6px; }
.ty-stat-list dt { color: var(--mute); font-size: 12.5px; }
.ty-stat-list dd { color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 中栏提示条 ---------- */
.ty-notice {
    display: flex; align-items: center; gap: 9px;
    padding: 10px var(--pad); margin-bottom: 14px;
    background: var(--primary-soft);
    border-color: rgba(var(--ls-primary-rgb, 59, 130, 246), .14);
    color: #1e40af;
    font-size: 13px;
    overflow: hidden;
}
.ty-notice-dot {
    flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary);
}
.ty-notice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 版块卡 ---------- */
.ty-block { margin-bottom: 14px; overflow: hidden; }
.ty-block-hd {
    display: flex; align-items: center; gap: 12px;
    min-height: 50px; padding: 0 var(--pad);
    border-bottom: 1px solid var(--line-soft);
    overflow: hidden;
}
.ty-block-name {
    flex: 0 0 auto; color: var(--ink); font-size: 15px; font-weight: 600;
}
.ty-block-desc {
    flex: 1 1 auto; min-width: 0; color: var(--mute); font-size: 12.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ty-block-stat { flex: 0 0 auto; margin-left: auto; color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ty-block-more {
    flex: 0 0 auto; height: 26px; padding: 0 11px; border-radius: var(--ls-radius, 6px);
    border: 1px solid var(--line); background: var(--card); color: var(--text);
    font-size: 12.5px; line-height: 24px; text-decoration: none !important;
    transition: all .14s;
}
.ty-block-more:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 帖子表（纯文字列，表格左右各留 16px） ---------- */
.ty-list { table-layout: fixed; width: calc(100% - var(--pad) * 2); margin: 0 var(--pad); }
.ty-list thead th {
    height: 32px; padding: 0 10px 0 0; text-align: left;
    color: var(--mute); font-size: 12px; font-weight: 400;
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}
.ty-list td {
    padding: 8px 10px 8px 0;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.ty-list thead th:last-child, .ty-list td:last-child { padding-right: 0; }
.ty-list tr:last-child td { border-bottom: 0; }
.ty-row { cursor: pointer; transition: background .14s; }
.ty-row:hover { background: var(--hover); }
.ty-row.ty-busy { opacity: .5; }
.ty-list .c-a { overflow: hidden; }
.ty-list .c-u, .ty-list thead .c-u { width: 104px; color: var(--sub); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-list .c-r, .ty-list thead .c-r { width: 56px; text-align: right; color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ty-list .c-l, .ty-list thead .c-l { width: 88px; text-align: right; color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.ty-list thead .c-r, .ty-list thead .c-l { text-align: right; padding-right: 0; }
.ty-list thead .c-r { padding-right: 10px; }

.ty-line { display: flex; align-items: center; gap: 0; min-width: 0; }
.ty-title {
    flex: 0 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ink); font-size: 14px;
}

.ty-tag {
    display: inline-block; flex: 0 0 auto;
    margin-left: 8px; padding: 0 6px; height: 19px;
    line-height: 19px; vertical-align: middle;
    border-radius: var(--ls-radius-sm, 4px);
    background: var(--line-soft); color: var(--sub);
    font-size: 11px; font-style: normal; white-space: nowrap;
}
.ty-tag-top { background: var(--primary-soft); color: var(--primary-d); }
.ty-tag-video { background: #eff6ff; color: #2563eb; }
.ty-tag-article { background: #ecfdf5; color: #047857; }
.ty-tag-music, .ty-tag-voice { background: #f5f3ff; color: #6d28d9; }
.ty-tag-vote { background: #fffbeb; color: #b45309; }
.ty-tag-redbag { background: #fef2f2; color: #b91c1c; }
.ty-tag-img { background: #f0fdfa; color: #0f766e; }
.ty-tag-board { background: #f1f5f9; color: var(--sub); }

.ty-empty { padding: 22px 0; text-align: center; color: var(--mute); font-size: 13px; }

.ty-loadmore { text-align: center; padding: 4px 0 10px; }
.ty-loadmore a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 168px; height: 36px; padding: 0 20px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--ls-radius, 6px);
    color: var(--text); font-size: 13px; text-decoration: none;
    transition: all .14s;
}
.ty-loadmore a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 提示与回顶 ---------- */
.ty-toast {
    position: fixed; left: 50%; bottom: 64px; z-index: 60;
    transform: translate(-50%, 12px);
    padding: 9px 18px;
    background: rgba(31, 41, 55, .92); color: #fff;
    border-radius: var(--ls-radius, 6px); font-size: 13px;
    opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.ty-toast.on { opacity: 1; transform: translate(-50%, 0); }
.ty-top {
    position: fixed; right: 24px; bottom: 40px; z-index: 40;
    width: 40px; height: 40px; line-height: 38px; text-align: center;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--ls-radius, 6px);
    color: var(--sub); font-size: 15px;
    box-shadow: var(--ls-shadow-sm, 0 2px 4px rgba(0, 0, 0, .06));
}
.ty-top:hover { color: var(--primary); border-color: var(--primary); }

/* ==========================================================================
   细节美化：阴影层次、表头区、名次徽标、行悬停、按钮态
   只调视觉，所有内边距与列宽保持原样（卡片内容一律离边 16px）
   ========================================================================== */

.ty { font-variant-numeric: tabular-nums; }

/* 卡片：边框淡一点，悬停时轻微提亮，不做位移避免跳动 */
.ty-side, .ty-block, .ty-notice { border-color: #e6e9ef; }
.ty-block { transition: border-color .16s, box-shadow .16s; }
.ty-block:hover { border-color: #dbe2ea; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }

/* 卡片头 */
.ty-side-hd { font-size: 15px; letter-spacing: .01em; }
.ty-side-hd span { letter-spacing: 0; }

/* 左栏目录：分区做成浅底分组块，和下面的版块行一眼分开 */
.ty-boards { padding: 6px 8px 10px; }
.ty-group {
    padding: 7px 4px 4px; border-radius: 8px;
    background: #f4f7fa;
}
.ty-group + .ty-group { border-top: 0; margin-top: 6px; }
.ty-group-h {
    padding: 0 6px 3px; gap: 7px; font-size: 12.5px; font-weight: 700;
    color: #46505d; letter-spacing: .02em;
}
.ty-g-ic {
    width: 18px; height: 18px; border-radius: 4px; opacity: 1;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--ls-primary-rgb, 59, 130, 246), .10);
    color: var(--primary); font-size: 12px; line-height: 1;
}
.ty-group-h .ty-g-n { color: #a4adb9; font-size: 11px; font-weight: 500; }
.ty-group-d {
    padding: 0 6px 6px 31px; color: #9aa3af;
    font-size: 11px; line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ty-b { height: 27px; padding: 0 8px; border-radius: 5px; font-size: 13px; }
.ty a.ty-b { color: var(--text); }
.ty b.ty-b-name, .ty-b-name { color: #4b5563; }
.ty-b-n { color: #97a0ad; font-size: 11.5px; }
.ty a.ty-b:hover { color: var(--primary); }
.ty-b:hover { background: #fff; }
.ty-boards.ty-cat-compact .ty-b { height: 24px; font-size: 12.5px; }
.ty-boards.ty-cat-compact .ty-group { padding: 5px 3px 3px; }
.ty-boards.ty-cat-loose .ty-b { height: 32px; font-size: 13.5px; }
.ty-boards.ty-cat-loose .ty-group { padding: 9px 5px 5px; }

/* 版块卡头：帖数做成胶囊，进入按钮悬停填充 */
.ty-block-hd { min-height: 52px; }
.ty-block-stat {
    flex: 0 0 auto;
    padding: 0 8px; height: 20px; line-height: 20px;
    border-radius: 10px; background: var(--line-soft);
    color: var(--sub); font-size: 12px;
}
.ty .ty-block-hd a.ty-block-more {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; white-space: nowrap;
    height: 28px; padding: 0 12px; line-height: 1;
    font-size: 12.5px; color: var(--text);
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--ls-radius, 6px); text-decoration: none;
    transition: all .14s;
}
.ty .ty-block-hd a.ty-block-more:hover,
.ty-block-more:hover {
    background: var(--primary); border-color: var(--primary); color: #fff;
}

/* 帖子表：表头铺浅底形成区带，行悬停用极淡主色 */
.ty-list thead th {
    height: 34px; font-size: 12px; font-weight: 500; color: var(--sub);
    background: #fafbfd; border-bottom: 1px solid var(--line);
}
.ty-list td { padding: 9px 10px 9px 0; }
.ty-row:hover { background: #f5f8ff; }
.ty-row:hover .c-u { color: var(--sub); }
.ty-row:hover .c-r, .ty-row:hover .c-l { color: var(--mute); }
.ty-tag { margin-left: 8px; }

/* 右栏名次：热帖榜与版块排行统一成色块，前三名实底 */
.ty-rank-n {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 4px;
    background: var(--primary-soft); color: var(--primary-d);
    font-size: 11px; font-weight: 600; letter-spacing: 0;
}
.ty-rank-list li:nth-child(1) .ty-rank-n { background: var(--primary); color: #fff; }
.ty-rank-list li:nth-child(2) .ty-rank-n { background: #60a5fa; color: #fff; }
.ty-rank-list li:nth-child(3) .ty-rank-n { background: #93c5fd; color: #fff; }
.ty-rank-list li, .ty-brank li { padding: 9px 0; gap: 10px; }

/* 统计：数字略大，行间松一点 */
.ty-stat-list { gap: 14px 8px; }
.ty-stat-list dd { font-size: 16px; letter-spacing: -.01em; }

/* 提示条：从左到右淡出，圆点加一圈柔光 */
.ty-notice { background: linear-gradient(90deg, #eff6ff 0%, #f8fbff 100%); }
.ty-notice-dot { box-shadow: 0 0 0 3px rgba(59, 130, 246, .10); }

/* 加载更多与回顶 */
.ty-loadmore a { height: 38px; }
.ty-loadmore a:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-d); }
.ty-top { width: 42px; height: 42px; line-height: 40px; border-radius: 50%; font-size: 16px; }
.ty-top:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 模块设置：区块开关 ---------- */
.ty-no-nav .ty-topbar { display: none; }
.ty-no-nav .ty-main { padding-top: 20px; }

.ty-no-catalog .ty-col-l { display: none; }
.ty.ty-no-catalog .ty-main { grid-template-columns: minmax(0, 1fr) minmax(220px, 288px); }
.ty.ty-right-off .ty-main { grid-template-columns: minmax(170px, 212px) minmax(0, 1fr); }
.ty.ty-no-catalog.ty-right-off .ty-main { grid-template-columns: minmax(0, 1fr); }

.ty-list.ty-hide-u .c-u { display: none; }
.ty-list.ty-hide-r .c-r { display: none; }
.ty-list.ty-hide-l .c-l { display: none; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1140px) {
    .ty-wrap { width: calc(100% - 32px); }
    .ty-main { grid-template-columns: minmax(0, 1fr) 268px; }
    .ty-col-l { display: none; }
    .ty.ty-no-catalog .ty-main { grid-template-columns: minmax(0, 1fr) 268px; }
    .ty.ty-right-off .ty-main { grid-template-columns: minmax(0, 1fr); }
    .ty-nav-in { overflow-x: auto; scrollbar-width: none; }
    .ty-nav-in::-webkit-scrollbar { display: none; }
    .ty-nav a { padding: 0 13px; }
    .ty-nav a:nth-child(n+9) { display: none; }
}
@media (max-width: 860px) {
    .ty-main { grid-template-columns: minmax(0, 1fr); }
    .ty.ty-no-catalog .ty-main,
    .ty.ty-right-off .ty-main,
    .ty.ty-no-catalog.ty-right-off .ty-main { grid-template-columns: minmax(0, 1fr); }
    .ty-col-r { grid-row: 2; position: static; }
    .ty-topbar { gap: 12px; padding: 0 14px; }
    .ty-nav { overflow: hidden; }
    .ty-nav-in { height: 52px; overflow-x: visible; }
    .ty-nav a { padding: 0 12px; }
    .ty-nav a:nth-child(n+7) { display: none; }
    .ty-list .c-u, .ty-list .c-l { display: none; }
    .ty-list .c-r { width: 48px; }
    .ty-block-desc { display: none; }
    .ty-top { right: 12px; bottom: 20px; }
}
