* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #eaeaea;
    position: relative;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 移动端分类按钮 - 调整位置到左上角边缘 */
.mobile-toggle-btn {
    display: none;
    position: fixed;
    left: 10px; /* 从15px减少到10px */
    top: 10px;  /* 从15px减少到10px */
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px; /* 稍微减小按钮大小 */
    height: 48px;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.mobile-toggle-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.mobile-toggle-btn.active {
    background: #2c3e50;
    transform: rotate(90deg);
}

/* 搜索框样式 */
.search-container {
    max-width: 600px;
    margin: 20px auto 0;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-box:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 1.2rem;
}

.main-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    position: relative;
}

@media (max-width: 992px) {
    .websites-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .mobile-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 桌面端分类侧边栏在移动端隐藏 */
    .categories {
        display: none;
    }
    
    /* 移动端分类导航 - 从左侧滑出覆盖一半屏幕 */
    .mobile-categories {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        z-index: 1000;
        border-radius: 0;
        transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        padding: 80px 20px 30px 20px;
        overflow-y: auto;
        background: white;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-categories.active {
        left: 0;
    }
    
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(3px);
    }
    
    .overlay.active {
        display: block;
    }
    
    h1 {
        font-size: 2rem;
        margin-top: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* 移动端隐藏桌面版分类 */
    .desktop-categories {
        display: none;
    }
}

/* 桌面端分类侧边栏样式 */
.categories {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.categories h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.category-item:hover {
    background-color: #f0f7ff;
    transform: translateX(5px);
}

.category-item.active {
    background-color: #3498db;
    color: white;
}

.category-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* 移动端分类导航样式 */
.mobile-categories {
    display: none;
}

@media (max-width: 768px) {
    .mobile-categories {
        display: block;
    }
    
    .mobile-categories h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
        color: #2c3e50;
        padding-bottom: 10px;
        border-bottom: 2px solid #3498db;
        text-align: center;
    }
    
    .mobile-categories .category-list {
        list-style: none;
    }
    
    .mobile-categories .category-item {
        padding: 15px;
        margin-bottom: 12px;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        font-weight: 500;
        border-left: 4px solid transparent;
    }
    
    .mobile-categories .category-item:hover {
        background-color: #f0f7ff;
        transform: translateX(5px);
        border-left-color: #3498db;
    }
    
    .mobile-categories .category-item.active {
        background-color: #3498db;
        color: white;
        border-left-color: #2c3e50;
    }
    
    .mobile-categories .category-icon {
        margin-right: 15px;
        font-size: 1.3rem;
        width: 28px;
        text-align: center;
    }
    
    /* 移动端关闭按钮 */
    .mobile-close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #7f8c8d;
        cursor: pointer;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    
    .mobile-close-btn:hover {
        background-color: #f5f5f5;
        color: #2c3e50;
    }
}

/* 网站卡片区域样式 */
.websites-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.8rem;
    color: #2c3e50;
}

.section-title i {
    margin-right: 10px;
    color: #3498db;
}

.category-count {
    background: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 修改桌面端网站卡片布局 - 每行显示3个，增加间隙 */
.websites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 1200px) {
    .websites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .websites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .websites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .websites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.website-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 170px;
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.website-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: #3498db;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.website-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    color: white;
    font-size: 1.6rem;
}

.website-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.website-url {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-top: 8px;
    word-break: break-all;
    line-height: 1.4;
}

/* 移除网站描述样式 */
.website-description {
    display: none;
}

.website-link {
    display: inline-block;
    margin-top: auto;
    padding: 10px 15px;
    background: #3498db;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    font-size: 1rem;
}

.website-link:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #3498db;
    display: block;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #bdc3c7;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 搜索高亮 */
.highlight {
    background-color: #fff9c4;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #e74c3c;
    grid-column: 1 / -1;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #e74c3c;
}

.error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.error-state button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.error-state button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #eaeaea;
}

/* 响应式调整 - 针对手机端标题进行调整 */
@media (max-width: 576px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-count {
        margin-top: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-left: 0; /* 移除之前可能的左边距 */
        padding-left: 0; /* 确保没有内边距 */
        text-align: center;
        width: 100%;
    }
    
    .search-container {
        margin-top: 15px;
        width: 90%; /* 减小搜索框宽度，避免与按钮重叠 */
        margin-left: auto;
        margin-right: auto;
    }
    
    .container {
        padding: 15px;
    }
    
    .websites-section {
        padding: 20px;
    }
    
    .website-card {
        padding: 20px;
        height: 160px;
    }
    
    .website-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* 确保头部内容居中显示 */
    header {
        padding-top: 40px; /* 增加上内边距，为导航按钮留出空间 */
    }
}

/* 特别针对小屏幕手机的调整 */
@media (max-width: 400px) {
    .mobile-toggle-btn {
        left: 8px;
        top: 8px;
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .search-container {
        width: 95%;
    }
}

/* 添加动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.website-card {
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
}

.website-card:nth-child(1) { animation-delay: 0.05s; }
.website-card:nth-child(2) { animation-delay: 0.1s; }
.website-card:nth-child(3) { animation-delay: 0.15s; }
.website-card:nth-child(4) { animation-delay: 0.2s; }
.website-card:nth-child(5) { animation-delay: 0.25s; }
.website-card:nth-child(6) { animation-delay: 0.3s; }
.website-card:nth-child(7) { animation-delay: 0.35s; }
.website-card:nth-child(8) { animation-delay: 0.4s; }
.website-card:nth-child(9) { animation-delay: 0.45s; }
.website-card:nth-child(10) { animation-delay: 0.5s; }
