/* 基础样式设置 - 卡通风格配色 */
:root {
    --primary-color: #355c36; /* 深绿色 */
    --primary-light: #bee2b9; /* 淡绿色 */
    --secondary-color: #264d6c; /* 深蓝色 */
    --accent-color: #f5c181; /* 柔和橙色 */
    --accent-pink: #f5aa9e; /* 粉橘色 */
    --accent-blue: #b7ddf5; /* 天蓝色 */
    --accent-red: #c5583d; /* 砖红色 */
    --light-color: #f9f5eb; /* 背景米白色 */
    --dark-color: #355c36; /* 深绿色文字 */
    --grey-color: #6b7c7d; /* 中性灰色 */
    --light-grey: #e8e0d0; /* 淡米色 */
    --success-color: #bee2b9; /* 淡绿色 */
    --warning-color: #f5c181; /* 柔和橙色 */
    --info-color: #b7ddf5; /* 天蓝色 */
    --danger-color: #c5583d; /* 砖红色 */
    --white: #ffffff; /* 纯白色 */
    
    /* 卡通风格分类卡片背景色 */
    --card-general: #f5c181; /* 通用工具 - 柔和橙色 */
    --card-math: #f5aa9e; /* 数学工具 - 粉橘色 */
    --card-science: #bee2b9; /* 科学工具 - 淡绿色 */
    --card-language: #b7ddf5; /* 语文工具 - 天蓝色 */
    --card-english: #e6c9f0; /* 外语工具 - 淡紫色 */
    --card-history: #ffd7b3; /* 历史工具 - 淡黄色 */
    
    /* 卡通风格图标颜色 */
    --icon-general: #e67e22; /* 通用工具图标 - 橙色 */
    --icon-math: #e74c3c; /* 数学工具图标 - 红色 */
    --icon-science: #27ae60; /* 科学工具图标 - 绿色 */
    --icon-language: #3498db; /* 语文工具图标 - 蓝色 */
    --icon-english: #9b59b6; /* 外语工具图标 - 紫色 */
    --icon-history: #f39c12; /* 历史工具图标 - 黄色 */
    
    /* 卡通风格文字颜色 */
    --text-title: #2c3e50; /* 主标题 - 深蓝灰 */
    --text-subtitle: #34495e; /* 副标题 - 蓝灰 */
    --text-body: #2c3e50; /* 正文 - 深蓝灰 */
    --text-light: #7f8c8d; /* 辅助文字 - 浅灰 */
    --text-accent: #e74c3c; /* 强调文字 - 红色 */
    --text-success: #27ae60; /* 成功文字 - 绿色 */
    --text-warning: #f39c12; /* 警告文字 - 橙色 */
    
    /* 简化阴影 - 扁平设计 */
    --shadow-sm: 0 1px 3px rgba(53, 92, 54, 0.08);
    --shadow-md: 0 2px 6px rgba(53, 92, 54, 0.1);
    --shadow-lg: 0 4px 12px rgba(53, 92, 54, 0.12);
    
    /* 统一圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 简化过渡 */
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--light-color);
    position: relative;
    overflow-x: hidden;
}

/* 卡通背景装饰 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 190, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(190, 226, 185, 0.08) 0%, transparent 50%);
    z-index: -2;
    pointer-events: none;
}

/* 飘浮的卡通装饰元素 - 简化版本 */
body::after {
    content: "⭐ ⭐";
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
    animation: gentle-float 8s ease-in-out infinite;
}

@keyframes gentle-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h1 { 
    font-size: 2.8rem; 
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}
h2 { 
    font-size: 2.5rem; 
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.12);
}
h3 { 
    font-size: 2rem; 
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
h4 { font-size: 1.6rem; }
h5 { font-size: 1.4rem; }
h6 { font-size: 1.2rem; }

p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-body);
}

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

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-title);
}



/* 动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 卡通风格按钮 */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--radius-xl);
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* 卡通按钮装饰星星 */
.btn::before {
    content: "✨";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
    opacity: 0;
    transform: rotate(0deg) scale(0.5);
    transition: all 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
    transform: rotate(360deg) scale(1);
}

.btn-primary {
    background: linear-gradient(45deg, var(--card-general), var(--icon-general));
    color: var(--white);
    border: 3px solid var(--icon-general);
    position: relative;
}

.btn-primary::after {
    content: "🎯";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--icon-general), var(--card-general));
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.4);
    border-color: var(--card-general);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--card-language), var(--icon-language));
    color: var(--white);
    border: 3px solid var(--icon-language);
    position: relative;
}

