/* ==========================================================================
   dczyw · 首页样式
   ========================================================================== */

/* ---------- 顶部横幅 ---------- */

.home-banner {
    position: relative;
    padding: 62px 0 56px;
    background: linear-gradient(135deg, #0a63c4 0%, #007bf5 45%, #48a6ff 100%);
    color: #fff;
    overflow: hidden;
}
.home-banner::before,
.home-banner::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}
.home-banner::before { width: 420px; height: 420px; right: -120px; top: -180px; }
.home-banner::after { width: 260px; height: 260px; left: -80px; bottom: -150px; }
.banner-inner { position: relative; z-index: 2; text-align: center; }
.banner-title { font-size: 34px; font-weight: 800; letter-spacing: 5px; text-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.banner-sub { margin-top: 10px; font-size: 15px; color: rgba(255, 255, 255, .86); letter-spacing: 1px; }

.banner-search {
    display: flex;
    width: 720px;
    max-width: 100%;
    margin: 26px auto 0;
    padding: 6px;
    border-radius: 40px;
    background: rgba(255, 255, 255, .22);
    backdrop-filter: blur(6px);
}
.banner-search input[type="search"] {
    flex: 1 1 auto;
    height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 40px 0 0 40px;
    background: #fff;
    color: #333;
    outline: none;
    font-size: 15px;
}
.banner-search button {
    flex: 0 0 132px;
    height: 46px;
    border: 0;
    border-radius: 0 40px 40px 0;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .2s ease;
}
.banner-search button:hover { background: var(--brand-dark); }

.banner-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 26px;
    margin-top: 22px;
    font-size: 13px;
    color: rgba(255, 255, 255, .82);
}
.banner-stats strong { font-size: 16px; color: #fff; margin: 0 3px; }

/* ---------- 首页栅格 ---------- */

.home-wrap { padding-top: 24px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.home-primary { min-width: 0; }
.home-aside { min-width: 0; }

/* ---------- 最近更新 ---------- */

.update-list { display: block; }
.update-list[hidden] { display: none; }
.update-list li {
    display: grid;
    grid-template-columns: 34px 58px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 11px 12px;
    border-radius: 26px 0 0 26px;
    background: var(--surface-alt);
    margin-bottom: 8px;
    transition: background .25s ease, transform .25s ease;
}
.update-list li:nth-child(2n) { border-radius: 0 26px 26px 0; background: #fff; }
.update-list li:nth-child(4n + 3),
.update-list li:nth-child(4n + 4) { background: #fff; }
.update-list li:hover { background: #eef6ff; transform: translateX(2px); }
.update-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    flex: 0 0 auto;
}
.update-thumb img { width: 100%; height: 100%; object-fit: cover; }
.update-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.update-list time {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    padding-right: 10px;
    border-right: 2px solid var(--line);
    text-align: center;
}
.update-list time.is-new { color: var(--danger); font-weight: 600; }
.update-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: var(--text);
    min-width: 0;
}
.update-title:hover { color: var(--brand); }
.update-view {
    justify-self: end;
    padding: 3px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
}
.update-view:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.update-pager { display: flex; justify-content: center; gap: 10px; padding: 16px 0 4px; }
.pager-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--brand);
    background: transparent;
    color: var(--brand);
    font-size: 13px;
    line-height: 1;
}
.pager-num.is-active { background: var(--brand); color: #fff; }

/* ---------- 软件专区 ---------- */

.soft-zone {}
.zone-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.zone-tabs { display: flex; flex-wrap: wrap; gap: 26px; }
.zone-tab {
    position: relative;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: var(--muted-light);
    font-size: 15px;
    transition: color .2s ease;
}
.zone-tab::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -13px;
    width: 0;
    height: 3px;
    background: var(--brand);
    border-radius: 3px;
    transition: width .25s ease;
}
.zone-tab:hover { color: var(--brand); }
.zone-tab.is-active { color: var(--brand); }
.zone-tab.is-active::after { width: 100%; }
.zone-all { font-size: 13px; color: var(--muted); white-space: nowrap; }
.zone-all:hover { color: var(--brand); }

.zone-panels { padding-top: 6px; }
.zone-panel[hidden] { display: none; }
.soft-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.soft-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}
.soft-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #fff;
    display: block;
}
.soft-thumb img { width: 100%; height: 100%; object-fit: cover; }
.soft-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}
.soft-main { flex: 1 1 auto; min-width: 0; position: relative; padding-right: 62px; }
.soft-main h3 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
}
.soft-main h3 a { color: var(--text); }
.soft-main h3 a:hover { color: var(--brand); }
.soft-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted-light); display: flex; align-items: center; gap: 2px; }
.soft-views { display: inline-flex; align-items: center; gap: 3px; }
.soft-view {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 14px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 12px;
}
.soft-view:hover { background: #1b8eff; color: #fff; }

/* ---------- 热榜 ---------- */

.hot-tabs { display: flex; gap: 18px; }
.hot-tab {
    position: relative;
    padding: 4px 0;
    border: 0;
    background: none;
    font-size: 14px;
    color: var(--muted);
}
.hot-tab::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: var(--brand);
    transition: width .2s ease;
}
.hot-tab.is-active { color: var(--brand); }
.hot-tab.is-active::after { width: 100%; }
.hot-panel[hidden] { display: none; }
.hot-empty { color: var(--muted-light); font-size: 13px; padding: 14px 0; }

