/* ===== CSS Variables ===== */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --bg-color: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --text-color: #424242;
    --text-secondary: #757575;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
}

/* ===== Layout ===== */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
}

.logo svg {
    flex-shrink: 0;
}

.logo-img {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.brand-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

/* ===== Main Content ===== */
.main {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
}

.page {
    display: none;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

/* ===== Animation Selector ===== */
.animation-selector {
    width: 100%;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.animation-category {
    margin-bottom: 3rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.category-icon {
    font-size: 1.75rem;
}

.category-desc {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: auto;
}

.animation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.animation-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

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

.card-preview {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-preview-gradient {
    background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 50%, #FFA726 100%);
}

.preview-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
}

.preview-landscape {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8C8 50%, #6B8E23 100%);
}

.preview-svg {
    width: 80px;
    height: 80px;
    color: var(--primary-color);
}

.preview-gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #FFE0B2, #FFCC80, #FFA726, #FFE0B2);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

.preview-dots {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

.card-info {
    padding: 1.25rem;
}

.card-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.tag-easy { background: #C8E6C9; color: #2E7D32; }
.tag-medium { background: #FFE082; color: #F57C00; }
.tag-hard { background: #FFAB91; color: #D84315; }

/* ===== Animation Page ===== */
#animationPage {
    padding: 0;
    max-width: none;
}

.animation-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px - 80px); /* header - controls */
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#animationCanvas {
    width: 100%;
    height: 100%;
}

#animationOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.hint {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1.125rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.hint.show {
    opacity: 1;
}

/* ===== Guide & About Pages ===== */
.guide-content,
.about-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.guide-content h2,
.about-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.guide-section,
.about-section {
    margin-bottom: 2rem;
}

.guide-section h3,
.about-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.guide-section ul,
.guide-section ol {
    padding-left: 1.5rem;
}

.guide-section li,
.about-section li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.about-intro {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.about-footer p {
    margin: 0.25rem 0;
}

/* ===== Controls ===== */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.controls.hidden {
    display: none;
}

/* Fullscreen mode styles */
.header.fullscreen-hidden,
.controls.fullscreen-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.header,
.controls {
    transition: opacity 0.3s ease;
}

/* Cursor hint in fullscreen */
body.fullscreen-active #animationPage {
    cursor: pointer;
}

body.fullscreen-active #animationPage:active {
    cursor: default;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-center {
    flex: 1;
    justify-content: center;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--text-color);
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--bg-secondary);
}

#playPauseBtn {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white;
}

#playPauseBtn:hover {
    background: #45a049;
}

.hidden {
    display: none !important;
}

.time-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.speed-control {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 0.25rem;
}

.speed-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.speed-btn:hover {
    color: var(--text-color);
}

.speed-btn.active {
    background: var(--bg-color);
    color: var(--text-color);
    font-weight: 600;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.modal-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-color);
}

.safety-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.safety-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.disclaimer {
    background: #FFF3E0;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* ===== Password Modal ===== */
.password-modal {
    z-index: 1001; /* 比安全警告模态框高一层 */
}

.password-content {
    max-width: 500px;
    text-align: center;
}

.password-body {
    margin-top: 1rem;
}

.wechat-info {
    margin-bottom: 2rem;
}

.wechat-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.wechat-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.wechat-account {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #07c160 0%, #00b050 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin: 0 auto;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.wechat-icon {
    flex-shrink: 0;
}

.wechat-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.password-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.password-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    transition: var(--transition);
}

.password-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.password-input::placeholder {
    color: var(--text-secondary);
}

.password-input-group .btn-primary {
    flex: 0 0 auto;
    min-width: 100px;
}

.password-error {
    display: none;
    color: #f44336;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(244, 67, 54, 0.1);
    border-radius: var(--radius);
}

.password-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-style: italic;
}

/* ===== Settings Panel ===== */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-color);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 200;
}

.settings-panel.show {
    right: 0;
}

.settings-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.setting-item span {
    color: var(--text-secondary);
}

.setting-item input[type="checkbox"] {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--border-color);
    position: relative;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}

.setting-item input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.setting-item input[type="checkbox"]:checked {
    background: var(--primary-color);
}

.setting-item input[type="checkbox"]:checked::before {
    left: 22px;
}

