/**
 * 现代化AI点评模态框样式
 * 专业商务风格 - 高级感设计 (No Animations)
 * @version 2.0.0
 */

/* ========================================
   模态框遮罩层
   ======================================== */

.modern-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    /* Removed animation: modernFadeIn */
}

/* ========================================
   模态框容器
   ======================================== */

.modern-modal-container {
    width: 100%;
    max-width: 880px;
    /* Removed animation: modernSlideUp */
}

.modern-modal-container.large {
    max-width: 1100px;
    /* 宽版模态框 */
}

/* ========================================
   模态框内容主体
   ======================================== */

.modern-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* 移除 渐变装饰背景 */
.modern-modal-bg-decoration {
    display: none;
}

/* ========================================
   关闭按钮
   ======================================== */

.modern-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modern-close-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

/* ========================================
   头部区域
   ======================================== */

.modern-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 图标包装器 */
.modern-modal-icon-wrapper {
    display: block;
    margin-bottom: 0;
}

.modern-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.modern-modal-icon i {
    font-size: 20px;
    color: white;
}

/* 标题 */
.modern-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    background: none;
    -webkit-text-fill-color: initial;
    letter-spacing: -0.01em;
}

/* 副标题 */
.modern-modal-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 400;
}

/* ========================================
   主体内容区域
   ======================================== */

.modern-modal-body {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    min-height: 300px;
    background: #f8fafc;
}

/* Custom Scrollbar */
.modern-modal-body::-webkit-scrollbar {
    width: 6px;
}

.modern-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modern-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modern-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   AI卡片 / 内容卡片
   ======================================== */

.modern-ai-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Minimal shadow */
    overflow: hidden;
    margin-bottom: 20px;
}

/* 操作栏 */
.modern-ai-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.modern-ai-toolbar span {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

/* 状态显示 */
.modern-ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.modern-status-text {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* 操作按钮组 */
.modern-ai-actions {
    display: flex;
    gap: 8px;
}

.modern-icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modern-icon-btn i {
    font-size: 12px;
}

.modern-icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
    transform: none;
    box-shadow: none;
}

/* ========================================
   AI内容区域
   ======================================== */

.modern-ai-content {
    padding: 20px;
    min-height: 200px;
    background: white;
}

/* 空状态 */
.modern-ai-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.modern-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.modern-empty-icon i {
    font-size: 28px;
    color: #94a3b8;
    background: none;
    -webkit-text-fill-color: initial;
}

.modern-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 8px 0;
}

.modern-empty-text {
    font-size: 13px;
    color: #64748b;
    max-width: 400px;
    margin: 0;
    line-height: 1.5;
}



/* ========================================
   底部操作区域
   ======================================== */

.modern-modal-footer {
    padding: 16px 32px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

/* ========================================
   现代化按钮
   ======================================== */

.modern-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.modern-btn i {
    font-size: 14px;
}

.modern-btn:active {
    background-color: #e2e8f0;
    transform: none;
}

/* 次要按钮 */
.modern-btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modern-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: none;
}

.modern-btn-secondary:hover i {
    transform: none;
}

/* 主要按钮 */
.modern-btn-primary {
    background: #3b82f6;
    color: white;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.5);
}

.modern-btn-primary:hover {
    background: #2563eb;
    box-shadow: none;
    transform: none;
}

.modern-btn-primary:hover i {
    transform: none;
}

/* 移除 按钮光泽效果 */
.modern-btn-shine {
    display: none;
}

/* ========================================
   班级对比特有样式 (Class Comparison Extension)
   ======================================== */

/* 筛选工具栏 */
.comparison-toolbar-tags {
    background: #f8fafc;
    border-radius: 8px;
    /* Sharper */
    padding: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 筛选组 */
.tag-select-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* 筛选标签标题 */
.tag-select-label {
    min-width: 90px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
    font-size: 13px;
}

.tag-select-label i {
    color: #64748b;
    font-size: 14px;
}

/* 标签容器 */
.tag-select-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 标签项 */
.tag-item {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    background: white;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag-item:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
    transform: none;
}

.tag-item.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: none;
}

.tag-item.active:hover {
    background: #2563eb;
    transform: none;
}

/* 加载和占位状态 */
.tag-loading,
.tag-placeholder {
    font-size: 12px;
    color: #94a3b8;
    padding: 6px 0;
    font-style: normal;
}

/* 结果指标卡片 - Beautified */
.modern-metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #edf2f7;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modern-metric-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.08),
        0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Accent line at the top */
.modern-metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #3b82f6;
    opacity: 0.8;
}

.metric-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Uniform icon colors in cards */
.metric-title i {
    color: #3b82f6 !important;
    font-size: 16px;
}

.metric-chart {
    height: 110px;
    margin-bottom: 16px;
    border-radius: 6px;
    background: #fdfdfd;
}

