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

:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #C8E6C9;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --danger-color: #f44336;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --info-color: #2196F3;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-hint: #9E9E9E;
    --divider-color: #E0E0E0;
    --background-color: #F5F5F5;
    --card-background: #FFFFFF;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.16);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, #E8F5E9 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--background-color);
    position: relative;
}

.app-header {
    background: transparent;
    padding: 18px 16px 8px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-card {
    background: var(--card-background);
    border-radius: 24px;
    padding: 18px 16px 20px;
    box-shadow: var(--shadow-medium);
    text-align: center;
}

.app-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 2px;
    padding: 14px 46px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    min-width: 70%;
}

.app-title::before {
    content: '🏃';
    font-size: 1.4rem;
}

.app-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.main-content {
    padding: 8px 16px 80px;
}

.section {
    animation: fadeIn var(--transition-normal);
}

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

.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group label {
    /* display: block; */
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--divider-color);
    border-radius: var(--border-radius-sm);
    background: var(--card-background);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

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

.form-input::placeholder {
    color: var(--text-hint);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #66BB6A 0%, #43A047 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

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

.btn-danger {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
    color: white;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.user-info-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 16px;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 16px;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 32px;
    height: 32px;
}

.user-details h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-details p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--background-color);
    border-radius: var(--border-radius-sm);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-multi-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value-top {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-value-bottom {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card2 {
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 10px auto;
    font-family: Arial, sans-serif;
}

.card2 .header {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 14px;
}

.card2 .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.card2 .distance {
    font-size: 32px;
    color: #333;
}

.card2 .time {
    font-size: 18px;
    color: #888;
}

.card2 .status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    margin-top: 10px;
}

.card2 .green {
    background-color: #8bc34a;
    color: #fff;
}

.card2 .gray {
    background-color: #ccc;
    color: #fff;
}

.card2 .orange {
    background-color: #ff9800;
    color: #fff;
}

.card2 .blue {
    background-color: #1c90e9;
    color: #fff;
}

.card2 .image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsSAAALEgHS3X78AAAH9UlEQVR42tWcW2wcVxnHfzNe27W9jtP4Eju+1HGcNM2ldmijNNNGlFSEtIigQERFKyREeUAibUACAS/baF4AIZBI4AUEpQpBBKFepEJJCQ2IdkNaSm2IghOcNvGuk/gWx1lfd20PD9+ss5fZ2Z3dnV3nJ63kndk9M+fvOed8t7MKBcDnNzqAHUAXsAFo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QqGEWFsjQyPK+Cy80p99eza8kGobg11m4CCyucx1YoM1IzPw83Ou5Dh7zT5Zkq4EuR14B6jHZXa3ShzyLwOuiDACbNc1JaVxn0lR+jbgNHd2UfrHdE2xjbukTZqZDewBsssYFJcbwCfSiQDONq5sAv5EEXOlDgkgezXOZ/LhjNOoZoOPIFXuy51eYFemIjgSwhRjAHiIGGdlGfJLQLObGK3IdbvjUZZJ3TZiMT6X7XbHrCsMTKNrI/BDiuiomdf+EbAxWxEgf1uiO5Ha5mJsif6+rik519vle5N8K/BV4Gnc2wc2CPya5bhJ3kKQ6M8mPAnszYMoQWTpPsGd8LMJNsJ0IKtNF1K81o6Y7SuQip0IkpUfR8oULgMXkGXwH4X4IY3/A4lOU2bMjKE4AAAAAElFTkSuQmCC');
    background-size: cover;
}

.user-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.meta-value {
    font-size: 0.875rem;
    font-weight: 500;
}

.action-panel {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 16px;
}

.route-selector {
    margin-bottom: 16px;
}

.route-selector label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.action-buttons .btn {
    padding: 14px 16px;
}

.auto-run-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--background-color);
    border-radius: var(--border-radius-sm);
}

