/* ==================== 全局变量 ==================== */
:root {
    --black: #1a1a1a;
    --dark-gray: #2d2d2d;
    --gray: #6c757d;
    --light-gray: #f5f5f5;
    --yellow: #ffc107;
    --yellow-dark: #e0a800;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 20px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--black);
    line-height: 1.6;
}

/* ==================== 网站横幅 ==================== */
.site-banner {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    color: var(--white);
    text-align: center;
    padding: 2rem 1rem;
    /* 修改6：让横幅支持右上角放置联系站长按钮 */
    position: relative;
}

.banner-code {
    max-width: 800px;
    margin: 0 auto;
}

/* 修改1：对调 - 原 banner-title 改为小字体白色（辅助文字"自鱼自乐"） */
.banner-title-sub {
    font-size: 1.2rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
    opacity: 0.7;
    color: var(--white);
}

/* 修改1：对调 - 原 banner-url 改为大字体黄色（域名 kunkun520.com） */
.banner-url-main {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--yellow);
    font-family: monospace;
    letter-spacing: 2px;
}

.banner-slogan {
    font-size: 0.9rem;
    opacity: 0.7;
}

.banner-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

/* 修改6：联系站长按钮 - 横幅右上角 */
.banner-contact-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: var(--yellow);
    color: var(--black);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    z-index: 10;
}

.banner-contact-btn:hover {
    background: var(--yellow-dark);
    transform: scale(1.05);
}

/* ==================== 搜索栏 ==================== */
.search-container {
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255,193,7,0.2);
}

.search-btn {
    background: var(--yellow);
    color: var(--black);
    border: none;
    padding: 0 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: var(--yellow-dark);
    transform: scale(0.98);
}

/* ==================== 两个大卡片 ==================== */
.hero-cards {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.hero-card {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    color: var(--black);
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.hero-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.hero-card p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 1rem;
}

.hero-btn {
    display: inline-block;
    background: var(--black);
    color: var(--yellow);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ==================== 主布局（左侧导航 + 右侧内容） ==================== */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    gap: 2rem;
    min-height: calc(100vh - 400px);
}

/* 左侧导航栏 */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: 12px;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    border-bottom: 1px solid #eee;
}

.nav-menu li a {
    display: block;
    padding: 0.8rem 1.2rem;
    color: var(--dark-gray);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.nav-menu li a:hover {
    background: var(--light-gray);
    color: var(--yellow-dark);
    padding-left: 1.5rem;
}

.nav-menu li a.active {
    background: var(--yellow);
    color: var(--black);
    font-weight: bold;
}

/* 汉堡菜单（手机端显示） */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: var(--white);
    border-radius: 8px;
    width: 40px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark-gray);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    min-width: 0;
}

/* ==================== 分类区域 ==================== */
.category-section {
    margin-bottom: 2.5rem;
    /* 修改5：为锚点跳转预留偏移，避免被顶部遮挡 */
    scroll-margin-top: 1rem;
}

.category-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--yellow);
    display: inline-block;
}

/* ==================== 卡片网格 ==================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--yellow);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-category-tag {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    background: var(--light-gray);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    color: var(--gray);
}

/* 修改4：卡片名称黄色背景标签 */
.card-name-tag {
    display: inline-block;
    background: var(--yellow);
    color: var(--black);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.6rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s;
}

.card:hover .card-name-tag {
    background: var(--yellow-dark);
}

