/* 现代简约风格 - 作业列表优化 */
:root {
    /* 主色调 */
    --primary: #0d6efd;
    --primary-light: #e7f1ff;
    --primary-dark: #0a58ca;
    
    /* 状态色 */
    --success: #198754;
    --success-light: #d1f2e1;
    --warning: #ffc107;
    --warning-light: #fff8e1;
    --danger: #dc3545;
    --danger-light: #fde8e8;
    
    /* 中性色 */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* 语义色 */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 间距 */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 1rem;
}

/* ===== 通用样式 ===== */
.assignments-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

/* ===== 卡片和区块样式 ===== */
.assignment-section,
.profile-card,
.not-logged-in-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: box-shadow 0.2s ease;
}

.assignment-section {
    margin-bottom: 1rem;
    padding: var(--space-xl);
}

.assignment-section:hover {
    box-shadow: var(--shadow-md);
}

.profile-card {
    padding: 2rem;
    margin: 1rem 0 2rem;
}

.not-logged-in-container {
    margin-top: 1rem;
    padding: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== 区块头部 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.section-info {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.section-icon.pending {
    background: linear-gradient(135deg, var(--gray-50), #ffffff);
    color: var(--text-primary);
}

.section-icon.submitted {
    background: linear-gradient(135deg, var(--success-light), #f0fff4);
    color: var(--success);
}

.section-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.3;
}

.section-description {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.4;
}

/* ===== 按钮样式 ===== */
.btn.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(2px);
}

/* ===== 卡片网格布局 ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
    align-items: stretch;
}

/* ===== 作业卡片 ===== */
.assignment-card {
    display: flex;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.6s ease-out;
}

.assignment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}

.assignment-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.assignment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
    text-decoration: none;
    color: inherit;
}

.assignment-card:hover::after {
    left: 100%;
}

.card-pending:hover {
    border-color: var(--warning);
}

.card-submitted:hover {
    border-color: var(--success);
}

/* ===== 卡片徽章 ===== */
.card-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-badge.pending {
    background: var(--warning-light);
    color: #8a6d3b;
}

.card-badge.submitted {
    background: var(--success-light);
    color: #2d5a3d;
}