.btn-secondary::after {
    content: "🎨";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, var(--icon-language), var(--card-language));
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
    border-color: var(--card-language);
}

.btn-outline {
    background: var(--white);
    color: var(--text-accent);
    border: 3px solid var(--text-accent);
    padding: 0.8rem 1.8rem;
    position: relative;
}

.btn-outline::after {
    content: "🌟";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.btn-outline:hover {
    background: linear-gradient(45deg, var(--text-accent), var(--text-warning));
    color: var(--white);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
    border-color: var(--text-warning);
}



/* 导航栏样式 - 纯扁平设计 */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--light-grey);
}

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

.logo h1 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    color: var(--text-accent);
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 0;
}

.logo i {
    color: var(--text-warning);
    margin-right: 0.8rem;
    font-size: 1.8rem;
}



.search-bar {
    display: flex;
    flex-grow: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-bar input {
    flex-grow: 1;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--light-grey);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.9rem;
    background-color: var(--light-grey);
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    background-color: white;
    border-color: var(--accent-color);
}

.search-bar button {
    background-color: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 0 1.2rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background-color: var(--primary-color);
    color: white;
}

.main-nav ul {
    display: flex;
    align-items: center;
}

.main-nav li {
    margin-left: 1.5rem;
}

.main-nav a {
    color: var(--text-subtitle);
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.main-nav a:hover {
    background: var(--card-language);
    color: var(--icon-language);
}

.main-nav a.active {
    background: var(--text-accent);
    color: var(--white);
}

.btn-login {
    display: flex;
    align-items: center;
    background-color: var(--light-grey);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.btn-login i {
    margin-right: 0.5rem;
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: white;
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* 英雄区域样式 - 卡通风格 */
.hero {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--light-color) 0%, rgba(245, 193, 129, 0.1) 100%);
    border-bottom: 3px solid var(--text-warning);
    position: relative;
    overflow: hidden;
}



.hero::after {
    content: "🌈";
    position: absolute;
    top: 30px;
    right: 10%;
    font-size: 3rem;
    opacity: 0.4;
    animation: rainbow-sway 6s ease-in-out infinite;
}



@keyframes rainbow-sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.hero .container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    padding-right: 2rem;
}

.hero-content h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-accent);
    line-height: 1.3;
}



.hero-content p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-subtitle);
    line-height: 1.8;
}

.hero-description {
    margin-top: 1.5rem;
    padding: 1.5rem;
}

.description-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.description-item:last-child {
    margin-bottom: 0;
}

.description-icon {
    font-size: 1.2rem;
    margin-right: 0.8rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.description-item span:last-child {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-body);
    flex: 1;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-display {
    width: 640px;
    height: 360px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    transition: var(--transition);
}

.hero-image-display:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 响应式封面图片 */
@media (max-width: 768px) {
    .hero-image-display {
        width: 90vw;
        height: calc(90vw * 9 / 16);
        max-width: 480px;
        max-height: 270px;
    }
}

@media (max-width: 480px) {
    .hero-image-display {
        width: 95vw;
        height: calc(95vw * 9 / 16);
    }
}

.hero-image img {
    max-width: 400px;
    max-height: 300px;
    border-radius: var(--radius-lg);
    object-fit: cover;
}

/* 分类导航样式 - 纯扁平设计 */
.categories {
    padding: 4rem 0;
    background: var(--white);
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 3px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 卡通卡片装饰边框 - 已禁用渐变背景 */
.category-card::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    /* background: linear-gradient(45deg, var(--text-accent), var(--text-warning), var(--text-success), var(--icon-language)); */
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}



.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* .category-card:hover::before {
    opacity: 1;
} */



.category-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: scale(1.1) rotate(5deg); }
    25% { transform: scale(1.15) rotate(-5deg); }
    75% { transform: scale(1.05) rotate(10deg); }
}

/* 分类图标样式 */
.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.category-card:hover .category-icon img {
    transform: scale(1.1) rotate(5deg);
    animation: wiggle 0.5s ease-in-out;
}

/* 精选工具图标样式 */
.resource-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    transition: var(--transition);
}

.resource-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.resource-card:hover .resource-icon img {
    transform: scale(1.05);
}

/* 工具页面图标样式 */
.tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon img {
    transform: scale(1.1) rotate(5deg);
    animation: wiggle 0.5s ease-in-out;
}

/* 复制链接按钮 */
.copy-link-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 10;
}

