/* ============================================
   ddooo.com 专题聚合页 - 主样式表
   ============================================ */

:root {
    --primary: #4cae4c;
    --primary-dark: #3d8b3d;
    --primary-light: #5cb85c;
    --primary-soft: rgba(76, 174, 76, 0.08);
    --accent: #ff6600;
    --accent-light: #ff8533;
    --download-bg: #ff6600;
    --download-hover: #e55c00;
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --bg-main: #f5f5f5;
    --bg-white: #ffffff;
    --bg-soft: #fafafa;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --header-h: 60px;
    --container-w: 1200px;
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 15px;
}

/* ============ 顶部导航栏 ============ */
.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 20px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(76, 174, 76, 0.3);
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 1px;
}

.search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    overflow: hidden;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    background: var(--bg-white);
}

.search-box button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.header-actions a {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.header-actions a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============ 主导航菜单 ============ */
.main-nav {
    background: var(--primary);
    border-bottom: 2px solid var(--primary-dark);
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
}

.nav-list > li > a {
    display: block;
    padding: 12px 22px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-list > li > a:hover,
.nav-list > li.active > a {
    background: var(--primary-dark);
    color: #fff;
}

/* ============ 专题横幅 ============ */
.topic-banner {
    width: 100%;
    height: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    box-shadow: var(--shadow-md);
}

.topic-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-banner .banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
}

.topic-banner .banner-overlay h1 {
    font-size: 26px;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.topic-banner .banner-overlay .banner-desc {
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ============ 专题介绍 ============ */
.topic-intro {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 15px;
}

.topic-intro h2 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-intro h2::before {
    content: "";
    display: block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.topic-intro .intro-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 14px;
}

.topic-intro .intro-text strong {
    color: var(--primary);
    font-weight: 600;
}

.topic-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-light);
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.topic-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topic-stats .stat-num {
    color: var(--accent);
    font-weight: bold;
    font-size: 16px;
}

/* ============ 主体布局 ============ */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 20px;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ============ 分类标题 ============ */
.section-header {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--primary);
}

.section-header .section-title {
    font-size: 17px;
    font-weight: bold;
    color: var(--text-main);
}

.section-header .section-count {
    font-size: 13px;
    color: var(--text-light);
}

.section-header .section-count .count-num {
    color: var(--accent);
    font-weight: bold;
}

/* ============ 软件网格列表 ============ */
.soft-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.soft-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.soft-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.soft-card .card-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

.soft-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.soft-card .card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.soft-card .card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soft-card .card-name a:hover {
    color: var(--primary);
}

.soft-card .card-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.soft-card .card-tag {
    padding: 1px 6px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 3px;
    font-size: 11px;
}

.soft-card .card-size {
    color: var(--text-muted);
    text-decoration: underline;
}

.soft-card .card-version {
    color: var(--text-light);
}

.soft-card .card-download {
    align-self: center;
    flex-shrink: 0;
    padding: 6px 16px;
    background: var(--download-bg);
    color: #fff;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.soft-card .card-download:hover {
    background: var(--download-hover);
    color: #fff;
}

.soft-card .card-download.disabled {
    background: var(--border);
    color: var(--text-light);
    cursor: default;
}

/* ============ 评论区 ============ */
.comment-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 15px;
}

.comment-header {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 16px;
    font-weight: bold;
}

.comment-header .comment-count {
    color: var(--accent);
    font-weight: bold;
    margin: 0 4px;
}

.comment-form {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--bg-white);
}

.comment-form textarea:focus {
    border-color: var(--primary);
}

.comment-form .form-action {
    margin-top: 10px;
    text-align: right;
}

.comment-form .btn-submit {
    padding: 8px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .btn-submit:hover {
    background: var(--primary-dark);
}

.comment-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-light);
    font-size: 14px;
}

