/* 
 * 大白小应用 - 主样式文件
 * 版本: 2.0.0
 */

/* --- 图标字体优化方案 --- */
/* 使用更可靠的字体加载策略，确保图标正常显示 */

/* 优化字体加载 - 使用 font-display: block 确保字体加载完成后再显示 */
@font-face {
    font-family: 'remixicon';
    font-display: block;
    src: url('https://cdn.jsdelivr.net/npm/remixicon@4.2.0/fonts/remixicon.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/npm/remixicon@4.2.0/fonts/remixicon.woff') format('woff');
}

/* 图标基础样式 - 确保正确的字体渲染 */
[class^="ri-"], [class*=" ri-"] {
    font-family: "remixicon" !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    speak: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 当字体加载失败时，使用简洁的文字备用方案 */
@supports not (font-family: "remixicon") {
    .ri-search-line::before {
        content: "搜索";
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 12px;
    }
    
    .ri-moon-line::before {
        content: "暗";
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 12px;
    }
    
    .ri-translate-2::before {
        content: "语言";
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 10px;
    }
    
    .ri-menu-line::before {
        content: "菜单";
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 10px;
    }
    
    .ri-loader-4-line::before {
        content: "...";
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 12px;
        animation: pulse 1s infinite;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- 变量与主题设置 --- */
:root {
    /* 浅色模式变量 */
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --primary-color-light: rgba(0, 123, 255, 0.1);
    --secondary-color: #6c757d;
    --light-bg: #f8f9fa;
    --white-bg: #f4f7f9;
    --dark-text: #212529;
    --light-text: #555;
    --border-color: #dee2e6;
    --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
    --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --card-header-bg: #f0f4ff;
    --footer-bg: #f8f9fa;
    --navbar-bg: #ffffff;
    --navbar-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --tool-card-bg: #ffffff;
    --tool-card-hover-bg: #f8f9fa;
    --tool-link-button-bg: #f0f4ff;
    --tool-link-button-color: var(--primary-color);
    --search-input-bg: #f0f4ff;
    --search-input-text: #212529;
    --search-button-bg: var(--primary-color);
    --search-button-color: #ffffff;
    --wave-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='1' d='M0,192L80,176C160,160,320,128,480,138.7C640,149,800,203,960,218.7C1120,235,1280,213,1360,202.7L1440,192L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
}

/* 深色模式变量 */
[data-theme="dark"] {
    --primary-color: #3a8eff;
    --primary-hover: #5aa3ff;
    --primary-color-light: rgba(58, 142, 255, 0.15);
    --secondary-color: #adb5bd; /* Lighter secondary color */
    --light-bg: #343a40; /* Lighter main background */
    --white-bg: #212529; /* Darker contrast background */
    --dark-text: #f8f9fa; /* Brighter main text */
    --light-text: #adb5bd; /* Brighter secondary text */
    --border-color: #495057; /* Lighter border */
    --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    --card-header-bg: #2c3347;
    --footer-bg: #212529; /* Darker footer */
    --navbar-bg: #212529; /* Darker navbar */
    --navbar-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    --tool-card-bg: #3c4248; /* Distinct card background */
    --tool-card-hover-bg: #495057; /* Lighter card hover */
    --tool-link-button-bg: #2c3347;
    --tool-link-button-color: #3a8eff;
    --search-input-bg: #495057;
    --search-input-text: #f8f9fa;
    --search-button-bg: #3a8eff;
    --search-button-color: #ffffff;
    --wave-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23212529' fill-opacity='1' d='M0,192L80,176C160,160,320,128,480,138.7C640,149,800,203,960,218.7C1120,235,1280,213,1360,202.7L1440,192L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
}

/* --- 全局基础样式 --- */
/* 全局盒模型设置 */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden; /* 防止横向滚动 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 0;
    line-height: 1.7;
    color: var(--dark-text);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* 防止横向滚动 */
    width: 100%; /* 确保body宽度不超过视口 */
}

.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

/* 让主要内容区域占据剩余空间，确保页脚在底部 */
main {
    flex-grow: 1;
    background-color: var(--light-bg);
    transition: background-color 0.3s ease;
    padding-top: 120px; /* 增加顶部内边距，为固定导航栏留出更多空间 */
    padding-bottom: 80px; /* 增加底部内边距，确保分类卡片底部边框完全显示 */
}

/* 移动端调整主内容区域的顶部间距 */
@media (max-width: 768px) {
    main {
        padding-top: 100px; /* 移动端减少顶部间距 */
    }
}

@media (max-width: 480px) {
    main {
        padding-top: 90px; /* 小屏幕进一步减少顶部间距 */
    }
}

/* 工具分类网格底部间距 */
.category-grid {
    margin-bottom: 40px; /* 为分类网格添加底部间距，确保最后一行卡片底部边框完全可见 */
}

/* 为没有使用main标签的页面内容区域添加顶部间距 */
.main-content,
.contact-page-main {
    padding-top: 120px; /* 与main标签保持一致的顶部间距 */
}

main h2 {
    text-align: center; /* 标题居中 */
    margin-bottom: 20px; /* 减小标题下方空间，使布局更紧凑 */
    font-size: 2.2em; /* 调整标题大小 */
    color: var(--dark-text); /* 确保标题颜色与主题一致 */
}

/* 特色网站标题样式 */
h2.featured-sites-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    color: var(--dark-text);
    font-weight: 600;
}

/* --- 通用组件样式 --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
}

/* --- 响应式调整 --- */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
    }
}

