/* =========================================================
   SoftGo 软件下载导航 - 前台样式
   配色：背景 #fafafa / 卡片 #ffffff / 主文字 #2c2c2c
        次要文字 #666666 / 强调色 #5B8FF9
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

ul, ol, li { list-style-type: none; }

body {
    background: #fafafa;
    color: #2c2c2c;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #5B8FF9; text-decoration: none; transition: color .2s; }
a:hover { color: #4a7fe8; }

img { max-width: 100%; }

/* ---------- 容器：与导航同宽 1170px ---------- */
.container {
    width: 1170px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #ececec;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
    padding-top: 10px;
    padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
    width: 40px; height: 40px;
    background: #5B8FF9;
    color: #fff;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-size: 25px;
    flex-shrink: 0;
    transition: transform .2s, background .2s;
}
a.brand-logo:hover { transform: translateY(-1px); }
.site-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.site-title a { color: #2c2c2c; }
.site-title a:hover { color: #5B8FF9; }
.site-desc { font-size: 12px; color: #999; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-search {
    position: relative;
    flex-shrink: 0;
}
.search-toggle {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: color .2s, border-color .2s, box-shadow .2s;
}
.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
    color: #5B8FF9;
    border-color: #5B8FF9;
    box-shadow: 0 0 0 3px rgba(91, 143, 249, .12);
}
.search-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 101;
}
.search-panel.is-open { display: flex; }
.search-panel input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 8px 34px 8px 12px;
    font-size: 13px;
    color: #2c2c2c;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.search-panel input[type="search"]:focus {
    border-color: #5B8FF9;
    box-shadow: 0 0 0 3px rgba(91, 143, 249, .12);
}
.search-submit {
    position: absolute;
    right: 16px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #999;
    cursor: pointer;
    transition: color .2s, background .2s;
}
.search-submit:hover { color: #fff; background: #5B8FF9; }

.back-link {
    font-size: 13px; color: #666;
    padding: 6px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    white-space: nowrap;
    transition: all .2s;
}
.back-link:hover { color: #5B8FF9; border-color: #5B8FF9; }

/* ---------- 搜索结果提示 ---------- */
.site-main { flex: 1; padding-top: 24px; padding-bottom: 48px; width: 1170px; }

.search-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
    padding: 0 2px;
}
.search-result-bar strong { color: #5B8FF9; font-weight: 600; }
.search-reset { font-size: 13px; color: #999; white-space: nowrap; }
.search-reset:hover { color: #5B8FF9; }

/* ---------- 软件列表 ---------- */
.soft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* 首批之外的卡片默认隐藏，由「查看更多」逐批展开 */
.soft-card-more { display: none; }

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}
.btn-load-more {
    background: #ffffff;
    color: #5B8FF9;
    border: 1px solid #d5e3fb;
    padding: 10px 36px;
    border-radius: 24px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(91, 143, 249, .08);
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.btn-load-more:hover {
    background: #5B8FF9;
    color: #fff;
    border-color: #5B8FF9;
    box-shadow: 0 4px 14px rgba(91, 143, 249, .3);
    transform: translateY(-1px);
}
.btn-load-more .load-more-count { color: #999; font-size: 12px; margin-left: 2px; }
.btn-load-more:hover .load-more-count { color: #dbe7fd; }

.soft-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.soft-card:hover,
.soft-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(91, 143, 249, .12);
    border-color: #d5e3fb;
}
.soft-go {
    font-size: 22px;
    color: #ccc;
    margin-left: auto;
    transition: color .2s, transform .2s;
    flex-shrink: 0;
}
.soft-card:hover .soft-go,
.soft-card:focus-visible .soft-go { color: #5B8FF9; transform: translateX(3px); }

/* 图标（图片或字母头像） */
.soft-icon { flex-shrink: 0; }
.soft-icon img {
    width: 56px; height: 56px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
}
.letter-avatar {
    width: 56px; height: 56px;
    border-radius: 14px;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    user-select: none;
}

.soft-info { min-width: 0; flex: 1; }
.soft-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c2c2c;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
}
.soft-name-link { color: #2c2c2c; }
.soft-name-link:hover { color: #5B8FF9; }
.ver-badge {
    font-size: 11px;
    font-weight: 400;
    color: #5B8FF9;
    background: #eef4fe;
    border-radius: 4px;
    padding: 1px 7px;
    flex-shrink: 0;
}
.soft-summary {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.soft-meta {
    font-size: 12px; color: #999;
    margin-top: 5px;
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
    white-space: nowrap;
    overflow: hidden;
}
.soft-meta .dot { color: #ddd; }
.soft-host { color: #8a8a8a; }

/* ---------- 空状态 ---------- */
.empty-tip {
    background: #fff;
    border-radius: 12px;
    text-align: center;
    padding: 64px 20px;
    color: #666;
    font-size: 15px;
}
.empty-tip .sub { font-size: 13px; color: #999; margin-top: 8px; }

/* ---------- 信息弹窗 ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: softgoFadeIn .18s ease;
}
.modal-mask.show { display: flex; }
@keyframes softgoFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 440px;
    max-width: 100%;
    padding: 30px 28px 22px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    animation: softgoPopIn .2s ease;
}
@keyframes softgoPopIn {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to { opacity: 1; transform: none; }
}

.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 30px; height: 30px;
    border: none;
    background: #f5f5f5;
    color: #999;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: all .2s;
}
.modal-close:hover { background: #eee; color: #2c2c2c; transform: rotate(90deg); }

.modal-head { display: flex; align-items: center; gap: 14px; padding-right: 26px; }
.modal-icon .letter-avatar, .modal-icon img { width: 60px; height: 60px; border-radius: 15px; }
.modal-head-text { min-width: 0; }
.modal-title {
    font-size: 18px; color: #2c2c2c;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-meta { font-size: 12px; color: #999; margin-top: 4px; }

.modal-site {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    background: #f3f8ff;
    border: 1px solid #e3edfd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}
.modal-site-label {
    color: #5B8FF9;
    background: #e1edfe;
    border-radius: 4px;
    padding: 1px 8px;
    flex-shrink: 0;
}
.modal-site-host {
    color: #2c2c2c;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-summary {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px 14px;
    max-height: 150px;
    overflow-y: auto;
}
.modal-summary:empty { display: none; }
.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}
.modal-tip { text-align: center; font-size: 12px; color: #bbb; margin-top: 14px; line-height: 1.7; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
}
.btn-primary { background: #5B8FF9; color: #fff; }
.btn-primary:hover { background: #4a7fe8; color: #fff; box-shadow: 0 4px 12px rgba(91, 143, 249, .35); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: #5B8FF9; border-color: #5B8FF9; }
.btn-ghost:hover { background: #f3f8ff; color: #4a7fe8; border-color: #4a7fe8; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 11px 28px; font-size: 15px; border-radius: 10px; }

/* ---------- 详情页 ---------- */
.detail-card {
    background: #fff;
    border-radius: 14px;
    padding: 36px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}
.detail-head { display: flex; gap: 22px; align-items: flex-start; }
.detail-icon .letter-avatar, .detail-icon img { width: 80px; height: 80px; border-radius: 18px; font-size: 34px; }
.detail-name { font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-name .ver-badge { font-size: 13px; padding: 2px 10px; }
.detail-summary { font-size: 14px; color: #666; margin-top: 6px; }
.detail-actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }

.detail-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 28px;
    background: #fafafa;
    border-radius: 10px;
    padding: 18px 20px;
}
.meta-item { text-align: center; min-width: 0; }
.meta-label { display: block; font-size: 12px; color: #999; }
.meta-value {
    display: block;
    font-size: 14px;
    color: #2c2c2c;
    margin-top: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-title {
    font-size: 17px;
    margin: 34px 0 16px;
    padding-left: 12px;
    position: relative;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: #5B8FF9;
}
.detail-desc {
    font-size: 14px;
    color: #2c2c2c;
    line-height: 2;
    word-break: break-word;
}
.detail-desc p { margin-bottom: 12px; }
.detail-footer-tip {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px dashed #eee;
    font-size: 12px;
    color: #aaa;
    line-height: 1.8;
}

/* ---------- 详情页相关推荐 ---------- */
.related-soft { margin-top: 36px; }
.related-title {
    position: relative;
    font-size: 18px;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0 0 18px;
    padding-left: 12px;
    line-height: 1.3;
}
.related-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 2px;
    background: #5B8FF9;
}
.related-grid { margin-top: 0; }

/* 面包屑导航 */
.breadcrumb { margin: 0 0 14px; font-size: 13px; color: #999; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before {
    content: '/';
    margin: 0 8px;
    color: #ccc;
}
.breadcrumb a { color: #5B8FF9; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: #666; }

/* 静态页面 */
.page-card .page-title { font-size: 22px; margin-bottom: 18px; }
/* 普通文章 */
.post-card .page-title { font-size: 22px; margin-bottom: 10px; }
.post-meta {
    font-size: 13px; color: #999;
    margin: 0 0 18px; padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex; flex-wrap: wrap; gap: 6px 16px;
}
.post-meta a { color: #5B8FF9; }
.post-meta-views { display: inline-flex; align-items: center; gap: 4px; }
/* 文章底部标签 */
.post-tags {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.post-tags-label { font-size: 13px; color: #999; }
.tag-chip {
    display: inline-flex; align-items: center;
    height: 26px; padding: 0 10px;
    font-size: 12px; line-height: 1;
    color: #5B8FF9;
    background: #f2f6ff;
    border-radius: 13px;
    transition: background .15s, color .15s;
}
.tag-chip:hover { background: #5B8FF9; color: #fff; }
/* 文章页：正文 + 右侧边栏 */
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
.side-widget {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.side-widget:last-child { margin-bottom: 0; }
.side-widget-title {
    font-size: 15px; font-weight: 700; color: #2c2c2c;
    margin: 0 0 15px; padding-left: 10px;
    border-left: 4px solid #5B8FF9;
    line-height: 16px;
}
/* 最新发布 */
.side-post-list { list-style: none; margin: 0; padding: 0; }
.side-post-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 0; border-bottom: 1px dashed #f0f0f0;
}
.side-post-list li:last-child { border-bottom: none; padding-bottom: 0; }
.side-post-list li:first-child { padding-top: 0; }
.side-post-link {
    flex: 1; min-width: 0;
    font-size: 13px; color: #2c2c2c; line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-post-link:hover { color: #5B8FF9; }
.side-post-date { flex-shrink: 0; font-size: 12px; color: #aaa; }
/* 热门排行 */
.side-rank-list { list-style: none; margin: 0; padding: 0; }
.side-rank-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-bottom: 1px dashed #f0f0f0;
}
.side-rank-list li:last-child { border-bottom: none; padding-bottom: 0; }
.side-rank-list li:first-child { padding-top: 0; }
.side-rank-no {
    flex-shrink: 0;
    width: 18px; height: 18px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; font-style: normal;
    background: #e8ecf3; color: #8a94a6;
}
.side-rank-no.rank-1 { background: #ff6b6b; color: #fff; }
.side-rank-no.rank-2 { background: #ffa940; color: #fff; }
.side-rank-no.rank-3 { background: #ffd666; color: #fff; }
.side-rank-link {
    flex: 1; min-width: 0;
    font-size: 13px; color: #2c2c2c; line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-rank-link:hover { color: #5B8FF9; }
.side-rank-views { flex-shrink: 0; font-size: 12px; color: #aaa; }
/* 最新加入的软件 */
.side-soft-list { list-style: none; margin: 0; padding: 0; }
.side-soft-list li { padding: 7px 0; border-bottom: 1px dashed #f0f0f0; }
.side-soft-list li:last-child { border-bottom: none; padding-bottom: 0; }
.side-soft-list li:first-child { padding-top: 0; }
.side-soft-link {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #2c2c2c;
}
.side-soft-link:hover { color: #5B8FF9; }
.side-soft-icon { flex-shrink: 0; width: 20px; height: 20px; display: inline-flex; }
.side-soft-icon .soft-icon,
.side-soft-icon img,
.side-soft-icon .letter-avatar { width: 20px; height: 20px; border-radius: 6px; }
.side-soft-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-soft-ver {
    flex-shrink: 0; font-size: 11px; color: #8a94a6;
    background: #f2f4f8; border-radius: 4px; padding: 1px 5px;
}

/* 文章归档列表 */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list-item { padding: 18px 0; border-bottom: 1px solid #f0f0f0; }
.post-list-item:first-child { padding-top: 4px; }
.post-list-item:last-child { border-bottom: none; }
.post-list-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.post-list-title a { color: #2c2c2c; }
.post-list-title a:hover { color: #5B8FF9; }
.post-list-meta {
    display: flex; flex-wrap: wrap; gap: 6px 16px;
    font-size: 12px; color: #999; margin: 0 0 8px;
}
.post-list-excerpt { margin: 0; font-size: 14px; color: #666; line-height: 1.7; }
.post-list-card .pagination { margin-top: 22px; }
.post-list-card .nav-links { display: flex; gap: 8px; justify-content: center; }
.post-list-card .page-numbers {
    min-width: 32px; height: 32px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #e5e5e5; border-radius: 6px;
    font-size: 13px; color: #666;
}
.post-list-card .page-numbers.current,
.post-list-card .page-numbers:hover { background: #5B8FF9; border-color: #5B8FF9; color: #fff; }
.entry-content h2, .entry-content h3 { margin: 22px 0 12px; }
.entry-content ul, .entry-content ol { margin: 10px 0 10px 22px; }
.entry-content ul li { list-style: disc; }
.entry-content ol li { list-style: decimal; }

/* ---------- 页脚 ---------- */
.site-footer {
    background: #fff;
    border-top: 1px solid #ececec;
    padding: 18px 0;
    text-align: center;
    font-size: 12px;
    color: #999;
}
.footer-copy { margin-top: 4px; color: #c2c2c2; }

/* ---------- 分类页签 ---------- */
.soft-list-title {
    position: relative;
    font-size: 17px;
    color: #2c2c2c;
    margin: 0 0 18px;
    padding-left: 15px;
    line-height: 1.3;
}
.soft-list-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 2px;
    background: #5B8FF9;
}
.cat-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    transition: all .2s;
}
.cat-tab:hover {
    color: #5B8FF9;
    border-color: #b9d2fb;
    background: #f5f9ff;
}
.cat-tab.active {
    background: #5B8FF9;
    border-color: #5B8FF9;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(91, 143, 249, .28);
}
.cat-tab .cat-count {
    font-size: 11px;
    color: #aaa;
    background: #f3f3f3;
    border-radius: 10px;
    padding: 0 7px;
    line-height: 17px;
    transition: all .2s;
}
.cat-tab:hover .cat-count { background: #e3edfd; color: #5B8FF9; }
.cat-tab.active .cat-count { background: rgba(255, 255, 255, .25); color: #fff; }

/* 分类归档头部 */
.cat-archive-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.cat-archive-title { font-size: 20px; color: #2c2c2c; }
.cat-archive-desc { font-size: 13px; color: #999; margin-top: 4px; max-width: 760px; }

/* 详情页分类徽章 */
.detail-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.cat-chip {
    display: inline-block;
    font-size: 12px;
    color: #5B8FF9;
    background: #eef4fe;
    border: 1px solid #dce8fd;
    border-radius: 6px;
    padding: 2px 10px;
    transition: all .2s;
}
.cat-chip:hover { background: #5B8FF9; color: #fff; border-color: #5B8FF9; }

/* ---------- 首页 hero：轮播图 + 最新加入 ---------- */
.hero {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    margin: 0 0 20px;
}
.hero-no-carousel { grid-template-columns: 1fr; }

.hero-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
.carousel-track { display: flex; transition: transform .45s ease; }
.carousel-slide { position: relative; flex: 0 0 100%; display: block; }
.carousel-slide img {
    width: 100%; height: 240px;
    object-fit: cover;
    display: block;
}
.carousel-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 30px 16px 12px;
    color: #fff; font-size: 15px; font-weight: 600;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
    pointer-events: none;
}
.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: #2c2c2c; font-size: 18px; line-height: 1;
    cursor: pointer;
    opacity: 0; transition: opacity .2s, background .2s;
    z-index: 2;
}
.hero-carousel:hover .carousel-arrow { opacity: 1; }
.carousel-arrow:hover { background: #fff; color: #5B8FF9; }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-dots {
    position: absolute; right: 14px; bottom: 12px;
    display: flex; gap: 6px; z-index: 2;
}
.carousel-dot {
    width: 8px; height: 8px; padding: 0;
    border: none; border-radius: 4px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: background .2s, width .2s;
}
.carousel-dot.active { background: #fff; width: 18px; }

.hero-latest {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    align-self: start;
}
.hero-latest-title {
    position: relative;
    font-size: 15px;
    color: #2c2c2c;
    line-height: 1.3;
    margin: 0 0 12px;
    padding-left: 15px;
}
.hero-latest-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 2px;
    background: #5B8FF9;
}
.latest-list { display: grid; grid-template-columns: 1fr; gap: 2px; }
.latest-item a {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 4px;
    border-radius: 8px;
    color: #2c2c2c;
    transition: background .15s, color .15s;
}
.latest-item a:hover { background: #f5f7fb; color: #5B8FF9; }
.latest-icon { flex-shrink: 0; width: 16px; height: 16px; }
.latest-icon img,
.latest-icon .letter-avatar {
    width: 16px; height: 16px;
    border-radius: 8px;
    font-size: 12px;
}
.latest-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 13px;
}
.latest-ver {
    flex-shrink: 0;
    font-size: 11px; color: #5B8FF9;
    background: #eef4fe;
    border-radius: 4px;
    padding: 1px 6px;
}
/* 无轮播时最新加入改横向网格 */
.hero-no-carousel .latest-list { grid-template-columns: repeat(4, 1fr); }

/* 最新加入：自动向上轮播（6 行视窗，JS 按实际高度动态计算可见行数） */
.latest-list.latest-scroll {
    display: block;
    height: 180px; /* 6 行 × 30px */
    overflow: hidden;
}
.latest-list.latest-scroll .latest-item { height: 30px; }
.latest-track { will-change: transform; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
    .site-main { width: 100%; }
}
@media (max-width: 900px) {
    .post-layout { grid-template-columns: 1fr; }
    .post-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .post-sidebar .side-widget { margin-bottom: 0; }
}
@media (max-width: 560px) {
    .post-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .soft-grid { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; gap: 8px; }
    .search-panel { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
    .detail-card { padding: 24px 18px; }
    .detail-head { flex-direction: column; }
    .detail-meta { grid-template-columns: repeat(2, 1fr); }
    .modal-actions { grid-template-columns: 1fr; }
    .site-desc { white-space: normal; }
    .cat-tabs { gap: 8px; }
    .cat-tab { padding: 5px 13px; font-size: 12px; }
    .cat-archive-head { flex-direction: column; }
    .hero { grid-template-columns: 1fr; }
    .carousel-slide img { height: 180px; }
    .hero-no-carousel .latest-list { grid-template-columns: repeat(2, 1fr); }
}
