/* 全局样式与配色方案 */
:root {
    --primary-color: #8B0000; /* 深红色作为主色 */
    --secondary-color: #5D4037; /* 深褐色 */
    --background-color: #F5F5F0; /* 米色背景 */
    --text-color: #3E2723; /* 深褐色文字 */
    --light-accent: #D7CCC8; /* 浅米色 */
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}
.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    order: 2;
    color: var(--text-color);
    margin-left: auto; /* 将按钮推到右侧 */
    padding: 0.5rem; /* 增加点击区域 */
}

/* 可访问性：焦点样式 */
a:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 跳过导航链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 导航栏 */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    order: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-links.active {
    max-height: 500px;
    margin-top: 1rem;
}

.nav-links li {
    margin: 0.5rem 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    order: 2;
    width: 100%;
    margin: 1rem 0 0 0;
    align-items: center;
}

.search-bar input {
    padding: 0.7rem 0.5rem;
    border: 1px solid var(--light-accent);
    border-radius: 4px 0 0 4px;
    outline: none;
    flex-grow: 1;
    height: 40px;
    box-sizing: border-box;
    font-size: 1rem;
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    height: 40px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 0.8rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 0.9rem;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #999;
}

.breadcrumb a {
    color: var(--text-color);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* 主要内容区 */
.container {
    max-width: 1400px;
    margin: 1rem auto 2rem;
    padding: 0 5%;
}

/* 页面标题区域 */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-accent);
}

.page-title {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.page-description {
    color: #666;
    font-size: 1rem;
}

/* 排行榜导航 */
.ranking-nav {
    display: flex;

    overflow-x: auto;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.ranking-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.ranking-nav-item {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    background-color: var(--white);
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s;
}

.ranking-nav-item.active, .ranking-nav-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 排行榜列表 */
.ranking-list {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid var(--light-accent);
    transition: background-color 0.3s;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background-color: rgba(139, 0, 0, 0.05);
}

.ranking-number {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.ranking-number.top3 {
    font-size: 1.5rem;
}

.ranking-cover {
    flex: 0 0 80px;
    margin: 0 1rem;
}

.ranking-cover img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.ranking-info {
    flex: 1;
}

.ranking-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.ranking-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.ranking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.ranking-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.ranking-action {
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #6B0000;
    text-decoration: none;
}

/* 分类排行榜 */
.category-rankings {
    margin-top: 3rem;
}

.category-rankings h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.category-rankings h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.category-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed var(--light-accent);
}

.category-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.category-list a {
    display: flex;
    align-items: center;
}

.category-list .rank {
    flex: 0 0 20px;
    color: var(--primary-color);
    font-weight: 500;
    margin-right: 0.5rem;
}

/* 页脚 */
footer {
    background-color: var(--secondary-color);
    color: var(--light-accent);
    padding: 2rem 5%;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-column h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: var(--light-accent);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: var(--white);
    text-decoration: underline;
}

.copyright {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* 平板设备样式 */
@media (min-width: 576px) {
    .page-title {
        font-size: 2.2rem;
    }

    .ranking-nav-item {
        padding: 0.5rem 1.5rem;
        margin-right: 1rem;
        font-size: 1rem;
        margin-top: 10px;
    }

    .ranking-cover {
        flex: 0 0 100px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面设备样式 */
@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        max-height: none;
        width: auto;
        order: 2;
    }

    .nav-links li {
        margin-left: 1.5rem;
        margin-bottom: 0;
    }

    .search-bar {
        order: 3;
        width: auto;
        margin: 0 0 0 1.5rem;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .ranking-nav {
        justify-content: center;
        flex-wrap: wrap;

    }

    .ranking-item {

        padding: 1.2rem;
    }

    .ranking-cover {
        flex: 0 0 120px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }

}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important; /* 强制覆盖其他样式 */
    }
}

/* 默认状态（无下划线） */
a {
    text-decoration: none;
}

/* 鼠标悬停时也保持无下划线 */
a:hover {
    text-decoration: none;
}

