:root {
  --bg: #f7f3e8;
  --card: #fffdf8;
  --ink: #2b2f33;
  --muted: #5f6a75;
  --accent: #247f94;
  --accent-2: #d48942;
  --accent-3: #f3e1bc;
  --ok: #1f8a4c;
  --warn: #d94841;
  --line: #d7cfbf;
  --shadow: 0 18px 40px rgba(33, 33, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, #f7d98f 0, transparent 28%),
    radial-gradient(circle at 88% 85%, #b8e3db 0, transparent 33%),
    linear-gradient(170deg, #f8f5ed 0%, #f5efe0 48%, #eff7f4 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  padding: 24px;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  filter: blur(2px);
  opacity: 0.55;
}

.bg-shape-a {
  width: 240px;
  height: 240px;
  border-radius: 40% 60% 55% 45%;
  background: #ffd36e;
  top: -60px;
  right: 4vw;
  animation: sway 9s ease-in-out infinite;
}

.bg-shape-b {
  width: 190px;
  height: 190px;
  border-radius: 58% 42% 36% 64%;
  background: #98d8ce;
  left: -50px;
  bottom: 8vh;
  animation: sway 10s ease-in-out infinite reverse;
}

.hidden {
  display: none !important;
}

.entry-shell,
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
}

.entry-kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.entry-title {
  margin: 8px 0 14px;
  text-align: center;
  font-size: clamp(2rem, 4vw, 3.4rem);
  color: #6a4b2f;
  letter-spacing: 1px;
}

.entry-card {
  background: color-mix(in srgb, var(--card) 88%, #fff 12%);
  border: 2px solid var(--line);
  border-radius: 34px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.entry-grid-box {
  border: 2px solid #cbbca2;
  border-radius: 30px;
  padding: 12px;
  background: #fcf8f1;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.student-chip {
  border: 3px solid #b9946d;
  border-radius: 16px;
  background: #f6f0e8;
  color: #7f5a35;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.student-chip:hover {
  transform: translateY(-1px);
  background: #fff9ef;
}

.student-chip.active {
  background: linear-gradient(120deg, #247f94 0%, #2ba7c2 100%);
  border-color: #1b6676;
  color: #fff;
}

.entry-login-box {
  margin-top: 12px;
  border: 2px solid #d4c5aa;
  border-radius: 28px;
  background: #f7f2e9;
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 10px;
}

#loginHint {
  margin: 0 0 8px;
  text-align: center;
  color: #35597a;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 800;
}

.entry-login-btn {
  cursor: pointer;
  border: none;
  border-radius: 22px;
  min-width: 180px;
  height: 54px;
  background: linear-gradient(135deg, var(--accent-2) 0%, #c4722f 100%);
  color: #fff;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  font-weight: 700;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.entry-login-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.hero,
.container,
.footer,
.teacher-hero,
.teacher-grid {
  max-width: 1080px;
  margin: 0 auto;
}

.hero,
.teacher-hero {
  background: color-mix(in srgb, var(--card) 88%, #fff 12%);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.whoami {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #c7d9df;
  background: #eef8fb;
  color: #14586b;
  font-weight: 700;
}

.hero-kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero h2,
.teacher-hero h2 {
  margin: 8px 0;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
}

.progress-wrap {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.progress-track {
  height: 12px;
  background: #ece9e0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #247f94 0%, #5ec7d1 100%);
  border-radius: inherit;
  transition: width 0.45s ease;
}

.container {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.task-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-btn {
  cursor: pointer;
  border: 1px solid #c7d9df;
  background: #f4fafb;
  color: #1d5f71;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  transition: transform 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
}

.task-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.task-btn.active {
  background: linear-gradient(135deg, #247f94 0%, #2f9bb0 100%);
  color: #fff;
  border-color: #247f94;
}

.task-panel {
  margin-top: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card h3 {
  margin: 0;
  font-size: clamp(1.12rem, 2.2vw, 1.5rem);
}

.card h4 {
  margin: 0 0 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 12px;
  background: color-mix(in srgb, var(--accent-3) 70%, #fff 30%);
  color: #725419;
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  min-width: 620px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

th {
  background: #f2f8f6;
}

.qa-grid {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.question legend {
  padding: 0 4px;
  font-weight: 700;
}

.question label,
.block-label {
  display: block;
  margin-top: 8px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfc9bc;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 127, 148, 0.14);
}

.inline-form {
  margin-top: 8px;
}

.inline-form label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form input,
.inline-form select {
  width: 190px;
}

.hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #efdfb6;
  color: #7e5d22;
}

.season-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.season-card {
  border: 1px dashed #c7bda8;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.action-btn,
.ghost-btn {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.action-btn {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #2f9bb0 100%);
  color: #fff;
}

.ghost-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.action-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.feedback {
  min-height: 24px;
  margin: 8px 0 0;
  font-weight: 700;
}

.feedback.ok {
  color: var(--ok);
}

.feedback.warn {
  color: var(--warn);
}

.mini-input {
  min-width: 78px;
  padding: 8px;
  text-align: center;
}

.footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.teacher-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.teacher-tip {
  background: linear-gradient(130deg, #f9f6ee 0%, #f0f8f9 100%);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.62s ease forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(6deg); }
}

@media (max-width: 960px) {
  .student-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .task-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-grid,
  .two-col,
  .season-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 14px;
  }

  .entry-title {
    font-size: 2rem;
  }

  .entry-card,
  .hero,
  .teacher-hero,
  .card {
    border-radius: 18px;
    padding: 14px;
  }

  .student-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .student-chip {
    min-height: 42px;
    font-size: 1rem;
  }

  .entry-login-btn {
    width: 100%;
    min-width: 0;
    height: 62px;
    font-size: 2rem;
  }

  .task-switcher {
    grid-template-columns: 1fr;
  }

  .top-line,
  .card-head,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-form input,
  .inline-form select {
    width: 100%;
  }
}