.tool-card:hover .copy-link-btn {
    opacity: 1;
    transform: scale(1);
}

.copy-link-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 复制成功提示 */
.copy-feedback {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: var(--success-color);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 11;
    white-space: nowrap;
}
        
.tool-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
}

/* 分类卡片不同背景色 */
.category-card.general {
    background: var(--card-general);
}
.category-card.general .category-icon {
    color: var(--icon-general);
}

.category-card.math {
    background: var(--card-math);
}
.category-card.math .category-icon {
    color: var(--icon-math);
}

.category-card.science {
    background: var(--card-science);
}
.category-card.science .category-icon {
    color: var(--icon-science);
}

.category-card.language {
    background: var(--card-language);
}
.category-card.language .category-icon {
    color: var(--icon-language);
}

.category-card.english {
    background: var(--card-english);
}
.category-card.english .category-icon {
    color: var(--icon-english);
}

.category-card.history {
    background: var(--card-history);
}
.category-card.history .category-icon {
    color: var(--icon-history);
}

.category-card h3 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.category-card p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    color: black;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
}

.categories .section-title {
    text-align: center;
}

.categories-layout {
    display: flex;
    gap: 32px;
    align-items: stretch;
}

.categories-main {
    flex: 1;
    min-width: 0;
}

/* 热门工具排行榜 */
.tool-ranking {
    flex: 0 0 320px;
    background: linear-gradient(180deg, #ffffff 0%, #fff5eb 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 24px;
    border: 2px solid rgba(53, 92, 54, 0.08);
    align-self: flex-start;
    position: relative;
}

.tool-ranking::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(53, 92, 54, 0.08);
    pointer-events: none;
}

.ranking-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.ranking-header .section-title {
    text-align: left;
    margin-bottom: 6px;
    font-size: 1.6rem;
}

.ranking-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.ranking-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.ranking-range {
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(190, 226, 185, 0.3);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.ranking-view-all {
    font-weight: 600;
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ranking-view-all::after {
    content: "›";
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.ranking-view-all:hover::after {
    transform: translateX(4px);
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(53, 92, 54, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-link {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    color: inherit;
}

.ranking-link:hover {
    text-decoration: none;
}

.ranking-item:not(.loading):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.ranking-order {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(245, 161, 129, 0.15);
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-item:nth-child(1) .ranking-order {
    background: linear-gradient(135deg, #fdd692, #f5a881);
    color: #8a4f1c;
}

.ranking-item:nth-child(2) .ranking-order {
    background: linear-gradient(135deg, #dfe6f5, #cdd5ec);
    color: #3d4a73;
}

.ranking-item:nth-child(3) .ranking-order {
    background: linear-gradient(135deg, #f8e3c3, #f6d1a1);
    color: #7a4b1c;
}

.ranking-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-link::after {
    content: "\f061";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--text-light);
    transition: transform 0.2s ease, color 0.2s ease;
}

.ranking-item:not(.loading):hover .ranking-link::after {
    transform: translateX(6px);
    color: var(--secondary-color);
}

.ranking-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-title);
}

.ranking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-light);
}

.ranking-desc {
    color: var(--text-light);
}

.ranking-count {
    margin-left: auto;
    font-weight: 600;
    color: var(--primary-color);
}

.ranking-item.loading .ranking-link {
    cursor: default;
}

.ranking-item.loading .ranking-link::after {
    content: "";
}

@media (max-width: 1024px) {
    .categories-layout {
        flex-direction: column;
    }
    
    .tool-ranking {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 768px) {
    .ranking-link {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .ranking-order {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .ranking-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ranking-count {
        margin-left: 0;
    }
}

/* 分类卡片文字颜色 */
.category-card.general h3 {
    color: white;
}

.category-card.math h3 {
    color: white;
}

.category-card.science h3 {
    color: white;
}

.category-card.language h3 {
    color: white;
}

.category-card.english h3 {
    color: white;
}

.category-card.history h3 {
    color: white;
}

/* 资源卡片样式 - 纯扁平设计 */
.featured-resources {
    padding: 4rem 0;
    background: var(--light-color);
}

.resource-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    height: 320px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.coming-soon-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 20px);
    background: rgba(34, 34, 34, 0.92);
    color: #fff;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
}

.coming-soon-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* 资源卡片装饰边框 */
.resource-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(45deg, var(--text-accent), var(--text-warning), var(--text-success));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    opacity: 0;
    transition: var(--transition);
}

/* 资源卡片角落装饰 */
.resource-card::after {
    content: "🎪";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
    transition: all 0.4s ease;
}

.resource-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.resource-card:hover::before {
    opacity: 1;
}

.resource-card:hover::after {
    opacity: 1;
    transform: scale(1) rotate(360deg);
}

/* 精选工具卡片不同背景色 */
.resource-card.timer {
    background: var(--card-science);
}

.resource-card.group-scorer {
    background: var(--card-language);
}

.resource-card.random-picker {
    background: var(--card-english);
}

.resource-card.score-analysis {
    background: var(--card-language);
}

.resource-card.paper-generator {
    background: var(--card-general);
}

.resource-card.ticket-generator {
    background: var(--card-history);
}

.resource-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resource-card:hover .resource-image img {
    transform: scale(1.05);
}

.resource-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-sm);
}

.resource-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.resource-content h3 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: white;
}

/* 精选工具卡片文字颜色 */
.resource-card.timer h3 {
    color: white;
}

.resource-card.group-scorer h3 {
    color: white;
}

.resource-card.random-picker h3 {
    color: white;
}

.resource-card.score-analysis h3 {
    color: white;
}

.resource-card.paper-generator h3 {
    color: white;
}

.resource-card.ticket-generator h3 {
    color: white;
}

.resource-card.timer .resource-author {
    color: white;
}

.resource-card.group-scorer .resource-author {
    color: white;
}

.resource-card.random-picker .resource-author {
    color: white;
}

.resource-card.score-analysis .resource-author {
    color: white;
}

.resource-card.paper-generator .resource-author {
    color: white;
}

.resource-card.ticket-generator .resource-author {
    color: white;
}

.resource-author {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0;
    line-height: 1.6;
}



.resource-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: white;
}

