/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #f59e0b;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --danger-color: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

/* 导航栏 */
.navbar {
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

.nav-links a.active {
  background: var(--primary-color);
  color: white;
}

/* 移动端导航 */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  color: var(--text-color);
}

/* 主要内容区 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* 页面标题 */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 2rem;
}

/* 班级信息横幅 */
.class-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.class-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.class-slogan {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* 倒计时样式 */
.countdown-container {
  text-align: center;
}

.countdown-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.countdown-exam-name {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.countdown-item {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  min-width: 100px;
}

.countdown-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.countdown-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

.countdown-date {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* 考试时间信息 */
.exam-info {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.exam-info h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.exam-schedule {
  display: grid;
  gap: 0.75rem;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.schedule-date {
  color: var(--text-light);
}

/* 分数线表格 */
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.score-table th,
.score-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.score-table th {
  background: var(--bg-color);
  font-weight: 600;
  color: var(--text-color);
}

.score-table tr:hover {
  background: var(--bg-color);
}

.score-table .highlight {
  background: #fef3c7;
  font-weight: 600;
}

.score-diff {
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.score-up {
  color: var(--success-color);
}

.score-down {
  color: var(--danger-color);
}

/* 提示框 */
.notice-box {
  background: #fef3c7;
  border-left: 4px solid var(--secondary-color);
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

.notice-box p {
  color: #92400e;
  font-size: 0.95rem;
}

/* 目标墙（localStorage） */
.goal-wall {
  margin-top: 2rem;
}

.goal-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.goal-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.goal-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.goal-list {
  display: grid;
  gap: 1rem;
}

.goal-item {
  background: var(--bg-color);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

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

.goal-text {
  flex: 1;
}

.goal-date {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.goal-delete {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.goal-delete:hover {
  opacity: 1;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
  }

  .class-name {
    font-size: 1.75rem;
  }

  .class-slogan {
    font-size: 1rem;
  }

  .countdown-timer {
    gap: 0.75rem;
  }

  .countdown-item {
    padding: 1rem 1.25rem;
    min-width: 80px;
  }

  .countdown-number {
    font-size: 2rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  .score-table {
    font-size: 0.875rem;
  }

  .score-table th,
  .score-table td {
    padding: 0.75rem 0.5rem;
  }

  .goal-form {
    flex-direction: column;
  }

  .schedule-item {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem;
  }

  .class-banner {
    padding: 2rem 1rem;
  }

  .countdown-item {
    min-width: 70px;
    padding: 0.75rem 1rem;
  }

  .countdown-number {
    font-size: 1.75rem;
  }
}
