/* ==========================================================
   upx8wiki · home
   公告条 / 每日一言 / 最近更新 / 分类卡片
   ========================================================== */

/* ---------------- 公告 ---------------- */

.notice {
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    border-radius: 0 6px 6px 0;
    margin-bottom: 16px;
    overflow: hidden;
}

.notice[hidden] {
    display: none;
}

.notice-in {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 6px 14px;
}

.notice-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--warn);
}

.notice-tag svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notice-body {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.notice-item {
    display: none;
    font-size: 12.8px;
    color: var(--tx-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-item.on {
    display: block;
}

.notice-item a {
    border-bottom: 1px solid transparent;
}

.notice-item a:hover {
    color: var(--tx);
    border-bottom-color: var(--tx-4);
}

.notice-nav {
    flex: 0 0 auto;
    font-size: 10.5px;
    color: var(--tx-4);
    font-variant-numeric: tabular-nums;
    padding: 2px 6px;
    border-radius: 3px;
}

.notice-nav:hover {
    background: rgba(0, 0, 0, .04);
}

.notice-nav b {
    color: var(--warn);
    font-weight: 800;
}

.notice-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--tx-4);
}

.notice-close:hover {
    background: rgba(0, 0, 0, .05);
    color: var(--tx-2);
}

.notice-close svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------------- 每日一言 ---------------- */

.quote {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 24px 30px 20px;
    margin-bottom: 16px;
}

.quote-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .16em;
    color: var(--tx-4);
    margin-bottom: 13px;
}

.quote-label i {
    display: block;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--tx-4);
}

.quote-date {
    font-weight: 700;
    letter-spacing: .04em;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--line-2);
    color: var(--tx-4);
}

.quote-text {
    font-size: 21px;
    line-height: 1.62;
    font-weight: 600;
    letter-spacing: -.012em;
    color: var(--tx);
    min-height: 34px;
    transition: opacity .3s ease, transform .3s ease;
}

.quote-text.out {
    opacity: 0;
    transform: translateY(-4px);
}

.quote-text::before {
    content: "「";
    color: var(--tx-4);
}

.quote-text::after {
    content: "」";
    color: var(--tx-4);
}

.quote-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.quote-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quote-dots i {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 3px;
    background: var(--tx-2);
    opacity: .34;
    cursor: pointer;
    transition: width .25s ease, opacity .25s ease;
}

.quote-dots i:hover {
    opacity: .6;
}

.quote-dots i.on {
    width: 16px;
    opacity: 1;
}

.quote-next {
    font-size: 11.5px;
    color: var(--tx-3);
    padding: 3px 9px;
    border-radius: 4px;
    transition: background-color .15s ease, color .15s ease;
}

.quote-next:hover {
    background: var(--line-2);
    color: var(--tx-2);
}

/* ---------------- 区块标题 ---------------- */

.sec-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line-2);
}

.sec-t {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.sec-meta {
    font-size: 11px;
    color: var(--tx-4);
    font-variant-numeric: tabular-nums;
}

.sec-more {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--tx-3);
    transition: color .15s ease;
}

.sec-more:hover {
    color: var(--accent);
}

/* ---------------- 最近更新 ---------------- */

.recent {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows, 8), auto);
    grid-auto-flow: column;
    column-gap: 34px;
    padding: 8px 16px 14px;
}

.rrow {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6.5px 6px;
    border-radius: 5px;
    min-width: 0;
    transition: background-color .13s ease;
}

.rrow:hover {
    background: var(--line-2);
}

.rrow .rt {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.9px;
    color: var(--tx-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .13s ease;
}

.rrow:hover .rt {
    color: var(--tx);
}

.rrow .rd {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 10.5px;
    color: var(--tx-4);
    font-variant-numeric: tabular-nums;
}

/* ---------------- 分类卡片 ---------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-h {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line-2);
}

.card-ico {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--cbg);
}

.card-ico svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--c);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card-t {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.card-n {
    font-size: 10.5px;
    color: var(--tx-4);
    font-variant-numeric: tabular-nums;
}

.card-more {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--tx-3);
    transition: color .15s ease;
}

.card-more:hover {
    color: var(--c);
}

.card-list {
    padding: 6px 11px 11px;
    flex: 1 1 auto;
}

.crow {
    display: flex;
    align-items: flex-start;
    padding: 6.5px 7px;
    border-radius: 5px;
    min-width: 0;
    transition: background-color .13s ease;
}

.crow:hover {
    background: var(--line-2);
}

.crow .ct-t {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.9px;
    color: var(--tx-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .13s ease;
}

.crow:hover .ct-t {
    color: var(--tx);
}

.crow .cd {
    flex: 0 0 auto;
    margin-left: 12px;
    margin-top: 1px;
    font-size: 10.5px;
    color: var(--tx-4);
    font-variant-numeric: tabular-nums;
}

.card-empty {
    font-size: 12px;
    color: var(--tx-4);
    padding: 14px 8px;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 980px) {
    .cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .recent-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-flow: row;
    }

    .recent-grid .rrow:nth-child(n+9) {
        display: none;
    }
}

@media (max-width: 760px) {
    .quote {
        padding: 20px 18px 16px;
    }

    .quote-text {
        font-size: 18px;
        line-height: 1.6;
    }

    .sec-head {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .sec-more {
        font-size: 11px;
    }

    .recent-grid {
        padding: 6px 10px 10px;
    }

    .recent-grid .rrow:nth-child(n+7) {
        display: none;
    }

    .card-h {
        padding: 12px 14px;
    }

    .card-list {
        padding: 5px 8px 9px;
    }

    .notice-in {
        gap: 8px;
        padding: 7px 10px;
    }
}
