:root {
    --primary-color: #3366ff;
    --primary-hover: #2d78f4;
    --secondary-color: #f8f8f8;
    --accent-color: #f50;
    --text-color: #333;
    --light-text: #000;
    --border-color: #e6e6e6;
    --link-color: #333333;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
    position: relative;
}

a:hover {
    color: var(--primary-hover);
}

a:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    animation: underlineExpand 0.3s ease-out;
}

@keyframes underlineExpand {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    flex: 1;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    margin-left: 15px;
    color: var(--text-color);
}

.nav-container {
    display: flex;
    align-items: center; 
}

.main-nav {
    display: flex;
    margin-right: 20px;
}

.main-nav a {
    padding: 6px 10px;
    font-size: 14px;
    color: var(--text-color);
    font-weight: bold;
    border-radius: 4px;
}

.main-nav strong {
    color: var(--accent-color);
}

.main-nav a:hover {
    color: var(--primary-color);
    background-color: #f0f7ff;
    text-decoration: none;
}

/* Search Box */
.search-container {
    position: relative;
    margin-right: 20px;
    width: 350px; /* 固定搜索容器宽度 */
}

.search-input {
    width: 100%; /* 使用100%宽度填充容器 */
    padding: 10px 50px 10px 40px; /* 右侧留出按钮空间 */
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background-color: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 16px;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51, 133, 255, 0.2);
    background-color: #fff;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-color), #4a9bff);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap; /* 防止文字换行 */
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), #3a8bff);
    transform: translateY(-50%) scale(1.05);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.weather-container {
    display: flex;
    align-items: center;
    height: 40px; /* 与导航栏高度匹配 */
    margin-left: 20px; /* 与搜索框保持适当间距 */
    width: 240px; /* 固定容器宽度 */
}

.weather-container iframe {
    height: 24px !important; /* 适当调整高度 */
    width: auto;
    border: none;
    vertical-align: middle; /* 垂直居中 */
}
/* 主题切换按钮样式  */
 .theme-toggle-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 6px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}
.theme-toggle-btn:hover {
    background: #999;
}

/* Main Content Sections - Centered Layout */
.main-content {
    margin: 20px auto;
    flex: 1;
    width: 100%;
    max-width: 1200px;
}

/* Quick Links Section */
.quick-links {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin: 0 auto 20px;
    max-width: 1200px;
}

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(6, 2fr);
    gap: 12px;
}

.link-column a {
            display: block;
            padding: 8px 10px;
            margin-bottom: 6px;
            border-radius: 4px;
            transition: var(--transition);
            font-size: 15px;
            border: 1px solid #dbeafe;

}

.link-column a i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    color: var(--primary-color);   /*链接前图标颜色 */
}

.link-column a:hover {
    background-color: #f0f7ff;
    text-decoration: none;
    transform: translateX(3px);
    color: var(--primary-color);
}

/* Category Section - Centered Grid */
.category-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 auto;
    max-width: 1200px;
}

.category-box {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 18px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.category-title {
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.category-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.category-links {
    display: grid;
    grid-template-columns: repeat(3, 2fr);
    gap: 6px;
}

.category-links a {
    display: flex;
    align-items: center;
    background-color: #f0f7ff;
    padding: 8px 10px;
    font-size: 15px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color:var(--link-color);    /*链接颜色 */
}

.category-links a:hover {
    color: #fff;
    background-color: var(--primary-color);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.more-link {
    display: inline-flex;
    align-items: center;
    margin-top: 15px;
    font-size: 14px;
    color: var(--light-text);
    transition: var(--transition);
}

.more-link i {
    margin-left: 5px;
    transition: var(--transition);
}

.more-link:hover {
    color: var(--primary-color);
}

.more-link:hover i {
    transform: translateX(3px);
}

/* Tab Section - Centered */
.tab-section {
    margin: 20px auto;
    max-width: 1200px;
}

.tab-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin: 0 auto;
}

.tab-menu {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: #f0f0f0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.tab-btn i {
    margin-right: 8px;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    background-color: #cccccc;
}

.tab-content {
    padding: 18px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-pane a {
    display: inline-flex;
    align-items: center;
    margin: 4px 6px 4px 0;
    padding: 6px 10px;
    background-color: #f5f5f5;
    border-radius: 2px;
    font-size: 14px;
    transition: var(--transition);
}

.tab-pane a:hover {
    background-color: #e0e0f0;
    text-decoration: none;
    color: var(--primary-color);    /*标签背景颜色 */
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* Footer */
footer {
    background: linear-gradient(to bottom, #fff, #ccc);
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    margin: 0 10px 10px;
    color: var(--light-text);
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a i {
    margin-right: 6px;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.copyright {
    text-align: center;
    color: var(--light-text);
    font-size: 13px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-links, .category-section, .tab-section {
    animation: fadeInUp 0.6s ease-out forwards;
}

.category-section {
    animation-delay: 0.1s;
}

.tab-section {
    animation-delay: 0.2s;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .links-grid {
        gap: 10px;
    }
    
    .category-links {
        gap: 8px;
    }
}

@media (max-width: 992px) {
    .links-grid {
        grid-template-columns: repeat(3, 2fr);
        gap: 8px;
    }
    
    .category-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-links {
        grid-template-columns: repeat(2, 2fr);
        gap: 8px;
    }
    
    .link-column a, .category-links a {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 10px 15px;
        flex-wrap: nowrap;
    }
    
    .mobile-menu-btn {
        display: block;
        order: 2;
        margin-left: auto;
    }
    
    .nav-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        flex-direction: column;
        padding: 15px;
    }
    
    .nav-container.active {
        display: flex;
    }
    
    .main-nav {
        flex-direction: column;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    /* 移动端导航垂直对齐问题 */
    .main-nav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 5px 0;
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .search-container {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .search-input {
        padding: 12px 50px 12px 45px; /* 移动端增加内边距 */
    }
    
    .search-btn {
        padding: 8px 18px; /* 移动端增大按钮 */
    }
    
    .weather-container {
        width: 100%;
        text-align: center;
    }
    
    /* 保持2列布局 */
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .category-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .tab-menu {
        justify-content: center;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .quick-links, .category-box {
        padding: 15px;
    }
    
    .search-btn {
        padding: 8px 18px;
    }
}

@media (max-width: 576px) {
    /* 超小屏幕保持2列布局 */
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .category-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .link-column a, .category-links a {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    /* 最小屏幕保持2列布局 */
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .category-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .link-column a, .category-links a {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .tab-btn {
        flex: 1 0 50%;
        text-align: center;
        padding: 10px 5px;
    }
    
    .footer-links a {
        flex: 1 0 50%;
        justify-content: center;
        margin: 5px 0;
    }
}
