/* ============================================
   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;
    --star-color: #ffb400;
    --badge-blue: #3498db;
    --badge-red: #e74c3c;
    --text-main: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --bg-main: #f5f5f5;
    --bg-white: #ffffff;
    --bg-soft: #fafafa;
    --bg-code: #f8f8f8;
    --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;
}

/* ============ 面包屑 ============ */
.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);
}

/* ============ 主体布局 ============ */
.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;
}

/* ============ 游戏信息卡片 ============ */
.game-info-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 15px;
}

.game-info-top {
    display: flex;
    gap: 20px;
}

.game-icon {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-detail {
    flex: 1;
    min-width: 0;
}

.game-detail h1 {
    font-size: 22px;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.4;
}

.game-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.game-attrs .attr-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-attrs .attr-label {
    color: var(--text-light);
}

.game-attrs .attr-value {
    color: var(--text-main);
}

.game-attrs .attr-value.accent {
    color: var(--accent);
    font-weight: 500;
}

.game-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 36px;
    background: var(--download-bg);
    color: #fff;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-download:hover {
    background: var(--download-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.btn-favorite {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.btn-favorite:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============ 标签切换 ============ */
.tab-nav {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

.tab-nav a {
    flex: 1;
    text-align: center;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.tab-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
    background: var(--primary-soft);
}

/* ============ 详情内容区 ============ */
.detail-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 15px;
}

.detail-section h2 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.detail-section h3 {
    font-size: 16px;
    color: var(--text-main);
    margin: 20px 0 12px;
    font-weight: 600;
}

.detail-section h4 {
    font-size: 15px;
    color: var(--primary);
    margin: 16px 0 8px;
    font-weight: 600;
}

.detail-content {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.9;
}

.detail-content p {
    margin-bottom: 14px;
}

.detail-content img {
    margin: 16px auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.detail-content ol {
    padding-left: 20px;
    margin: 12px 0 16px;
}

.detail-content ol li {
    list-style: decimal;
    margin-bottom: 10px;
    line-height: 1.8;
}

.detail-content ul.dot-list {
    padding-left: 20px;
    margin: 12px 0 16px;
}

.detail-content ul.dot-list li {
    list-style: disc;
    margin-bottom: 8px;
    line-height: 1.8;
}

.detail-content strong {
    color: var(--primary);
    font-weight: 600;
}

/* ============ 特色项 (带小标题) ============ */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    padding: 14px 16px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.feature-item .feature-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}

.feature-item .feature-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ============ 攻略图文混排 ============ */
.guide-content {
    font-size: 14px;
    color: var(--text-main);
    line-height: 2;
}

.guide-content p {
    margin-bottom: 14px;
}

.guide-content .guide-intro {
    padding: 14px 16px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.guide-step {
    margin-bottom: 20px;
}

.guide-step .step-text {
    margin-bottom: 10px;
}

.guide-step img {
    margin: 10px 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* ============ 截图展示 ============ */
.screenshot-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 0 12px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.screenshot-gallery::-webkit-scrollbar {
    height: 6px;
}

.screenshot-gallery::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.screenshot-item {
    flex-shrink: 0;
    width: 260px;
    height: 146px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* ============ 游戏信息表 ============ */
.game-info-table {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.game-info-table .info-row {
    display: flex;
    border-bottom: 1px solid var(--border-light);
}

.game-info-table .info-row:last-child {
    border-bottom: none;
}

.game-info-table .info-label {
    width: 110px;
    padding: 12px 16px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.game-info-table .info-value {
    flex: 1;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 13px;
    word-break: break-all;
}

/* ============ 底部徽章栏 ============ */
.badge-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.badge-bar .net-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-bar .net-badge.blue {
    background: rgba(52, 152, 219, 0.12);
    color: var(--badge-blue);
}

.badge-bar .net-badge.red {
    background: rgba(231, 76, 60, 0.12);
    color: var(--badge-red);
}

.badge-bar .file-info {
    color: var(--text-light);
    font-size: 12px;
}

/* ============ 评论区 ============ */
.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;
}

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

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

/* ============ 底部导航 ============ */
.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;
}

/* ============ 图片灯箱 ============ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
}

/* ============================================
   响应式适配 - 平板
   ============================================ */
@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;
    }

    .game-info-card {
        padding: 16px;
    }

    .game-info-top {
        gap: 14px;
    }

    .game-icon {
        width: 80px;
        height: 80px;
    }

    .game-detail h1 {
        font-size: 18px;
    }

    .game-attrs {
        gap: 6px 14px;
        font-size: 12px;
    }

    .game-actions {
        justify-content: center;
    }

    .btn-download {
        padding: 10px 28px;
        font-size: 14px;
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .tab-nav a {
        padding: 12px 10px;
        font-size: 13px;
    }

    .detail-section {
        padding: 16px;
    }

    .detail-section h2 {
        font-size: 16px;
    }

    .detail-section h3 {
        font-size: 15px;
    }

    .detail-content {
        font-size: 14px;
    }

    .screenshot-item {
        width: 200px;
        height: 112px;
    }

    .game-info-table .info-label {
        width: 85px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .game-info-table .info-value {
        padding: 10px 12px;
        font-size: 12px;
    }

    .feature-item {
        padding: 12px 14px;
    }

    .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) {
    .nav-list > li > a {
        padding: 8px 11px;
        font-size: 13px;
    }

    .screenshot-item {
        width: 160px;
        height: 90px;
    }

    .game-detail h1 {
        font-size: 16px;
    }

    .game-icon {
        width: 70px;
        height: 70px;
    }
}
