:root {
  --bg: #f7f7f5;
  --text: #202124;
  --muted: #63666a;
  --line: #d9ddd7;
  --primary: #246b5f;
  --primary-dark: #174d44;
  --surface: #ffffff;
  --accent: #b23b3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  font-weight: 700;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover,
.nav-form button:hover {
  color: var(--primary);
}

.nav-form {
  display: inline;
  max-width: none;
}

.nav-form button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nav-links > a,
.nav-links > .nav-form {
  white-space: nowrap;
}

.page-main {
  padding: 48px 0;
}

.mobile-page-back {
  display: none;
}

.hero,
.placeholder-card,
.form-panel,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
}

.hero h1,
.placeholder-card h1,
.form-panel h1,
.table-panel h2 {
  margin: 0 0 20px;
  font-size: 32px;
}

.table-panel {
  margin-top: 24px;
}

.table-panel h2 {
  font-size: 24px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 14px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.admin-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: var(--accent);
  background: var(--accent);
}

.button-ghost {
  background: transparent;
  color: var(--primary);
}

.button-danger {
  border-color: var(--accent);
  background: var(--accent);
}

.inline-form {
  display: inline;
  max-width: none;
}

.muted-text {
  color: var(--muted);
}

form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.profile-form {
  max-width: 560px;
}

label {
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.avatar-field {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fafafa;
  object-fit: cover;
}

.avatar-field p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.readonly-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 420px;
  margin-bottom: 20px;
}

.readonly-fields div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
}

.readonly-fields span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.readonly-fields strong {
  display: block;
  margin-top: 2px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.checkbox-row input {
  width: auto;
  min-height: 0;
}

.privacy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.privacy-field .checkbox-row {
  min-height: 40px;
  white-space: nowrap;
}

.flash {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #ecd48b;
  border-radius: 6px;
  background: #fff8df;
}

.empty-wall {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.admin-dashboard {
  display: grid;
  gap: 24px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.admin-action-card {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(32, 33, 36, 0.08);
}

.admin-action-card:hover,
.admin-action-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(32, 33, 36, 0.12);
}

.admin-action-card span {
  color: var(--muted);
  font-size: 14px;
}

.admin-action-card strong {
  font-size: 22px;
}

.admin-action-card p {
  margin: 0;
  color: var(--muted);
}

.dialog-open {
  overflow: hidden;
}

.students-page {
  --paper-bg: #fffaf0;
  --paper-line: rgba(95, 77, 52, 0.09);
  --envelope-back: #f8e9cc;
  --envelope-flap: #dfc195;
  --envelope-pocket: #f0d7ad;
  --envelope-edge: rgba(92, 70, 42, 0.18);
  --ink: #2f2a25;
  --ink-muted: #766d62;
  --seal-green: #6f8d73;
}

.students-page body {
  background:
    radial-gradient(circle at 14% 8%, rgba(111, 141, 115, 0.16), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(201, 133, 98, 0.14), transparent 28%),
    repeating-linear-gradient(0deg, rgba(92, 70, 42, 0.028) 0, rgba(92, 70, 42, 0.028) 1px, transparent 1px, transparent 18px),
    #f5f0e6;
}

.students-page .container {
  width: min(100% - 36px, 1180px);
}

.students-page .page-main {
  padding: 44px 0 64px;
}

.classmate-home-shell {
  color: var(--ink, #2f2a25);
}

.envelope-wall {
  display: grid;
  gap: 22px;
  margin-top: 34px;
}

.envelope-wall__hero {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 38px 42px;
  border: 1px solid rgba(92, 70, 42, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(244, 231, 207, 0.88)),
    linear-gradient(90deg, transparent 0, transparent 50px, rgba(178, 95, 95, 0.10) 51px, transparent 52px),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(92, 70, 42, 0.055) 32px);
  box-shadow: 0 22px 52px rgba(74, 55, 28, 0.09);
  color: var(--ink);
  overflow: hidden;
}

.envelope-wall__hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -66px;
  width: 310px;
  height: 220px;
  border: 2px solid rgba(111, 141, 115, 0.18);
  border-radius: 52% 48% 0 0;
  transform: rotate(-8deg);
}

.envelope-wall__hero span {
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 700;
}

.envelope-wall__eyebrow {
  margin: 0;
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 700;
}

.envelope-wall__hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08;
}

.envelope-wall__lead {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: 30px;
}

.section-heading p {
  margin: 0;
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 700;
}

.envelope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.envelope-card {
  position: relative;
  display: block;
  min-height: 218px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  perspective: 900px;
  text-align: left;
  transform: translateY(0);
  transition: transform 180ms ease;
}

.envelope-card:hover,
.envelope-card:focus-visible {
  transform: translateY(-5px);
}

.envelope-card:focus-visible {
  outline: 3px solid rgba(111, 141, 115, 0.45);
  outline-offset: 6px;
}

.envelope-card__back,
.envelope-card__flap,
.envelope-card__pocket,
.envelope-card__content {
  position: absolute;
  pointer-events: none;
}

.envelope-card__back {
  inset: 18px 0 0;
  z-index: 1;
  border: 1px solid var(--envelope-edge);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.45), transparent 26%),
    repeating-linear-gradient(25deg, rgba(92, 70, 42, 0.028) 0, rgba(92, 70, 42, 0.028) 1px, transparent 1px, transparent 9px),
    linear-gradient(135deg, var(--envelope-back), #e7c99e);
  box-shadow: 0 18px 34px rgba(74, 55, 28, 0.14);
}

.envelope-card__flap {
  top: 18px;
  right: 0;
  left: 0;
  z-index: 3;
  height: 112px;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.34), transparent 62%),
    repeating-linear-gradient(42deg, rgba(92, 70, 42, 0.035) 0, rgba(92, 70, 42, 0.035) 1px, transparent 1px, transparent 11px),
    var(--envelope-flap);
  transform-origin: top center;
  transition: transform 220ms ease;
}

.envelope-card:hover .envelope-card__flap,
.envelope-card:focus-visible .envelope-card__flap {
  transform: rotateX(16deg);
}