.auto-run-toggle span {
    font-size: 0.9375rem;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--divider-color);
    transition: var(--transition-fast);
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.records-container {
    margin-top: 16px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 4px;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.record-card:active {
    transform: scale(0.99);
}

.record-header {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
}

.record-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.record-info {
    flex: 1;
}

.record-date {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.record-location {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.record-location::before {
    content: '📍';
    font-size: 0.75rem;
}

.record-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.record-distance {
    display: flex;
    flex-direction: column;
}

.record-distance .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.record-distance .unit {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.record-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.record-time::before {
    content: '⏱';
    font-size: 0.75rem;
}

.record-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-valid {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
}

.status-pending {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    color: #EF6C00;
}

.status-invalid {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    color: #C62828;
}

.status-running {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    color: #1565C0;
}

.record-expand-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--background-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.record-expand-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.record-card.expanded .record-expand-btn {
    background: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.record-details {
    display: none;
    border-top: 1px solid var(--divider-color);
    animation: slideDown var(--transition-normal);
}

.record-card.expanded .record-details {
    display: block;
}

.record-details-content {
    padding: 16px;
}

.record-map-container {
    height: 200px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--background-color);
}

.record-map-container .leaflet-container {
    height: 100%;
    width: 100%;
}

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

.detail-section {
    margin-top: 16px;
}

.detail-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    background: var(--background-color);
    padding: 12px;
    border-radius: var(--border-radius-sm);
}

.detail-item-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-item-value {
    font-size: 0.875rem;
    font-weight: 500;
    word-break: break-all;
}

.photo-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--background-color);
    border-radius: var(--border-radius-sm);
    margin-top: 12px;
}

.photo-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-count {
    font-size: 0.875rem;
    font-weight: 500;
}

.view-photo-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.view-photo-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.map-preview {
    margin-top: 12px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    height: 200px;
    background: var(--background-color);
    position: relative;
}

.map-preview-btn {
    width: 100%;
    height: 100%;
    border: none;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    color: var(--secondary-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.map-preview-btn:hover {
    background: linear-gradient(135deg, #BBDEFB 0%, #90CAF9 100%);
}

.map-preview-btn svg {
    width: 40px;
    height: 40px;
}

.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 400px;
}

.toast {
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--shadow-heavy);
    animation: toastFloat 2.1s ease forwards;
    pointer-events: auto;
}

.toast.toast-success {
    background: var(--success-color);
}

.toast.toast-error {
    background: var(--danger-color);
}

.toast.toast-warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

.toast.toast-info {
    background: var(--info-color);
}

@keyframes toastFloat {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }
    15% {
        opacity: 1;
        transform: translateY(0);
    }
    75% {
        opacity: 1;
        transform: translateY(-6px);
    }
    100% {
        opacity: 0;
        transform: translateY(-22px);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    background: white;
    padding: 32px 48px;
    border-radius: var(--border-radius);
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--divider-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.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: 2000;
    padding: 16px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalIn var(--transition-normal);
}

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

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: white;
}

#modalImage {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.map-modal .modal-content {
    width: 100%;
    max-width: 500px;
}

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

.map-modal .modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.map-modal .modal-close {
    position: static;
    background: transparent;
}

.map-content {
    display: flex;
    flex-direction: column;
}

.track-map {
    width: 100%;
    height: 400px;
    background: #E3F2FD;
}

.announcement-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}

.announcement-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    max-width: 360px;
    text-align: center;
    animation: modalIn var(--transition-normal);
}

.announcement-content h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.announcement-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.announcement-content .btn {
    margin-top: 8px;
}

@media screen and (max-width: 360px) {
    html {
        font-size: 14px;
    }
    
    .app-header {
        padding: 20px 16px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .user-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        padding: 10px 6px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
}

@media screen and (min-width: 481px) {
    .app-container {
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: 24px;
        min-height: calc(100vh - 40px);
        box-shadow: var(--shadow-heavy);
    }
    
    .app-header {
        border-radius: 24px 24px 0 0;
    }
}

@media screen and (min-width: 768px) {
    .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --card-background: #1E1E1E;
        --text-primary: #FFFFFF;
        --text-secondary: #B0B0B0;
        --text-hint: #757575;
        --divider-color: #333333;
    }
    
    body {
        background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    }
    
    .form-input {
        background: #2C2C2C;
        border-color: #444444;
        color: white;
    }
    
    .stat-item,
    .auto-run-toggle,
    .detail-item,
    .photo-section {
        background: #2C2C2C;
    }
    
    .record-header:hover {
        background: #2C2C2C;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

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

.record-details-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.pull-indicator {
    text-align: center;
    padding: 12px;
    color: var(--text-hint);
    font-size: 0.875rem;
}

.remember-account {
    margin-bottom: 20px;
}

.login-announcement {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    background: rgba(76, 175, 80, 0.06);
    border: 1px dashed rgba(76, 175, 80, 0.4);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.login-announcement-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(76, 175, 80, 0.12);
    flex-shrink: 0;
}

.login-announcement-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    user-select: none;
    padding: 12px 16px;
    background: var(--background-color);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    width: 100%;
}

.checkbox-label-text {
    flex: 1;
    text-align: left;
}

.checkbox-label:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--divider-color);
    border-radius: 6px;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    background: var(--card-background);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 7px;
    height: 13px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-action .form-input {
    padding-right: 48px;
}

.input-action-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all var(--transition-fast);
}

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

.account-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-heavy);
    z-index: 100;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    animation: slideDown var(--transition-fast);
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--divider-color);
}

.account-dropdown-item:last-child {
    border-bottom: none;
}

.account-dropdown-item:hover {
    background: var(--primary-light);
}

.account-dropdown-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.account-dropdown-item .info {
    flex: 1;
    min-width: 0;
}

.account-dropdown-item .info .id {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.account-dropdown-item .info .school {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.account-dropdown-item .delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    transition: all var(--transition-fast);
}

.account-dropdown-item .delete-btn:hover {
    background: var(--danger-color);
    color: white;
}

.user-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    gap: 4px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--divider-color);
    color: var(--text-secondary);
    box-shadow: none;
}

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

.user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.account-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
    animation: fadeIn var(--transition-normal);
}

.account-selector-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-heavy);
    animation: modalIn var(--transition-normal);
}

.account-selector-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.account-list::-webkit-scrollbar {
    width: 6px;
}

.account-list::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 3px;
}

.account-list::-webkit-scrollbar-thumb {
    background: var(--divider-color);
    border-radius: 3px;
}

.account-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.account-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--background-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.account-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.account-item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.account-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-item-info .account-id {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.account-item-info .account-school {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
