/* ========== 全局变量 ========== */
:root {
    --primary: #4A6CF7;
    --primary-dark: #3B4CCA;
    --primary-light: #EEF2FF;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #06B6D4;
    --gray-light: #F8FAFC;
    --gray: #94A3B8;
    --gray-dark: #64748B;
    --dark: #0F172A;
    --border: #E2E8F0;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: #F1F5F9;
    color: var(--dark);
    line-height: 1.6;
}

/* ========== 头部 ========== */
.ees-header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.ees-header-inner {
    max-width: 1400px; margin: 0px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 74px;
}
.ees-header-logo a {
    text-decoration: none; color: var(--primary);
    font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.ees-header-nav { display: flex; align-items: center; gap: 16px; }
.ees-user-greeting { font-weight: 500; color: var(--dark); }

/* ========== 主布局 ========== */
.ees-main-wrapper { display: flex; min-height: calc(100vh - 64px - 60px); }
.ees-dashboard { display: flex; width: 100%; }

/* ========== 侧边栏 ========== */
.ees-sidebar {
    width: 260px; background: white; border-right: 1px solid var(--border);
    padding: 25px 0; flex-shrink: 0;
}
.ees-user-info {
    padding: 0 20px 20px; border-bottom: 1px solid var(--border);
    margin-bottom: 15px; display: flex; align-items: center; gap: 10px;
    font-weight: 600; color: var(--dark);
}
.ees-user-info i { font-size: 28px; color: var(--primary); }
.ees-menu { list-style: none; }
.ees-menu-item a {
    display: flex; align-items: center; gap: 12px; padding: 12px 20px;
    color: #4B5563; text-decoration: none; transition: all 0.2s;
    border-left: 3px solid transparent;
}
.ees-menu-item a:hover { background: var(--gray-light); color: var(--primary); }
.ees-menu-item.active a {
    background: var(--primary-light); color: var(--primary);
    border-left-color: var(--primary); font-weight: 600;
}

/* ========== 内容区 ========== */
.ees-content { flex: 1; padding: 30px 40px; overflow-y: auto; }
.ees-tab-content { display: none; }
.ees-tab-content.active { display: block; }
.ees-content h2 { margin-bottom: 25px; color: var(--dark); font-weight: 700; }
.ees-content h2 i { margin-right: 8px; color: var(--primary); }

/* ========== 底部 ========== */
.ees-footer {
    background: white; border-top: 1px solid var(--border);
    text-align: center; padding: 20px; color: var(--gray); font-size: 14px;
}

/* ========== 按钮 ========== */
.ees-btn {
    display: inline-block; font-weight: 600; text-align: center;
    padding: 10px 22px; border-radius: 10px; border: none; cursor: pointer;
    transition: all 0.2s; font-size: 15px; text-decoration: none; line-height: 1.4;
}
.ees-btn-primary { background: var(--primary); color: white; }
.ees-btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(74,108,247,0.3); }
.ees-btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.ees-btn-outline:hover { background: var(--primary); color: white; }
.ees-btn-success { background: var(--success); color: white; }
.ees-btn-success:hover { background: #16A34A; transform: translateY(-1px); }
.ees-btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 8px; }
.ees-btn-block { width: 100%; padding: 12px; }

/* ========== 卡片 ========== */
.ees-card {
    background: white; border-radius: var(--radius);
    padding: 25px; box-shadow: var(--shadow);
}