.envelope-card__pocket {
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  height: 134px;
  clip-path: polygon(0 30%, 50% 73%, 100% 30%, 100% 100%, 0 100%);
  background:
    linear-gradient(145deg, transparent 49%, rgba(92, 70, 42, 0.24) 50%, transparent 51%),
    linear-gradient(215deg, transparent 49%, rgba(92, 70, 42, 0.18) 50%, transparent 51%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.48), rgba(239, 214, 174, 0.96)),
    var(--envelope-pocket);
  border: 1px solid var(--envelope-edge);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.envelope-card__content {
  inset: 32px 22px 22px;
  z-index: 5;
  display: grid;
  grid-template-rows: 56px auto auto;
  gap: 8px;
  align-content: start;
}

.envelope-card__top {
  min-height: 56px;
}

.envelope-card__avatar,
.letter-paper__avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.55), transparent 30%),
    #e8d3b0;
  color: #5f4a2d;
  font-family: Georgia, "SimSun", serif;
  font-weight: 700;
}

.envelope-card__avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 76px;
  height: 76px;
  border: 2px solid rgba(255, 250, 240, 0.9);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 250, 240, 0.96) 0 13px, transparent 14px),
    radial-gradient(ellipse at 50% 74%, rgba(255, 250, 240, 0.96) 0 25px, transparent 26px),
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.55), transparent 30%),
    #e8d3b0;
  box-shadow: 0 8px 18px rgba(74, 55, 28, 0.13);
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.envelope-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.envelope-card__status {
  position: absolute;
  top: 16px;
  right: 0;
  padding: 4px 10px;
  border: 1px solid rgba(92, 70, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.78);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
}

.envelope-card__name {
  position: relative;
  z-index: 2;
  font-family: Georgia, "SimSun", serif;
  font-size: 29px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.envelope-card__nickname {
  position: relative;
  z-index: 2;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.42;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.envelope-card--private .envelope-card__back,
.envelope-card--private .envelope-card__flap,
.envelope-card--private .envelope-card__pocket,
.envelope-card--unclaimed .envelope-card__back,
.envelope-card--unclaimed .envelope-card__flap,
.envelope-card--unclaimed .envelope-card__pocket {
  filter: saturate(0.72);
}

.letter-overlay[hidden] {
  display: none;
}

.letter-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.letter-overlay.is-visible {
  opacity: 1;
}

.letter-overlay.is-closing {
  opacity: 0;
}

.letter-overlay__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 250, 240, 0.42), transparent 34%),
    rgba(47, 42, 37, 0.14);
}

.letter-stage {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  min-height: 680px;
  outline: none;
  opacity: 0;
  transform: translateY(22px) scale(0.92);
}

.letter-overlay.is-opening .letter-stage,
.letter-overlay.is-open .letter-stage {
  animation: stageLift 260ms ease forwards;
}

