:root {
  --paper: #f5f1e8;
  --paper-deep: #ece6d9;
  --card: #fffdf8;
  --ink: #20332b;
  --ink-soft: #5f6d66;
  --ink-faint: #89928d;
  --green: #2f7d61;
  --green-deep: #214f3e;
  --green-soft: #dfece5;
  --orange: #d9814e;
  --orange-soft: #f5e4d7;
  --blue: #5078a8;
  --blue-soft: #e2e9f2;
  --line: #ded8cc;
  --line-soft: #ece7dc;
  --danger: #b64f4f;
  --danger-soft: #faeaea;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-sm: 0 8px 26px rgba(42, 55, 48, 0.06);
  --shadow-md: 0 22px 70px rgba(42, 55, 48, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}

.page-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(217, 129, 78, 0.16), transparent 24rem),
    radial-gradient(circle at 87% 31%, rgba(47, 125, 97, 0.11), transparent 30rem),
    repeating-linear-gradient(108deg, rgba(52, 66, 58, 0.018) 0 1px, transparent 1px 7px);
}

.public-page.is-locked {
  overflow: hidden;
}

.public-page.is-locked > .site-header,
.public-page.is-locked > main,
.public-page.is-locked > .site-footer {
  visibility: hidden;
}

.site-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  overflow: auto;
  padding: 34px 20px;
  background:
    radial-gradient(circle at 14% 17%, rgba(217, 129, 78, 0.21), transparent 23rem),
    radial-gradient(circle at 84% 82%, rgba(47, 125, 97, 0.16), transparent 28rem),
    repeating-linear-gradient(108deg, rgba(52, 66, 58, 0.018) 0 1px, transparent 1px 7px),
    var(--paper);
  place-items: center;
}

.gate-card {
  position: relative;
  z-index: 2;
  width: min(100%, 450px);
  padding: 40px 42px 33px;
  text-align: center;
  background: rgba(255, 253, 248, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 90px rgba(42, 55, 48, 0.13);
  backdrop-filter: blur(16px);
}

.gate-brand-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 25px;
  border-radius: 14px 14px 14px 4px;
}

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

.gate-card .eyebrow {
  justify-content: center;
  margin-bottom: 16px;
}

.gate-card h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.035em;
}

.gate-description {
  max-width: 330px;
  margin: 14px auto 28px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.gate-form {
  text-align: left;
}

.gate-form .field > span {
  color: var(--ink);
}

.gate-form input {
  height: 48px;
  text-align: center;
  letter-spacing: 0.08em;
}

.gate-submit {
  width: 100%;
  height: 46px;
  margin-top: 13px;
  justify-content: space-between;
}

.gate-submit svg {
  width: 18px;
}

.gate-footnote {
  display: flex;
  margin: 27px 0 0;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink-faint);
  font-size: 10px;
}

.gate-footnote i {
  width: 16px;
  height: 1px;
  background: var(--line);
}

.gate-ornament {
  position: absolute;
  width: 260px;
  height: 260px;
  pointer-events: none;
  border: 1px solid rgba(47, 125, 97, 0.12);
  border-radius: 50%;
}

.gate-ornament::before,
.gate-ornament::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.gate-ornament::before {
  inset: 45px;
  border: 1px solid rgba(47, 125, 97, 0.11);
}

.gate-ornament::after {
  top: 24px;
  right: 35px;
  width: 10px;
  height: 10px;
  background: var(--orange);
}

.gate-ornament-left {
  top: -110px;
  left: -95px;
}

.gate-ornament-right {
  right: -65px;
  bottom: -105px;
  width: 310px;
  height: 310px;
  border-color: rgba(217, 129, 78, 0.14);
}

.gate-ornament-right::after {
  background: var(--green);
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1280px, calc(100% - 64px));
  height: 86px;
  margin-inline: auto;
}

.brand,
.login-brand,
.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: inline-grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--card);
  background: var(--green-deep);
  border-radius: 11px 11px 11px 3px;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  color: var(--ink-soft);
  font-size: 14px;
}

.site-nav > a:not(.admin-entry) {
  position: relative;
  padding: 8px 0;
}

.site-nav > a:not(.admin-entry)::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.site-nav > a:not(.admin-entry):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.admin-entry {
  display: grid;
  width: 36px;
  height: 36px;
  margin-left: 4px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.admin-entry:hover {
  color: var(--green);
  background: rgba(255, 253, 248, 0.7);
  border-color: var(--green);
}

.admin-entry svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px 330px;
  gap: 38px;
  align-items: center;
  min-height: 550px;
  padding-top: 44px;
  padding-bottom: 90px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.21em;
}

