/**
 * 公共样式文件
 * 功能：定义全局主题色、字体、滚动条、表格、卡片、进度条、统计徽章等通用样式
 * 适用页面：所有页面均引入此文件
 */

/* ====== 全局基础样式 ====== */
html, body {
    width: 100%;
    height: 100%;
    font-family: Microsoft Yahei, PingFang SC, Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background: #fff;
    font-size: 14px;
    color: #454545;
    position: relative;
}

/* ====== 输入框自动填充样式覆盖 ====== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    -webkit-text-fill-color: #1a1a2e !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ====== 自定义滚动条 - 内容区 ====== */
.dashboard-main::-webkit-scrollbar { width: 6px; }
.dashboard-main::-webkit-scrollbar-track { background: transparent; }
.dashboard-main::-webkit-scrollbar-thumb { background: rgba(49,130,206,0.2); border-radius: 3px; }
.dashboard-main::-webkit-scrollbar-thumb:hover { background: rgba(49,130,206,0.35); }

/* ====== 自定义滚动条 - 侧边栏 ====== */
.dashboard-sidebar::-webkit-scrollbar { width: 4px; }
.dashboard-sidebar::-webkit-scrollbar-track { background: transparent; }
.dashboard-sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }

/* ====== 加载/空数据/错误提示 ====== */
.loading-text, .empty-text, .error-text {
    text-align: center;
    padding: 60px 0;
    color: #718096;
    font-size: 14px;
}
.loading-text::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-text { color: #e53e3e; }

/* ====== 内容卡片 ====== */
.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 22px;
    margin-bottom: 22px;
    border: 1px solid #edf2f7;
    transition: box-shadow 0.25s;
}
.content-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ====== 数据表格 ====== */
.data-table-wrap { overflow-x: auto; border-radius: 8px; }
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: #fff;
}
.data-table thead tr { background: linear-gradient(135deg, #ebf4ff 0%, #e0ecf9 100%); }
.data-table th {
    color: #1a365d;
    font-weight: 600;
    padding: 13px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #bee3f8;
    font-size: 13px;
}
.data-table th:first-child { border-radius: 8px 0 0 0; }
.data-table th:last-child { border-radius: 0 8px 0 0; }
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
    vertical-align: middle;
    transition: background 0.2s;
    font-size: 13px;
    line-height: 1.6;
}
.data-table tbody tr:nth-child(even) { background: #f7fafc; }
.data-table tbody tr:hover { background: #ebf4ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.td-course {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* ====== 进度条 ====== */
.progress-bar-wrap {
    display: inline-block;
    width: 100px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 8px;
}
.progress-bar {
    height: 100%;
    border-radius: 4px;
    animation: progressGrow 0.6s ease-out;
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}
@keyframes progressGrow { from { width: 0%; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-text { font-size: 12px; color: #4a5568; vertical-align: middle; font-weight: 500; }

/* ====== 统计栏 ====== */
.stats-bar {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #ebf4ff 0%, #e0ecf9 100%);
    border-radius: 8px;
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.stats-bar b { color: #1a365d; font-weight: 700; }
.stat-done { color: #38a169 !important; }
.stat-progress { color: #dd6b20 !important; }
.stat-not { color: #a0aec0 !important; }

/* ====== 学期分组 ====== */
.score-semester-group { margin-bottom: 22px; }
.score-semester-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #ebf4ff 0%, #e0ecf9 100%);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    border-left: 4px solid #3182ce;
    transition: all 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.score-semester-header:hover {
    background: linear-gradient(135deg, #e0ecf9 0%, #d6e4f5 100%);
    box-shadow: 0 2px 8px rgba(49,130,206,0.12);
    transform: translateX(2px);
}
.score-semester-toggle {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 7px solid #3182ce;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-right: 12px;
    transition: transform 0.25s;
}
.score-semester-toggle.collapsed { transform: rotate(0deg); }
.score-semester-toggle:not(.collapsed) { transform: rotate(90deg); }
.score-semester-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a365d;
    margin-right: 12px;
    letter-spacing: 0.5px;
}
.score-semester-stats { font-size: 12px; color: #718096; font-weight: 400; }
.score-semester-body { margin-top: 8px; animation: fadeSlideIn 0.3s ease-out; }

/* ====== 考核状态 ====== */
.status-pass { color: #38a169; font-weight: 600; }
.status-fail { color: #e53e3e; font-weight: 600; }

/* ====== 统计卡片行 ====== */
.stat-cards-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* ====== 统计卡片项 ====== */
.stat-card-item {
    flex: 1;
    min-width: 160px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    border: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.stat-card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 12px 0 0 12px;
}
.stat-card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg {
    width: 24px;
    height: 24px;
}
.stat-card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.stat-card-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.stat-card-label {
    font-size: 13px;
    color: #718096;
    margin-top: 4px;
    font-weight: 500;
}
.stat-card-pct {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 600;
}

/* 总课程 - 蓝色 */
.stat-card-total::before { background: linear-gradient(180deg, #3182ce, #63b3ed); }
.stat-card-total .stat-card-icon { background: rgba(49,130,206,0.1); }
.stat-card-total .stat-card-icon svg { color: #3182ce; }
.stat-card-total .stat-card-num { color: #2b6cb0; }
.stat-card-total .stat-card-pct { color: #3182ce; }

/* 已完成 - 绿色 */
.stat-card-done::before { background: linear-gradient(180deg, #38a169, #68d391); }
.stat-card-done .stat-card-icon { background: rgba(56,161,105,0.1); }
.stat-card-done .stat-card-icon svg { color: #38a169; }
.stat-card-done .stat-card-num { color: #276749; }
.stat-card-done .stat-card-pct { color: #38a169; }

/* 学习中 - 橙色 */
.stat-card-progress::before { background: linear-gradient(180deg, #dd6b20, #ed8936); }
.stat-card-progress .stat-card-icon { background: rgba(221,107,32,0.1); }
.stat-card-progress .stat-card-icon svg { color: #dd6b20; }
.stat-card-progress .stat-card-num { color: #9c4221; }
.stat-card-progress .stat-card-pct { color: #dd6b20; }

/* 未开始 - 灰色 */
.stat-card-not::before { background: linear-gradient(180deg, #a0aec0, #cbd5e0); }
.stat-card-not .stat-card-icon { background: rgba(160,174,192,0.1); }
.stat-card-not .stat-card-icon svg { color: #a0aec0; }
.stat-card-not .stat-card-num { color: #4a5568; }
.stat-card-not .stat-card-pct { color: #a0aec0; }

/* ====== 统计徽章(旧版兼容) ====== */
.stat-badge {
    background: #fff;
    border-radius: 12px;
    padding: 18px 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    transition: all 0.25s;
    border: 1px solid #f0f2f5;
}
.stat-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.stat-badge-num { font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat-badge-label { font-size: 12px; color: #8e8ea0; margin-top: 6px; font-weight: 500; }
.stat-badge-total .stat-badge-num { color: #3182ce; }
.stat-badge-total { border-color: rgba(49,130,206,0.15); }
.stat-badge-done .stat-badge-num { color: #38a169; }
.stat-badge-done { border-color: rgba(56,161,105,0.15); }
.stat-badge-progress .stat-badge-num { color: #dd6b20; }
.stat-badge-progress { border-color: rgba(221,107,32,0.15); }
.stat-badge-not .stat-badge-num { color: #a0aec0; }
.stat-badge-not { border-color: rgba(160,174,192,0.15); }

/* ====== 淡入动画 ====== */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ====== 按钮通用样式 ====== */
.btns {
    font-size: 12px;
    font-weight: 500;
    color: #FFFFFF;
    text-shadow: 0px 2px 4px rgba(69,69,69,0.51);
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px;
}