/* Renaissance风格统一样式 - 中文分级阅读平台 */

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft Yahei", Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f2f2f2;
  height: 100%;
}

/* ========== 学生端样式 ========== */

/* 学生端 - 极简顶部栏 */
.student-header {
  background: #555;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.student-header .logo {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-header .user-name {
  font-size: 16px;
}

/* 学生端 - 标题区 */
.student-page-title {
  background: #f2f2f2;
  padding: 25px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.student-page-title h1 {
  font-size: 28px;
  color: #333;
  margin: 0;
}

/* 学生端 - 内容区 */
.student-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* 学生端 - 区块标题 */
.student-section {
  margin-bottom: 30px;
}

.student-section h2 {
  font-size: 20px;
  color: #333;
  margin: 0 0 10px 0;
}

.student-section .heading-line {
  height: 2px;
  background: #c4c4c4;
  margin: 0 0 20px 0;
}

/* 学生端 - 功能卡片 */
.student-tile {
  background: white;
  border-radius: 8px;
  padding: 20px;
  border-bottom: 1px solid #c4c4c4;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 10px;
  text-decoration: none;
}

.student-tile:hover,
.student-tile:focus {
  background-color: #0000000a;
  outline: none;
}

.student-tile .tile-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  font-size: 30px;
  color: white;
}

.student-tile .tile-icon.blue {
  background: #3498db;
}

.student-tile .tile-icon.green {
  background: #27ae60;
}

.student-tile .tile-icon.orange {
  background: #e67e22;
}

.student-tile .tile-icon.purple {
  background: #9b59b6;
}

.student-tile .tile-content {
  flex: 1;
}

.student-tile .tile-title {
  font-size: 18px;
  color: #146eb3;
  font-weight: 500;
}