.eyebrow > span {
  width: 26px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  max-width: 630px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 4.5vw, 58px);
  font-weight: 600;
  line-height: 1.31;
  letter-spacing: -0.055em;
}

.nowrap {
  white-space: nowrap;
}

.ink-accent {
  position: relative;
  color: var(--green-deep);
  white-space: nowrap;
}

.ink-accent::after {
  position: absolute;
  right: 2px;
  bottom: -2px;
  left: 2px;
  height: 8px;
  content: "";
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c38-6 78-7 196-3' fill='none' stroke='%23d9814e' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
  opacity: 0.72;
}

.hero-subtitle {
  max-width: 500px;
  margin: 25px 0 31px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 7px;
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(33, 79, 62, 0.35);
}

.text-link svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.text-link:hover svg {
  transform: translateX(4px);
}

.hero-visual {
  position: relative;
  width: 330px;
  height: 390px;
}

.sun-disc {
  position: absolute;
  top: 27px;
  left: 33px;
  width: 256px;
  height: 256px;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 248, 230, 0.85), transparent 21%),
    linear-gradient(145deg, #efbc82, #dd8d58);
  border-radius: 52% 48% 53% 47% / 46% 43% 57% 54%;
  box-shadow: inset 0 0 45px rgba(147, 73, 33, 0.12);
  animation: float 8s ease-in-out infinite;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(47, 125, 97, 0.38);
  border-radius: 50%;
}

.orbit::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--green);
  border-radius: 50%;
}

.orbit-one {
  top: 8px;
  left: 10px;
  width: 300px;
  height: 300px;
  transform: rotate(-24deg);
}

.orbit-one::after {
  top: 62px;
  right: 34px;
}

.orbit-two {
  top: 67px;
  left: 63px;
  width: 187px;
  height: 187px;
  border-color: rgba(255, 253, 248, 0.43);
}

.orbit-two::after {
  right: 11px;
  bottom: 37px;
  width: 5px;
  height: 5px;
  background: var(--card);
}

.leaf {
  position: absolute;
  width: 58px;
  height: 98px;
  background: var(--green);
  border-radius: 100% 0 100% 0;
  box-shadow: inset 8px 0 20px rgba(255, 255, 255, 0.08);
}

.leaf::after {
  position: absolute;
  top: 10px;
  left: 26px;
  width: 1px;
  height: 76px;
  content: "";
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(13deg);
}

.leaf-one {
  right: -2px;
  bottom: 12px;
  transform: rotate(24deg);
}

.leaf-two {
  right: 42px;
  bottom: -13px;
  width: 42px;
  height: 76px;
  background: #4e9278;
  transform: rotate(61deg);
}

.hero-note {
  position: absolute;
  right: -23px;
  bottom: 84px;
  display: flex;
  width: 152px;
  min-height: 96px;
  padding: 18px 20px;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 17px 40px rgba(46, 48, 39, 0.12);
  transform: rotate(3deg);
}

.hero-note::before {
  position: absolute;
  top: -7px;
  left: 55px;
  width: 38px;
  height: 14px;
  content: "";
  background: rgba(217, 195, 156, 0.72);
  transform: rotate(-2deg);
}

.hero-note span {
 margin-bottom: 5px;
  color: var(--orange);
  font-family: var(--serif);
  font-size: 12px;
}

.hero-note strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
}

.hero-note i {
  width: 29px;
  height: 1px;
  margin-top: 12px;
  background: var(--orange);
}

.doodle-star {
  position: absolute;
  color: var(--orange);
}

.star-one {
  top: 49px;
  right: 10px;
  font-size: 24px;
}

.star-two {
  bottom: 78px;
  left: 6px;
  color: var(--green);
  font-size: 18px;
}

.hero-latest {
  position: relative;
  min-height: 270px;
  padding: 28px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.hero-latest::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 88px;
  height: 88px;
  content: "";
  background: var(--green-soft);
  border-radius: 0 0 0 100%;
  opacity: 0.8;
}

.hero-latest::after {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 24px;
  height: 24px;
  content: "✦";
  color: var(--green);
  font-size: 19px;
}

.latest-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.07em;
}

.latest-top time {
  font-variant-numeric: tabular-nums;
}