.setting-item input[type="range"] {
    flex: 1;
    margin-left: 1rem;
}

.setting-item select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .brand-tagline {
        font-size: 0.7rem;
    }

    .nav {
        flex: 1;
        justify-content: center;
        margin: 0 1rem;
    }

    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .page {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .category-title {
        font-size: 1.25rem;
        flex-wrap: wrap;
    }

    .category-desc {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .animation-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .controls {
        padding: 0.75rem 1rem;
    }

    .speed-control,
    .volume-control {
        display: none;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        margin: 1rem;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 0.875rem;
    }

    .brand-tagline {
        font-size: 0.625rem;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .time-display {
        font-size: 0.75rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    #playPauseBtn {
        width: 48px;
        height: 48px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .controls,
    .settings-panel,
    .modal {
        display: none;
    }

    .main {
        overflow: visible;
    }

    .page {
        max-width: 100%;
        padding: 0;
    }
}

/* ===== Training Reminder System ===== */
.training-reminder {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 90%;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    z-index: 2000;
    transition: top 0.3s ease;
}

.training-reminder.show {
    top: 80px;
}

.training-reminder-info {
    border-left: 4px solid #2196F3;
}

.training-reminder-warning {
    border-left: 4px solid #FF9800;
}

.training-reminder-alert {
    border-left: 4px solid #f44336;
    animation: shake 0.5s;
}

.training-reminder-success {
    border-left: 4px solid #4CAF50;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-50%) translateY(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(-50%) translateY(5px); }
}

.reminder-content {
    position: relative;
}

.reminder-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.reminder-message {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.reminder-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.reminder-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--primary-color);
    color: white;
    transition: var(--transition);
}

.reminder-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.reminder-btn:last-child {
    background: var(--bg-secondary);
    color: var(--text-color);
}

.reminder-btn:last-child:hover {
    background: var(--border-color);
}

.reminder-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--text-secondary);
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.reminder-close:hover {
    background: #333;
    transform: rotate(90deg);
}

/* ===== Dark Mode Support ===== */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-secondary: #252525;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #333;
    --primary-color: #66bb6a;
}

[data-theme="dark"] .training-reminder {
    background: #2a2a2a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .settings-panel {
    background: #2a2a2a;
}

[data-theme="dark"] .password-content {
    background: #2a2a2a;
}

[data-theme="dark"] .animation-card {
    background: #2a2a2a;
    border-color: #333;
}

[data-theme="dark"] .animation-card:hover {
    background: #333;
    border-color: #444;
}

[data-theme="dark"] #animationCanvas {
    background: #1a1a1a;
}

[data-theme="dark"] .disclaimer {
    background: rgba(255, 152, 0, 0.1);
    border-left-color: #FF9800;
}

/* ===== Playlist Cards ===== */
.playlist-section {
    margin-bottom: 3rem;
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.playlist-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.playlist-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.playlist-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.playlist-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
}

.playlist-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.playlist-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.setting-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 768px) {
    /* Larger touch targets */
    .control-btn {
        width: 52px;
        height: 52px;
    }

    #playPauseBtn {
        width: 64px;
        height: 64px;
    }

    .animation-card,
    .playlist-card {
        min-height: 120px;
    }

    /* Better spacing for mobile */
    .controls {
        padding: 1rem;
    }

    .control-group {
        gap: 1rem;
    }

    /* Optimize settings panel for mobile */
    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .settings-panel.show {
        right: 0;
    }

    /* Larger text for readability */
    .animation-card h4 {
        font-size: 1rem;
    }

    .card-desc {
        font-size: 0.875rem;
    }

    /* Optimize playlist cards */
    .playlist-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Better touch spacing */
    .animation-grid {
        gap: 1rem;
    }

    .speed-btn {
        min-width: 48px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .controls {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Landscape mode for mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .header {
        padding: 0.5rem 1rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .brand-tagline {
        display: none;
    }

    .controls {
        padding: 0.75rem 1rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    #playPauseBtn {
        width: 48px;
        height: 48px;
    }
}

/* Dark mode for playlists */
[data-theme="dark"] .playlist-card {
    background: #2a2a2a;
    border-color: #333;
}

[data-theme="dark"] .playlist-card:hover {
    background: #333;
    border-color: #66bb6a;
}

[data-theme="dark"] .playlist-item {
    background: #333;
}