.student-tile .tile-description {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.student-tile .tile-arrow {
  color: #146eb3;
  font-size: 20px;
}

/* 学生端 - 进度卡片（无分数） */
.progress-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.progress-card h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.progress-card .progress-item {
  margin-bottom: 15px;
}

.progress-card .progress-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.progress-card .progress-bar-simple {
  background: #c4c4c4;
  height: 8px;
  border-radius: 4px;
  position: relative;
}

.progress-card .progress-bar-simple-fill {
  background: #27ae60;
  height: 100%;
  border-radius: 4px;
}

/* 学生端 - 测验页面 */
.quiz-header-bar {
  background: #555;
  padding: 15px 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.quiz-header-bar .quiz-title {
  font-size: 18px;
}

.quiz-header-bar button {
  background: #737373;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
}

.quiz-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.quiz-question {
  background: white;
  padding: 30px;
  border-radius: 8px;
}

.quiz-question-number {
  font-size: 14px;
  color: #737373;
  margin-bottom: 20px;
}

.quiz-question-text {
  font-size: 18px;
  color: #333;
  margin-bottom: 30px;
  line-height: 1.8;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.quiz-option {
  background: white;
  border: 1px solid #959595;
  padding: 15px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.quiz-option:hover {
  border-color: #146eb3;
}

.quiz-option.selected {
  background: #e3f1fc;
  border-color: #146eb3;
}

.quiz-option input[type="radio"] {
  opacity: 0;
  position: absolute;
}

.quiz-option .option-marker {
  width: 20px;
  height: 20px;
  border: 2px solid #959595;
  border-radius: 50%;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option.selected .option-marker {
  border-color: #146eb3;
  background: #146eb3;
}

.quiz-option.selected .option-marker::after {
  content: "";
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
}

.quiz-actions {
  margin-top: 30px;
  display: flex;
  gap: 10px;
}

.quiz-btn {
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  border: none;
}

.quiz-btn-primary {
  background: #146eb3;
  color: white;
}

.quiz-btn-primary:hover {
  background: #0d4977;
}

.quiz-btn-secondary {
  background: white;
  color: #146eb3;
  border: 2px solid #146eb3;
}

/* ========== 教师/管理端样式 ========== */

/* 教师/管理端 - 顶部导航 */
.top-nav {
  background-color: #2c3e50;
  color: white;
  padding: 15px 20px;
}

.top-nav .nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.top-nav .logo {
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav .nav-menu {
  display: flex;
  gap: 20px;
}

.top-nav .nav-menu a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.top-nav .nav-menu a:hover,
.top-nav .nav-menu a.active {
  background-color: #34495e;
}

.top-nav .user-info {
  font-size: 16px;
}

/* 教师/管理端 - 主内容区 */
.main-content {
  max-width: 1480px;
  margin: 20px auto;
  padding: 20px;
}

/* 教师/管理端 - 卡片 */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  color: #2c3e50;
  font-weight: bold;
}

.card-actions {
  display: flex;
  gap: 10px;
}

/* 教师/管理端 - 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-primary {
  background: #146eb3;
  color: white;
}

.btn-primary:hover {
  background: #0d4977;
}

.btn-secondary {
  background: white;
  color: #146eb3;
  border: 2px solid #146eb3;
}

.btn-secondary:hover {
  background: #e3f1fc;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-success:hover {
  background: #229954;
}

.btn-warning {
  background: #e67e22;
  color: white;
}

.btn-warning:hover {
  background: #d35400;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-large {
  padding: 12px 30px;
  font-size: 16px;
}

/* 教师/管理端 - 表格 */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background: #f8f9fa;
  font-weight: bold;
  color: #2c3e50;
}

.table tr:hover {
  background: #f8f9fa;
}

/* 教师/管理端 - 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #146eb3;
  outline: none;
}

.form-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 教师/管理端 - 状态标签 */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-normal {
  background: #d4edda;
  color: #155724;
}

.status-warning {
  background: #fff3cd;
  color: #856404;
}

.status-danger {
  background: #f8d7da;
  color: #721c24;
}

.status-info {
  background: #d1ecf1;
  color: #0c5460;
}

/* 教师/管理端 - 热力图 */
.heatmap-row-normal {
  background: rgba(39, 174, 96, 0.1);
}

.heatmap-row-warning {
  background: rgba(230, 126, 34, 0.1);
}

.heatmap-row-danger {
  background: rgba(231, 76, 60, 0.2);
}

/* 弹出层（Modal） */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.modal.show {
  display: block;
}

.modal-content {
  background: white;
  margin: 5% auto;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  background: #2c3e50;
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.modal-footer {
  padding: 15px 20px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* 进度条（详细版） */
.progress-bar {
  background: #ddd;
  width: 100%;
  height: 20px;
  border-radius: 10px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #333;
  font-weight: 500;
}

/* 徽章 */
.badge-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.badge-item {
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.badge-item:hover {
  transform: translateY(-3px);
}

.badge-item .badge-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.badge-item .badge-name {
  font-size: 14px;
  color: #2c3e50;
}

/* 搜索框 */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-box button {
  padding: 10px 20px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #737373;
}

.empty-state .empty-icon {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #146eb3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 底部导航栏 */
.bottom-nav {
  background-color: #2c3e50;
  color: white;
  padding: 15px 20px;
  margin-top: 20px;
}

.bottom-nav .nav-menu {
  display: flex;
  justify-content: space-around;
  max-width: 1200px;
  margin: 0 auto;
}

.bottom-nav .nav-menu a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.bottom-nav .nav-menu a:hover,
.bottom-nav .nav-menu a.active {
  background-color: #34495e;
}

/* 内容卡片网格 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.content-card {
  background: white;
  border: 1px solid #eee;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.content-card .cover-placeholder {
  height: 100px;
  background: #f5f5f5;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.content-card .title {
  font-weight: bold;
  font-size: 16px;
  color: #333;
}

.content-card .author {
  color: #666;
  font-size: 14px;
}

.content-card .level-badge {
  margin-top: 10px;
}

.content-card .level-badge span {
  background: #3498db;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .student-header,
  .top-nav .nav-content {
    padding: 10px 15px;
  }
  
  .student-page-title,
  .student-content,
  .quiz-content,
  .main-content {
    padding: 15px;
  }
  
  .student-tile .tile-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .student-tile .tile-title {
    font-size: 16px;
  }
  
  .top-nav .nav-menu {
    flex-direction: column;
    gap: 10px;
  }
  
  .quiz-header-bar {
    padding: 10px 15px;
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-content {
    margin: 10% auto;
    max-width: 90%;
  }
  
  .table th,
  .table td {
    padding: 8px;
    font-size: 14px;
  }
}