.letter-stage__close {
  position: absolute;
  top: 4px;
  right: 28px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 1px solid var(--envelope-edge, rgba(92, 70, 42, 0.18));
  border-radius: 50%;
  background: var(--paper-bg, #fffaf0);
  color: var(--ink-muted, #766d62);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(54, 38, 18, 0.18);
}

.enlarged-envelope {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: min(720px, 92vw);
  height: 450px;
  transform: translateX(-50%);
  perspective: 1200px;
}

.enlarged-envelope__back,
.enlarged-envelope__flap,
.enlarged-envelope__pocket {
  position: absolute;
}

.enlarged-envelope__back {
  inset: 88px 0 0;
  z-index: 1;
  border: 1px solid var(--envelope-edge, rgba(92, 70, 42, 0.18));
  border-radius: 9px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.42), transparent 25%),
    repeating-linear-gradient(25deg, rgba(92, 70, 42, 0.032) 0, rgba(92, 70, 42, 0.032) 1px, transparent 1px, transparent 10px),
    linear-gradient(135deg, var(--envelope-back, #f8e9cc), #e3c499);
  box-shadow: 0 28px 68px rgba(38, 28, 16, 0.30);
}

.enlarged-envelope__flap {
  top: 88px;
  right: 0;
  left: 0;
  z-index: 5;
  height: 210px;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.32), transparent 62%),
    repeating-linear-gradient(42deg, rgba(92, 70, 42, 0.035) 0, rgba(92, 70, 42, 0.035) 1px, transparent 1px, transparent 11px),
    var(--envelope-flap, #dfc195);
  transform-origin: top center;
  transform: rotateX(0deg);
}

.letter-overlay.is-opening .enlarged-envelope__flap,
.letter-overlay.is-open .enlarged-envelope__flap {
  z-index: 2;
  animation: flapOpen 430ms ease 180ms forwards;
}

.enlarged-envelope__pocket {
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  height: 266px;
  clip-path: polygon(0 25%, 50% 72%, 100% 25%, 100% 100%, 0 100%);
  background:
    linear-gradient(145deg, transparent 49.3%, rgba(92, 70, 42, 0.22) 50%, transparent 50.7%),
    linear-gradient(215deg, transparent 49.3%, rgba(92, 70, 42, 0.18) 50%, transparent 50.7%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.52), rgba(240, 216, 178, 0.98)),
    var(--envelope-pocket, #f0d7ad);
  border: 1px solid var(--envelope-edge, rgba(92, 70, 42, 0.18));
  border-top: 0;
  border-radius: 0 0 9px 9px;
  box-shadow: 0 20px 46px rgba(38, 28, 16, 0.16);
}

.letter-paper {
  position: absolute;
  left: 50%;
  bottom: 132px;
  z-index: 4;
  width: min(700px, calc(100vw - 44px));
  max-height: min(72vh, 610px);
  overflow-y: auto;
  padding: 36px 38px 106px;
  border: 1px solid rgba(92, 70, 42, 0.14);
  border-radius: 8px;
  background-color: var(--paper-bg, #fffaf0);
  background-image:
    linear-gradient(90deg, rgba(178, 95, 95, 0.12) 0, rgba(178, 95, 95, 0.12) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(0deg, transparent 0, transparent 33px, rgba(92, 70, 42, 0.065) 34px),
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.62), transparent 30%),
    repeating-linear-gradient(34deg, rgba(92, 70, 42, 0.026) 0, rgba(92, 70, 42, 0.026) 1px, transparent 1px, transparent 11px);
  box-shadow: 0 24px 60px rgba(80, 55, 24, 0.22);
  opacity: 0;
  transform: translate(-50%, 116px) scale(0.96);
}

.letter-overlay.is-opening .letter-paper,
.letter-overlay.is-open .letter-paper {
  animation: letterRise 560ms cubic-bezier(0.2, 0.85, 0.2, 1) 420ms forwards;
}

.letter-paper__header,
.letter-paper__content {
  opacity: 0;
}

.letter-overlay.is-opening .letter-paper__header,
.letter-overlay.is-opening .letter-paper__content,
.letter-overlay.is-open .letter-paper__header,
.letter-overlay.is-open .letter-paper__content {
  animation: contentFade 260ms ease 900ms forwards;
}

.letter-paper__header {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.letter-paper__avatar {
  width: 76px;
  height: 76px;
  border: 2px solid rgba(92, 70, 42, 0.10);
  font-size: 32px;
  overflow: hidden;
}

.letter-paper__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.letter-paper__header h2 {
  margin: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: 32px;
}

.letter-paper__header p,
.letter-paper__meta {
  margin: 4px 0 0;
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 700;
}

.letter-paper__detail {
  display: grid;
  grid-template-columns: minmax(76px, max-content) minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border-left: 3px solid rgba(111, 141, 115, 0.38);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 250, 240, 0.58);
}

.letter-paper__detail-label {
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.75;
  white-space: nowrap;
}

.letter-paper__detail-value {
  color: #3f3325;
  font-weight: 500;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.letter-paper__freeform {
  padding-top: 4px;
  color: #4b3d2b;
  font-family: Georgia, "SimSun", serif;
  line-height: 1.8;
}

.letter-paper__content {
  display: grid;
  gap: 20px;
  color: var(--ink);
}

.letter-paper__content p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.letter-paper__quote {
  color: #5f4a2d;
  font-family: Georgia, "SimSun", serif;
  font-size: 20px;
  line-height: 1.55;
}

.letter-paper__note {
  color: var(--ink-muted);
}

@keyframes stageLift {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes flapOpen {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(178deg);
  }
}

@keyframes letterRise {
  from {
    opacity: 0;
    transform: translate(-50%, 116px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 36px) scale(1);
  }
}

@keyframes contentFade {
  to {
    opacity: 1;
  }
}

.site-footer {
  padding: 24px 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 14px 0;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    width: 100%;
    font-size: 16px;
  }

  .nav-links > a,
  .nav-links > .nav-form,
  .nav-form button {
    display: block;
    width: 100%;
    text-align: center;
  }

  .page-main {
    padding: 24px 0;
  }

  .mobile-page-back {
    position: sticky;
    top: 0;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-bottom: 12px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(32, 33, 36, 0.08);
  }

  .mobile-page-back:hover,
  .mobile-page-back:focus-visible {
    border-color: var(--primary);
    color: var(--primary-dark);
  }

  .hero,
  .placeholder-card,
  .form-panel,
  .table-panel {
    padding: 24px;
  }

  .privacy-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .privacy-field .checkbox-row {
    min-height: 0;
  }

  .envelope-wall__hero {
    padding: 24px;
    border-radius: 8px;
  }

  .envelope-wall__hero::after {
    right: -80px;
    bottom: -96px;
  }

  .envelope-wall__hero h1 {
    font-size: 32px;
  }

  .envelope-wall__lead {
    font-size: 16px;
  }

  .section-heading {
    display: grid;
    gap: 2px;
  }

  .envelope-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .envelope-card {
    min-height: 198px;
  }

  .envelope-card__content {
    inset: 30px 18px 22px;
  }

  .envelope-card__flap {
    height: 98px;
  }

  .envelope-card__pocket {
    height: 116px;
  }

  .envelope-card__name {
    font-size: 28px;
  }

  .letter-overlay {
    align-items: end;
    padding: 0;
  }

  .letter-stage {
    width: 100%;
    min-height: 88vh;
  }

  .letter-stage__close {
    top: 14px;
    right: 14px;
  }

  .enlarged-envelope {
    left: 50%;
    right: auto;
    bottom: 0;
    width: min(390px, 92vw);
    height: 278px;
    transform: translateX(-50%);
  }

  .enlarged-envelope__back {
    inset: 58px 0 0;
  }

  .enlarged-envelope__flap {
    top: 58px;
    height: 124px;
  }

  .enlarged-envelope__pocket {
    height: 170px;
  }

  .letter-paper {
    bottom: 78px;
    width: min(350px, calc(100vw - 28px));
    max-height: 70vh;
    padding: 24px 20px 72px;
    border-radius: 8px;
    transform: translate(-50%, 120px) scale(0.98);
  }

  .letter-overlay.is-opening .letter-paper,
  .letter-overlay.is-open .letter-paper {
    animation-name: letterRiseMobile;
  }

  .letter-paper__header {
    grid-template-columns: 62px 1fr;
  }

  .letter-paper__avatar {
    width: 62px;
    height: 62px;
    font-size: 26px;
  }

  .letter-paper__header h2 {
    font-size: 27px;
  }

  .letter-paper__content {
    gap: 16px;
  }

  .letter-paper__detail {
    grid-template-columns: 1fr;
    row-gap: 5px;
    padding: 12px 14px;
  }

  .letter-paper__detail-label {
    font-size: 13px;
    line-height: 1.45;
  }

  .announcement-page .page-main {
    padding-top: 34px;
  }

  .announcement-paper {
    min-height: 64vh;
    padding: 28px 22px 34px;
  }

  .announcement-paper h1 {
    margin-bottom: 22px;
    font-size: 30px;
  }

  .announcement-paper__close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 26px;
  }

  .announcement-paper__blank {
    min-height: 360px;
  }
}

@keyframes letterRiseMobile {
  from {
    opacity: 0;
    transform: translate(-50%, 120px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 24px) scale(1);
  }
}

/* Homepage: envelope UI A prototype applied to the real app. */
.students-page {
  --paper-bg: #fffaf0;
  --paper-line: rgba(95, 77, 52, 0.09);
  --envelope-back: #f8e9cc;
  --envelope-flap: #dfc195;
  --envelope-pocket: #f0d7ad;
  --envelope-edge: rgba(92, 70, 42, 0.18);
  --ink: #2f2a25;
  --ink-muted: #766d62;
  --rope: rgba(143, 103, 57, 0.72);
  --clip-dark: #9d6c3d;
  --clip-light: #f2d6a5;
  --seal-green: #6f8d73;
  overflow-x: hidden;
}

