/* 基本样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background-color: #1e88e5;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 15px;
    text-align: center;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.search-box button {
    background-color: #0d47a1;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #002171;
}

/* 导航栏样式 */
nav {
    background-color: #0d47a1;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.nav-links li {
    margin: 5px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 14px;
    white-space: nowrap;
}

.nav-links a:hover {
    background-color: #1565c0;
}

/* 主体内容样式 */
main {
    padding: 30px 0;
}

.category-section {
    margin-bottom: 40px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e88e5;
    color: #0d47a1;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.link-card {
    display: flex;
    text-decoration: none;
    color: #333;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: #e3f2fd;
}

.link-icon {
    margin-right: 15px;
    font-size: 24px;
    color: #1e88e5;
    display: flex;
    align-items: center;
}

.link-content h3 {
    margin-bottom: 5px;
    font-size: 16px;
}

.link-content p {
    font-size: 14px;
    color: #666;
}

/* 页脚样式 */
footer {
    background-color: #0d47a1;
    color: white;
    padding: 20px 0;
    text-align: center;
}

footer a {
    color: #bbdefb;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #1e88e5;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: #0d47a1;
}

/* 无搜索结果提示 */
.no-results {
    text-align: center;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-size: 18px;
    color: #666;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 导航栏移动端布局 */
    nav .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .mobile-menu-toggle {
        display: block;
        align-self: flex-end;
        margin-top: -40px;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        background: rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 15px;
        margin-top: 10px;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 3px 0;
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px;
    }
    
    /* 主题和语言选择器移动端布局 */
    .theme-toggle,
    .language-selector {
        margin-left: 0;
        margin-top: 10px;
    }
    
    /* 卡片网格移动端优化 */
    .link-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 头部移动端优化 */
    header h1 {
        font-size: 24px;
    }
    
    .site-tagline {
        font-size: 1rem;
        margin-top: -5px;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    /* 搜索框移动端优化 */
    .search-box {
        max-width: 100%;
        margin: 15px 0;
    }
    
    .search-box input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 访问统计移动端位置调整 */
    .visit-stats {
        bottom: 90px;
        left: 15px;
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* 返回顶部按钮移动端调整 */
    #back-to-top {
        bottom: 90px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* 收藏按钮样式 */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ccc;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s;
}

.favorite-btn:hover {
    color: #f8c200;
}

.favorite-btn.active {
    color: #f8c200;
}

/* 暗色模式 */
.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-theme .category-section {
    background-color: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.dark-theme .link-card {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-theme .link-card:hover {
    background-color: #3d3d3d;
}

.dark-theme .link-content p {
    color: #aaa;
}

.dark-theme .category-section h2 {
    border-bottom-color: #444;
    color: #90caf9;
}

/* 主题切换按钮 */
.theme-toggle {
    margin-left: 15px;
}

.theme-toggle button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.theme-toggle button:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 访问统计 */
.visit-stats {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background-color: rgba(30, 136, 229, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.dark-theme .visit-stats {
    background-color: rgba(30, 30, 30, 0.8);
}

/* 标语样式 */
.site-tagline {
    color: #ffffff;
    text-align: center;
    font-size: 1.2rem;
    margin-top: -10px;
    margin-bottom: 20px;
    font-weight: 300;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 语言选择器样式 */
.language-selector {
    position: relative;
    margin-left: auto;
    z-index: 1000;
}

.current-lang {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.current-lang span {
    margin-right: 5px;
}

.language-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 4px;
    min-width: 120px;
    display: none;
}

.language-selector.active .language-dropdown {
    display: block;
}

.language-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.language-dropdown a:last-child {
    border-bottom: none;
}

.language-dropdown a.active {
    background: #e8f0fe;
    color: #1e88e5;
}

.language-dropdown a:hover {
    background: #f5f5f5;
}

/* 响应式设计优化 */

/* 平板设备 (768px - 991px) */
@media (max-width: 991px) {
    .container {
        width: 90%;
    }
    
    .link-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    h1 {
        font-size: 24px;
    }
    
    .site-tagline {
        font-size: 16px;
    }
    
    .search-box {
        width: 80%;
    }
}

/* 手机设备 (767px以下) */
@media (max-width: 767px) {
    .container {
        width: 95%;
    }
    
    .link-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    header {
        padding: 15px 0;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .site-tagline {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .search-box {
        width: 100%;
        margin: 10px 0;
    }
    
    #search-input {
        padding: 8px 15px;
    }
    
    #search-btn {
        padding: 8px 15px;
    }
    
    nav .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        margin-top: 10px;
    }
    
    nav.menu-open .nav-links {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 15px;
        top: 12px;
    }
    
    body {
        padding-top: 0;
    }
    
    nav {
        position: relative;
    }
    
    .link-card {
        padding: 12px;
    }
    
    .link-card h3 {
        font-size: 16px;
    }
    
    .link-card p {
        font-size: 12px;
    }
    
    .language-selector {
        position: static;
        margin: 10px 0;
    }
    
    .language-dropdown {
        position: absolute;
        left: 0;
        width: 100%;
    }
}

/* 极小设备 (375px以下) */
@media (max-width: 375px) {
    .link-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 18px;
    }
}

/* 移动设备导航样式 */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 20px;
    color: white;
}

@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    nav .container > a {
        display: none;
    }
    
    nav.expanded .container > a {
        display: block;
    }
    
    nav .container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 移动导航菜单 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        cursor: pointer;
        font-size: 24px;
        color: white;
        position: absolute;
        right: 20px;
        top: 15px;
    }
    
    nav .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    nav.menu-open .nav-links {
        display: flex;
    }
    
    .nav-links li {
        margin: 5px 0;
    }
} 