@media (max-width: 576px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
}

/* --- 成长阶段时间轴样式 --- */
.timeline-section {
    padding: 60px 0;
    background-color: var(--light-bg);
    transition: background-color 0.3s ease;
}

.timeline-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2em;
    color: var(--dark-text);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    background: var(--primary-color);
    height: 100%;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-item:nth-child(even) .timeline-content {
    text-align: right;
}

.timeline-icon {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    border: 4px solid var(--white-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .timeline-icon {
    border-color: var(--dark-text);
}


.timeline-content {
    width: calc(50% - 60px); /* 减去图标和一些间距 */
    padding: 20px;
    background: var(--white-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.timeline-content:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-5px);
}

.timeline-content h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.timeline-content p {
    color: var(--light-text);
    font-size: 0.95em;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column !important; /* 强制堆叠 */
        align-items: flex-start;
        margin-bottom: 40px;
    }

    .timeline-item:nth-child(even) .timeline-content {
        text-align: left; /* 统一左对齐 */
    }

    .timeline-icon {
        left: 20px;
        transform: translate(-50%, -50%); /* 保持居中于线条 */
        top: 0; /* 调整位置，使其在内容块的顶部 */
    }

    .timeline-content {
        width: calc(100% - 40px); /* 调整宽度 */
        margin-left: 40px; /* 留出时间轴线的空间 */
        padding: 15px;
    }

    .timeline-content h3 {
        font-size: 1.3em;
    }

    .timeline-content p {
        font-size: 0.9em;
    }
}

/* --- 热门工具推荐区域样式 --- */
.popular-tools {
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin: 40px 0;
    box-shadow: none;
    position: relative;
}

.popular-tools h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
    color: var(--dark-text);
    font-weight: 600;
}

.popular-tools-container {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--white-bg);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popular-tools-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.popular-tool-item {
    background: var(--white-bg);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

/* 热门工具项背景色方案 */
.popular-tool-item:nth-child(1) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    border: 1px solid rgba(102, 126, 234, 0.18);
}

.popular-tool-item:nth-child(2) {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.12) 0%, rgba(245, 87, 108, 0.12) 100%);
    border: 1px solid rgba(240, 147, 251, 0.18);
}

.popular-tool-item:nth-child(3) {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.12) 0%, rgba(0, 242, 254, 0.12) 100%);
    border: 1px solid rgba(79, 172, 254, 0.18);
}

.popular-tool-item:nth-child(4) {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.12) 0%, rgba(56, 249, 215, 0.12) 100%);
    border: 1px solid rgba(67, 233, 123, 0.18);
}

.popular-tool-item:nth-child(5) {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.12) 0%, rgba(254, 225, 64, 0.12) 100%);
    border: 1px solid rgba(250, 112, 154, 0.18);
}

.popular-tool-item:nth-child(6) {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.12) 0%, rgba(107, 114, 128, 0.12) 100%);
    border: 1px solid rgba(156, 163, 175, 0.18);
}

.popular-tool-item:nth-child(7) {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px solid rgba(168, 85, 247, 0.18);
}