/* ========== 表格 ========== */
.ees-table {
    width: 100%; border-collapse: separate; border-spacing: 0 8px;
}
.ees-table thead th {
    background: var(--gray-light); padding: 14px 16px;
    text-align: left; font-weight: 600; color: var(--dark);
    border-radius: 8px 8px 0 0;
}
.ees-table tbody td {
    background: white; padding: 14px 16px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.ees-table tbody tr:hover td { background: #F8FAFC; }

/* ========== 仪表盘统计卡片 ========== */
.ees-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
}
.ees-stat-box {
    background: white; padding: 35px 20px; border-radius: var(--radius);
    box-shadow: var(--shadow); text-align: center; transition: transform 0.2s;
}
.ees-stat-box:hover { transform: translateY(-4px); }
.ees-stat-box p { margin-top: 18px; color: var(--gray-dark); font-weight: 500; }

/* ========== 圆形进度条 ========== */
.progress-circle {
    width: 130px; height: 130px; border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, #e5e7eb 0deg);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto; position: relative;
}
.progress-circle::before {
    content: ""; position: absolute;
    width: 104px; height: 104px; background: white; border-radius: 50%;
}
.progress-text {
    position: relative; z-index: 1;
    font-size: 24px; font-weight: 700; color: var(--primary);
}
.progress-circle.small {
    width: 90px; height: 90px;
}
.progress-circle.small::before {
    width: 72px; height: 72px;
}
.progress-circle.small .progress-text {
    font-size: 17px;
}

/* ========== 面板（待考/已考） ========== */
.ees-panels {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 30px;
}
.ees-panel {
    background: white; border-radius: var(--radius);
    padding: 25px; box-shadow: var(--shadow);
}
.ees-panel h3 {
    margin-top: 0; margin-bottom: 20px; color: var(--primary);
    display: flex; align-items: center; gap: 10px; font-weight: 700;
}
.list-unstyled { list-style: none; padding: 0; }
.list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .title { font-weight: 500; flex: 1; }
.list-item .meta { color: var(--gray); font-size: 0.9rem; margin: 0 15px; white-space: nowrap; }
.empty { text-align: center; padding: 30px; color: var(--gray); font-style: italic; }

/* 待考表格固定列宽 */
.pending-table { table-layout: fixed; }
.pending-table .title-cell { width: 60%; word-wrap: break-word; }
.pending-table .time-cell { width: 20%; text-align: center; }
.pending-table .action-cell { width: 20%; text-align: center; }

/* ========== 家长 - 孩子卡片 ========== */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.child-card {
    background: white; border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.child-card:hover { transform: translateY(-3px); }
.child-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 24px;
}
.child-header i { font-size: 30px; color: var(--primary); }
.child-header h3 { margin: 0; font-weight: 700; font-size: 1.3rem; }
.child-stats {
    display: flex; justify-content: space-around; margin-bottom: 24px;
    flex-wrap: wrap;
}
.stat-item { text-align: center; width: 100px; }
.stat-item span { display: block; margin-top: 10px; color: var(--gray-dark); font-size: 0.95rem; }
.last-exam {
    background: var(--gray-light); padding: 14px 18px;
    border-radius: 10px; font-size: 0.95rem;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.last-exam .time { color: var(--gray); font-size: 0.85rem; margin-left: auto; }

/* 孩子记录标签 */
.child-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.child-tab {
    background: white; border: 1px solid var(--border);
    padding: 10px 22px; border-radius: 8px; cursor: pointer;
    font-weight: 500; transition: all 0.2s; color: var(--dark);
}
.child-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.child-records { display: none; }
.child-records.active { display: block; }

/* ========== 考试单题页面 ========== */
.ees-exam-container {
    max-width: 800px;
    margin: 0 auto;
}
.exam-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; flex-wrap: wrap;
}
.exam-meta { display: flex; align-items: center; gap: 20px; }
#ees-timer {
    background: var(--primary); color: white;
    padding: 8px 20px; border-radius: 20px; font-weight: bold; font-size: 15px;
}
.ees-single-question {
    background: white; border-radius: var(--radius);
    padding: 35px; box-shadow: var(--shadow-lg);
    margin-bottom: 25px;
    border-left: 5px solid var(--primary);
}
.ees-single-question .q-title {
    font-size: 1.15rem; margin-bottom: 25px; line-height: 1.6;
}
.ees-single-question label {
    display: block; margin: 10px 0; padding: 12px 16px;
    border-radius: 8px; cursor: pointer; transition: background 0.15s;
    border: 1px solid var(--border);
}
.ees-single-question label:hover { background: var(--primary-light); border-color: var(--primary); }
.ees-single-question input[type="radio"],
.ees-single-question input[type="checkbox"] {
    margin-right: 10px; transform: scale(1.1);
}
.ees-input, .ees-single-question textarea, .ees-single-question input[type="text"] {
    width: 100%; padding: 14px 16px;
    border: 2px solid var(--border); border-radius: 8px;
    font-size: 15px; transition: border-color 0.2s; font-family: var(--font);
}
.ees-input:focus, .ees-single-question textarea:focus, .ees-single-question input[type="text"]:focus {
    border-color: var(--primary); outline: none;
}
.exam-nav {
    display: flex; justify-content: space-between; margin-top: 30px;
}