.students-page body {
  position: relative;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background-color: #f6efe3;
  background-image:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.28) 0 2px, transparent 3px),
    repeating-linear-gradient(0deg, rgba(120, 98, 67, 0.036) 0, rgba(120, 98, 67, 0.036) 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(90deg, rgba(120, 98, 67, 0.024) 0, rgba(120, 98, 67, 0.024) 1px, transparent 1px, transparent 44px),
    linear-gradient(180deg, #f8f1e5, #f3eadb);
  background-repeat: repeat, repeat, repeat, no-repeat;
  background-size: 72px 72px, 100% 28px, 44px 100%, 100% 100%;
}

.students-page body::before,
.students-page body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.students-page body::before {
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  height: clamp(520px, 68vh, 720px);
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.02) 0%, rgba(255, 250, 240, 0.12) 58%, #f6efe3 100%),
    url("/images/envelope-ui-a/campus-wall-hero.jpg") center top / cover no-repeat;
}

.students-page body::after {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: auto;
  opacity: 0.9;
  background-image:
    url("/images/envelope-ui-a/vine-sparse.svg"),
    url("/images/envelope-ui-a/row-vine-shadow.svg"),
    linear-gradient(180deg, rgba(246, 239, 227, 0), #f6efe3 74%);
  background-position:
    left -38px top 520px,
    right -260px top 640px,
    center top;
  background-repeat: repeat-y, repeat-y, no-repeat;
  background-size:
    min(15vw, 168px) auto,
    min(48vw, 480px) auto,
    100% 760px;
}

.students-page .site-header,
.students-page .page-main,
.students-page .site-footer {
  position: relative;
  z-index: 1;
}

.students-page .site-header {
  border-bottom-color: rgba(92, 70, 42, 0.12);
  background: rgba(255, 250, 240, 0.82);
  backdrop-filter: blur(8px);
}

.students-page .container {
  width: min(100% - 36px, 1180px);
}

.students-page .page-main {
  padding: clamp(72px, 11vh, 126px) 0 64px;
}

.students-page .classmate-home-shell {
  color: var(--ink);
}

.students-page .envelope-wall__hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 32px 8px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.students-page .envelope-wall__hero::after {
  content: "";
  position: absolute;
  right: 6%;
  bottom: 10px;
  width: 260px;
  height: 120px;
  border: 0;
  border-top: 2px solid rgba(143, 103, 57, 0.16);
  border-radius: 50%;
  transform: rotate(-3deg);
}

.students-page .envelope-wall__eyebrow,
.students-page .section-heading p {
  margin: 0;
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 700;
}

.students-page .envelope-wall__hero h1 {
  position: relative;
  z-index: 1;
  justify-self: center;
  margin: 0;
  font-family: "Times New Roman", "SimSun", "Songti SC", serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.students-page .envelope-wall__lead {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 18px;
}

.students-page .envelope-wall {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
  margin-top: 18px;
}

.students-page .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.students-page .section-heading h2 {
  margin: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: 30px;
}

.students-page .letter-rope-board {
  display: grid;
  gap: 34px;
  padding: 10px 0 28px;
}

.students-page .letter-rope-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 32px;
  align-items: start;
  padding: 48px 6px 0;
  isolation: isolate;
}

.students-page .letter-rope-row--count-1 {
  grid-template-columns: minmax(260px, 360px);
  justify-content: center;
}

.students-page .letter-rope-row--count-2 {
  grid-template-columns: repeat(2, minmax(260px, 360px));
  justify-content: center;
}

.students-page .letter-rope-row::before,
.students-page .letter-rope-row::after,
.students-page .envelope-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.students-page .letter-rope-row::before {
  top: 82px;
  right: -44px;
  left: -44px;
  z-index: 0;
  height: 190px;
  opacity: 0.34;
  background: url("/images/envelope-ui-a/row-vine-shadow.svg") center bottom / 100% 100% no-repeat;
  mix-blend-mode: multiply;
}

.students-page .letter-rope-row::after {
  top: 146px;
  right: clamp(24px, 7vw, 92px);
  left: clamp(24px, 7vw, 92px);
  z-index: 1;
  height: 106px;
  border-radius: 999px;
  opacity: 0.16;
  background:
    radial-gradient(ellipse at 28% 58%, rgba(76, 94, 57, 0.28), transparent 56%),
    radial-gradient(ellipse at 74% 48%, rgba(76, 94, 57, 0.18), transparent 60%);
  filter: blur(5px);
}

.students-page .letter-rope-row:nth-child(2n)::before {
  transform: scaleX(-1) translateY(8px);
}

.students-page .letter-rope-row:nth-child(3n)::before {
  transform: translateY(-8px);
  opacity: 0.25;
}

.students-page .letter-rope {
  position: absolute;
  top: 28px;
  right: 18px;
  left: 18px;
  z-index: 4;
  height: 12px;
  border-top: 2px solid var(--rope);
  border-radius: 50%;
  box-shadow: 0 3px 5px rgba(80, 55, 24, 0.10);
}

.students-page .letter-rope::before {
  content: "";
  position: absolute;
  top: -3px;
  right: 0;
  left: 0;
  height: 6px;
  opacity: 0.34;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(85, 58, 30, 0.42) 9px 11px);
}

.students-page .envelope-card {
  position: relative;
  z-index: 3;
  display: block;
  min-height: 218px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  perspective: 900px;
  text-align: left;
  transform: rotate(var(--tilt, 0deg)) translateY(0);
  transform-origin: 50% -28px;
  transition: opacity 180ms ease, filter 180ms ease, transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.students-page .envelope-card:hover,
.students-page .envelope-card:focus-visible {
  transform: rotate(0deg) translateY(-6px);
}

.students-page .envelope-card:focus-visible {
  outline: 3px solid rgba(111, 141, 115, 0.45);
  outline-offset: 6px;
}

.students-page .hanging-card:hover {
  animation: hangingSwing 720ms ease-in-out;
}

.students-page .hanging-card.is-picked {
  opacity: 0.32;
  filter: saturate(0.88);
  transform: rotate(0deg) translateY(56px) scale(0.93);
}

.students-page .hanging-card.is-picked .hanging-clip {
  opacity: 0.46;
}

.students-page .envelope-card::before {
  inset: 74px -28px -14px;
  z-index: 0;
  opacity: 0.34;
  background: url("/images/envelope-ui-a/envelope-under-vine-shadow.svg") center bottom / 112% auto no-repeat;
  mix-blend-mode: multiply;
  transform: translateY(8px);
}

.students-page .letter-rope-row:nth-child(2n) .envelope-card::before {
  transform: scaleX(-1) translateY(12px);
}

.students-page .letter-rope-row:nth-child(3n) .envelope-card::before {
  opacity: 0.26;
}

.students-page .hanging-clip {
  position: absolute;
  top: -36px;
  left: 50%;
  z-index: 20;
  width: 30px;
  height: 52px;
  border: 1px solid rgba(88, 57, 28, 0.16);
  border-radius: 6px;
  background:
    linear-gradient(90deg, var(--clip-dark), var(--clip-light) 48%, var(--clip-dark)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 7px);
  box-shadow: 0 5px 12px rgba(80, 55, 24, 0.22);
  transform: translateX(-50%);
  transition: opacity 160ms ease, transform 220ms ease;
}

.students-page .hanging-clip::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 2px;
  height: 40px;
  border-radius: 999px;
  background: rgba(90, 60, 30, 0.32);
  transform: translateX(-50%);
}