.hot-list { padding-top: 4px; }
.hot-list li { border-bottom: 1px solid var(--line); }
.hot-list li:last-child { border-bottom: 0; }
.hot-list a { display: flex; align-items: center; gap: 8px; padding: 9px 0; font-size: 14px; }
.hot-list i {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: var(--radius);
    background: #f3f3f3;
    color: #696969;
    font-style: normal;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hot-list li:nth-child(1) i { background: var(--brand); color: #fff; }
.hot-list li:nth-child(2) i { background: #389cff; color: #fff; }
.hot-list li:nth-child(3) i { background: #87c3ff; color: #fff; }
.hot-list li:nth-child(4) i { background: #bedfff; color: #fff; }
.hot-list a span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-soft);
}
.hot-list a:hover span { color: var(--brand); }

/* 卡片式热榜（首页主列用） */
.hot-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.hot-card {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow .25s ease, transform .25s ease;
}
.hot-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.hot-index {
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: var(--radius) 0 12px 0;
    background: #f6f6f6;
    color: #666;
    font-style: normal;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hot-card:nth-child(1) .hot-index { background: #fd6d3f; color: #fff; }
.hot-card:nth-child(2) .hot-index { background: #f9b801; color: #fff; }
.hot-card:nth-child(3) .hot-index { background: #88d87a; color: #fff; }
.hot-card:nth-child(4) .hot-index { background: #5fafff; color: #fff; }
.hot-card:nth-child(5) .hot-index { background: #cac9c9; color: #fff; }
.hot-thumb {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: block;
}
.hot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hot-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}
.hot-body { min-width: 0; flex: 1 1 auto; padding-right: 46px; }
.hot-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}
.hot-title:hover { color: var(--brand); }
.hot-meta { margin: 5px 0 0; font-size: 12px; color: var(--muted-light); }
.hot-view {
    position: absolute;
    right: 10px;
    bottom: 12px;
    padding: 3px 10px;
    border-radius: var(--radius);
    background: #f6f6f6;
    color: var(--text-soft);
    font-size: 12px;
}
.hot-view:hover { background: var(--brand); color: #fff; }

/* ---------- 资源卡片网格 ---------- */

.resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.resource-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    transition: box-shadow .25s ease, transform .25s ease;
    display: flex;
    flex-direction: column;
}
.resource-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.resource-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--surface-alt);
    overflow: hidden;
}
.resource-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.resource-card:hover .resource-cover img { transform: scale(1.04); }
.resource-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
}
.resource-tag {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 9px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11px;
    backdrop-filter: blur(4px);
}
.resource-body { padding: 12px 12px 10px; display: flex; flex-direction: column; flex: 1 1 auto; }
.resource-title { font-size: 14px; font-weight: 500; line-height: 1.5; margin-bottom: 6px; }
.resource-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}
.resource-title a:hover { color: var(--brand); }
.resource-excerpt { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.resource-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted-light);
    margin-top: auto;
}
.resource-meta a { color: var(--brand); }
.resource-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted-light);
}
.resource-foot span { display: inline-flex; align-items: center; gap: 3px; }
.resource-view { color: var(--text-soft); }
.resource-view:hover { color: var(--brand); }

/* ---------- 侧栏小部件 ---------- */