/* ========== 考试详情卡片（试卷风格） ========== */
.exam-detail-cards {
    display: flex; flex-direction: column; gap: 18px;
    margin: 25px 0;
}
.detail-card {
    background: white; border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
    border-left: 6px solid #ccc; transition: box-shadow 0.2s;
}
.detail-card:hover { box-shadow: var(--shadow-lg); }
.detail-card.correct { border-left-color: var(--success); background: #F0FFF4; }
.detail-card.wrong { border-left-color: var(--danger); background: #FFF5F5; }
.detail-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
}
.detail-num { font-weight: 700; font-size: 1.1rem; }
.detail-type {
    background: #EDF2F7; padding: 2px 12px; border-radius: 6px;
    font-size: 0.85rem; color: var(--gray-dark);
}
.detail-score {
    margin-left: auto; font-weight: 600; color: var(--primary);
}
.detail-title {
    font-size: 1rem; margin-bottom: 18px; line-height: 1.6;
}
.detail-answers {
    display: flex; gap: 40px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.answer-row { flex: 1; }
.answer-row strong { display: inline-block; margin-right: 6px; }
.detail-verdict {
    font-weight: 700; font-size: 0.95rem;
}
.detail-card.correct .detail-verdict { color: #16A34A; }
.detail-card.wrong .detail-verdict { color: #DC2626; }

/* ========== 消息提示 ========== */
.ees-alert {
    padding: 14px 20px; border-radius: 10px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px; font-weight: 500;
}
.ees-alert-success { background: #DCFCE7; color: #166534; }
.ees-alert-error   { background: #FEE2E2; color: #991B1B; }
.ees-alert-warning { background: #FEF3C7; color: #92400E; }
.ees-alert-info    { background: #DBEAFE; color: #1E40AF; }

/* 考试导航左右分区 */
.exam-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.nav-left {
    /* 左侧始终占位，即使按钮隐藏 */
    min-width: 120px;
}
.nav-right {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
/* 如果希望导航在长页面底部固定，可添加 sticky */
.exam-nav {
    position: sticky;
    bottom: 0;
    background: white;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
/* 题目头部样式 */
.q-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.q-num {
    font-weight: 700;
    font-size: 1.1rem;
}
.q-type-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.q-score {
    color: var(--gray);
    font-size: 0.9rem;
}
.q-title {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--dark);
}
.ees-menu .fas {
    font-weight: 900;
    width: 15px;
}
/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .ees-main-wrapper { flex-direction: column; }
    .ees-dashboard { flex-direction: column; }
    .ees-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .ees-content { padding: 20px; }
    .ees-panels { grid-template-columns: 1fr; }
    .ees-stats-grid { grid-template-columns: 1fr; }
    .children-grid { grid-template-columns: 1fr; }
    .exam-meta { flex-direction: column; align-items: flex-start; }
    .detail-answers { flex-direction: column; gap: 10px; }
}
/* 手机端专属样式：限制文字最多10个字，超出省略 */
@media (max-width: 768px) {
    .ees-header-logo a {
        /* 文字单行不换行 */
        white-space: nowrap;
        /* 超出隐藏 */
        overflow: hidden;
        /* 文字末尾显示省略号 ... */
        text-overflow: ellipsis;
        /* 控制宽度，刚好容纳10个中文汉字，按需微调 */
        max-width: 140px;
        font-size: 1.1rem;
    }
}