/* 全局样式 - 调整为非黑色背景 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "SimHei", sans-serif;
    background-color: #f5f1e6; /* 浅米色背景 */
    background-image: url('/images/legend-bg.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: #333; /* 深色文字 */
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 加载动画 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 241, 230, 0.9); /* 浅色加载背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0d9c6;
    border-top: 5px solid #c9a063;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 头部样式 */
.header {
    background-color: rgba(245, 241, 230, 0.9); /* 浅色头部背景 */
    border-bottom: 2px solid #c9a063;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin: 0 15px;
}

.main-nav a {
    color: #333; /* 深色导航文字 */
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    color: #c9a063;
    background-color: rgba(0, 0, 0, 0.05);
}

.search-box {
    width: 300px;
}

.search-container {
    display: flex;
}

.input-text {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #d0c8b0;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-btn {
    padding: 0 15px;
    background-color: #c9a063;
    color: #000;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #d9b57a;
}

.loading-indicator {
    display: none;
    align-items: center;
    margin-left: 10px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #c9a063;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 英雄区样式 */
.hero-banner {
    background-image: url('/images/legend-hero.jpg');
    background-size: cover;
    background-position: center;
    padding: 80px 0;
    text-align: center;
    position: relative;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 241, 230, 0.5); /* 浅色遮罩 */
}

.hero-banner .container {
    position: relative;
    z-index: 1;
}

.banner-content h1 {
    font-size: 48px;
    color: #a07830; /* 深金色标题 */
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

.banner-content p {
    font-size: 20px;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: #444;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    margin: 0 10px;
}

.btn-primary {
    background-color: #c9a063;
    color: #000;
    border: 2px solid #c9a063;
}

.btn-primary:hover {
    background-color: #d9b57a;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #a07830;
    border: 2px solid #a07830;
}

.btn-secondary:hover {
    background-color: rgba(201, 160, 99, 0.1);
    transform: translateY(-2px);
}

/* 主内容区样式 */
main {
    padding: 40px 0;
}

section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0d9c6;
}

h2 {
    color: #a07830;
    font-size: 24px;
    position: relative;
    padding-left: 15px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #c9a063;
}

.view-all {
    color: #a07830;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.view-all:hover {
    color: #d9b57a;
    text-decoration: underline;
}

/* 分类样式 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: rgba(255, 255, 255, 0.9); /* 白色卡片背景 */
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: #c9a063;
    background-color: #fff;
}

.category-icon {
    font-size: 36px;
    margin-bottom: 10px;
    color: #c9a063;
}

.category-name {
    font-weight: bold;
}

/* 文章列表样式 - 优化为每行4个，字体缩小 */
.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.article-card {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.article-card:hover {
    border-color: #c9a063;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-title a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
    line-height: 1.5;
}

.article-title a:hover {
    color: #c9a063;
}

.article-meta {
    margin: 10px 0;
    font-size: 12px;
    color: #777;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-meta a {
    color: #777;
    text-decoration: none;
}

.article-meta a:hover {
    color: #c9a063;
}

.article-tags {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    background-color: rgba(201, 160, 99, 0.2);
    color: #a07830;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background-color: rgba(201, 160, 99, 0.3);
}

.article-excerpt {
    margin: 15px 0;
    color: #555;
    font-size: 14px;
}

.read-more {
    display: inline-block;
    color: #a07830;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.read-more:hover {
    color: #d9b57a;
    padding-left: 5px;
}

/* 网站列表样式 - 优化为每行5个，字体缩小 */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.site-card {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.site-card:hover {
    border-color: #c9a063;
    transform: translateY(-3px);
}

.site-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #f5f1e6;
}

.default-logo {
    width: 50px;
    height: 50px;
    background-color: #c9a063;
    color: #000;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.site-name {
    font-weight: bold;
    margin-bottom: 3px;
    color: #333;
    font-size: 14px;
}

.site-domain {
    font-size: 11px;
    color: #777;
    margin-bottom: 5px;
}

.site-desc {
    font-size: 12px;
    color: #555;
}

/* 文章详情页样式 */
.article-detail {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0d9c6;
}

.article-header h1 {
    color: #a07830;
    font-size: 28px;
    margin-bottom: 15px;
}

.article-content {
    color: #333;
    line-height: 1.8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 4px;
}

.article-content p {
    margin-bottom: 15px;
}

.resource-info {
    background-color: rgba(201, 160, 99, 0.1);
    border-left: 3px solid #c9a063;
    padding: 15px;
    margin: 30px 0;
    border-radius: 0 4px 4px 0;
}

.resource-info h3 {
    color: #a07830;
    margin-bottom: 10px;
}

.resource-link {
    display: flex;
}

.resource-link input {
    flex: 1;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #d0c8b0;
    color: #333;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.copy-btn {
    padding: 0 15px;
    background-color: #c9a063;
    color: #000;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
}

.article-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.share-btn, .like-btn {
    padding: 8px 15px;
    background-color: transparent;
    color: #a07830;
    border: 1px solid #a07830;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.share-btn:hover, .like-btn:hover {
    background-color: rgba(201, 160, 99, 0.1);
}

/* 相关文章样式 */
.related-articles {
    margin-top: 40px;
}

.related-articles h3 {
    color: #a07830;
    margin-bottom: 20px;
    font-size: 20px;
}

.related-article {
    display: block;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.related-article:hover {
    border-color: #c9a063;
    transform: translateX(5px);
}

.related-article h4 {
    margin-bottom: 5px;
}

.related-meta {
    font-size: 12px;
    color: #777;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 8px;
}

.page-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #e0d9c6;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-btn:hover {
    background-color: rgba(201, 160, 99, 0.2);
    border-color: #c9a063;
    color: #a07830;
}

.page-btn.prev::before {
    content: '← ';
}

.page-btn.next::after {
    content: ' →';
}

.current {
    display: inline-block;
    padding: 8px 15px;
    background-color: #c9a063;
    color: #000;
    border-radius: 4px;
    font-weight: bold;
}

.page-ellipsis {
    color: #777;
    padding: 0 5px;
}

/* 无结果样式 */
.no-results, .no-articles {
    text-align: center;
    padding: 50px 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
}

.no-results-icon, .no-articles-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #c9a063;
}