/* ============ 侧边栏组件 ============ */
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.widget-header {
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-light);
    background: linear-gradient(180deg, #fafafa, #fff);
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-header::before {
    content: "";
    display: block;
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.widget-body {
    padding: 14px 18px;
}

/* ============ 侧边栏 - 排行榜 ============ */
.rank-list {
    display: flex;
    flex-direction: column;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-light);
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    width: 22px;
    height: 22px;
    border-radius: var(--radius);
    background: var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num {
    background: #ff4444;
    color: #fff;
}

.rank-item:nth-child(2) .rank-num {
    background: #ff7733;
    color: #fff;
}

.rank-item:nth-child(3) .rank-num {
    background: #ffaa00;
    color: #fff;
}

.rank-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-title {
    font-size: 13px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.rank-title a:hover {
    color: var(--primary);
}

.rank-cat {
    font-size: 12px;
    color: var(--text-light);
}

/* ============ 侧边栏 - 标签云 ============ */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    padding: 5px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--border-light);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.tag-cloud a:hover {
    background: var(--primary);
    color: #fff;
}

/* ============ 侧边栏 - 专题列表 ============ */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topic-list-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    transition: all 0.2s;
}

.topic-list-item:hover {
    background: var(--primary-soft);
}

.topic-list-item .topic-thumb {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.topic-list-item .topic-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-list-item .topic-info {
    flex: 1;
    min-width: 0;
}

.topic-list-item .topic-name {
    font-size: 13px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.topic-list-item .topic-name a:hover {
    color: var(--primary);
}

.topic-list-item .topic-desc {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ 底部导航 ============ */
.footer-nav {
    background: var(--bg-white);
    border-top: 2px solid var(--primary);
    padding: 24px 0;
    margin-top: 20px;
}

.footer-nav-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.footer-col h4 {
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 12px;
    font-weight: bold;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-col ul li a:hover {
    color: var(--primary);
}

/* ============ 底部版权 ============ */
.footer-copy {
    background: #2c2c2c;
    color: #999;
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
}

.footer-copy a {
    color: #bbb;
}

.footer-copy a:hover {
    color: var(--primary-light);
}

.footer-copy p {
    margin-bottom: 4px;
}

/* ============ 返回顶部 ============ */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    border: none;
    font-size: 20px;
}

.back-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ============ SEO 折叠内容 ============ */
.seo-details {
    margin-top: 20px;
    padding: 12px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
}
.seo-details summary {
    cursor: pointer;
    color: #999;
    font-size: 0.8rem;
}
.seo-details[open] summary {
    margin-bottom: 10px;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 20px 0;
}

.pagination a {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-white);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================
   响应式适配 - 平板
   ============================================ */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .footer-nav-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   响应式适配 - 手机
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-h: 54px;
    }

    .container {
        padding: 0 10px;
    }

    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 0;
        gap: 8px;
    }

    .logo-area {
        order: 1;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .logo-text {
        font-size: 17px;
    }

    .header-actions {
        order: 2;
        margin-left: auto;
    }

    .header-actions a {
        padding: 5px 10px;
        font-size: 12px;
    }

    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .nav-list > li > a {
        padding: 10px 14px;
        font-size: 14px;
    }

    /* 横幅 */
    .topic-banner {
        height: 160px;
    }

    .topic-banner .banner-overlay {
        padding: 14px 16px;
    }

    .topic-banner .banner-overlay h1 {
        font-size: 18px;
    }

    .topic-banner .banner-overlay .banner-desc {
        font-size: 12px;
    }

    /* 专题介绍 */
    .topic-intro {
        padding: 16px;
    }

    .topic-intro h2 {
        font-size: 17px;
    }

    /* 软件网格 - 单列 */
    .soft-grid {
        grid-template-columns: 1fr;
    }

    .soft-card {
        padding: 12px;
    }

    .soft-card .card-thumb {
        width: 50px;
        height: 50px;
    }

    .soft-card .card-name {
        font-size: 13px;
    }

    /* 底部 */
    .footer-nav-inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .back-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .pagination a {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .nav-list > li > a {
        padding: 8px 11px;
        font-size: 13px;
    }

    .topic-banner {
        height: 130px;
    }

    .topic-banner .banner-overlay h1 {
        font-size: 16px;
    }
}