/* ==================== 修改3："查看更多" 卡片 - 黄色醒目样式 ==================== */
.more-card {
    background: linear-gradient(135deg, var(--yellow) 0%, #ffb300 100%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid var(--yellow-dark) !important;
    min-height: 140px;
}

.more-card:hover {
    background: linear-gradient(135deg, var(--yellow-dark) 0%, #e0a000 100%) !important;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255,193,7,0.35);
}

.more-content {
    text-align: center;
}

.more-icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

/* 修改3：查看全部文本 - 白色加粗大字 */
.more-label {
    display: inline-block;
    color: var(--black);
    font-size: 1.1rem;
    font-weight: bold;
    background: var(--white);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ==================== 查看全部按钮 ==================== */
.view-all {
    text-align: center;
    margin-top: 1rem;
}

.view-all-btn {
    display: inline-block;
    background: transparent;
    color: var(--gray);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.view-all-btn:hover {
    background: var(--yellow);
    color: var(--black);
}

/* ==================== 详情页 ==================== */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
}

.detail-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* 修改4：详情页名称 - 底部黄色下划线装饰 */
.detail-name-tag {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 4px solid var(--yellow);
    display: inline-block;
}

.detail-short-title {
    font-size: 1rem;
    color: var(--yellow-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.detail-desc {
    line-height: 1.8;
    color: var(--dark-gray);
    margin-bottom: 2rem;
}

.detail-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.detail-buttons {
    margin-bottom: 2rem;
}

.detail-buttons h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 修改问题3：按钮样式自适应 - 宽度根据文字自动撑开，有合理内边距 */
.btn-primary {
    display: inline-block;
    background: var(--yellow);
    color: var(--black);
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--yellow-dark);
    transform: scale(1.02);
}

/* 备用按钮样式，统一使用黄色系 */
.btn-secondary {
    display: inline-block;
    background: var(--yellow);
    color: var(--black);
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--yellow-dark);
    color: var(--black);
}

.detail-footer-note {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--gray);
    margin: 1.5rem 0;
}

.back-link {
    text-align: center;
    margin-top: 1rem;
}

.back-btn {
    display: inline-block;
    color: var(--gray);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--light-gray);
    color: var(--black);
}

/* ==================== 联系站长页 ==================== */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.contact-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.contact-intro {
    background: var(--light-gray);
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    line-height: 1.8;
    color: var(--dark-gray);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 12px;
}

.contact-icon {
    font-size: 1.8rem;
}

.contact-label {
    font-weight: bold;
    color: var(--dark-gray);
}

.contact-value {
    color: var(--gray);
    font-family: monospace;
}

.contact-note {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #856404;
}

.contact-note p {
    margin: 0.3rem 0;
}

/* ==================== 搜索页 ==================== */
.search-header {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.search-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.search-keyword {
    font-size: 1rem;
    margin: 0.5rem 0;
}

.search-count {
    font-size: 0.9rem;
    color: var(--gray);
}

.search-hint {
    color: var(--gray);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 12px;
}

.empty-state p {
    margin: 0.5rem 0;
    color: var(--gray);
}

.back-home-btn {
    display: inline-block;
    margin-top: 1rem;
    background: var(--yellow);
    color: var(--black);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
}

/* ==================== 类目子页面 ==================== */
.category-header {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.category-header-title {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.category-header-count {
    color: var(--gray);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

.page-link {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark-gray);
    transition: all 0.3s;
}

.page-link:hover {
    background: var(--yellow);
    color: var(--black);
}

.page-current {
    padding: 0.5rem 1rem;
    background: var(--yellow);
    border-radius: 8px;
    font-weight: bold;
}

/* ==================== 修改7：返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--yellow);
    color: var(--black);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--yellow-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ==================== 页脚 ==================== */
.footer {
    background: var(--black);
    color: var(--gray);
    margin-top: 2rem;
    padding: 2rem;
    font-size: 0.8rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 768px) {
    .hero-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-layout {
        flex-direction: column;
        padding: 0.5rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .sidebar {
        display: none;
        width: 100%;
        position: static;
    }
    
    .sidebar.active {
        display: block;
    }
    
    .nav-menu li a {
        padding: 0.8rem 1rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 0.8rem;
    }
    
    /* 修改1响应式：小屏域名字体缩小 */
    .banner-url-main {
        font-size: 1.5rem;
    }
    
    .banner-title-sub {
        font-size: 0.9rem;
    }
    
    /* 修改6响应式：联系站长按钮适配小屏 */
    .banner-contact-btn {
        position: static;
        display: inline-block;
        margin-top: 0.8rem;
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .detail-card {
        padding: 1rem;
    }
    
    .detail-name-tag {
        font-size: 1.3rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-primary, .btn-secondary {
        text-align: center;
    }
    
    .contact-card {
        padding: 1rem;
    }
    
    /* 修改7响应式：返回顶部按钮缩小 */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.2rem;
    }
    
    /* 修改3响应式：查看更多卡片适应小屏 */
    .more-label {
        font-size: 0.95rem;
        padding: 0.4rem 1rem;
    }
}