.popular-tool-item:nth-child(8) {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(22, 163, 74, 0.12) 100%);
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.popular-tool-item:nth-child(9) {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.12) 0%, rgba(249, 115, 22, 0.12) 100%);
    border: 1px solid rgba(251, 146, 60, 0.18);
}

.popular-tool-item:nth-child(10) {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(219, 39, 119, 0.12) 100%);
    border: 1px solid rgba(236, 72, 153, 0.18);
}

/* 循环使用背景色，从第11个开始重复 */
.popular-tool-item:nth-child(n+11):nth-child(10n+1) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    border: 1px solid rgba(102, 126, 234, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+2) {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.12) 0%, rgba(245, 87, 108, 0.12) 100%);
    border: 1px solid rgba(240, 147, 251, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+3) {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.12) 0%, rgba(0, 242, 254, 0.12) 100%);
    border: 1px solid rgba(79, 172, 254, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+4) {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.12) 0%, rgba(56, 249, 215, 0.12) 100%);
    border: 1px solid rgba(67, 233, 123, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+5) {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.12) 0%, rgba(254, 225, 64, 0.12) 100%);
    border: 1px solid rgba(250, 112, 154, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+6) {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.12) 0%, rgba(107, 114, 128, 0.12) 100%);
    border: 1px solid rgba(156, 163, 175, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+7) {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px solid rgba(168, 85, 247, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+8) {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(22, 163, 74, 0.12) 100%);
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+9) {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.12) 0%, rgba(249, 115, 22, 0.12) 100%);
    border: 1px solid rgba(251, 146, 60, 0.18);
}

.popular-tool-item:nth-child(n+11):nth-child(10n+10) {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(219, 39, 119, 0.12) 100%);
    border: 1px solid rgba(236, 72, 153, 0.18);
}

.popular-tool-item:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.popular-tool-item a {
    display: flex;
    align-items: center;
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.3s ease;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    justify-content: center;
}

.popular-tool-item a:hover {
    color: var(--primary-color);
}

.popular-tool-icon {
    font-size: 1.1rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.popular-tool-title {
    font-size: 1.0rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 深色模式调整 */
[data-theme="dark"] .popular-tools-container {
    background: var(--white-bg);
    border-color: var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .popular-tools {
        padding: 25px 0;
    }
    
    .popular-tools h2 {
        font-size: 1.6em;
        margin-bottom: 10px;
    }
    
    .popular-tools-container {
        padding: 15px;
    }
    
    .popular-tools-list {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 8px;
    }
    
    .popular-tool-item {
        padding: 8px 10px;
    }
    
    .popular-tool-icon {
        font-size: 1.1em;
    }
    
    .popular-tool-title {
        font-size: 0.9em;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .popular-tools-container {
        padding: 12px;
    }
    
    .popular-tools-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .popular-tool-item {
        padding: 6px 8px;
        min-width: 0;
    }
    
    .popular-tool-title {
        font-size: 0.85em;
        max-width: 100%;
    }
}

/* --- 社区展示区域样式 --- */
.community-section {
    padding: 60px 0 0 0;
    background: var(--white-bg);
    transition: background-color 0.3s ease;
}

.community-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    color: var(--dark-text);
    font-weight: 600;
}

.community-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--white-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.community-card {
    background: var(--white-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 160px;
}

/* 社区卡片背景色方案 */
.community-card:nth-child(1) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.community-card:nth-child(2) {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15) 0%, rgba(245, 87, 108, 0.15) 100%);
    border: 1px solid rgba(240, 147, 251, 0.2);
}

.community-card:nth-child(3) {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.15) 100%);
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.community-card:nth-child(4) {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.15) 100%);
    border: 1px solid rgba(67, 233, 123, 0.2);
}

.community-card:nth-child(5) {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.15) 0%, rgba(254, 225, 64, 0.15) 100%);
    border: 1px solid rgba(250, 112, 154, 0.2);
}

/* 为有背景色的卡片调整文字颜色 */
.community-card:nth-child(1) .community-title,
.community-card:nth-child(2) .community-title,
.community-card:nth-child(3) .community-title,
.community-card:nth-child(4) .community-title,
.community-card:nth-child(5) .community-title {
    color: var(--dark-text);
}

.community-card:nth-child(1) .community-description,
.community-card:nth-child(2) .community-description,
.community-card:nth-child(3) .community-description,
.community-card:nth-child(4) .community-description,
.community-card:nth-child(5) .community-description {
    color: var(--light-text);
}

