* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; }

/* 通用 */
.btn { padding: 8px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all .2s; }
.btn-primary { background: #1677ff; color: #fff; }
.btn-primary:hover { background: #0958d9; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #389e0d; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #d9363e; }
.btn-default { background: #fff; border: 1px solid #d9d9d9; color: #333; }
.btn-default:hover { border-color: #1677ff; color: #1677ff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 10px 32px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; outline: none; transition: border-color .2s; }
input:focus, select:focus, textarea:focus { border-color: #1677ff; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
th { background: #fafafa; font-weight: 600; color: #666; }
tr:hover { background: #f5f5f5; }
.card { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 20px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-easy { background: #f6ffed; color: #52c41a; }
.tag-medium { background: #fff7e6; color: #fa8c16; }
.tag-hard { background: #fff2f0; color: #ff4d4f; }
.tag-single { background: #e6f4ff; color: #1677ff; }
.tag-multiple { background: #f9f0ff; color: #722ed1; }
.tag-judge { background: #fffbe6; color: #faad14; }

/* 登录注册 */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-box { background: #fff; border-radius: 12px; padding: 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-box h1 { text-align: center; margin-bottom: 8px; font-size: 24px; color: #333; }
.auth-box .subtitle { text-align: center; color: #999; margin-bottom: 30px; font-size: 14px; }
.auth-box .form-group { margin-bottom: 16px; }
.auth-box label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.auth-box input { width: 100%; }
.auth-box .btn { width: 100%; margin-top: 8px; }
.auth-box .switch-link { text-align: center; margin-top: 16px; font-size: 14px; color: #1677ff; cursor: pointer; }
.auth-tip { background: #e6f4ff; border-radius: 6px; padding: 10px; font-size: 12px; color: #1677ff; margin-bottom: 20px; line-height: 1.6; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; padding: 0; position: fixed; height: 100vh; overflow-y: auto; z-index: 100; }
.sidebar .logo { padding: 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid #1f1f1f; text-align: center; }
.sidebar .menu-item { padding: 14px 24px; cursor: pointer; transition: all .2s; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.sidebar .menu-item:hover { background: #1f1f1f; }
.sidebar .menu-item.active { background: #1677ff; }
.sidebar .menu-icon { font-size: 16px; }
.sidebar .user-info { position: absolute; bottom: 0; width: 100%; padding: 16px 20px; border-top: 1px solid #1f1f1f; font-size: 13px; }
.sidebar .user-info .logout { color: #ff7875; cursor: pointer; margin-top: 8px; display: block; }
.main { flex: 1; margin-left: 220px; padding: 24px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h2 { font-size: 22px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .stat-label { color: #999; font-size: 13px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: bold; color: #1677ff; }
.stat-card .stat-value.pass { color: #52c41a; }
.stat-card .stat-value.fail { color: #ff4d4f; }

/* 模态框 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 600px; max-height: 85vh; overflow-y: auto; max-width: 90vw; }
.modal.wide { width: 800px; }
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal .form-group { margin-bottom: 16px; }
.modal label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; font-weight: 500; }
.modal input, .modal select, .modal textarea { width: 100%; }
.modal textarea { min-height: 80px; resize: vertical; }
.modal .option-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.modal .option-row input { flex: 1; }
.modal .modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* 考试答题 */
.exam-header { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; text-align: center; }
.exam-timer { font-size: 32px; font-weight: bold; color: #1677ff; }
.exam-timer.urgent { color: #ff4d4f; }
.question-block { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 16px; }
.question-block .q-num { font-weight: bold; color: #1677ff; margin-right: 8px; }
.question-block .q-type-tag { margin-left: 8px; }
.question-block .q-content { font-size: 16px; line-height: 1.8; margin: 12px 0; }
.question-block .option { padding: 10px 16px; border: 1px solid #e8e8e8; border-radius: 6px; margin-bottom: 8px; cursor: pointer; transition: all .2s; display: flex; align-items: center; gap: 10px; }
.question-block .option:hover { border-color: #1677ff; background: #f0f7ff; }
.question-block .option.selected { border-color: #1677ff; background: #e6f4ff; }
.question-block .option input { cursor: pointer; }
.exam-actions { position: sticky; bottom: 0; background: #fff; padding: 16px 24px; border-radius: 8px; box-shadow: 0 -2px 8px rgba(0,0,0,.1); display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }

.result-card { text-align: center; padding: 40px; }
.result-card .score-circle { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 36px; font-weight: bold; }
.result-card .score-circle.pass { background: #f6ffed; color: #52c41a; border: 4px solid #52c41a; }
.result-card .score-circle.fail { background: #fff2f0; color: #ff4d4f; border: 4px solid #ff4d4f; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; }
.badge-green { background: #f6ffed; color: #52c41a; }
.badge-blue { background: #e6f4ff; color: #1677ff; }
.badge-gray { background: #f5f5f5; color: #999; }
.badge-red { background: #fff2f0; color: #ff4d4f; }

.exam-card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.exam-card .info h3 { margin-bottom: 8px; }
.exam-card .info p { color: #999; font-size: 13px; margin-bottom: 4px; }
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .icon { font-size: 48px; margin-bottom: 16px; }
.flex-end { display: flex; justify-content: flex-end; gap: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.warn-box { background: #fffbe6; border: 1px solid #ffe58f; border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: #d48806; }

/* 答题卡侧边栏 */
.exam-layout { display: flex; gap: 20px; }
.exam-main { flex: 1; min-width: 0; }
.exam-sidebar { width: 240px; flex-shrink: 0; }
.answer-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); position: sticky; top: 24px; }
.answer-card h4 { margin-bottom: 16px; font-size: 16px; }
.answer-card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.ac-item { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; background: #f0f0f0; color: #999; transition: all .2s; }
.ac-item:hover { transform: scale(1.1); }
.ac-item.answered { background: #52c41a; color: #fff; }
.ac-item.marked { background: #fa8c16; color: #fff; }
.ac-item.current { box-shadow: 0 0 0 3px #1677ff; }
.ac-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #666; margin-bottom: 16px; }
.ac-legend span { display: flex; align-items: center; gap: 6px; }
.ac-dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.ac-dot.answered { background: #52c41a; }
.ac-dot.unanswered { background: #f0f0f0; }
.ac-dot.marked { background: #fa8c16; }
.mark-btn { padding: 2px 10px; font-size: 12px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; background: #fff; color: #666; transition: all .2s; }
.mark-btn.active { background: #fa8c16; color: #fff; border-color: #fa8c16; }

/* 答题回顾 */
.wrong-question { border-left: 4px solid #ff4d4f; }
.q-review-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.q-explanation { background: #fffbe6; border: 1px solid #ffe58f; border-radius: 6px; padding: 12px 16px; margin-top: 12px; font-size: 14px; color: #d48806; line-height: 1.6; }
.question-block .option.correct { border-color: #52c41a; background: #f6ffed; }
.question-block .option.wrong { border-color: #ff4d4f; background: #fff2f0; }
.q-review-answer { margin-top: 8px; font-size: 13px; color: #666; }

/* 导入面板 */
.import-tabs { display: flex; gap: 0; margin-bottom: 16px; }
.import-tab { padding: 8px 20px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; font-size: 14px; }
.import-tab:first-child { border-radius: 6px 0 0 6px; }
.import-tab:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.import-tab.active { background: #1677ff; color: #fff; border-color: #1677ff; }
.file-upload-area { border: 2px dashed #d9d9d9; border-radius: 8px; padding: 30px; text-align: center; cursor: pointer; transition: all .2s; }
.file-upload-area:hover { border-color: #1677ff; background: #f0f7ff; }
.file-upload-area input { display: none; }

/* 多选下拉组件（考试组卷规则用） */
.ms-container { position: relative; display: inline-block; min-width: 200px; }
.ms-trigger {
  background: #fff; border: 1px solid #d9d9d9; border-radius: 6px;
  padding: 6px 10px; font-size: 13px; cursor: pointer; display: flex;
  align-items: center; gap: 6px; width: 100%;
  min-height: 34px; transition: border-color .2s;
}
.ms-trigger:hover { border-color: #4096ff; }
.ms-trigger.open { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,0.1); }
.ms-text { flex: 1; text-align: left; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-placeholder { color: #bfbfbf; }
.ms-arrow { color: #999; font-size: 10px; transition: transform .2s; }
.ms-trigger.open .ms-arrow { transform: rotate(180deg); }
.ms-popup {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 1000;
  background: #fff; border: 1px solid #d9d9d9; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 260px;
  overflow-y: auto; min-width: 100%; padding: 4px 0;
  width: max-content; max-width: 360px;
}
.ms-item { display: flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.ms-item:hover { background: #f5f5f5; }
.ms-item input { margin: 0; flex-shrink: 0; }
.option-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 企业管理员标签 */
.tag-manager { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; border-radius: 4px; padding: 2px 8px; font-size: 12px; }

/* 考试分析统计卡片 */
.stat-card { background: #fff; border-radius: 8px; padding: 14px 20px; text-align: center; min-width: 100px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-num { font-size: 24px; font-weight: 700; color: #1677ff; }
.stat-label { font-size: 12px; color: #999; margin-top: 4px; }