.resource-meta span:first-child {
    color: white;
}

.resource-meta span:last-child {
    color: white;
}

.view-all {
    text-align: center;
    margin-top: 3rem;
}

/* 分享按钮样式 */
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.category-card:hover .share-buttons,
.resource-card:hover .share-buttons {
    opacity: 1;
    transform: translateY(0);
}

.share-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-btn:hover::before {
    opacity: 1;
}

.share-btn.wechat {
    background: linear-gradient(135deg, #07c160, #00a854);
    color: white;
}

.share-btn.wechat:hover {
    background: linear-gradient(135deg, #00a854, #07c160);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
}

.share-btn.qq {
    background: linear-gradient(135deg, #12b7f5, #0099e0);
    color: white;
}

.share-btn.qq:hover {
    background: linear-gradient(135deg, #0099e0, #12b7f5);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(18, 183, 245, 0.4);
}

.share-btn i {
    font-size: 16px;
    z-index: 1;
    position: relative;
}

/* 分享按钮在不同卡片中的适配 */
.category-card .share-buttons {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 2;
}

.category-card:hover .share-buttons {
    transform: translateX(-50%) translateY(0);
}

.resource-card .share-buttons {
    margin-top: 15px;
}

/* 统计部分样式 - 卡通风格 */
.stats {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--white) 0%, rgba(183, 221, 245, 0.1) 100%);
    position: relative;
    overflow: hidden;
}

/* 统计区域装饰 */
.stats::before {
    content: "🎊 🎉 🎊 🎉";
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    opacity: 0.2;
    animation: party-bounce 3s ease-in-out infinite;
}

@keyframes party-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.stats .container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    margin: 1rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

/* 统计项目装饰边框 */
.stat-item::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--text-accent), var(--text-warning), var(--text-success), var(--icon-language));
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

/* 统计项目装饰徽章 */
.stat-item::after {
    content: "🏆";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s ease;
}

.stat-item:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover::after {
    opacity: 1;
    transform: scale(1);
}

.stat-item i {
    font-size: 3rem;
    margin-right: 1.5rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.stat-item:hover i {
    transform: scale(1.1);
    animation: stat-pulse 0.6s ease-in-out;
}

@keyframes stat-pulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
}

/* 统计项目不同背景色 */
.stat-item:nth-child(1) {
    background: var(--card-general);
}
.stat-item:nth-child(1) i {
    color: var(--icon-general);
}

.stat-item:nth-child(2) {
    background: var(--card-math);
}
.stat-item:nth-child(2) i {
    color: var(--icon-math);
}

.stat-item:nth-child(3) {
    background: var(--card-science);
}
.stat-item:nth-child(3) i {
    color: var(--icon-science);
}