.students-page .hanging-clip::after {
  content: "";
  position: absolute;
  top: 24px;
  right: 5px;
  left: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(90, 60, 30, 0.38);
}

.students-page .hanging-clip__jaw {
  position: absolute;
  right: 7px;
  bottom: 6px;
  left: 7px;
  height: 10px;
  border-radius: 0 0 5px 5px;
  background: rgba(93, 61, 30, 0.18);
}

.students-page .envelope-card__back,
.students-page .envelope-card__flap,
.students-page .envelope-card__pocket,
.students-page .envelope-card__content {
  position: absolute;
  pointer-events: none;
}

.students-page .envelope-card__back {
  inset: 18px 0 0;
  z-index: 1;
  border: 1px solid var(--envelope-edge);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.45), transparent 26%),
    repeating-linear-gradient(25deg, rgba(92, 70, 42, 0.028) 0, rgba(92, 70, 42, 0.028) 1px, transparent 1px, transparent 9px),
    linear-gradient(135deg, var(--envelope-back), #e7c99e);
  box-shadow: 0 18px 34px rgba(74, 55, 28, 0.14);
}

.students-page .hanging-card:hover .envelope-card__back,
.students-page .hanging-card:focus-visible .envelope-card__back {
  box-shadow: 0 24px 42px rgba(74, 55, 28, 0.18);
}

.students-page .envelope-card__flap {
  top: 18px;
  right: 0;
  left: 0;
  z-index: 3;
  height: 112px;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.34), transparent 62%),
    repeating-linear-gradient(42deg, rgba(92, 70, 42, 0.035) 0, rgba(92, 70, 42, 0.035) 1px, transparent 1px, transparent 11px),
    var(--envelope-flap);
  transform-origin: top center;
  transition: transform 220ms ease;
}

.students-page .envelope-card:hover .envelope-card__flap,
.students-page .envelope-card:focus-visible .envelope-card__flap {
  transform: rotateX(16deg);
}

.students-page .envelope-card__pocket {
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  height: 134px;
  clip-path: polygon(0 30%, 50% 73%, 100% 30%, 100% 100%, 0 100%);
  background:
    linear-gradient(145deg, transparent 49%, rgba(92, 70, 42, 0.24) 50%, transparent 51%),
    linear-gradient(215deg, transparent 49%, rgba(92, 70, 42, 0.18) 50%, transparent 51%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.48), rgba(239, 214, 174, 0.96)),
    var(--envelope-pocket);
  border: 1px solid var(--envelope-edge);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.students-page .envelope-card__content {
  inset: 32px 22px 22px;
  z-index: 5;
  display: grid;
  grid-template-rows: 56px auto auto;
  gap: 8px;
  align-content: start;
}

.students-page .envelope-card__top {
  min-height: 56px;
}

.students-page .envelope-card__avatar,
.students-page .letter-paper__avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.55), transparent 30%),
    #e8d3b0;
  color: #5f4a2d;
  font-family: Georgia, "SimSun", serif;
  font-weight: 700;
}

.students-page .envelope-card__avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 76px;
  height: 76px;
  border: 2px solid rgba(255, 250, 240, 0.9);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 250, 240, 0.96) 0 13px, transparent 14px),
    radial-gradient(ellipse at 50% 74%, rgba(255, 250, 240, 0.96) 0 25px, transparent 26px),
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.55), transparent 30%),
    #e8d3b0;
  box-shadow: 0 8px 18px rgba(74, 55, 28, 0.13);
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.students-page .envelope-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.students-page .envelope-card__status {
  position: absolute;
  top: 16px;
  right: 0;
  padding: 4px 10px;
  border: 1px solid rgba(92, 70, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.78);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
}

.students-page .envelope-card__name {
  position: relative;
  z-index: 2;
  font-family: Georgia, "SimSun", serif;
  font-size: 29px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.students-page .envelope-card__nickname {
  position: relative;
  z-index: 2;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.42;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.students-page .envelope-card--private .envelope-card__back,
.students-page .envelope-card--private .envelope-card__flap,
.students-page .envelope-card--private .envelope-card__pocket,
.students-page .envelope-card--unclaimed .envelope-card__back,
.students-page .envelope-card--unclaimed .envelope-card__flap,
.students-page .envelope-card--unclaimed .envelope-card__pocket {
  filter: saturate(0.72);
}

.students-page .letter-overlay {
  z-index: 40;
  padding: 28px;
}

.students-page .letter-overlay__backdrop {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 250, 240, 0.48), transparent 38%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.18), rgba(246, 239, 227, 0.10)),
    rgba(47, 42, 37, 0.28);
}

.students-page .letter-stage {
  width: min(100%, 920px);
  min-height: 700px;
}

.students-page .letter-stage__close {
  top: 0;
  right: 16px;
}

.students-page .enlarged-envelope {
  width: min(780px, 94vw);
  height: 500px;
}

.students-page .enlarged-envelope__back {
  inset: 96px 0 0;
}

.students-page .enlarged-envelope__flap {
  top: 96px;
  height: 230px;
}

.students-page .enlarged-envelope__pocket {
  height: 296px;
}

.students-page .letter-paper {
  bottom: 154px;
  width: min(700px, calc(100vw - 64px));
  max-height: min(74vh, 660px);
  padding: 40px 48px 112px;
  font-size: 17px;
  line-height: 1.75;
}

