:root {
  --green: #0bb072;
  --green-dark: #08704b;
  --green-soft: #e9f8f1;
  --blue: #2d8cff;
  --orange: #ffb15c;
  --rose: #f96f8f;
  --bg: #f3f7f5;
  --card: #ffffff;
  --text: #12302a;
  --muted: #6a7b76;
  --line: #dce8e3;
  --shadow: 0 18px 48px rgba(19, 55, 45, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 4%, rgba(45, 140, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #eef9f4 0%, var(--bg) 380px);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

.hidden {
  display: none !important;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(115deg, rgba(6, 112, 75, 0.92), rgba(8, 139, 92, 0.86)),
    url("/static/base-images/datong-melon-2.jpeg") center/cover;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.login-brand {
  color: var(--green-dark);
  font-weight: 950;
}

.login-card h1 {
  margin-top: 10px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.7;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 18px 0;
  padding: 5px;
  border-radius: 8px;
  background: #f3f8f5;
}

.auth-tab {
  border: 0;
  border-radius: 6px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.auth-tab.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 8px 24px rgba(19, 55, 45, 0.08);
}

.login-form,
.register-fields {
  display: grid;
  gap: 13px;
}

.register-fields {
  display: none;
}

.register-fields.show {
  display: grid;
}

.site-shell {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: linear-gradient(180deg, #09b976 0%, #078b5c 58%, #076744 100%);
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 4px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 22px;
  font-weight: 900;
}

.brand-kicker,
.brand-sub {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.brand-title {
  margin: 4px 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(0, 94, 56, 0.34);
  color: #fff;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar-left,
.identity-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.base-switch {
  min-width: 230px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
}

.base-switch select {
  margin-top: 6px;
}

.eyebrow {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-size: 30px;
  letter-spacing: 0;
}

.student-chip {
  min-width: 220px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.student-chip span,
.student-chip small {
  display: block;
}

.student-chip span {
  font-weight: 900;
}

.student-chip small {
  margin-top: 4px;
  color: var(--muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero,
.admin-hero {
  position: relative;
  display: grid;
  gap: 22px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(6, 112, 75, 0.96), rgba(13, 175, 111, 0.9)),
    url("/static/base-images/datong-melon-2.jpeg") center/cover;
  box-shadow: var(--shadow);
}

.hero {
  grid-template-columns: minmax(0, 1.3fr) 380px;
  min-height: 350px;
  padding: 34px;
}

.admin-hero {
  padding: 28px;
}

.hero-copy span,
.admin-hero span {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.hero h2,
.admin-hero h2 {
  max-width: 780px;
  margin: 12px 0 0;
  font-size: 36px;
  line-height: 1.18;
}

.hero p,
.admin-hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary,
.secondary,
.ghost,
.link-btn,
.mini,
.pill {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.primary {
  padding: 12px 20px;
  background: var(--green);
  color: #fff;
}

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

.secondary {
  padding: 11px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-dark);
}

.secondary:hover {
  background: var(--green-soft);
}

.ghost {
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hero-panel {
  align-self: stretch;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.panel-title {
  margin-bottom: 12px;
  font-weight: 900;
}

.featured-base strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
}

.featured-base p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.base-thumb {
  min-height: 150px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2) center/cover;
}

.tag-row,
.base-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span,
.base-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.stat,
.card,
.base-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat {
  padding: 20px;
}

.stat span {
  display: block;
  color: var(--green-dark);
  font-size: 34px;
  font-weight: 950;
}

.stat label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.stats.color .stat:nth-child(2) span {
  color: var(--blue);
}

.stats.color .stat:nth-child(3) span {
  color: var(--orange);
}

.stats.color .stat:nth-child(4) span {
  color: var(--rose);
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.card {
  padding: 20px;
}

.mt {
  margin-top: 18px;
}

.card-head,
.base-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.action-row,
.resource-actions,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.location-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
}

.location-status {
  color: var(--muted);
  line-height: 1.55;
}

.card-title {
  font-size: 20px;
  font-weight: 950;
}

.card-head p,
.hint {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.link-btn {
  padding: 8px 12px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.section-title {
  margin-bottom: 18px;
}

.section-title span {
  color: var(--green-dark);
  font-weight: 900;
}

.section-title h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

.base-list {
  display: grid;
  gap: 18px;
}

.base-card {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
}

.base-image {
  min-height: 245px;
  border-radius: 8px;
  background: var(--green-soft) center/cover;
}

.base-card h3 {
  margin: 0;
  font-size: 24px;
}

.base-card-top p,
.base-intro,
.achievement {
  color: var(--muted);
  line-height: 1.75;
}

.pill {
  padding: 8px 12px;
  background: #eff8ff;
  color: #126ab7;
  white-space: nowrap;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.info-grid div {
  padding: 12px;
  border-radius: 8px;
  background: #f7fbf9;
}

.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-grid strong {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

label,
.block-label {
  display: grid;
  gap: 7px;
  color: #33544c;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fbfdfc;
  color: var(--text);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(11, 176, 114, 0.12);
}

.block-label,
.file-box,
.card .primary {
  margin-top: 14px;
}

.file-box {
  display: block;
  padding: 16px;
  border: 1px dashed rgba(8, 112, 75, 0.42);
  border-radius: 8px;
  background: #f7fbf9;
  color: var(--green-dark);
  cursor: pointer;
}

.file-box input {
  height: auto;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.timeline,
.table-lite,
.teacher-list,
.resource-grid {
  display: grid;
  gap: 12px;
}

.resource-grid.compact {
  grid-template-columns: 1fr;
}

.timeline-item,
.teacher-card,
.resource-card,
.empty {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.timeline-item span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.timeline-item strong,
.resource-card strong {
  display: block;
  margin-top: 5px;
}

.timeline-item p,
.resource-card p,
.teacher-card p,
.teacher-card span {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.teacher-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 950;
}

.resource-card {
  position: relative;
}

.resource-icon {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.resource-card a {
  color: var(--green-dark);
  font-weight: 900;
  text-decoration: none;
}

.share-card {
  max-width: 520px;
}

.poster-wrap {
  display: grid;
  place-items: center;
  margin: 16px 0;
}

.share-poster {
  width: min(100%, 360px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7fbf9;
  box-shadow: var(--shadow);
}

.share-link-label {
  margin-top: 10px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.search {
  max-width: 260px;
}

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

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

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

th {
  background: #f7fbf9;
  color: #49645d;
  font-size: 13px;
  font-weight: 900;
}

td {
  color: #274039;
  font-size: 14px;
}

.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status.pending {
  background: #fff7e8;
  color: #b86a00;
}

.status.good {
  background: #fff0f4;
  color: #cf2f58;
}

.status.ok {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status.bad {
  background: #fff1ef;
  color: #c43b2b;
}

.mini {
  padding: 7px 10px;
  background: #e8f4ff;
  color: #126ab7;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(10, 26, 22, 0.46);
}

.modal.show {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f3;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.review-meta {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f7fbf9;
}

.review-meta span,
.review-body p {
  color: var(--muted);
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  max-width: 520px;
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(13, 37, 31, 0.96);
  color: #fff;
  opacity: 0;
  transform: translateX(-50%) translateY(18px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .site-shell,
  .hero,
  .grid.two,
  .base-card,
  .info-grid,
  .form-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-left,
  .identity-box,
  .location-tools,
  .share-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero h2,
  .admin-hero h2 {
    font-size: 30px;
  }
}