.community-card:nth-child(1) .community-footer,
.community-card:nth-child(2) .community-footer,
.community-card:nth-child(3) .community-footer,
.community-card:nth-child(4) .community-footer,
.community-card:nth-child(5) .community-footer {
    border-top: 1px solid var(--border-color);
}

.community-card:nth-child(1) .community-type,
.community-card:nth-child(2) .community-type,
.community-card:nth-child(3) .community-type,
.community-card:nth-child(4) .community-type,
.community-card:nth-child(5) .community-type {
    color: var(--secondary-color);
}

.community-card:nth-child(1) .community-type i,
.community-card:nth-child(2) .community-type i,
.community-card:nth-child(3) .community-type i,
.community-card:nth-child(4) .community-type i,
.community-card:nth-child(5) .community-type i {
    color: var(--primary-color);
}

.community-card:nth-child(1) .community-action,
.community-card:nth-child(2) .community-action,
.community-card:nth-child(3) .community-action,
.community-card:nth-child(4) .community-action,
.community-card:nth-child(5) .community-action {
    color: var(--primary-color);
    font-weight: 600;
}

/* 悬停效果增强 */
.community-card:nth-child(1):hover,
.community-card:nth-child(2):hover,
.community-card:nth-child(3):hover,
.community-card:nth-child(4):hover,
.community-card:nth-child(5):hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-8px);
}

.community-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-5px);
}

.community-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.community-content {
    padding: 18px 22px 28px 22px; /* 增加左右和底部内边距 */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 社区卡片按钮样式 */
.community-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 20px; /* 进一步增加底部间距 */
}

.join-link-button, .qr-code-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9em;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    flex: 1;
    white-space: nowrap; /* 防止文字换行 */
}

.join-link-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

.join-link-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.qr-code-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.qr-code-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.qr-code-button:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: translateY(-2px);
}

.qr-code-button:hover::before {
    left: 100%;
}

/* 深色模式下的按钮样式 */
[data-theme="dark"] .join-link-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

[data-theme="dark"] .join-link-button:hover {
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

[data-theme="dark"] .qr-code-button {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .qr-code-button:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

[data-theme="dark"] .qr-code-button::before {
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.15), transparent);
}

.community-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0 0 12px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-description {
    color: var(--light-text);
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0 0 8px 0;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 3em;
}

.community-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.community-type {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary-color);
    font-size: 0.9em;
    font-weight: 500;
}

.community-type i {
    font-size: 1.1em;
    color: var(--primary-color);
}

.community-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-size: 0.9em;
    font-weight: 600;
    transition: color 0.3s ease;
}

.community-action i {
    font-size: 1em;
    transition: transform 0.3s ease;
}

.community-card:hover .community-action {
    color: var(--primary-hover);
}

.community-card:hover .community-action i {
    transform: translateX(3px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .community-section {
        padding: 40px 0;
    }
    
    .community-section h2 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    
    .community-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .community-card {
        height: 140px;
    }
    
    .community-content {
        padding: 16px;
    }
    
    .community-title {
        font-size: 1.2em;
    }
    
    .community-description {
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .community-section {
        padding: 30px 0;
    }
    
    .community-section h2 {
        font-size: 1.6em;
        margin-bottom: 25px;
    }
    
    .community-card {
        height: auto;
        min-height: 180px; /* 增加最小高度 */
    }
    
    .community-content {
        padding: 14px 14px 20px 14px; /* 增加底部内边距 */
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .community-title {
        font-size: 1.1em;
        margin: 0 0 8px 0;
    }
    
    .community-description {
        font-size: 0.85em;
        margin: 0 0 10px 0; /* 增加底部间距 */
    }
    
    .community-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: auto; /* 将按钮推到底部 */
        padding-top: 10px; /* 增加顶部间距 */
        margin-bottom: 20px; /* 增加底部间距，从8px改为20px */
    }
    
    .join-link-button, .qr-code-button {
        width: 100%;
        padding: 10px 12px; /* 增加垂直内边距 */
        font-size: 0.85em;
        justify-content: center; /* 确保内容居中 */
    }
    
    .community-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* --- 教育服务专区样式 --- */
.education-services-section {
    padding: 60px 0;
    background: var(--light-bg);
    transition: background-color 0.3s ease;
    position: relative;
}

/* 微妙背景装饰 */
.education-services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(139, 157, 195, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(209, 163, 209, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.education-services-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    color: var(--dark-text);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.education-services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.education-service-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 24px 20px 24px 20px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 160px;
    cursor: pointer;
    background: var(--white-bg);
    backdrop-filter: blur(15px);
}

.education-service-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.education-service-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 8px;
    width: 100%;
}

/* 不同背景色 - 使用指定颜色 */
.education-service-card.family-education {
    background: linear-gradient(135deg, rgba(255, 138, 101, 0.65) 0%, rgba(255, 138, 101, 0.55) 100%);
    border-color: rgba(255, 138, 101, 0.75);
    box-shadow: 0 8px 32px rgba(255, 138, 101, 0.25);
}

.education-service-card.education-tools {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.65) 0%, rgba(66, 165, 245, 0.55) 100%);
    border-color: rgba(66, 165, 245, 0.75);
    box-shadow: 0 8px 32px rgba(66, 165, 245, 0.25);
}

.education-service-card.exam-helper {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.65) 0%, rgba(102, 187, 106, 0.55) 100%);
    border-color: rgba(102, 187, 106, 0.75);
    box-shadow: 0 8px 32px rgba(102, 187, 106, 0.25);
}