.students-page .letter-paper__content {
  gap: 22px;
}

.students-page .letter-paper__quote {
  font-size: 22px;
}

.students-page .letter-paper__detail {
  padding: 15px 18px;
  border-left: 3px solid rgba(111, 141, 115, 0.38);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 250, 240, 0.58);
}

.students-page .letter-paper__header h2 {
  font-size: 36px;
}

.announcement-page .page-main {
  padding-top: clamp(48px, 8vh, 92px);
}

.announcement-shell {
  display: grid;
  justify-items: center;
  color: var(--ink);
}

.announcement-paper {
  position: relative;
  width: min(760px, 100%);
  min-height: min(68vh, 680px);
  padding: clamp(34px, 5vw, 56px);
  border: 1px solid rgba(92, 70, 42, 0.14);
  border-radius: 8px;
  background-color: var(--paper-bg, #fffaf0);
  background-image:
    linear-gradient(90deg, rgba(178, 95, 95, 0.10) 0, rgba(178, 95, 95, 0.10) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(0deg, transparent 0, transparent 35px, rgba(92, 70, 42, 0.07) 36px),
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.66), transparent 34%),
    repeating-linear-gradient(34deg, rgba(92, 70, 42, 0.024) 0, rgba(92, 70, 42, 0.024) 1px, transparent 1px, transparent 11px);
  box-shadow: 0 24px 60px rgba(80, 55, 24, 0.18);
}

.announcement-paper h1 {
  margin: 0 0 28px;
  color: #3f3325;
  font-family: "Times New Roman", "SimSun", "Songti SC", serif;
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
}

.announcement-paper__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(92, 70, 42, 0.18);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.94);
  color: #5f4a2d;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(44, 31, 20, 0.12);
}

.announcement-paper__close:hover,
.announcement-paper__close:focus-visible {
  color: var(--seal-green);
  border-color: rgba(111, 141, 115, 0.42);
}

.announcement-paper__blank {
  min-height: 420px;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 35px, rgba(92, 70, 42, 0.12) 36px);
}

.announcement-paper__content {
  display: grid;
  gap: 18px;
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.9;
}

.announcement-paper__version {
  margin: 0;
  color: #5f4a2d;
  font-family: "Times New Roman", "SimSun", "Songti SC", serif;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  text-align: center;
}

.announcement-paper__summary {
  margin: 0;
  color: #3f3325;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  text-align: center;
}

.announcement-paper__list {
  display: grid;
  gap: 14px;
  margin: 8px 0 0;
}

.announcement-paper__list div {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(92, 70, 42, 0.10);
}

.announcement-paper__list div:last-child {
  border-bottom: 0;
}

.announcement-paper__list dt {
  color: var(--seal-green);
  font-weight: 700;
}

.announcement-paper__list dd {
  min-width: 0;
  margin: 0;
  color: #493a2a;
}

.announcement-paper__permissions {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(92, 70, 42, 0.14);
}

.announcement-paper__permissions h2 {
  margin: 0;
  color: #3f3325;
  font-size: clamp(20px, 2.6vw, 25px);
  line-height: 1.35;
  text-align: center;
}

.announcement-paper__permission-list {
  display: grid;
  gap: 14px;
}

.announcement-paper__permission-list section {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(111, 141, 115, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
}

.announcement-paper__permission-list h3 {
  margin: 0;
  color: var(--seal-green);
  font-size: 18px;
  line-height: 1.45;
}

.announcement-paper__permission-list p {
  margin: 0;
  color: #493a2a;
}

.photo-wall-page .page-main {
  padding-top: clamp(54px, 8vh, 96px);
}

.photo-wall-shell {
  display: grid;
  gap: 34px;
  color: var(--ink);
}

.photo-wall-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 24px 8px 0;
}

.photo-wall-hero h1 {
  grid-column: 1;
  margin: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.08;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.photo-wall__upload {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  max-width: 420px;
  padding: 14px;
  border: 1px solid rgba(92, 70, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.74);
  box-shadow: 0 18px 38px rgba(67, 48, 30, 0.08);
  backdrop-filter: blur(8px);
}

.photo-wall__upload label {
  grid-column: 1 / -1;
  color: var(--seal-green);
  font-size: 14px;
}

.photo-wall__upload input {
  background: rgba(255, 255, 255, 0.62);
}

.photo-wall__login {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  background: rgba(255, 250, 240, 0.72);
}

.photo-wall-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: clamp(22px, 4vw, 54px);
  align-items: start;
  padding: clamp(50px, 6vh, 64px) 4px 80px;
  isolation: isolate;
}

.photo-wall-board::before {
  content: "";
  position: absolute;
  inset: 26px 1% auto;
  height: 220px;
  border-top: 2px solid rgba(143, 103, 57, 0.16);
  border-radius: 50%;
  transform: rotate(-2deg);
  pointer-events: none;
}

.photo-wall__item {
  position: relative;
  z-index: var(--photo-z, 1);
  width: min(100%, 540px);
  margin: var(--photo-offset, 0) auto 0;
  color: inherit;
  transform: rotate(var(--photo-tilt, 0deg));
  transform-origin: 50% 22%;
  transition: transform 180ms ease, filter 180ms ease;
}

.photo-wall__preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.photo-wall__item:nth-child(2n) {
  justify-self: start;
}

.photo-wall__item:nth-child(2n + 1) {
  justify-self: end;
}

.photo-wall__item:hover,
.photo-wall__item:focus-within {
  z-index: 30;
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  filter: drop-shadow(0 22px 28px rgba(44, 31, 20, 0.2));
}

.photo-wall__preview:focus-visible,
.photo-wall__delete:focus-visible {
  outline: 3px solid rgba(111, 141, 115, 0.48);
  outline-offset: 8px;
}

.photo-wall__delete-form {
  position: absolute;
  top: 12%;
  right: 7%;
  z-index: 5;
  max-width: none;
}

.photo-wall__delete {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(92, 70, 42, 0.2);
  border-radius: 999px;
  background: rgba(178, 59, 59, 0.94);
  color: #fffaf0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(44, 31, 20, 0.2);
}

.photo-wall__delete:hover {
  background: #8f2f2f;
}

.photo-wall__frame {
  position: relative;
  aspect-ratio: 910 / 710;
  filter: drop-shadow(0 18px 24px rgba(44, 31, 20, 0.18));
}

