/* ============================================
   ddooo.com 风格模板 - 主样式表
   电脑软件下载站风格
   ============================================ */

:root {
    --primary: #4cae4c;
    --primary-dark: #3d8b3d;
    --primary-light: #5cb85c;
    --primary-soft: rgba(76, 174, 76, 0.1);
    --accent: #ff6600;
    --accent-light: #ff8533;
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --bg-main: #f5f5f5;
    --bg-white: #ffffff;
    --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.6;
    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 {
    position: relative;
}

.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;
}

.nav-list > li > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #fff;
    transition: width 0.2s;
}

.nav-list > li:hover > a::after,
.nav-list > li.active > a::after {
    width: 60%;
}

/* ============ 面包屑 ============ */
.breadcrumb {
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-muted);
}

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

.breadcrumb span {
    margin: 0 6px;
    color: var(--text-light);
}

/* ============ 轮播图 / 焦点图 ============ */
.banner-section {
    margin: 15px 0;
}

.banner-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    height: 320px;
}

.banner-main {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--bg-white);
}

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

.banner-main .banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
}

.banner-main .banner-caption h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.banner-main .banner-caption p {
    font-size: 13px;
    opacity: 0.9;
}

.banner-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.banner-side-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.banner-side-item .side-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* ============ 通用区块 ============ */
.section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 2px solid var(--border-light);
    background: linear-gradient(180deg, #fafafa, #fff);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-main);
}

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

.section-title a {
    color: var(--text-main);
}

.section-more {
    font-size: 13px;
    color: var(--text-muted);
}

.section-more:hover {
    color: var(--primary);
}

.section-body {
    padding: 16px 20px;
}

/* ============ 精品推荐 网格 ============ */
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.recommend-item {
    display: block;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s;
    background: var(--bg-white);
}

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

.recommend-img {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--border-light);
}

.recommend-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.recommend-item:hover .recommend-img img {
    transform: scale(1.05);
}

.recommend-info {
    padding: 10px 12px;
}

.recommend-info h4 {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommend-info .item-meta {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommend-info .item-meta .item-size {
    color: var(--accent);
    margin-right: 6px;
}

/* ============ 分类标签栏 ============ */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
}

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

.category-tabs a:hover,
.category-tabs a.active {
    background: var(--primary);
    color: #fff;
}

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

.soft-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.soft-item:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.soft-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border-light);
}

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

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

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

.soft-info h4 a:hover {
    color: var(--primary);
}

.soft-info .soft-desc {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.soft-info .soft-meta {
    font-size: 12px;
    color: var(--text-light);
}

.soft-info .soft-meta .soft-cat {
    color: var(--primary);
    margin-right: 8px;
}

/* ============ 最新更新列表 ============ */
.update-list {
    display: flex;
    flex-direction: column;
}

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

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

.update-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border-light);
}

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

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

.update-cat {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 3px;
}

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

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

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

.update-date {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
    padding: 3px 8px;
    background: var(--border-light);
    border-radius: var(--radius);
}

/* ============ 排行榜样式 ============ */
.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-title {
    flex: 1;
    font-size: 13px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ============ 标签云 ============ */
.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;
}

/* ============ 双栏布局 ============ */
.dual-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* ============ 专题链接区 ============ */
.topic-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
}

.topic-links a {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.topic-links a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* ============ 底部链接导航 ============ */
.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-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

    .banner-main {
        height: 220px;
    }

    .banner-side {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
        height: 120px;
    }

    .recommend-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .soft-list {
        grid-template-columns: 1fr;
    }

    .dual-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;
    }

    /* 焦点图 */
    .banner-grid {
        gap: 8px;
    }

    .banner-main {
        height: 180px;
    }

    .banner-main .banner-caption h3 {
        font-size: 15px;
    }

    .banner-main .banner-caption p {
        font-size: 12px;
    }

    .banner-side {
        height: 90px;
    }

    .banner-side-item .side-caption {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* 区块标题 */
    .section-header {
        padding: 10px 14px;
    }

    .section-title {
        font-size: 16px;
    }

    .section-body {
        padding: 12px 14px;
    }

    /* 精品推荐 */
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .recommend-img {
        height: 110px;
    }

    .recommend-info {
        padding: 8px 10px;
    }

    .recommend-info h4 {
        font-size: 13px;
    }

    /* 软件列表 */
    .soft-item {
        padding: 10px;
    }

    .soft-thumb {
        width: 52px;
        height: 52px;
    }

    /* 最新更新 */
    .update-thumb {
        width: 48px;
        height: 48px;
    }

    .update-date {
        font-size: 11px;
        padding: 2px 6px;
    }

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

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

@media (max-width: 480px) {
    .recommend-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

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

    .banner-main {
        height: 150px;
    }

    .soft-item {
        gap: 10px;
    }
}
