/* 基础样式和重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    transition: background-color 0.5s ease, color 0.3s ease;
    background: linear-gradient(135deg, #f0fff4 0%, #e6f4f1 100%);
    color: #5a5a5a;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 2rem;
}

body.dark-theme {
    background: linear-gradient(135deg, #1a2c23 0%, #121f1a 100%);
    color: #e0e0e0;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 0 0 30px 30px;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2rem;
}

body.dark-theme header {
    background: rgba(35, 55, 45, 0.85);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(45deg, #2ecc71, #1abc9c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
}

/* 主题切换按钮 */
.theme-toggle button {
    background: linear-gradient(45deg, #2ecc71, #1abc9c);
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.8rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle button:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

body.dark-theme .theme-toggle button {
    background: linear-gradient(45deg, #2c5530, #1e3a2a);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .theme-toggle button:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* 搜索容器 */
.search-container {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem;
}

#searchInput {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    border: 3px solid #2ecc71;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.2);
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
}

#searchInput:focus {
    border-color: #1abc9c;
    box-shadow: 0 6px 20px rgba(26, 188, 156, 0.4);
    transform: translateY(-2px);
}

body.dark-theme #searchInput {
    background: rgba(40, 65, 50, 0.8);
    border-color: #2c5530;
    color: #f0f0f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 统计信息 */
.stats-container {
    text-align: center;
    margin-top: 0.8rem;
    font-size: 1rem;
    color: #27ae60;
    font-weight: 600;
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
}

body.dark-theme .stats-container {
    color: #2ecc71;
}

/* 分类容器 */
.categories-container {
    max-width: 1000px;
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.category-btn {
    background: linear-gradient(45deg, #2ecc71, #1abc9c);
    border: none;
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    color: white;
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.5);
}

.category-btn.active {
    background: linear-gradient(45deg, #ff7eb3, #ff7b7b);
    box-shadow: 0 4px 10px rgba(255, 126, 179, 0.4);
}

body.dark-theme .category-btn {
    background: linear-gradient(45deg, #2c5530, #1e3a2a);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .category-btn:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

body.dark-theme .category-btn.active {
    background: linear-gradient(45deg, #ff7eb3, #ff7b7b);
    box-shadow: 0 4px 10px rgba(255, 126, 179, 0.4);
}

/* 网站卡片容器 */
.websites-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* 网站卡片样式 */
.website-card {
    background: linear-gradient(135deg, #fff 0%, #f0fff4 100%);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.website-card::before {
    content: "";
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50,15 C65,30 85,40 85,60 C85,80 70,85 50,85 C30,85 15,80 15,60 C15,40 35,30 50,15 Z' fill='%232ecc71'/%3E%3Ccircle cx='40' cy='45' r='5' fill='%23fff'/%3E%3Ccircle cx='60' cy='45' r='5' fill='%23fff'/%3E%3Cpath d='M35,65 Q50,75 65,65' stroke='%23fff' stroke-width='3' fill='none'/%3E%3C/svg%3E") no-repeat;
    background-size: contain;
    opacity: 0.7;
    transform: rotate(15deg);
}

.website-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(46, 204, 113, 0.4);
}

body.dark-theme .website-card {
    background: linear-gradient(135deg, #253c30 0%, #1a2c23 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(44, 85, 48, 0.5);
}

body.dark-theme .website-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.website-card h2 {
    font-size: 1.4rem;
    margin: 0;
    padding: 1.5rem 1.5rem 0.8rem;
    color: #27ae60;
    font-weight: 700;
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.website-card .icon {
    font-size: 1.2rem;
}

body.dark-theme .website-card h2 {
    color: #2ecc71;
}

.website-card .url {
    padding: 0 1.5rem;
    color: #16a085;
    word-break: break-all;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-family: 'Comic Sans MS', 'PingFang SC', monospace;
}

.website-card .url a {
    text-decoration: none;
    color: inherit;
    position: relative;
    padding: 0.3rem 0.5rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.website-card .url a:hover {
    background: rgba(22, 160, 133, 0.1);
    text-decoration: none;
}

body.dark-theme .website-card .url a {
    color: #1abc9c;
}

.website-card .description {
    padding: 0 1.5rem 1rem;
    color: #2c5530;
    font-size: 1rem;
    background: rgba(240, 255, 244, 0.5);
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
}

body.dark-theme .website-card .description {
    color: #a3c9a8;
    background: rgba(40, 65, 50, 0.5);
}

.website-card .actions {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.visit-btn {
    background: linear-gradient(45deg, #2ecc71, #1abc9c);
    border: none;
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    color: white;
    font-family: 'Comic Sans MS', 'PingFang SC', cursive;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.visit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.5);
}

body.dark-theme .visit-btn {
    background: linear-gradient(45deg, #2c5530, #1e3a2a);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .visit-btn:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .websites-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    header {
        padding: 1rem 1.2rem;
        border-radius: 0 0 25px 25px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .search-container {
        margin: 0 auto 1rem;
        padding: 0 1rem;
    }
    
    #searchInput {
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }
    
    .theme-toggle button {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
        padding: 0.6rem;
    }
    
    .categories-container {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .websites-container {
        grid-template-columns: 1fr;
        padding: 0 1rem 1.5rem;
    }
    
    .website-card h2 {
        font-size: 1.3rem;
        padding: 1.2rem 1.2rem 0.6rem;
    }
    
    .website-card .url {
        padding: 0 1.2rem;
        font-size: 0.95rem;
    }
    
    .website-card .description {
        padding: 0 1.2rem 0.8rem;
        font-size: 0.95rem;
    }
    
    .website-card .actions {
        padding: 0 1.2rem 1.2rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .categories-container {
        margin-bottom: 1rem;
    }
}

/* 添加一些可爱的动画元素 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.website-card:hover::before {
    animation: float 2s ease-in-out infinite;
}