/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 作业列表样式 */
.homework-list {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.homework-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.homework-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.homework-item:hover::before {
    transform: scaleX(1);
}

.homework-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.homework-info {
    flex: 1;
    min-width: 0;
}

.homework-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    word-wrap: break-word;
}

.homework-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #7f8c8d;
    align-items: center;
}

.homework-type {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.homework-arrow {
    font-size: 24px;
    color: #bdc3c7;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.homework-item:hover .homework-arrow {
    color: #667eea;
    transform: translateX(8px);
}

/* 错误和空数据样式 */
.error-message, .no-data {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    margin: 40px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.error-message {
    color: #e74c3c;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .homework-list {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .homework-item {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .homework-title {
        font-size: 18px;
    }
    
    .homework-meta {
        font-size: 13px;
        gap: 10px;
    }
    
    .homework-type {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .homework-arrow {
        font-size: 20px;
        margin-left: 15px;
    }
}

@media (max-width: 480px) {
    .homework-item {
        padding: 16px;
    }
    
    .homework-title {
        font-size: 16px;
    }
    
    .homework-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 保留原有的批注相关样式... */
.homework-details-list {
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
}

.homework-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    /* 修复宽度问题的关键属性 */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.homework-detail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #667eea;
}

/* 详情信息区域优化 */
.detail-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.detail-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    /* 支持自动换行并防止溢出 */
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow: hidden;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-top: 8px;
    overflow: hidden;
}

.student-number,
.student-nickname {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    border: 1px solid #e9ecef;
    font-weight: 500;
    display: inline-block;
    /* 防止标签过长导致溢出 */
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.student-number {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.student-nickname {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #e1bee7;
}

.detail-arrow {
    font-size: 20px;
    color: #999;
    margin-left: 15px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.homework-detail-item:hover .detail-arrow {
    color: #667eea;
    transform: translateX(5px);
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    .homework-title-fixed {
        font-size: 18px;
        padding: 15px;
    }
    
    .back-btn-right {
        right: 15px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .homework-details-list {
        padding: 15px;
    }
    
    .homework-detail-item {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .detail-title {
        font-size: 16px;
    }
    
    .detail-meta {
        font-size: 13px;
        gap: 10px;
        margin-top: 6px;
    }
    
    .student-number,
    .student-nickname {
        font-size: 13px;
        padding: 5px 10px;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .homework-title-fixed {
        font-size: 16px;
        padding: 12px;
    }
    
    .back-btn-right {
        right: 10px;
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .homework-details-list {
        padding: 10px;
    }
    
    .homework-detail-item {
        padding: 12px;
    }
    
    .detail-meta {
        gap: 8px;
    }
    
    .student-number,
    .student-nickname {
        font-size: 12px;
        padding: 4px 8px;
        max-width: 100px;
    }
    
    .detail-arrow {
        margin-left: 10px;
        font-size: 18px;
    }
}

/* 加载动画样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #667eea;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-top-color: #764ba2;
    animation-delay: -0.5s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.spinner-ring:nth-child(3) {
    border-top-color: #f093fb;
    animation-delay: -1s;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 隐藏加载动画的类 */
.loading-container.hidden {
    display: none;
}

/* 移动端加载动画优化 */
@media (max-width: 768px) {
    .loading-container {
        padding: 60px 20px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-text {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .loading-container {
        padding: 40px 15px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-text {
        font-size: 14px;
    }
}