.photo-wall__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("/images/photo-wall/film-frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
}

.photo-wall__image {
  position: absolute;
  inset: 17% 5.6% 18.6%;
  z-index: 1;
  overflow: hidden;
  background: #f8f1e5;
}

.photo-wall__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 36%;
}

.photo-wall__empty {
  grid-column: 1 / -1;
  padding: 80px 24px;
  color: var(--ink-muted);
  text-align: center;
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.photo-lightbox.is-visible {
  opacity: 1;
}

.photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(47, 42, 37, 0.36);
  cursor: zoom-out;
}

.photo-lightbox__stage {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-width: min(96vw, 1120px);
  max-height: min(92vh, 920px);
  margin: 0;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid rgba(255, 250, 240, 0.44);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 26px 70px rgba(30, 22, 15, 0.34);
  transform: translateY(12px) scale(0.98);
  transition: transform 180ms ease;
}

.photo-lightbox.is-visible .photo-lightbox__stage {
  transform: translateY(0) scale(1);
}

.photo-lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(92, 70, 42, 0.18);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.96);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(44, 31, 20, 0.18);
}

.photo-lightbox__image {
  display: block;
  max-width: calc(96vw - 56px);
  max-height: calc(92vh - 86px);
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
}

.photo-lightbox figcaption {
  min-height: 1.2em;
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}

@keyframes hangingSwing {
  0% {
    transform: rotate(var(--tilt, 0deg)) translateY(0);
  }
  35% {
    transform: rotate(1.3deg) translateY(-7px);
  }
  70% {
    transform: rotate(-0.8deg) translateY(-4px);
  }
  100% {
    transform: rotate(0deg) translateY(-6px);
  }
}

@media (max-width: 1020px) {
  .photo-wall-board {
    gap: 26px;
  }

  .students-page .letter-rope-row {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 30px;
  }

  .students-page .letter-rope-row--count-1 {
    grid-template-columns: minmax(260px, 360px);
  }

  .students-page .letter-rope-row::before {
    right: -30px;
    left: -30px;
    height: 176px;
    background-size: 112% 100%;
  }
}

@media (max-width: 760px) {
  .students-page body::after {
    opacity: 0.76;
    background-position:
      left -110px top 500px,
      right -260px top 690px,
      center top;
    background-size:
      150px auto,
      420px auto,
      100% 680px;
  }

  .students-page .page-main {
    padding: clamp(56px, 9vh, 96px) 0 40px;
  }

  .students-page .envelope-wall__hero {
    min-height: 190px;
    padding: 26px 2px 12px;
  }

  .students-page .envelope-wall__hero h1 {
    font-size: clamp(30px, 9vw, 38px);
  }

  .students-page .envelope-wall__lead {
    font-size: 16px;
  }

  .students-page .section-heading {
    display: grid;
    gap: 2px;
  }

  .photo-wall-hero {
    grid-template-columns: 1fr;
  }

  .photo-wall__upload,
  .photo-wall__login {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .photo-wall-board {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 44px;
  }

  .photo-wall__item,
  .photo-wall__item:nth-child(2n),
  .photo-wall__item:nth-child(2n + 1) {
    justify-self: center;
    width: min(100%, 520px);
    margin-top: min(var(--photo-offset, 0px), 34px);
  }

  .students-page .letter-rope-board {
    gap: 24px;
    padding-top: 0;
  }

  .students-page .letter-rope-row,
  .students-page .letter-rope-row--count-1,
  .students-page .letter-rope-row--count-2 {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 46px 0 0;
  }

  .students-page .letter-rope {
    right: 12px;
    left: 12px;
  }

  .students-page .letter-rope-row::before {
    top: 78px;
    right: -28px;
    left: -28px;
    height: 160px;
    opacity: 0.24;
    background-size: 760px 160px;
  }

  .students-page .letter-rope-row::after {
    top: 142px;
    right: 10px;
    left: 10px;
    height: 86px;
    opacity: 0.11;
  }

  .students-page .envelope-card {
    min-height: 198px;
  }

  .students-page .envelope-card::before {
    inset: 70px -18px -10px;
    opacity: 0.22;
    background-size: 124% auto;
  }

  .students-page .envelope-card__content {
    inset: 30px 18px 22px;
  }

  .students-page .envelope-card__flap {
    height: 98px;
  }

  .students-page .envelope-card__pocket {
    height: 116px;
  }

  .students-page .envelope-card__name {
    font-size: 28px;
  }

  .students-page .letter-overlay {
    align-items: end;
    padding: 0;
  }

  .students-page .letter-stage {
    width: 100%;
    min-height: 92vh;
  }

  .students-page .letter-stage__close {
    top: 14px;
    right: 14px;
  }

  .students-page .enlarged-envelope {
    left: 50%;
    right: auto;
    bottom: 0;
    width: min(430px, 96vw);
    height: 318px;
    transform: translateX(-50%);
  }

  .students-page .enlarged-envelope__back {
    inset: 66px 0 0;
  }

  .students-page .enlarged-envelope__flap {
    top: 66px;
    height: 142px;
  }

  .students-page .enlarged-envelope__pocket {
    height: 192px;
  }

  .students-page .letter-paper {
    bottom: 92px;
    width: min(368px, calc(100vw - 20px));
    max-height: 76vh;
    padding: 26px 22px 78px;
    border-radius: 8px;
    transform: translate(-50%, 120px) scale(0.98);
    font-size: 16px;
  }

  .students-page .letter-paper__header {
    grid-template-columns: 62px 1fr;
  }

  .students-page .letter-paper__avatar {
    width: 62px;
    height: 62px;
    font-size: 26px;
  }

  .students-page .letter-paper__header h2 {
    font-size: 27px;
  }

  .students-page .letter-paper__content {
    gap: 18px;
  }

  .students-page .letter-paper__detail {
    grid-template-columns: 1fr;
    row-gap: 5px;
    padding: 13px 15px;
  }

  .students-page .letter-paper__detail-label {
    font-size: 13px;
    line-height: 1.45;
  }

  .announcement-page .page-main {
    padding-top: 34px;
  }

  .announcement-paper {
    min-height: 64vh;
    padding: 28px 22px 34px;
  }

  .announcement-paper h1 {
    margin-bottom: 22px;
    font-size: 30px;
  }

  .announcement-paper__close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 26px;
  }

  .announcement-paper__blank {
    min-height: 360px;
  }

  .announcement-paper__content {
    gap: 14px;
    font-size: 16px;
    line-height: 1.78;
  }

  .announcement-paper__list div {
    grid-template-columns: 1fr;
    gap: 3px;
    padding-bottom: 11px;
  }

  .announcement-paper__permissions {
    margin-top: 8px;
    padding-top: 16px;
  }

  .announcement-paper__permission-list section {
    padding: 12px 13px;
  }
}

