* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px 40px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 95%;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 30px 0 20px 0;
    color: #333; /* 修改为深色文字，提高可读性 */
    position: relative;
}

.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
}

.language-switcher .lang-toggle-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #e0e0e0;
    border-radius: 24px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 140px;
    height: 36px;
}

.language-switcher .lang-toggle-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.language-switcher .lang-option {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    padding: 0 12px;
}

.language-switcher .lang-toggle-container.lang-zh .lang-option-zh,
.language-switcher .lang-toggle-container.lang-en .lang-option-en {
    color: #667eea;
    font-weight: 600;
}

.language-switcher .lang-toggle-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.language-switcher .lang-toggle-container.lang-en .lang-toggle-bg {
    transform: translateX(100%);
}

.language-switcher .lang-toggle-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .language-switcher {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }
}

h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    color: #555; /* 修改为深灰色，提高可读性 */
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    padding: 20px 0;
}

.tool-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 28px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

a.tool-card {
    text-decoration: none;
    color: inherit;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: #333;
}

.tool-desc {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

footer {
    text-align: center;
    color: #555; /* 修改为深灰色，提高可读性 */
    padding: 30px 0;
    margin-top: 30px;
    font-size: 0.9rem;
    opacity: 0.8;
}

footer a {
    color: #4a90e2;
    text-decoration: none;
    margin-left: 15px;
    transition: color 0.3s;
}

footer a:hover {
    color: #357abd;
    text-decoration: underline;
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 20px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .tool-card {
        padding: 24px 16px;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
    
    .tool-title {
        font-size: 1.05rem;
    }
    
    .tool-desc {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 16px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .tool-card {
        padding: 20px 12px;
    }
}