@charset "utf-8";
/* ============================================================================
   home.css — 首页样式（清爽学术风）
   替代原 views/site/index.php 里约 370 行的内联 <style>
   依赖 theme.css 中的 :root 变量
   ============================================================================ */

/* 首页：内容区不再垫一整块白板，让浅灰底透出来做层次 */
.site-index .wrap > .container {
    background-color: transparent;
    padding: 22px 15px 36px;
}

.home-page {
    max-width: 100%;
}

/* 内联 SVG 图标 */
.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}
.ico {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    vertical-align: -1px;
    color: var(--muted);
    flex: none;
}

/* -------------------------------------------------------------- 置顶通知 */
.notice-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--paper);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.5;
}
.notice-tag {
    flex: none;
    font-size: 11px;
    line-height: 1;
    color: var(--brand);
    background-color: var(--brand-soft);
    padding: 4px 6px;
    border-radius: 2px;
}
.notice-link {
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notice-link:hover {
    color: var(--brand);
}
.notice-empty {
    color: var(--muted);
}

/* ---------------------------------------------------------------- 主栅格 */
.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.col-main,
.col-side {
    display: grid;
    gap: 18px;
    align-content: start;
    min-width: 0;
}
@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------------ 面板 */
.panel {
    background-color: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    margin: 0;
    box-shadow: none;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 44px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line-soft);
}
.panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    letter-spacing: .2px;
}
.panel-title small {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 6px;
    letter-spacing: 0;
}
.panel-more {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.panel-more::after {
    content: " →";
    font-size: 12px;
}
.panel-more:hover {
    color: var(--brand);
}
.panel-body {
    padding: 16px;
}

/* -------------------------------------------------------------- 新闻卡片 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 16px;
}
@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.news-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.news-img {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 3px;
    background-color: var(--line-soft);
}
.news-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .2s ease;
}
.news-card:hover .news-img img {
    opacity: .86;
}
.news-title {
    margin: 9px 0 5px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-title a {
    color: inherit;
}
.news-card:hover .news-title a {
    color: var(--brand);
}
.news-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: auto;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.news-meta span {
    display: inline-flex;
    align-items: center;
}

/* -------------------------------------------------------------- 讨论列表 */
.dis-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dis-item {
    display: flex;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-soft);
}
.dis-item:first-child {
    padding-top: 0;
}
.dis-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.dis-avatar {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}
.dis-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dis-body {
    min-width: 0;
    flex: 1;
}
.dis-title {
    display: block;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dis-title:hover {
    color: var(--brand);
}
.dis-meta {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 3px;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.dis-meta span {
    display: inline-flex;
    align-items: center;
}

/* -------------------------------------------------------------- 比赛信息 */
.contest-list {
    margin: 0;
    padding: 0;
}
.contest-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line-soft);
    font-size: 12px;
    line-height: 1.55;
}
.contest-item:first-child {
    padding-top: 0;
}
.contest-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.contest-label {
    color: var(--muted);
}
.contest-value {
    color: var(--ink-2);
    word-break: break-all;
}
.contest-value a {
    color: var(--brand);
}
.contest-value a:hover {
    text-decoration: underline;
}
.contest-empty {
    font-size: 12px;
    color: var(--muted);
    padding: 2px 0;
}

/* ------------------------------------------------------ 榜单（排名/热榜） */
.rank-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rank-item {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
    min-width: 0;
}
.rank-item:first-child {
    padding-top: 0;
}
.rank-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.rank-no {
    flex: none;
    width: 16px;
    text-align: right;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.rank-item:nth-child(-n+3) .rank-no {
    color: var(--brand);
    font-weight: 600;
}
.rank-body {
    min-width: 0;
    flex: 1;
}
/* 榜单行：单行，超长省略，避免折行把卡片撑高 */
.rank-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.rank-name {
    font-size: 13px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.rank-name a {
    color: inherit;
}
.rank-name a:hover {
    color: var(--brand);
}
.rank-val {
    flex: none;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
}
.rank-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 等级标识：小色块，替代原来的彩色文字 */
.grade {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 2px;
    margin-left: 6px;
    vertical-align: 1px;
}
.grade-high { background: #FBF1DC; color: #8A5B0B; }
.grade-mid  { background: #E9EFF7; color: #2F5680; }
.grade-low  { background: #F0F1F0; color: #6B7679; }

/* ------------------------------------------------------------ 空状态提示 */
.empty-hint {
    padding: 22px 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}