.latest-label {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-latest h2 {
  position: relative;
  z-index: 1;
  min-height: 58px;
  margin: 0 0 25px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.45;
}

.latest-score-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.latest-score-row > i {
  background: var(--line-soft);
}

.latest-score-row div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.latest-score-row span {
  color: var(--ink-faint);
  font-size: 11px;
}

.latest-score-row strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.latest-participants {
  margin: 17px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.hero-latest > p:not(.latest-participants) {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.latest-link {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.latest-link span {
  transition: transform 180ms ease;
}

.latest-link:hover span {
  transform: translateX(3px);
}

.skeleton-line {
  width: 86%;
  height: 12px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #ece7dd 25%, #f6f2ea 48%, #ece7dd 72%);
  background-size: 200% 100%;
  border-radius: 3px;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-short {
  width: 42%;
}

.skeleton-title {
  width: 72%;
  height: 24px;
  margin-top: 33px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: -47px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.91);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.stat-card {
  display: flex;
  min-height: 104px;
  padding: 24px 34px;
  align-items: center;
  gap: 17px;
}

.stat-card + .stat-card {
  border-left: 1px solid var(--line-soft);
}

.stat-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
}

.stat-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.leaf-icon {
  color: var(--green);
  background: var(--green-soft);
}

.book-icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.rank-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-card > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 8px;
}

.stat-card div > span {
  width: 100%;
  color: var(--ink-faint);
  font-size: 12px;
}

.stat-card strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-card small {
  color: var(--ink-soft);
  font-size: 12px;
}

.section {
  padding-top: 112px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 36px;
}

.section-heading .eyebrow {
  margin-bottom: 13px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.section-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.select-wrap {
  display: flex;
  min-width: 170px;
  height: 43px;
  align-items: center;
  padding: 0 13px 0 16px;
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid var(--line);
}

.select-wrap span {
  margin-right: 8px;
  color: var(--ink-faint);
  font-size: 12px;
  white-space: nowrap;
}

.select-wrap select {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  appearance: none;
}

.select-wrap svg {
  width: 16px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

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

.chart-card {
  min-width: 0;
  padding: 26px 26px 15px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}

.chart-kicker {
  color: var(--orange);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.chart-card h3 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.chart-current {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
}

.chart-current strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-current span {
  color: var(--ink-faint);
  font-size: 10px;
}

.chart-wrap {
  width: 100%;
  min-height: 250px;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: #ebe7de;
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.chart-axis-label,
.chart-date-label {
  fill: #9aa19d;
  font-family: var(--sans);
  font-size: 10px;
}

.chart-line-shadow {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.chart-dot {
  fill: var(--card);
  stroke: var(--green);
  stroke-width: 2.4;
  transition: r 150ms ease;
}

.chart-point-hit {
  fill: transparent;
}

.chart-point:hover .chart-dot {
  r: 6px;
}

.chart-empty {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
}

.chart-empty span {
  margin-bottom: 10px;
  color: var(--orange);
  font-size: 26px;
}

.chart-empty p {
  margin: 0;
  font-size: 12px;
}

.records-section {
  padding-bottom: 100px;
}

.record-count {
  padding: 8px 14px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.65);
  border: 1px solid var(--line);
  border-radius: 30px;
  font-size: 11px;
}

.exam-list {
  position: relative;
}

.exam-list::before {
  position: absolute;
  top: 18px;
  bottom: 35px;
  left: 13px;
  width: 1px;
  content: "";
  background: linear-gradient(var(--line), var(--line) 90%, transparent);
}

.exam-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  margin-bottom: 18px;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  padding-top: 31px;
}

.timeline-marker span {
  display: block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  background: var(--paper);
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--paper);
}

.timeline-marker b {
  position: absolute;
  top: 51px;
  left: -6px;
  width: 39px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.exam-card-main {
  min-width: 0;
  padding: 28px 30px;
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.exam-card-main:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.exam-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.exam-card-head time {
  display: block;
  margin-bottom: 7px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.exam-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.exam-overview {
  display: flex;
  align-items: stretch;
  gap: 25px;
}

.exam-overview div {
  position: relative;
  display: flex;
  min-width: 82px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.exam-overview div + div {
  padding-left: 25px;
  border-left: 1px solid var(--line-soft);
}

.exam-overview span {
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 10px;
}

.exam-overview strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
}

.exam-overview small {
  color: var(--ink-faint);
  font-size: 9px;
}

.subject-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 1px;
  margin-top: 3px;
  background: var(--line-soft);
}

.subject-result {
  display: grid;
  min-width: 0;
  padding: 17px 16px;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: var(--card);
}

.subject-name {
  display: flex;
  overflow: hidden;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.subject-name i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--subject-color);
  border-radius: 50%;
}

.subject-result > strong {
  grid-row: span 2;
  margin-left: 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.subject-result strong small {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

.subject-rank {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.exam-note {
  margin: 18px 3px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.8;
}

.no-subject-results {
  margin: 18px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.loading-card,
.empty-records {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.6);
  border: 1px dashed var(--line);
  font-size: 13px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  margin-bottom: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.empty-records h3 {
  margin: 18px 0 6px;
  font-family: var(--serif);
  font-size: 22px;
}

.empty-records p {
  margin: 0 0 22px;
  color: var(--ink-faint);
}

.empty-illustration {
  position: relative;
  width: 74px;
  height: 58px;
}

.empty-illustration span {
  position: absolute;
  inset: 12px 8px 5px 8px;
  border: 1px solid var(--green);
  transform: rotate(-5deg);
}

.empty-illustration i {
  position: absolute;
  top: 11px;
  bottom: 6px;
  left: 36px;
  width: 1px;
  background: var(--green);
}

.empty-illustration b {
  position: absolute;
  top: -8px;
  right: -2px;
  color: var(--orange);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.primary-button {
  color: #fffdf8;
  background: var(--green-deep);
}

.primary-button:hover {
  background: #173e2f;
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  color: var(--green-deep);
  background: transparent;
  border-color: rgba(33, 79, 62, 0.27);
}

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

.ghost-button {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
}

.ghost-button:hover {
  color: var(--ink);
  background: var(--paper);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.danger-button:hover {
  background: #983f3f;
}

.site-footer {
  display: flex;
  min-height: 115px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer .brand-mark {
  width: 25px;
  height: 25px;
  border-radius: 8px 8px 8px 2px;
}

.site-footer .brand-mark svg {
  width: 16px;
}

.error-banner {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 17px;
  color: #fff;
  background: #8d4444;
  box-shadow: var(--shadow-md);
  font-size: 12px;
}

.error-banner button {
  padding: 4px 0;
  color: #fff;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.reveal {
  animation: reveal 700ms cubic-bezier(0.22, 0.7, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
}

.delay-1 {
  animation-delay: 100ms;
}

.delay-2 {
  animation-delay: 180ms;
}

/* Admin */
.admin-page {
  min-height: 100vh;
  background: #f3f1eb;
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 46%) 1fr;
}

.login-art {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: 46px 56px 60px;
  flex-direction: column;
  justify-content: space-between;
  color: #f5f1e8;
  background:
    radial-gradient(circle at 78% 18%, rgba(213, 171, 111, 0.3), transparent 26%),
    radial-gradient(circle at 15% 90%, rgba(108, 157, 132, 0.24), transparent 33%),
    #214f3e;
}

.login-art::before,
.login-art::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.login-art::before {
  top: -180px;
  right: -180px;
  width: 560px;
  height: 560px;
}

.login-art::after {
  right: -70px;
  bottom: -140px;
  width: 440px;
  height: 440px;
}

.login-brand {
  position: relative;
  z-index: 1;
  color: #fff;
}

.login-brand .brand-mark {
  color: var(--green-deep);
  background: #f5f1e8;
}

.login-quote {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.login-quote > span {
  display: block;
  width: 35px;
  height: 35px;
  color: #d9ae72;
  font-family: Georgia, serif;
  font-size: 68px;
  line-height: 1;
}

.login-quote p {
  margin: 23px 0 31px;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 39px);
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.03em;
}

.login-quote i {
  display: block;
  width: 53px;
  height: 1px;
  background: #d9ae72;
}

.login-doodle {
  position: relative;
  z-index: 1;
  display: flex;
  height: 25px;
  align-items: center;
  gap: 16px;
  color: #d9ae72;
  font-family: var(--serif);
  font-size: 18px;
}

.login-doodle i {
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.login-panel {
  display: grid;
  padding: 40px;
  background:
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(36, 61, 50, 0.025) 79px 80px),
    #f3f1eb;
  place-items: center;
}

.login-form {
  width: min(100%, 390px);
}

.login-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 64px;
  color: var(--ink-faint);
  font-size: 12px;
}

.login-back svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 180ms ease;
}

.login-back:hover svg {
  transform: translateX(-3px);
}

.login-form .eyebrow {
  margin-bottom: 14px;
}

.login-form h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
}

.login-hint {
  margin: 11px 0 34px;
  color: var(--ink-soft);
  font-size: 13px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.field em {
  color: var(--orange);
  font-style: normal;
}

.field input,
.field textarea {
  width: 100%;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input {
  height: 45px;
  padding: 0 13px;
}

.field textarea {
  min-height: 82px;
  padding: 11px 13px;
  line-height: 1.65;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 97, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a9aea9;
}

.field small {
  color: var(--ink-faint);
  font-size: 10px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 45px;
}

.icon-button {
  display: inline-grid;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  place-items: center;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 45px;
  color: var(--ink-faint);
}

.password-toggle svg,
.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.form-error {
  margin: 11px 0 0;
  padding: 9px 11px;
  color: #9a3f3f;
  background: var(--danger-soft);
  font-size: 11px;
}

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  justify-content: space-between;
  padding-inline: 20px;
}

.login-submit svg {
  width: 18px;
}

.login-footnote {
  margin: 32px 0 0;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.04em;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  padding: 29px 18px 22px;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.77);
  background: var(--green-deep);
}

.admin-brand {
  padding: 0 8px 31px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.admin-brand .brand-mark {
  width: 37px;
  height: 37px;
  color: var(--green-deep);
  background: #f4efe4;
}

.admin-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-brand strong {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.03em;
}

.admin-brand small {
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.07em;
}

.admin-nav {
  display: flex;
  margin-top: 27px;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 45px;
  padding: 0 13px;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.64);
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: color 180ms ease, background 180ms ease;
}

.nav-item svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-footer {
  display: flex;
  margin-top: auto;
  flex-direction: column;
  gap: 4px;
}

.sidebar-footer a,
.sidebar-footer button {
  display: flex;
  height: 39px;
  padding: 0 12px;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.46);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
  transition: color 180ms ease;
}

.sidebar-footer a:hover,
.sidebar-footer button:hover {
  color: #fff;
}

.sidebar-footer svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.admin-main {
  min-width: 0;
  padding: 0 42px 60px;
}

.admin-topbar {
  display: flex;
  min-height: 125px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #dedbd2;
}

.admin-date {
  margin: 0 0 5px;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.admin-topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
}

.topbar-action {
  min-height: 41px;
}

.admin-view {
  display: none;
  max-width: 1180px;
  padding-top: 30px;
  animation: reveal 400ms ease both;
}

.admin-view.active {
  display: block;
}

.admin-summary {
  display: grid;
  margin-bottom: 24px;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.summary-card {
  display: flex;
  min-height: 94px;
  padding: 19px 21px;
  align-items: center;
  gap: 15px;
  background: var(--card);
  border: 1px solid #ebe6db;
}

.summary-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
}

.summary-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.summary-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.summary-icon.orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.summary-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.summary-card > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
}

.summary-card div > span {
  width: 100%;
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.summary-card strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.summary-card strong.summary-text {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
}

.summary-card small {
  color: var(--ink-faint);
  font-size: 10px;
}

.content-card {
  background: var(--card);
  border: 1px solid #e9e4da;
}

.content-card-head {
  display: flex;
  min-height: 79px;
  padding: 16px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #ede8df;
}

.content-card-head h2,
.section-bar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.content-card-head p,
.section-bar p {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.search-wrap {
  position: relative;
  width: 205px;
}

.search-wrap svg {
  position: absolute;
  top: 11px;
  left: 12px;
  width: 16px;
  fill: none;
  stroke: #9ca39e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 37px;
  color: var(--ink);
  background: #f8f6f0;
  border: 1px solid #e8e3d9;
  border-radius: 2px;
  outline: none;
  font-size: 11px;
}

.search-wrap input:focus {
  border-color: var(--green);
}

.admin-table-wrap {
  min-height: 250px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  height: 43px;
  padding: 0 17px;
  color: #969d98;
  background: #faf8f3;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.admin-table td {
  height: 66px;
  padding: 10px 17px;
  color: var(--ink-soft);
  border-top: 1px solid #f0ece4;
  font-size: 11px;
  white-space: nowrap;
}

.admin-table tbody tr {
  transition: background 150ms ease;
}

.admin-table tbody tr:hover {
  background: #fbfaf6;
}

.exam-name-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.exam-date-block {
  display: flex;
  width: 34px;
  height: 39px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 2px;
}

.exam-date-block strong {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1;
}

.exam-date-block span {
  margin-top: 3px;
  font-size: 7px;
}

.exam-name-cell > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.exam-name-cell b {
  max-width: 230px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
}

.exam-name-cell small {
  color: var(--ink-faint);
  font-size: 9px;
}

.table-score {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.subject-pills {
  display: flex;
  gap: 4px;
}

.subject-pills span {
  padding: 4px 7px;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: 2px;
  font-size: 9px;
}

.subject-pills .more-pill {
  color: var(--ink-faint);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.row-action {
  display: grid;
  width: 30px;
  height: 30px;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  place-items: center;
}

.row-action:hover {
  color: var(--green);
  background: var(--green-soft);
  border-color: transparent;
}

.row-action.delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.row-action svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.admin-empty {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.admin-empty > span {
  display: grid;
  width: 49px;
  height: 49px;
  color: var(--orange);
  background: var(--orange-soft);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 21px;
  place-items: center;
}

.admin-empty h3 {
  margin: 14px 0 5px;
  font-family: var(--serif);
  font-size: 17px;
}

.admin-empty p {
  margin: 0 0 18px;
  color: var(--ink-faint);
  font-size: 11px;
}

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

.subject-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 13px;
}

.subject-admin-card {
  position: relative;
  min-height: 142px;
  padding: 21px;
  background: var(--card);
  border: 1px solid #e9e4da;
  overflow: hidden;
}

.subject-admin-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
  background: var(--subject-color);
}

.subject-admin-card.archived {
  opacity: 0.65;
}

.subject-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.subject-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.subject-card-title i {
  width: 9px;
  height: 9px;
  background: var(--subject-color);
  border-radius: 50%;
}

.subject-card-title strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.subject-card-meta {
  display: flex;
  margin-top: 20px;
  align-items: flex-end;
  justify-content: space-between;
}

.subject-card-meta div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.subject-card-meta span {
  color: var(--ink-faint);
  font-size: 9px;
}

.subject-card-meta b {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

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

.settings-card {
  display: grid;
  max-width: 830px;
  grid-template-columns: 235px minmax(0, 1fr);
  background: var(--card);
  border: 1px solid #e9e4da;
}

.security-heading {
  margin-top: 38px;
}

.security-settings {
  max-width: 830px;
}

.security-illustration svg {
  width: 60px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.settings-illustration {
  position: relative;
  display: grid;
  min-height: 430px;
  overflow: hidden;
  color: #f9f3e7;
  background:
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.15), transparent 38%),
    var(--green);
  place-items: center;
}

.settings-illustration::before,
.settings-illustration::after {
  position: absolute;
  width: 250px;
  height: 250px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.settings-illustration::before {
  top: -115px;
  left: -90px;
}

.settings-illustration::after {
  right: -120px;
  bottom: -90px;
}

.settings-illustration span {
  font-family: Georgia, serif;
  font-size: 66px;
}

.settings-illustration i {
  position: absolute;
  width: 75px;
  height: 1px;
  background: #d9ae72;
  transform: rotate(-38deg);
}

.settings-illustration b {
  position: absolute;
  right: 35px;
  bottom: 45px;
  color: #d9ae72;
  font-size: 25px;
}

.settings-fields {
  display: flex;
  padding: 37px 44px;
  flex-direction: column;
  gap: 22px;
}

.settings-fields .primary-button {
  align-self: flex-start;
  margin-top: 3px;
}

.modal {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.modal::backdrop {
  background: rgba(20, 38, 31, 0.48);
  backdrop-filter: blur(3px);
}

.modal[open] {
  animation: modal-in 220ms ease both;
}

.modal-card {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(18, 37, 29, 0.25);
}

.modal-head {
  display: flex;
  padding: 26px 30px 23px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head .eyebrow {
  margin-bottom: 8px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

.modal-body {
  padding: 26px 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
}

.field-wide {
  grid-column: span 2;
}

.subject-scores-head {
  display: flex;
  margin: 27px 0 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.subject-scores-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.subject-scores-head p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.subject-scores-head > span {
  color: var(--ink-faint);
  font-size: 9px;
}

.score-entry-list {
  border: 1px solid var(--line-soft);
}

.score-entry-row {
  display: grid;
  min-height: 51px;
  padding: 8px 13px;
  grid-template-columns: minmax(100px, 1fr) 120px 120px;
  align-items: center;
  gap: 12px;
}

.score-entry-row + .score-entry-row {
  border-top: 1px solid var(--line-soft);
}

.score-subject {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.score-subject i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--subject-color);
  border-radius: 50%;
}

.score-subject small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-input-wrap {
  position: relative;
}

.score-input-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #faf9f5;
  border: 1px solid #e9e5dc;
  outline: none;
  font-size: 11px;
}

.score-input-wrap input:focus {
  background: #fff;
  border-color: var(--green);
}

.score-input-wrap span {
  position: absolute;
  top: 10px;
  right: 9px;
  color: var(--ink-faint);
  font-size: 9px;
  pointer-events: none;
}

.score-input-wrap.has-suffix input {
  padding-right: 29px;
}

.no-subjects-note {
  margin: 0;
  padding: 19px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px dashed var(--line);
  font-size: 11px;
  text-align: center;
}

.no-subjects-note button {
  padding: 0;
  color: var(--green);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.notes-field {
  margin-top: 22px;
}

.modal-footer {
  display: flex;
  padding: 17px 30px;
  justify-content: flex-end;
  gap: 9px;
  background: #faf8f3;
  border-top: 1px solid var(--line-soft);
}

.small-modal {
  width: min(470px, calc(100% - 32px));
}

.small-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.color-options {
  display: flex;
  gap: 12px;
  padding-top: 3px;
}

.color-options label {
  position: relative;
  display: block;
  cursor: pointer;
}

.color-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.color-options i {
  display: block;
  width: 25px;
  height: 25px;
  background: var(--swatch);
  border: 3px solid var(--card);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.color-options input:checked + i {
  box-shadow: 0 0 0 2px var(--ink);
}

.confirm-modal {
  width: min(400px, calc(100% - 32px));
}

.confirm-card {
  padding: 31px;
  text-align: center;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(18, 37, 29, 0.25);
}

.confirm-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 17px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
  place-items: center;
}

.confirm-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.confirm-card h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.confirm-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.confirm-actions {
  display: grid;
  margin-top: 24px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 100;
  display: flex;
  min-width: 230px;
  padding: 13px 17px;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: var(--green-deep);
  box-shadow: 0 13px 40px rgba(20, 43, 33, 0.22);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #8d4444;
}

.toast-icon {
  display: grid;
  width: 22px;
  height: 22px;
  color: var(--green-deep);
  background: #e4efe8;
  border-radius: 50%;
  place-items: center;
}

.toast.error .toast-icon {
  color: #8d4444;
  background: #f6dede;
}

.toast-icon svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .hero-visual {
    display: none;
  }

  .admin-main {
    padding-inline: 30px;
  }
}

@media (max-width: 840px) {
  .shell,
  .site-header {
    width: min(100% - 36px, 720px);
  }

  .site-nav {
    gap: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 58px;
    padding-bottom: 78px;
  }

  .hero h1 {
    font-size: clamp(39px, 9vw, 56px);
  }

  .hero-latest {
    width: min(100%, 480px);
    min-height: 0;
  }

  .quick-stats {
    margin-top: -35px;
  }

  .stat-card {
    padding: 20px;
  }

  .section {
    padding-top: 83px;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    min-height: 95px;
  }

  .login-view {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px;
    background:
      radial-gradient(circle at 100% 0, rgba(47, 125, 97, 0.15), transparent 20rem),
      #f3f1eb;
  }

  .login-back {
    margin-bottom: 55px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    height: 67px;
    padding: 7px 13px;
    flex-direction: row;
    align-items: center;
    box-shadow: 0 -5px 25px rgba(24, 46, 36, 0.15);
  }

  .admin-brand,
  .sidebar-footer {
    display: none;
  }

  .admin-nav {
    display: grid;
    width: 100%;
    margin: 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .nav-item {
    height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
  }

  .nav-item svg {
    width: 18px;
  }

  .admin-main {
    padding: 0 22px 95px;
  }

  .admin-topbar {
    min-height: 98px;
  }

  .admin-topbar h1 {
    font-size: 23px;
  }

  .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card {
    min-height: 78px;
    padding: 13px;
    gap: 9px;
  }

  .summary-icon {
    width: 34px;
    height: 34px;
  }

  .summary-icon svg {
    width: 17px;
  }

  .summary-card strong {
    font-size: 18px;
  }

  .summary-card strong.summary-text {
    font-size: 11px;
  }

  .settings-card {
    grid-template-columns: 1fr;
  }

  .settings-illustration {
    display: none;
  }

  .security-heading {
    margin-top: 28px;
  }
}

@media (max-width: 580px) {
  .site-header {
    height: 74px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .site-nav {
    gap: 15px;
    font-size: 12px;
  }

  .site-nav > a:not(.admin-entry):first-child {
    display: none;
  }

  .admin-entry {
    width: 32px;
    height: 32px;
  }

  .gate-card {
    padding: 34px 25px 28px;
  }

  .gate-card h1 {
    font-size: 29px;
  }

  .hero {
    min-height: auto;
    padding-top: 45px;
  }

  .eyebrow {
    margin-bottom: 17px;
  }

  .hero h1 {
    font-size: 39px;
    line-height: 1.4;
  }

  .hero-subtitle {
    margin: 19px 0 26px;
    font-size: 15px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
    margin-top: -28px;
  }

  .stat-card {
    display: grid;
    min-height: 71px;
    padding: 13px 19px;
    grid-template-columns: 42px 1fr;
    gap: 12px;
  }

  .stat-card + .stat-card {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
  }

  .stat-icon svg {
    width: 19px;
  }

  .stat-card strong {
    font-size: 20px;
  }

  .section-heading {
    display: block;
    margin-bottom: 23px;
  }

  .section-heading h2 {
    font-size: 27px;
  }

  .select-wrap {
    margin-top: 18px;
  }

  .chart-card {
    padding: 21px 12px 8px;
  }

  .chart-card-head {
    padding-inline: 9px;
  }

  .chart-card h3 {
    font-size: 17px;
  }

  .chart-current strong {
    font-size: 19px;
  }

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

  .chart-wrap svg {
    width: 680px;
    max-width: none;
  }

  .chart-empty {
    min-height: 210px;
    text-align: center;
  }

  .records-section {
    padding-bottom: 70px;
  }

  .record-count {
    display: inline-block;
    margin-top: 16px;
  }

  .exam-list::before {
    left: 5px;
  }

  .exam-card {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .timeline-marker span {
    width: 9px;
    height: 9px;
    margin-left: 1px;
    box-shadow: 0 0 0 4px var(--paper);
  }

  .timeline-marker b {
    display: none;
  }

  .exam-card-main {
    padding: 20px 17px;
  }

  .exam-card-head {
    display: block;
  }

  .exam-overview {
    margin-top: 18px;
    gap: 0;
  }

  .exam-overview div {
    min-width: 0;
    flex: 1;
    align-items: flex-start;
  }

  .exam-overview div + div {
    padding-left: 18px;
  }

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

  .subject-result {
    padding: 14px 11px;
  }

  .subject-result > strong {
    font-size: 15px;
  }

  .site-footer > span:last-child {
    display: none;
  }

  .error-banner {
    right: 14px;
    bottom: 14px;
    left: 14px;
    justify-content: space-between;
  }

  .admin-main {
    padding-inline: 15px;
  }

  .admin-topbar {
    min-height: 88px;
  }

  .admin-date {
    font-size: 9px;
  }

  .admin-topbar h1 {
    font-size: 21px;
  }

  .topbar-action {
    min-height: 37px;
    padding: 0 13px;
    font-size: 11px;
  }

  .admin-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-card:last-child {
    display: none;
  }

  .content-card-head {
    display: block;
    padding: 16px;
  }

  .search-wrap {
    width: 100%;
    margin-top: 13px;
  }

  .admin-table th,
  .admin-table td {
    padding-inline: 8px;
  }

  .admin-table th:nth-child(2),
  .admin-table td:nth-child(2),
  .admin-table th:nth-child(5),
  .admin-table td:nth-child(5) {
    display: none;
  }

  .exam-date-block {
    display: none;
  }

  .exam-name-cell b {
    max-width: 105px;
  }

  .row-action {
    width: 28px;
  }

  .section-bar {
    display: block;
  }

  .section-bar .secondary-button {
    margin-top: 15px;
  }

  .subject-admin-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .subject-admin-card {
    min-height: 132px;
    padding: 16px;
  }

  .subject-card-meta {
    margin-top: 17px;
  }

  .subject-card-actions .row-action:first-child {
    display: none;
  }

  .settings-fields {
    padding: 25px 19px;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-card {
    max-height: calc(100vh - 16px);
  }

  .modal-head,
  .modal-body {
    padding-inline: 18px;
  }

  .modal-footer {
    padding-inline: 18px;
  }

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

  .field-wide {
    grid-column: span 2;
  }

  .score-entry-row {
    padding: 9px 10px;
    grid-template-columns: minmax(80px, 1fr) 80px 80px;
    gap: 7px;
  }

  .score-subject small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