.education-service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.education-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.education-service-card:hover::before {
    opacity: 1;
}

.education-service-card.family-education:hover {
    border-color: #8b9dc3;
}

.education-service-card.education-tools:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.education-service-card.exam-helper:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.service-icon {
    font-size: 28px;
    color: var(--primary-color);
    flex-shrink: 0;
    line-height: 1;
}

.education-service-card.family-education .service-icon {
    color: #ff8a65;
}

.education-service-card.education-tools .service-icon {
    color: #42a5f5;
}

.education-service-card.exam-helper .service-icon {
    color: #66bb6a;
}

.education-service-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--dark-text);
    line-height: 1.3;
    text-align: center;
}

.education-service-description {
    font-size: 14px;
    color: var(--light-text);
    line-height: 1.5;
    margin: 0;
    text-align: center;
    margin-top: 4px;
}

/* 即将上线徽章 - 精致设计 */
.coming-soon-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ffd966 0%, #f0ad4e 100%);
    color: #333;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(240, 173, 78, 0.3);
    letter-spacing: 0.5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .education-services-section {
        padding: 40px 0;
    }
    
    .education-services-section h2 {
        font-size: 1.8em;
    }
    
    .education-services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }
    
    .education-service-card {
         padding: 20px 16px 20px 16px;
         height: 140px;
     }
    
    .education-service-header {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .service-icon {
        font-size: 24px;
    }
    
    .education-service-card h3 {
         font-size: 18px;
     }
     
     .education-service-description {
         font-size: 13px;
     }
    
    .coming-soon-badge {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .education-services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    
    .education-service-card {
         padding: 22px 18px 22px 18px;
         height: 150px;
     }
    
    .service-icon {
        font-size: 26px;
    }
    
    .education-service-card h3 {
        font-size: 18px;
    }
    
    .education-service-description {
        font-size: 13px;
    }
}

/* 深色模式适配 */
[data-theme="dark"] .education-service-card.family-education {
    background: linear-gradient(135deg, rgba(255, 138, 101, 0.45) 0%, rgba(255, 138, 101, 0.35) 100%);
    border-color: rgba(255, 138, 101, 0.65);
    box-shadow: 0 8px 32px rgba(255, 138, 101, 0.35);
}

[data-theme="dark"] .education-service-card.education-tools {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.45) 0%, rgba(66, 165, 245, 0.35) 100%);
    border-color: rgba(66, 165, 245, 0.65);
    box-shadow: 0 8px 32px rgba(66, 165, 245, 0.35);
}

[data-theme="dark"] .education-service-card.exam-helper {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.45) 0%, rgba(102, 187, 106, 0.35) 100%);
    border-color: rgba(102, 187, 106, 0.65);
    box-shadow: 0 8px 32px rgba(102, 187, 106, 0.35);
}

[data-theme="dark"] .education-service-card.family-education .service-icon {
    color: #ff8a65;
}

[data-theme="dark"] .education-service-card.education-tools .service-icon {
    color: #42a5f5;
}

[data-theme="dark"] .education-service-card.exam-helper .service-icon {
    color: #66bb6a;
}

[data-theme="dark"] .coming-soon-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}
