/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[v-cloak] {
    display: none;
}

/* 主体样式 */
body {
    font-family: 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%,#667eea 50%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 容器布局 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 页面头部 */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

/* 刷新按钮 */
.refresh-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2em auto 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.refresh-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.refresh-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

/* 作业列表 */
.homework-list {
    display: grid;
    gap: 1.5rem;
}

.homework-item {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.homework-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 作业项头部 */
.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.homework-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.homework-major {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 作业内容 */
.homework-content {
    margin: 1rem 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
}

.homework-content h1,
.homework-content h2,
.homework-content h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.homework-content p {
    margin-bottom: 0.8rem;
}

/* 作业底部 */
.homework-footer {
    margin-top: 1rem;
}

.homework-tips {
    display: inline-block;
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #e17055;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(253, 203, 110, 0.3);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-text {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* 图片预览模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 富文本中的图片样式 */
.homework-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0.5rem 0;
}

.homework-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 更新提醒 */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1rem;
    text-align: center;
    z-index: 2000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.update-banner.show {
    transform: translateY(0);
    animation: slideDown 0.3s ease;
}

.update-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.update-message {
    flex: 1;
    font-size: 0.95rem;
}

.update-message strong {
    font-weight: 600;
}

.update-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.update-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

.update-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

.update-btn.primary:hover {
    background: white;
}

/* 当有更新提醒时，给body添加padding */
body.has-update-banner {
    padding-top: 60px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .refresh-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .homework-item {
        padding: 1rem;
    }

    .homework-time {
        font-size: 1rem;
    }

    .homework-major {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .refresh-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .homework-item {
        padding: 0.8rem;
        border-radius: 12px;
    }

    .homework-content {
        font-size: 0.95rem;
    }
}