/* ===== 卡片内容 ===== */
.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 var(--space-md) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.meta-item i {
    width: 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* ===== 时间状态 ===== */
.time-urgent {
    color: var(--danger);
    font-weight: 500;
}

.time-expired {
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.assignment-type {
    background: var(--gray-100);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ===== 卡片操作 ===== */
.card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--text-tertiary);
    margin-left: var(--space-md);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.assignment-card:hover .card-action {
    background: var(--primary);
    color: var(--white);
    transform: translateX(2px);
}

/* ===== 空状态设计 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--gray-300);
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    color: var(--text-tertiary);
    font-size: 1.5rem;
}

.empty-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
}

.empty-subtext {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.4;
}

/* ===== 个人信息卡片 ===== */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.profile-info {
    flex: 1;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: fit-content;
}

/* 用户名和签名样式 */
.profile-username-wrapper,
.profile-signature-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-username {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-meta {
    margin-top: 1rem;
}

.profile-role,
.profile-student-id {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.profile-signature {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== 编辑按钮和区域 ===== */
.edit-btn {
    color: var(--primary);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0.25rem;
    border-radius: 4px;
}

.edit-btn:hover {
    opacity: 1;
    background-color: var(--primary-light);
}

.edit-area {
    margin: 1rem 0;
}

.edit-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 400px;
}

.edit-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.edit-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.edit-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ===== 管理员区域 ===== */
.admin-section .section-header {
    align-items: center;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
}

/* ===== 未登录状态 ===== */
.login-content h4 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--text-primary);
}

.login-content p {
    margin: 0;
    color: var(--text-secondary);
}

.login-actions {
    display: flex;
    gap: 0.75rem;
}

/* ===== 统计计数样式 ===== */
.count-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.75rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.section-title-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.count-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.total-count {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.showing-count {
    font-size: 0.8rem;
    color: #adb5bd;
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

/* ===== 动画 ===== */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 响应式设计 ===== */

/* 大屏幕 */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* 平板 */
@media (max-width: 768px) {
    .assignment-section,
    .profile-card {
        padding: var(--space-lg);
    }
    
    .section-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .section-info {
        width: 100%;
    }
    
    .btn.btn-outline {
        align-self: flex-end;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .assignment-card {
        padding: var(--space-md);
    }
    
    .empty-state {
        padding: var(--space-xl) var(--space-lg);
    }
    
    .profile-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .profile-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .profile-actions .btn {
        flex: 1;
        min-width: 0;
    }
    
    .not-logged-in-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 2rem;
    }
    
    .login-actions {
        width: 100%;
        justify-content: center;
    }
    
    .login-actions .btn {
        min-width: 120px;
    }
    
    .edit-form {
        flex-direction: column;
    }
    
    .edit-buttons {
        align-self: flex-end;
    }
    
    /* 移动端横向布局优化 */
    .assignment-section {
        padding: 1rem;
    }

    .section-header {
        flex-direction: row;
        gap: 0.75rem;
    }

    .section-info {
        flex: 1;
        min-width: 0;
    }

    .section-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin-top: 0.125rem;
    }

    .section-content {
        flex: 1;
        min-width: 0;
    }

    .section-title {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    .section-title-container {
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .count-badge {
        margin-left: 0;
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    .count-info {
        gap: 0.5rem;
        margin-top: 0.25rem;
    }

    .total-count {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .showing-count {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .btn.btn-outline {
        width: 36px;
        height: 36px;
        margin-top: 0.125rem;
    }

    /* 紧凑的卡片布局 */
    .cards-grid {
        gap: 0.75rem;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .card-badge {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .meta-item {
        font-size: 0.8rem;
    }
    
    /* 管理员面板移动端优化 */
    .admin-section {
        padding: 1rem;
    }

    .admin-section .section-header {
        gap: 0.75rem;
    }

    .admin-section .section-title {
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .admin-section .section-title i {
        font-size: 1.1rem;
    }

    .admin-section .section-title h3 {
        font-size: 1.125rem;
    }

    .admin-section .section-description {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        color: #6c757d;
    }

    .admin-actions {
        gap: 0.5rem;
    }

    .admin-actions .btn {
        flex: 1;
        min-width: 120px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .admin-actions .btn i {
        font-size: 0.875rem;
        margin-right: 0.375rem;
    }
}

/* 手机 */
@media (max-width: 480px) {
    .assignment-section,
    .profile-card {
        padding: var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .section-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: var(--space-sm);
    }
    
    .meta-item {
        font-size: 0.8125rem;
    }
    
    .empty-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .empty-text {
        font-size: 1rem;
    }
    
    .profile-username {
        font-size: 1.5rem;
    }
    
    .assignment-card {
        padding: 1.25rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .admin-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .admin-actions .btn {
        width: 100%;
    }
    
    /* 超小屏幕优化 */
    .assignment-section {
        padding: 0.75rem;
    }

    .section-header {
        gap: 0.5rem;
    }

    .section-info {
        gap: 0.5rem;
    }

    .section-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .section-title-container {
        gap: 0.375rem;
        margin-bottom: 0.125rem;
    }

    .count-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    .count-info {
        gap: 0.375rem;
        margin-top: 0.125rem;
    }

    .total-count, .showing-count {
        font-size: 0.7rem;
    }

    .btn.btn-outline {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .cards-grid {
        gap: 0.5rem;
    }

    .assignment-card {
        padding: 0.875rem;
    }

    .empty-state {
        padding: 1.5rem 1rem;
    }

    .empty-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .empty-text {
        font-size: 1rem;
    }

    .empty-subtext {
        font-size: 0.8rem;
    }
    
    /* 管理员面板超小屏幕优化 */
    .admin-section {
        padding: 0.75rem;
    }

    .admin-section .section-header {
        gap: 0.5rem;
    }

    .admin-section .section-title h3 {
        font-size: 1rem;
    }

    .admin-section .section-description {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    .admin-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-actions .btn {
        min-width: 100%;
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .admin-actions .btn i {
        font-size: 0.85rem;
        margin-right: 0.25rem;
    }
}

/* 极窄屏幕 */
@media (max-width: 360px) {
    .admin-section {
        padding: 0.5rem;
    }

    .admin-section .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .admin-section .section-title h3 {
        font-size: 0.95rem;
    }

    .admin-section .section-description {
        font-size: 0.75rem;
    }

    .admin-actions .btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .section-header {
        flex-wrap: nowrap;
    }
    
    .section-info {
        min-width: 0;
    }
    
    .section-content {
        overflow: hidden;
    }
    
    .section-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .count-info {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .total-count, .showing-count {
        font-size: 0.65rem;
    }
}