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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

#app {
    max-width: 100%;
    padding: 0;
}

/* 日历顶部导航 */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-left h1 {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.week-range {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.header-right .fetch-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-right .fetch-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.header-right .fetch-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 日历容器 */
.calendar-container {
    background: white;
    min-height: 600px;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* 爬取结果 */
.result-section {
    background: white;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f6ffed;
    border-bottom: 1px solid #b7eb8f;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-header:hover {
    background: #e6f7e6;
}

.result-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #389e0d;
}

.toggle-icon {
    font-size: 12px;
    color: #52c41a;
    transition: transform 0.3s ease;
}

.result-content {
    padding: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 600px;
        overflow: visible;
    }
}

.result-message {
    font-size: 14px;
    color: #389e0d;
    margin-bottom: 12px;
}

.result-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.result-list h4 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.result-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 13px;
    color: #666;
}

.result-list li:last-child {
    border-bottom: none;
}

.result-list li.more {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* 控制台 */
.console-section {
    background: white;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.console-header:hover {
    background: #2d2d2d;
}

.console-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #d4d4d4;
}

.console-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-button {
    background: #0e639c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.clear-button:hover {
    background: #1177bb;
}

.console-content {
    background: #1e1e1e;
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.console-empty {
    color: #858585;
    text-align: center;
    padding: 20px 0;
}

.console-logs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 2px 0;
}

.log-time {
    color: #858585;
    min-width: 70px;
    flex-shrink: 0;
}

.log-message {
    flex: 1;
    word-break: break-all;
}

.log-item.info {
    color: #d4d4d4;
}

.log-item.success {
    color: #4ec9b0;
}

.log-item.error {
    color: #f14c4c;
}

.log-item.warning {
    color: #dcdcaa;
}

.log-item.debug {
    color: #9cdcfe;
}

/* 模态框 */
.modal-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;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

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

.student-modal {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: #f0f0f0;
    color: #666;
}

.modal-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.event-detail {
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 14px;
}

.event-detail:last-child {
    border-bottom: none;
}

.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.student-header p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.source-info {
    font-size: 12px !important;
    color: #999 !important;
}

.no-students {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

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

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.student-item:hover {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.student-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.student-id {
    font-size: 12px;
    color: #666;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.btn-secondary {
    background: white;
    color: #666;
    border: 1px solid #d9d9d9;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        text-align: center;
    }
    
    .calendar-container {
        margin: 10px;
    }
    
    .result-section,
    .console-section {
        margin: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}

/* 原有样式 */

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e8e8e8;
}

.fetch-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.fetch-btn:hover:not(:disabled) {
    background: #40a9ff;
}

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

.date-range {
    font-size: 14px;
    color: #666;
}

.fetch-result {
    background: white;
    border-bottom: 1px solid #e8e8e8;
    overflow: hidden;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f6ffed;
    border-bottom: 1px solid #b7eb8f;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-header:hover {
    background: #e6f7e6;
}

.result-title {
    font-size: 15px;
    font-weight: 500;
    color: #389e0d;
}

.toggle-icon {
    font-size: 12px;
    color: #52c41a;
    transition: transform 0.2s ease;
}

.result-content {
    max-height: 600px;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 600px;
    }
}

.result-message {
    padding: 12px 20px;
    background: #f0f9ff;
    color: #1890ff;
    font-size: 14px;
    border-bottom: 1px solid #91d5ff;
}

.result-list {
    padding: 10px;
}

.result-item {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: #f5f5f5;
    border-color: #d9d9d9;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e8e8e8;
}

.item-date {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.item-time {
    font-size: 13px;
    color: #1890ff;
    font-weight: 500;
}

.item-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-course {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.item-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.item-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.console-panel {
    background: white;
    border-bottom: 1px solid #e8e8e8;
    overflow: hidden;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.console-header:hover {
    background: #2d2d2d;
}

.console-title {
    font-size: 14px;
    font-weight: 500;
    color: #d4d4d4;
}

.console-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-btn {
    background: #0e639c;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #1177bb;
}

.console-panel .toggle-icon {
    color: #858585;
    font-size: 10px;
}

.console-content {
    background: #1e1e1e;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.console-content::-webkit-scrollbar {
    width: 8px;
}

.console-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.console-content::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.console-content::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.console-line {
    display: flex;
    align-items: flex-start;
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.console-line.info {
    color: #d4d4d4;
}

.console-line.success {
    color: #4ec9b0;
}

.console-line.error {
    color: #f14c4c;
}

.console-line.warning {
    color: #dcdcaa;
}

.console-line.debug {
    color: #9cdcfe;
}

.console-time {
    color: #858585;
    margin-right: 10px;
    flex-shrink: 0;
    min-width: 70px;
}

.console-message {
    flex: 1;
}

.calendar-container {
    background: white;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

#calendar {
    color: #333;
}

#calendar .fc-toolbar {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0;
}

#calendar .fc-toolbar-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

#calendar .fc-button {
    background: #fff;
    border: 1px solid #d9d9d9;
    color: #666;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

#calendar .fc-button:hover {
    color: #1890ff;
    border-color: #1890ff;
    background: #fff;
}

#calendar .fc-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#calendar .fc-button-active {
    background: #1890ff;
    border-color: #1890ff;
    color: white;
}

#calendar .fc-button-active:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: white;
}

#calendar .fc-scrollgrid {
    border: 1px solid #e8e8e8;
    border-right: none;
    border-bottom: none;
}

