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

:root {
    --primary-color: #4A90D9;
    --primary-dark: #357ABD;
    --secondary-color: #6C757D;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --light-color: #F8F9FA;
    --dark-color: #343A40;
    --border-color: #DEE2E6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #F5F7FA;
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 70px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.3);
}

/* 主内容区 */
.main-content {
    padding: 15px;
}

.section {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* 课程卡片 */
.course-card {
    background: var(--light-color);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s;
}

.course-card:last-child {
    margin-bottom: 0;
}

.course-card:active {
    transform: scale(0.98);
}

.course-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.course-time {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.course-location {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: var(--secondary-color);
    padding: 30px 20px;
    font-size: 0.9rem;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 5px 15px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: color 0.3s;
}

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

.nav-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.7rem;
}

/* 页面样式 */
.page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F5F7FA;
    z-index: 200;
    overflow-y: auto;
}

.page-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.page-content {
    padding: 15px;
}

/* 按钮样式 */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary {
    flex: 1;
}

/* 上传选项 */
.upload-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.upload-option {
    flex: 1;
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 30px 15px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}

.upload-option:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.05);
}

.upload-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

/* 上传预览 */
.upload-preview {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
}

.upload-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.upload-preview textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
}

.upload-preview select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 15px;
    background: white;
}

/* OCR结果 */
.ocr-result {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
    margin-top: 15px;
}

.ocr-result h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

#ocr-text {
    background: var(--light-color);
    padding: 10px;
    border-radius: var(--radius);
    min-height: 100px;
    white-space: pre-wrap;
    margin-bottom: 15px;
}

/* 笔记列表 */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-item {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.note-course {
    font-weight: 600;
    color: var(--primary-color);
}

.note-time {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.note-content {
    color: var(--dark-color);
    font-size: 0.9rem;
}

.note-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-top: 10px;
}

/* 课表网格 */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: white;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
}

.schedule-header {
    background: var(--primary-color);
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.schedule-cell {
    min-height: 60px;
    background: var(--light-color);
    padding: 6px;
    font-size: 0.7rem;
}

.schedule-course {
    background: rgba(74, 144, 217, 0.1);
    border-left: 2px solid var(--primary-color);
    padding: 4px 6px;
    margin-bottom: 4px;
    border-radius: 2px;
}

.schedule-course-name {
    font-weight: 600;
    color: var(--primary-color);
}

.schedule-course-time {
    color: var(--secondary-color);
    font-size: 0.65rem;
}

/* 课程表预览 */
.schedule-preview {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.schedule-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
}

/* 弹窗样式 */
.modal {
    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: 300;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    width: 100%;
    max-width: 350px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--dark-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
}

/* 设置样式 */
.settings-group {
    margin-bottom: 20px;
}

.switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.switch {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

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

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

input[type="checkbox"]:checked + .switch::after {
    transform: translateX(20px);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item select,
.setting-item input[type="time"] {
    width: auto;
    padding: 6px 10px;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

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

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

#loading-text {
    color: white;
    font-size: 1rem;
}

/* 总结页面 */
.summary-content {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
}

.summary-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.summary-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.summary-detail {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* 周末计划 */
.plan-content {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
}

.plan-day {
    margin-bottom: 15px;
}

.plan-day:last-child {
    margin-bottom: 0;
}

.plan-day-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.plan-item {
    padding: 8px 0;
    padding-left: 15px;
    border-left: 2px solid var(--primary-color);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* 提示内容 */
.tips-content {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
}

.tip-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.tip-icon {
    font-size: 1.2rem;
}

.tip-text {
    flex: 1;
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .schedule-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2D3436;
        --dark-color: #F5F7FA;
        --border-color: #4A4A4A;
    }
    
    body {
        background-color: #1A1A1A;
    }
    
    .section,
    .course-card,
    .modal-content,
    .page {
        background: #2D3436;
    }
    
    .header {
        background: linear-gradient(135deg, #2980B9, #1A5276);
    }
    
    .bottom-nav {
        background: #2D3436;
    }
    
    .nav-item.active {
        color: #3498DB;
    }
}
