/* ============================================
   扁平化学情系统 - 全局样式
   配色：教育蓝 #4A90D9 / 白 #FFFFFF / 灰 #F5F7FA
   ============================================ */

* { 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;
  min-height: 100vh;
}

a { text-decoration: none; color: #4A90D9; }
a:hover { color: #357ABD; }

/* ===== 通用容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f2f5;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary { background: #4A90D9; color: #fff; }
.btn-primary:hover { background: #357ABD; }

.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #45a818; }

.btn-warning { background: #faad14; color: #fff; }
.btn-warning:hover { background: #d99a0e; }

.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #d9363e; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 36px; font-size: 17px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border 0.2s;
  outline: none;
}
.form-input:focus { border-color: #4A90D9; box-shadow: 0 0 0 3px rgba(74,144,217,0.1); }
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.form-select:focus { border-color: #4A90D9; }

/* ===== 导航栏 ===== */
.navbar {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: #4A90D9;
}
.navbar-nav { display: flex; gap: 8px; align-items: center; }
.navbar-nav a {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: #555;
  transition: all 0.2s;
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: #e8f0fe;
  color: #4A90D9;
}
.navbar-user {
  font-size: 14px;
  color: #888;
  margin-left: 12px;
}
.logout-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 6px 14px;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  font-size: 13px;
}
.logout-btn:hover { border-color: #ff4d4f; color: #ff4d4f; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.tag-green { background: #e8f8e8; color: #389e0d; }
.tag-yellow { background: #fff7e6; color: #d48806; }
.tag-red { background: #fff1f0; color: #cf1322; }
.tag-gray { background: #f0f0f0; color: #999; }
.tag-star { background: #fffbe6; color: #faad14; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
th {
  background: #fafafa;
  font-weight: 600;
  color: #555;
}
tr:hover td { background: #fafafa; }

/* ===== 消息 ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-success { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.alert-error { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.alert-info { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }

/* ===== 加载 ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}
.loading::before {
  content: '';
  display: inline-block;
  width: 24px; height: 24px;
  border: 2px solid #e0e0e0;
  border-top-color: #4A90D9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 页面头部 ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header .subtitle { font-size: 14px; color: #888; margin-top: 4px; }

/* ===== 打印 ===== */
@media print {
  .navbar, .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}

/* ===== 客厅（教室）座位 ===== */
.classroom {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.platform {
  text-align: center;
  padding: 14px 0;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #e8f0fe, #d6e4ff);
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #4A90D9;
  letter-spacing: 4px;
}
.seat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}
.seat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.seat.green { background: #f0fff0; border-color: #b7eb8f; }
.seat.yellow { background: #fffbe6; border-color: #ffe58f; }
.seat.red { background: #fff1f0; border-color: #ffa39e; }
.seat.gray { background: #fafafa; border-color: #e8e8e8; }
.seat-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 6px;
}
.seat-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  text-align: center;
}
.seat-label {
  font-size: 11px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}
.seat-label.green { background: #b7eb8f; color: #135200; }
.seat-label.yellow { background: #ffe58f; color: #874d00; }
.seat-label.red { background: #ffa39e; color: #820014; }
.seat-label.gray { background: #e8e8e8; color: #999; }

/* ===== 答题详情 ===== */
.answer-item {
  padding: 16px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  margin-bottom: 12px;
}
.answer-item.correct { border-left: 4px solid #52c41a; }
.answer-item.wrong { border-left: 4px solid #ff4d4f; }
.answer-q { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.answer-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}
.answer-student {
  font-size: 14px;
  margin: 8px 0;
}
.answer-student span {
  color: #555;
  font-weight: 500;
}
.answer-result {
  font-size: 14px;
  font-weight: 500;
}
.answer-result .correct-text { color: #52c41a; }
.answer-result .wrong-text { color: #ff4d4f; }

/* ===== 图表容器 ===== */
.chart-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== 星级 ===== */
.stars {
  color: #faad14;
  font-size: 20px;
  letter-spacing: 2px;
}
.stars .empty { color: #e8e8e8; }

/* ===== 统计概览 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stat-card .num { font-size: 32px; font-weight: 700; color: #4A90D9; }
.stat-card .label { font-size: 14px; color: #888; margin-top: 4px; }

/* ===== 提交页面 ===== */
.submit-area {
  background: #fafafa;
  border: 2px dashed #d9d9d9;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
}
.submit-area.dragover { border-color: #4A90D9; background: #e8f0fe; }
.submit-area textarea {
  width: 100%;
  min-height: 300px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  resize: vertical;
  outline: none;
}
.submit-area textarea:focus { border-color: #4A90D9; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .container { padding: 12px; }
  .seat-grid { gap: 8px; }
  .seat { padding: 8px 4px; }
  .seat-avatar { width: 36px; height: 36px; font-size: 16px; }
  .seat-name { font-size: 12px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .navbar { flex-wrap: wrap; height: auto; padding: 10px 12px; }
  .navbar-nav { flex-wrap: wrap; }
}