.no-results p, .no-articles p {
    margin-bottom: 20px;
    color: #555;
}

.search-suggestion a, .btn-reset {
    color: #a07830;
    text-decoration: none;
}

.search-suggestion a:hover, .btn-reset:hover {
    text-decoration: underline;
}

.btn-reset {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #a07830;
    border-radius: 4px;
}

/* 页脚样式 */
.footer {
    background-color: rgba(245, 241, 230, 0.9);
    border-top: 2px solid #c9a063;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    text-align: center;
}

.copyright {
    margin-bottom: 15px;
    color: #777;
    font-size: 14px;
}

.copyright a {
    color: #a07830;
    text-decoration: none;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #777;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #a07830;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header .container {
        flex-wrap: wrap;
    }
    
    .search-box {
        width: 100%;
        margin-top: 15px;
        order: 3;
    }
    
    .articles-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-nav li {
        margin: 0 8px;
    }
    
    .banner-content h1 {
        font-size: 36px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .btn-primary, .btn-secondary {
        display: block;
        margin: 10px auto;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    
    .articles-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 576px) {
    .logo img {
        height: 40px;
    }
    
    .main-nav a {
        font-size: 14px;
        padding: 5px;
    }
    
    .banner-content h1 {
        font-size: 28px;
    }
    
    .banner-content p {
        font-size: 16px;
    }
    
    .articles-list, .sites-grid, .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-btn {
        padding: 5px 10px;
        font-size: 14px;
    }
    
    .article-actions {
        flex-direction: column;
    }
    
    .share-btn, .like-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-links {
        gap: 10px;
    }
    
    .footer-links a {
        font-size: 12px;
    }
}

/* 标签页特有样式 */
.tag-page {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 30px;
}

.tag-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0d9c6;
}

.tag-header h1 {
    color: #a07830;
    margin-bottom: 10px;
}

.tag-count {
    color: #777;
}

/* 网站大全页特有样式 */
.sites-directory {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 30px;
}

.directory-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0d9c6;
}

.directory-header h1 {
    color: #a07830;
    margin-bottom: 10px;
}

.directory-count {
    color: #777;
}

/* 搜索结果页特有样式 */
.search-results {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 30px;
}

.results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0d9c6;
}

.result-count {
    color: #777;
}

/* 分类筛选样式 */
.category-filter {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0d9c6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
}

.category-filter ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 10px;
}

.category-filter a {
    color: #333;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 15px;
    background-color: rgba(224, 217, 198, 0.5);
    font-size: 14px;
    transition: all 0.3s;
}

.category-filter a:hover, .category-filter a.active {
    background-color: #c9a063;
    color: #000;
}
