* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.logo h1 {
    color: #000000;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#login-form {
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#login-form input {
    width: 100%;
    padding: 16px;
    margin-bottom: 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#login-form input:focus {
    outline: none;
    border-color: #667eea;
}

#login-form button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#login-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.hint {
    color: #000000;
    margin-top: 20px;
    font-size: 14px;
}

.admin-link {
    color: #667eea;
    text-decoration: none;
    margin-top: 12px;
    font-size: 14px;
}

.header {
    background: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    color: #000;
    font-size: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome {
    font-size: 14px;
    color: #666;
}

.logout-btn {
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.login-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #5a6fd6;
}

.nav-tabs {
    display: flex;
    background: rgba(255,255,255,0.95);
    padding: 10px;
    gap: 10px;
    overflow-x: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.nav-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    background: #eee;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-content {
    padding: 16px;
}

.tab-panel {
    display: none;
}

.banner-container {
    position: relative;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.banner-wrapper {
    overflow: hidden;
}

.banner-list {
    display: flex;
    transition: transform 0.5s ease;
}

.banner-item {
    flex: 0 0 100%;
    width: 100%;
}

.banner-link {
    display: block;
    width: 100%;
}

.banner-image {
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 383;
    object-fit: cover;
}

.banner-link {
    position: relative;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to right, rgba(50, 50, 50, 0.9), rgba(80, 80, 80, 0.9));
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

.banner-overlay .banner-title {
    color: white;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.banner-placeholder {
    width: 100%;
    aspect-ratio: 900 / 383;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #00e676 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.banner-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

.banner-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.banner-title {
    font-size: 16px;
    font-weight: bold;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    width: 20px;
    border-radius: 4px;
    background: white;
}

.tab-panel.active {
    display: block;
}

.checkin-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.checkin-card h2 {
    color: #333;
    margin-bottom: 24px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area p {
    color: #999;
    font-size: 14px;
}

.preview-image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin-top: 16px;
    border-radius: 8px;
    border: 2px solid #eee;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.records-list, .ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-tip {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-tip p {
    color: #666;
    margin-bottom: 16px;
    font-size: 16px;
}

.btn-primary {
    padding: 12px 32px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.empty-state {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 16px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    color: #999;
}

.record-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.record-card .record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.record-card .student-name {
    font-weight: bold;
    color: #333;
}

.record-card .record-date {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.status-pending {
    font-size: 12px;
    padding: 4px 10px;
    background: #fff3cd;
    color: #856404;
    border-radius: 10px;
}

.status-approved {
    font-size: 12px;
    padding: 4px 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 10px;
}

.status-rejected {
    font-size: 12px;
    padding: 4px 10px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 10px;
}

.record-card .jump-count {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.record-card .record-image {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    margin-top: 12px;
    border-radius: 8px;
}

.ranking-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #667eea;
    pointer-events: none;
    transition: transform 0.3s;
}

.select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

#ranking-age-group {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#ranking-age-group:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

#ranking-age-group:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#ranking-age-group option {
    padding: 10px;
    font-size: 14px;
    background: white;
    color: #333;
}

.ranking-tabs {
    display: flex;
    gap: 10px;
}

.rank-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #eee;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.rank-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.rank-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.rank-item .rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.rank-item:first-child .rank-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
}

.rank-item:nth-child(2) .rank-badge {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: white;
}

.rank-item:nth-child(3) .rank-badge {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
}

.rank-item:not(:nth-child(-n+3)) .rank-badge {
    background: #eee;
    color: #666;
}

.rank-item .rank-info {
    flex: 1;
}

.rank-item .rank-username {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.rank-item .rank-value {
    font-size: 12px;
    color: #999;
}

.rank-item .rank-score {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.tutorial-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.tutorial-card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.tutorial-content {
    color: #555;
    line-height: 1.8;
}

.tutorial-content h2 {
    font-size: 18px;
    color: #333;
    margin-top: 20px;
    margin-bottom: 12px;
}

.tutorial-content h3 {
    font-size: 16px;
    color: #444;
    margin-top: 16px;
    margin-bottom: 10px;
}

.tutorial-content ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.tutorial-content li {
    margin-bottom: 8px;
}

.tutorial-content strong {
    color: #667eea;
    font-weight: bold;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .checkin-card {
        padding: 16px;
    }
    
    .upload-area {
        padding: 20px;
    }
}