/* 50 Sounds Practice - Base Styles */

/* ===========================================
   CSS Variables & Theme Colors
   =========================================== */
:root {
    /* 柔和現代風（明亮模式） */
    --bg-primary: #F9F6F2;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F0EB;
    --accent-primary: #4A6985;
    --accent-secondary: #6B8CAE;
    --text-primary: #3D3D3D;
    --text-secondary: #6B6B6B;
    --text-light: #8A8A8A;
    --border-color: #E5DED6;
    --shadow-color: rgba(61, 61, 61, 0.1);
    --shadow-hover: rgba(61, 61, 61, 0.15);
}

[data-theme="dark"] {
    /* 典雅暗色系（深色模式） */
    --bg-primary: #18181B;
    --bg-secondary: #27272A;
    --bg-tertiary: #3F3F46;
    --accent-primary: #F59E0B;
    --accent-secondary: #FBBF24;
    --text-primary: #E5E5E5;
    --text-secondary: #A3A3A3;
    --text-light: #737373;
    --border-color: #3F3F46;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
}

/* ===========================================
   Base Styles & Typography
   =========================================== */
body {
    font-family: "Helvetica", "Yu Gothic", sans-serif;
    text-align: center;
    margin: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    color: var(--text-primary);
    margin-bottom: 30px;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===========================================
   Utility Classes
   =========================================== */
.hidden {
    display: none !important;
}

.page-content {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.page-content:not(.hidden) {
    opacity: 1;
}

/* 字體載入優化 */
@font-face {
    font-family: "Helvetica";
    font-display: optional;
}

/* ===========================================
   Animations
   =========================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}