.stat-item:nth-child(4) {
    background: var(--card-language);
}
.stat-item:nth-child(4) i {
    color: var(--icon-language);
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
    color: var(--text-title);
}

.stat-info p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0;
}

/* 统计项目文字颜色 */
.stat-item:nth-child(1) .stat-info h3 {
    color: var(--icon-general);
}

.stat-item:nth-child(2) .stat-info h3 {
    color: var(--icon-math);
}

.stat-item:nth-child(3) .stat-info h3 {
    color: var(--icon-science);
}

.stat-item:nth-child(4) .stat-info h3 {
    color: var(--icon-language);
}

/* 教师感言样式 */
.testimonials {
    padding: 4rem 0;
    background-color: white;
}

.testimonial-slider {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none; /* 隐藏滚动条 */
}

.testimonial-slider::-webkit-scrollbar {
    display: none; /* 隐藏滚动条 */
}

.testimonial {
    min-width: 300px;
    flex: 1;
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-color);
    border: 1px solid var(--light-grey);
    transition: var(--transition);
}

.testimonial:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.testimonial-content {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.testimonial-author h4 {
    margin-bottom: 0.2rem;
}

.testimonial-author p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.85rem;
    color: var(--grey-color);
    margin-bottom: 0;
}

.testimonial-dots {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--light-grey);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background-color: var(--primary-color);
}

/* 加入我们区域样式 */
.join-us {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
    color: white;
    text-align: center;
    overflow: hidden;
}

.join-us:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(45deg, var(--accent-color) 25%, transparent 25%, transparent 50%, var(--accent-color) 50%, var(--accent-color) 75%, transparent 75%, transparent);
    background-size: 60px 60px;
    opacity: 0.05;
}

.join-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.join-content p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    opacity: 0.9;
}

/* 底部导航样式 */
.footer {
    background-color: #f9f5eb;
    color: var(--dark-color);
    padding: 4rem 0 1rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.footer-logo {
    flex: 1;
    min-width: 250px;
    margin-bottom: 2rem;
}

.footer-logo h2 {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.footer-logo i {
    margin-right: 0.5rem;
    color: var(--dark-color);
}

.footer-logo p {
    font-family: 'Source Han Serif SC', 'Noto Serif SC', 'STKaiti', 'KaiTi', '楷体', serif;
    opacity: 0.7;
    margin-top: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    flex: 2;
    justify-content: space-around;
}

.footer-links-column {
    min-width: 150px;
    margin-bottom: 2rem;
}

.footer-links-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    color: var(--dark-color);
}

.footer-links-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
}

.footer-links-column ul li {
    margin-bottom: 0.8rem;
}

.footer-links-column ul li a {
    color: var(--grey-color);
    transition: var(--transition);
}

.footer-links-column ul li a:hover {
    color: var(--dark-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-color);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-5px);
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 20px;
    text-align: center;
    color: var(--grey-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        margin: 1rem 0;
        max-width: 100%;
    }
    
    .stats .container {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background-color: white;
        transition: var(--transition);
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        padding: 2rem;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav li {
        margin: 1rem 0;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 0.5rem 0;
        width: 100%;
    }
    
    .btn-login {
        width: 100%;
        justify-content: center;
    }
    
    .category-cards,
    .resource-cards {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .footer-content {
        flex-direction: column;
    }
}

/* ===== 微信公众号样式 ===== */

/* 微信联系按钮样式 */
.contact-info {
    display: flex;
    justify-content: center;
}

.wechat-btn {
    background: linear-gradient(135deg, #1aad19, #00c800);
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 20px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.wechat-btn:hover {
    background: linear-gradient(135deg, #148a15, #00a800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.wechat-btn i {
    font-size: 1.2rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--light-grey);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: #1aad19;
    font-size: 1.4rem;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: var(--grey-color);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
    text-align: center;
}

.qr-container {
    margin-bottom: 20px;
}

.qr-code {
    width: 200px;
    height: 200px;
    border: 2px solid var(--light-grey);
    border-radius: var(--border-radius);
    object-fit: contain;
    background: var(--white);
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--light-grey);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: var(--light-color);
    color: var(--grey-color);
}

.qr-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #1aad19;
}

.qr-placeholder p {
    margin: 2px 0;
    font-size: 0.9rem;
}

.qr-instruction {
    color: var(--grey-color);
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

/* 模态框动画 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header,
    .modal-body {
        padding: 16px 20px;
    }
    
    .qr-code,
    .qr-placeholder {
        width: 180px;
        height: 180px;
    }
    
    .wechat-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}