.side-cats li { border-bottom: 1px solid var(--line); }
.side-cats li:last-child { border-bottom: 0; }
.side-cats a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 14px; color: var(--text-soft); }
.side-cats a:hover { color: var(--brand); }
.side-cats em { font-style: normal; font-size: 12px; color: var(--muted-light); }

.panel-note { background: var(--surface-alt); }
.note-title { font-size: 14px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.panel-note p:last-child { margin-bottom: 0; font-size: 12px; line-height: 1.75; color: var(--muted); }

/* ---------- 响应式 ---------- */

@media (max-width: 1200px) {
    .home-grid { grid-template-columns: minmax(0, 1fr) 300px; }
    .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hot-cards { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-aside { order: 2; }
    .soft-list { grid-template-columns: 1fr; }
    .banner-title { font-size: 26px; letter-spacing: 3px; }
}

@media (max-width: 720px) {
    .home-banner { padding: 44px 0 40px; }
    .banner-search { flex-direction: column; border-radius: var(--radius-lg); background: transparent; padding: 0; }
    .banner-search input[type="search"] { border-radius: var(--radius); height: 44px; }
    .banner-search button { margin-top: 8px; border-radius: var(--radius); flex-basis: 44px; }
    .banner-stats { gap: 14px; font-size: 12px; }
    .update-list li { grid-template-columns: 30px 46px minmax(0, 1fr); gap: 9px; padding: 10px 8px; border-radius: 22px 0 0 22px; }
    .update-view { display: none; }
    .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .resource-excerpt { display: none; }
    .zone-tabs { gap: 16px; overflow-x: auto; }
    .zone-tab { white-space: nowrap; font-size: 14px; }
    .soft-main { padding-right: 0; }
    .soft-view { position: static; transform: none; display: inline-block; margin-top: 6px; }
}

@media (max-width: 480px) {
    .resource-grid { grid-template-columns: 1fr; }
    .hot-cards { grid-template-columns: 1fr; }
    .soft-thumb { flex-basis: 54px; width: 54px; height: 54px; }
}

/* ---------- 夜间 ---------- */

html.night .home-banner { background: linear-gradient(135deg, #0a3a63 0%, #0e4a80 50%, #14608f 100%); }
html.night .update-list li { background: #1f2329; }
html.night .update-list li:nth-child(2n),
html.night .update-list li:nth-child(4n + 3),
html.night .update-list li:nth-child(4n + 4) { background: #191c21; }
html.night .update-list li:hover { background: #1d2937; }
html.night .update-title,
html.night .soft-main h3 a,
html.night .hot-title { color: #d2d6dc; }
html.night .soft-thumb,
html.night .hot-thumb,
html.night .update-thumb { background: #22262c; border-color: #2a2f36; }
html.night .soft-view { color: #fff; }
html.night .hot-view { background: #262b33; color: #b9bec6; }
html.night .hot-list a span { color: #b7bec7; }
html.night .hot-list a:hover span { color: #6fb0ff; }
html.night .hot-list i { background: #262b33; color: #98a1ab; }
html.night .hot-list li:nth-child(1) i { background: var(--brand); color: #fff; }
html.night .hot-list li:nth-child(2) i { background: #2f7fd6; color: #fff; }
html.night .hot-list li:nth-child(3) i { background: #3a6ea5; color: #fff; }
html.night .hot-list li:nth-child(4) i { background: #35506b; color: #fff; }
html.night .update-view { border-color: #2f353d; color: #a8b0ba; }
html.night .update-view:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
html.night .update-list time { border-color: #2a2f36; color: #7f8792; }
html.night .zone-head,
html.night .soft-list li,
html.night .hot-list li,
html.night .resource-foot,
html.night .sidebar-block { border-color: #2a2f36; }
html.night .side-cats li { border-color: #2a2f36; }
html.night .panel-note { background: #191c21; }
html.night .resource-card { background: #1b1e23; border-color: #2a2f36; }
html.night .resource-title a { color: #dfe3e8; }
html.night .resource-cover { background: #22262c; }
html.night .resource-meta,
html.night .resource-foot { border-color: #2a2f36; color: #7f8792; }
html.night .pager-num { color: #6ea8ff; border-color: #2f6fb5; }
html.night .pager-num.is-active { background: var(--brand); color: #fff; }