.metric-info {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.metric-best,
.metric-worst {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.metric-best span {
    color: #10b981;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.metric-worst span {
    color: #ef4444;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* 数据表格卡片 - Beautified */
.comparison-table-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.comparison-table-header {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comparison-table-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-table-title i {
    color: #3b82f6;
}

/* 表格排序控件 */
.comparison-sort-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    color: #475569;
    outline: none;
    transition: all 0.2s;
    background-color: white;
}

.comparison-sort-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* 表格主体 */
.comparison-table-body {
    padding: 0;
}

/* 现代化数据表格样式 - Enhanced */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 14px;
    background: white;
}

.data-table thead th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 16px 24px;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead th:first-child {
    border-top-left-radius: 8px;
}

.data-table thead th:last-child {
    border-top-right-radius: 8px;
}

.data-table tbody td {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
    font-size: 14px;
}

.data-table tbody td:first-child {
    font-weight: 600;
}

.data-table tbody td:nth-child(2) {
    font-weight: 600;
    color: #1e293b;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:nth-child(odd) {
    background-color: #fafbfc;
}

.data-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.data-table tbody tr:hover {
    background-color: #f0f9ff !important;
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* 排名徽章样式 - Premium */
.data-table tbody td:first-child strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
}

/* 前三名特殊样式 */
.data-table tbody tr:nth-child(1) td:first-child strong {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.data-table tbody tr:nth-child(2) td:first-child strong {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.data-table tbody tr:nth-child(3) td:first-child strong {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(147, 197, 253, 0.3);
}

/* 数值列样式增强 */
.data-table td:nth-child(3),
.data-table td:nth-child(4),
.data-table td:nth-child(5),
.data-table td:nth-child(6),
.data-table td:nth-child(7) {
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.data-table th:nth-child(3),
.data-table th:nth-child(4),
.data-table th:nth-child(5),
.data-table th:nth-child(6),
.data-table th:nth-child(7) {
    text-align: center;
}

/* 平均分列 */
.data-table td:nth-child(3) {
    color: #3b82f6;
    font-weight: 700;
}

/* 优秀率列 */
.data-table td:nth-child(4) {
    color: #10b981;
}

/* 及格率列 */
.data-table td:nth-child(5) {
    color: #6366f1;
}

/* 低分率列 */
.data-table td:nth-child(6) {
    color: #ef4444;
}

/* 学生数列 */
.data-table td:nth-child(7) {
    color: #64748b;
    font-weight: 500;
}


/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 768px) {
    .modern-modal-container {
        max-width: 100%;
        margin: 10px;
    }

    .modern-modal-content {
        border-radius: 12px;
        max-height: calc(100vh - 40px);
    }

    .modern-modal-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modern-modal-icon-wrapper {
        display: none;
    }

    .modern-modal-body {
        padding: 20px;
    }

    .modern-ai-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .modern-ai-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modern-icon-btn span {
        display: none;
    }

    .modern-icon-btn {
        padding: 8px 12px;
    }

    .modern-modal-footer {
        padding: 16px 20px;
    }

    .modern-btn {
        flex: 1;
    }

    .modern-close-btn {
        top: 16px;
        right: 16px;
    }
}

/* ========================================
   Loading State (Static)
   ======================================== */

.modern-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: simpleSpin 1s linear infinite;
}

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

.modern-loading-text {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.modern-loading-tip {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

/* ========================================
   Dark Mode Support (Simplified & Static)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .modern-modal-content {
        background: #1e293b;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .modern-modal-header {
        background: #1e293b;
        border-color: #334155;
    }

    .modern-modal-title {
        color: #f1f5f9;
        -webkit-text-fill-color: initial;
    }

    .modern-modal-subtitle {
        color: #94a3b8;
    }

    .modern-modal-body {
        background: #0f172a;
    }

    .modern-ai-card {
        background: #1e293b;
        border-color: #334155;
    }

    .modern-ai-toolbar {
        background: #1e293b;
        border-color: #334155;
    }

    .modern-ai-toolbar span {
        color: #e2e8f0;
    }

    .modern-ai-content {
        background: #1e293b;
    }

    .modern-modal-footer {
        background: #1e293b;
        border-color: #334155;
    }

    .modern-icon-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .modern-icon-btn:hover {
        background: #475569;
        color: #fff;
    }

    .comparison-toolbar-tags {
        background: #1e293b;
        border-color: #334155;
    }

    .tag-select-label {
        color: #cbd5e1;
    }

    .tag-select-label i {
        color: #94a3b8;
    }

    .tag-item {
        background: #334155;
        color: #94a3b8;
        border-color: #475569;
    }

    .tag-item:hover {
        background: #475569;
        color: #f1f5f9;
        border-color: #64748b;
    }

    .tag-item.active {
        background: #3b82f6;
        color: white;
        border-color: #3b82f6;
    }

    .modern-metric-card {
        background: #1e293b;
        border-color: #334155;
    }

    .metric-title {
        color: #cbd5e1;
    }

    .metric-info {
        background: #0f172a;
        border-color: #1e293b;
        color: #94a3b8;
    }

    .metric-best span,
    .metric-worst span {
        color: #e2e8f0;
    }

    .comparison-table-card {
        background: #1e293b;
        border-color: #334155;
    }

    .comparison-table-header {
        background: #1e293b;
        border-color: #334155;
    }

    .comparison-table-title {
        color: #f1f5f9;
    }

    .comparison-table-title i {
        color: #94a3b8;
    }

    .comparison-sort-select {
        background-color: #334155;
        color: #f1f5f9;
        border-color: #475569;
    }
}