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

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #f093fb;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    --nav-height: 60px;
}

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

.page-content {
    padding-bottom: calc(var(--nav-height) + 80px);
    min-height: 100vh;
}

.page-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    padding: 15px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    animation: slideDown 0.3s ease-out;
}

.back-button {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--bg-color);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-button:active {
    transform: scale(0.95);
    background: var(--border-color);
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 4px 20px;
    border-radius: 10px;
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 3px;
    transition: transform 0.3s ease;
}

.nav-text {
    font-size: 11px;
    line-height: 1;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
    animation: bounce 0.5s ease;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.modal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-color);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:active {
    transform: scale(0.9);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

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

@keyframes toastCardIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    animation: fadeIn 0.22s ease;
}

.toast-overlay.toast-hide {
    animation: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.toast-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: min(78vw, 300px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    text-align: center;
    animation: toastCardIn 0.22s ease;
}

.toast-message {
    font-size: 15px;
    color: #222;
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: break-word;
}

.toast-btn {
    display: block;
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-slide-down {
    animation: slideDown 0.5s ease-out;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    animation: fadeIn 0.22s ease;
}

.confirm-overlay.confirm-hide {
    animation: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.confirm-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: min(78vw, 300px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    animation: toastCardIn 0.22s ease;
}

.confirm-message {
    font-size: 15px;
    color: #222;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
    word-break: break-word;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
}

.confirm-btn-cancel,
.confirm-btn-ok {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.confirm-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.confirm-btn-ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.section-card {
    background: var(--card-bg);
    margin: 15px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}