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

:root {
    --primary-color: #1877F2;
    --primary-dark: #166FE5;
    --primary-light: #4E9FF4;
    --secondary-color: #42B72A;
    --bg-color: #F0F2F5;
    --surface-color: #ffffff;
    --text-color: #050505;
    --text-secondary: #65676B;
    --border-color: #CED0D4;
    --divider-color: #E4E6EB;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1), 0 16px 32px rgba(0, 0, 0, 0.1);
    --hover-overlay: rgba(24, 119, 242, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 48px 16px 32px;
    animation: fadeInDown 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 32px 0;
    flex: 1;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.test-card {
    background: var(--surface-color);
    border: none;
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.test-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hover-overlay);
    opacity: 0;
    border-radius: 12px;
    transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
}

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

.card-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.card-content h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.fullscreen-test {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: none;
}

.fullscreen-test.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 10000;
    animation: slideDown 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
}

.controls button:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.controls button:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.controls .close-btn {
    background: #ea4335;
}

.controls .close-btn:hover {
    background: #d33426;
}

.controls span {
    color: var(--text-color);
    font-size: 0.875rem;
}

footer {
    margin-top: 48px;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--divider-color);
}

.footer-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links .divider {
    color: var(--border-color);
    font-size: 0.875rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .test-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .container {
        padding: 16px;
    }

    .controls {
        padding: 8px 12px;
        flex-wrap: wrap;
        max-width: calc(100vw - 32px);
    }

    .controls button {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

.instruction {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.875rem;
    z-index: 10000;
    animation: slideUp 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: var(--shadow-md);
    max-width: calc(100vw - 32px);
}

.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 16px;
}

.page-content {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: none;
}

.page-content h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-top: 32px;
    margin-bottom: 16px;
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content p {
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.page-content ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.page-content li {
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 8px;
}

.page-content strong {
    color: var(--text-color);
    font-weight: 500;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 24px;
    transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.back-link:hover {
    opacity: 0.8;
}