#calendar .fc-scrollgrid td,
#calendar .fc-scrollgrid th {
    border: 1px solid #e8e8e8;
}

#calendar .fc-col-header-cell {
    background: #fafafa;
    padding: 12px 8px;
}

#calendar .fc-col-header-cell-cushion {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

#calendar .fc-timegrid-slot-label {
    background: #fafafa;
}

#calendar .fc-timegrid-slot-label-cushion {
    font-size: 13px;
    color: #666;
}

#calendar .fc-timegrid-axis-cushion {
    font-size: 13px;
    color: #999;
}

#calendar .fc-daygrid-day-number {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

#calendar .fc-day-today {
    background: #e6f7ff !important;
}

#calendar .fc-daygrid-day:hover {
    background: #f5f5f5;
}

#calendar .fc-event {
    background: #1890ff;
    border: none;
    border-radius: 2px;
    padding: 4px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

#calendar .fc-event:hover {
    background: #40a9ff;
    z-index: 999 !important;
}

#calendar .fc-event-title {
    font-size: 12px;
    font-weight: 500;
    color: white;
    line-height: 1.4;
}

#calendar .fc-event-teacher {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    margin-top: 2px;
}

#calendar .fc-event-room {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    margin-top: 1px;
}

#calendar .fc-timegrid-event-harness {
    margin: 1px 2px;
}

#calendar .fc-timegrid-event {
    box-shadow: none;
}

.event-details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 320px;
}

.event-details h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 500;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.event-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    padding: 10px 0;
}

.info-item .label {
    font-weight: 500;
    color: #666;
    min-width: 80px;
    font-size: 14px;
}

.info-item .value {
    color: #333;
    flex: 1;
    font-size: 14px;
}

.close-btn {
    background: #1890ff;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #40a9ff;
}

@media (max-width: 768px) {
    #calendar .fc-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    #calendar .fc-toolbar-chunk {
        text-align: center;
    }
    
    .info-item {
        flex-direction: column;
        gap: 4px;
    }
    
    .info-item .label {
        margin-bottom: 0;
    }
}

/* 模态框样式 */
.modal-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;
    animation: fadeIn 0.2s ease;
}

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

.student-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-info-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-tag {
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.source-tag.database {
    background: #e6f7ff;
    color: #1890ff;
}

.source-tag.api {
    background: #f6ffed;
    color: #52c41a;
}

.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-container p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.student-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.student-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #f0f0f0;
}

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

.student-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.type-badge {
    background: #1890ff;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.student-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    gap: 8px;
}

.info-label {
    font-size: 13px;
    color: #999;
    min-width: 70px;
}

.info-value {
    font-size: 13px;
    color: #333;
}

.info-value.arrived {
    color: #52c41a;
}

.info-value.not-arrived {
    color: #faad14;
}

.student-courses {
    background: white;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e8e8e8;
}

.courses-title {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.courses-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
}

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

.course-name {
    font-size: 13px;
    color: #333;
}

.course-hours {
    font-size: 12px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