@media (max-width: 380px) {
  .photo-wall__upload {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .students-page .envelope-card__name {
    font-size: 26px;
  }

  .students-page .envelope-card__nickname {
    font-size: 14px;
  }
}

.students-page .envelope-card__review-tag {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 17px 7px 13px;
  border: 1px solid rgba(92, 70, 42, 0.22);
  border-radius: 4px 12px 12px 4px;
  background:
    linear-gradient(90deg, rgba(111, 141, 115, 0.88), rgba(93, 120, 97, 0.94)),
    repeating-linear-gradient(0deg, rgba(255, 250, 240, 0.12) 0 1px, transparent 1px 7px);
  color: #fffaf0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  box-shadow: 0 8px 16px rgba(60, 45, 25, 0.18);
}

.students-page .envelope-card__review-tag::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  width: 13px;
  height: 13px;
  border-left: 1px solid rgba(92, 70, 42, 0.20);
  border-bottom: 1px solid rgba(92, 70, 42, 0.20);
  background: rgba(111, 141, 115, 0.9);
  transform: translateY(-50%) rotate(45deg);
}

.students-page .envelope-card__review-tag::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.72);
  transform: translateY(-50%);
}

.students-page .envelope-card__review-label {
  position: relative;
  z-index: 1;
}

.students-page .envelope-card__review-count {
  position: absolute;
  top: -9px;
  right: -9px;
  z-index: 2;
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border: 2px solid #fffaf0;
  border-radius: 999px;
  background: #b25f5f;
  color: #fffaf0;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 7px 12px rgba(60, 45, 25, 0.18);
}

.students-page .envelope-card:hover .envelope-card__review-tag,
.students-page .envelope-card:focus-visible .envelope-card__review-tag {
  background:
    linear-gradient(90deg, rgba(123, 151, 104, 0.94), rgba(93, 120, 97, 0.98)),
    repeating-linear-gradient(0deg, rgba(255, 250, 240, 0.12) 0 1px, transparent 1px 7px);
}

.students-page .review-overlay {
  z-index: 45;
}

.students-page .review-stage {
  width: min(100%, 920px);
  min-height: 700px;
}

.students-page .review-paper {
  top: 50%;
  bottom: auto;
  width: min(700px, calc(100vw - 64px));
  max-height: min(74vh, 660px);
  padding: 34px 42px 34px;
  transform: translate(-50%, -44%) scale(0.96);
  transition: opacity 180ms ease, transform 220ms ease;
}

.students-page .review-overlay.is-opening .review-paper,
.students-page .review-overlay.is-open .review-paper {
  animation: none;
}

.students-page .review-overlay .review-paper__header,
.students-page .review-overlay .review-paper__body {
  opacity: 1;
  animation: none;
}

.students-page .review-paper__header {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.students-page .review-paper__header h2 {
  margin: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: 34px;
}

.students-page .review-paper__header p {
  margin: 0;
  color: var(--seal-green);
  font-size: 14px;
  font-weight: 700;
}

.students-page .review-paper__body {
  display: grid;
  gap: 12px;
}

.students-page .review-form__message,
.students-page .review-login-note {
  min-height: 20px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.students-page .review-form__message.is-error {
  color: #9f3c3c;
}

.students-page .review-bubbles {
  display: grid;
  max-height: min(46vh, 392px);
  gap: 14px;
  overflow-y: auto;
  padding: 4px 8px 6px 0;
}

.students-page .review-bubbles__empty {
  margin: 0;
  color: var(--ink-muted);
}

.students-page .review-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 132px;
  padding: 20px 24px;
  border: 1px solid rgba(92, 70, 42, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 250, 240, 0.72)),
    rgba(252, 244, 232, 0.84);
  box-shadow: 0 18px 38px rgba(74, 55, 28, 0.10);
}

.students-page .review-card--editing {
  border-color: rgba(111, 141, 115, 0.24);
  box-shadow: 0 22px 44px rgba(74, 55, 28, 0.13);
}

.students-page .review-card__profile {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.students-page .review-card__avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(92, 70, 42, 0.10);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 250, 240, 0.96) 0 14px, transparent 15px),
    radial-gradient(ellipse at 50% 74%, rgba(255, 250, 240, 0.96) 0 25px, transparent 26px),
    rgba(232, 211, 176, 0.72);
  color: #8a5b28;
  font-family: Georgia, "SimSun", serif;
  font-size: 26px;
  font-weight: 700;
  overflow: hidden;
}

.students-page .review-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.students-page .review-card__name {
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.students-page .review-card__body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.students-page .review-card__content {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.students-page .review-card textarea {
  min-height: 98px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.62);
}

.students-page .review-card__counter {
  justify-self: end;
  color: var(--ink-muted);
  font-size: 13px;
}

.students-page .review-actions {
  position: sticky;
  bottom: -2px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0), var(--paper-bg, #fffaf0) 28%);
}

.students-page .review-actions[hidden] {
  display: none;
}

.students-page .review-actions .button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

@media (max-width: 760px) {
  .students-page .envelope-card__review-tag {
    right: 12px;
    bottom: 10px;
    min-height: 32px;
    padding: 7px 15px 7px 12px;
    font-size: 12px;
  }

  .students-page .review-stage {
    width: 100%;
    min-height: 92vh;
  }

  .students-page .review-paper {
    top: 50%;
    bottom: auto;
    width: min(368px, calc(100vw - 20px));
    max-height: 76vh;
    padding: 26px 22px 28px;
    transform: translate(-50%, -44%) scale(0.96);
  }

  .students-page .review-bubbles {
    max-height: 44vh;
  }

  .students-page .review-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    min-height: 118px;
    padding: 16px;
    border-radius: 22px;
  }

  .students-page .review-card__avatar {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }

  .students-page .review-card__content {
    font-size: 15px;
  }

  .students-page .review-actions {
    justify-content: stretch;
  }

  .students-page .review-actions .button {
    flex: 1;
  }
}
