:root {
  --green: #2db98d;
  --green-deep: #20aa80;
  --text: #202124;
  --muted: #8b8f95;
  --line: #edf0f2;
  --shadow: 0 4px 14px rgba(22, 39, 68, 0.11);
  --topbar-h: clamp(56px, 10.9vw, 74px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
  width: 100%;
  min-width: 320px;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--topbar-h);
  background: var(--green);
  color: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(19px, 4.2vw, 28px);
  line-height: 1;
  font-weight: 500;
}

.back-button {
  position: absolute;
  left: clamp(14px, 4.3vw, 28px);
  top: 50%;
  width: clamp(34px, 7.3vw, 46px);
  height: clamp(34px, 7.3vw, 46px);
  transform: translateY(-50%);
  color: #fff;
}

.back-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content {
  height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  padding: clamp(18px, 4.2vw, 30px) clamp(18px, 4.2vw, 36px) clamp(24px, 5.6vw, 44px);
  scrollbar-width: none;
}

.content::-webkit-scrollbar {
  display: none;
}

.cert-banner {
  display: block;
  width: 100%;
  height: clamp(96px, 21.2vw, 150px);
  overflow: hidden;
  border-radius: clamp(7px, 1.45vw, 11px);
  background: #65adf5;
}

.cert-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-section {
  margin-top: clamp(24px, 5.45vw, 40px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(14px, 3.1vw, 22px);
}

.info-section h2 {
  margin: 0;
  color: #202124;
  font-size: clamp(22px, 4.7vw, 32px);
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
}

.section-head p {
  margin: 0;
  color: #92979d;
  font-size: clamp(14px, 3.1vw, 20px);
  line-height: 1.3;
  white-space: nowrap;
}

.bind-link {
  color: var(--green);
}

.student-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: clamp(122px, 22.5vw, 174px);
  padding: clamp(24px, 5.4vw, 38px) clamp(24px, 5.4vw, 42px);
  overflow: hidden;
  border-radius: clamp(7px, 1.45vw, 12px);
  background: linear-gradient(135deg, #34c69c 0%, #26bf8a 62%, #28c997 100%);
  box-shadow: var(--shadow);
  color: #fff;
}

.student-card h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(23px, 5.1vw, 34px);
  line-height: 1.25;
  font-weight: 400;
}

.student-card p {
  margin: clamp(18px, 4vw, 30px) 0 0;
  color: #fff;
  font-size: clamp(17px, 3.8vw, 25px);
  line-height: 1.35;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(52px, 11.25vw, 76px);
  height: clamp(31px, 6.2vw, 44px);
  margin-top: 2px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 130, 96, 0.33);
  color: #fff;
  font-size: clamp(15px, 3.35vw, 22px);
  white-space: nowrap;
}

.empty-card,
.postgraduate-card {
  overflow: hidden;
  border-radius: clamp(8px, 1.8vw, 13px);
  background: #fff;
  box-shadow: var(--shadow);
}

.empty-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(96px, 18.7vw, 140px);
  padding: 18px 22px;
  color: #25272a;
  font-size: clamp(23px, 5vw, 33px);
  line-height: 1.35;
  text-align: center;
}

.degree-empty .empty-main {
  padding-left: clamp(28px, 6.5vw, 56px);
  padding-right: clamp(28px, 6.5vw, 56px);
}

.help {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 5px;
  border: 1px solid #8c8f94;
  border-radius: 50%;
  color: #8c8f94;
  font-size: 14px;
  line-height: 1;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(52px, 10.7vw, 76px);
  border-top: 1px solid var(--line);
  color: var(--green);
  font-size: clamp(17px, 3.8vw, 25px);
}

.card-action span {
  width: 9px;
  height: 9px;
  margin: -4px 0 0 8px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.card-action[aria-expanded="true"] span {
  margin-top: 4px;
  transform: rotate(225deg);
}

.expand-panel {
  border-top: 1px solid var(--line);
  padding: clamp(14px, 3.4vw, 24px) clamp(20px, 4.5vw, 34px);
  background: #fff;
}

.expand-panel[hidden] {
  display: none;
}

.expand-panel p {
  margin: 0;
  color: #6f747a;
  font-size: clamp(14px, 3.2vw, 20px);
  line-height: 1.65;
}

.postgraduate {
  padding-bottom: 20px;
}

.postgraduate > h2 {
  margin-bottom: clamp(12px, 2.9vw, 20px);
}

.postgraduate-card {
  padding: clamp(20px, 4.8vw, 34px) clamp(22px, 5.3vw, 40px);
  text-align: center;
}

.postgraduate-card strong {
  display: block;
  font-size: clamp(20px, 4.4vw, 28px);
  line-height: 1.3;
  font-weight: 500;
}

.postgraduate-card p {
  margin: clamp(12px, 2.9vw, 20px) 0 0;
  color: #92979d;
  font-size: clamp(14px, 3.1vw, 20px);
  line-height: 1.55;
}

.editor-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.34);
}

.editor-mask[hidden] {
  display: none;
}

.editor {
  width: min(100%, 520px);
  padding: 22px 20px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.editor h2 {
  margin: 0 0 16px;
  font-size: 21px;
  font-weight: 600;
}

.editor label {
  display: block;
  margin-top: 12px;
}

.editor label span {
  display: block;
  margin-bottom: 7px;
  color: #60656b;
  font-size: 14px;
}

.editor input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dfe4e8;
  border-radius: 7px;
  color: #222;
  outline: none;
}

.editor input:focus {
  border-color: var(--green);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.cancel-button,
.save-button {
  min-width: 76px;
  height: 38px;
  border-radius: 19px;
  font-size: 15px;
}

.cancel-button {
  background: #f1f3f5;
  color: #555b61;
}

.save-button {
  background: var(--green);
  color: #fff;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  max-width: calc(100% - 48px);
  transform: translate(-50%, 10px);
  padding: 9px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 420px) {
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head p {
    font-size: 13px;
  }

  .empty-main {
    font-size: 20px;
  }
}

/* Mobile dimensions matched to the saved education-info reference. */
@media (max-width: 767px) {
  .page { --u: 10vw; --topbar-h: calc(var(--u) * 1.173); }
  .topbar { background: #26b887; }
  .topbar h1 { font-size: 16px; line-height: 22px; }
  .back-button { left: 16px; width: 18px; height: 24px; }
  .content { padding: calc(var(--u) * .32) calc(var(--u) * .427) max(24px, env(safe-area-inset-bottom)); }
  .cert-banner { height: calc(var(--u) * 2.133); border-radius: calc(var(--u) * .16); }
  .info-section { margin-top: calc(var(--u) * .267); }
  .section-head { flex-direction: row; align-items: center; gap: 0; min-height: calc(var(--u) * 1.067); margin-bottom: calc(var(--u) * .053); }
  .info-section h2 { font-size: calc(var(--u) * .427); line-height: 1.5; color: #333; }
  .section-head h2 { flex: 0 0 33.333%; }
  .section-head p { flex: 1; min-width: 0; font-size: calc(var(--u) * .32); line-height: 1.5; text-align: right; color: #999; white-space: normal; }
  .bind-link { color: #26b887; }
  .student-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; min-height: 0; padding: calc(var(--u) * .427); border-radius: calc(var(--u) * .16); background: linear-gradient(90deg, #1faf7f, #3fcb92); box-shadow: 0 calc(var(--u) * .107) calc(var(--u) * .213) rgba(63,203,146,.4); }
  .student-card > div { display: contents; }
  .student-card h3 { grid-column: 1; padding-right: calc(var(--u) * .267); font-size: calc(var(--u) * .48); line-height: calc(var(--u) * .667); font-weight: 500; overflow-wrap: anywhere; }
  .student-card p { grid-column: 1 / -1; grid-row: 2; margin: calc(var(--u) * .24) 0 0; font-size: calc(var(--u) * .347); line-height: calc(var(--u) * .48); overflow-wrap: anywhere; }
  .level-pill { grid-column: 2; grid-row: 1; min-width: 0; height: calc(var(--u) * .533); margin-top: calc(var(--u) * .107); padding: 0 calc(var(--u) * .213); border-radius: calc(var(--u) * .267); font-size: calc(var(--u) * .32); line-height: calc(var(--u) * .533); background: #1da36e; }
  .empty-card, .postgraduate-card { border-radius: calc(var(--u) * .16); box-shadow: 0 calc(var(--u) * .053) calc(var(--u) * .213) rgba(0,0,0,.1); }
  .empty-main, .degree-empty .empty-main { display: block; min-height: 0; padding: calc(var(--u) * .613) calc(var(--u) * .3) calc(var(--u) * .453); font-size: calc(var(--u) * .48); line-height: calc(var(--u) * .667); color: #333; }
  .help { display: inline-grid; width: calc(var(--u) * .373); height: calc(var(--u) * .373); font-size: calc(var(--u) * .267); vertical-align: middle; }
  .card-action { height: auto; padding: calc(var(--u) * .213); font-size: calc(var(--u) * .373); line-height: 1.5; color: #26b887; }
  .card-action span { width: calc(var(--u) * .16); height: calc(var(--u) * .16); }
  .expand-panel { padding: calc(var(--u) * .507) calc(var(--u) * .4); }
  .expand-panel p { font-size: calc(var(--u) * .373); line-height: calc(var(--u) * .587); }
  .postgraduate > h2 { display: flex; align-items: center; min-height: calc(var(--u) * 1.067); margin-bottom: calc(var(--u) * .053); }
  .postgraduate-card { padding: calc(var(--u) * .427); }
  .postgraduate-card strong { font-size: calc(var(--u) * .48); line-height: calc(var(--u) * .667); font-weight: 400; }
  .postgraduate-card p { margin: calc(var(--u) * .24) 0 0; font-size: calc(var(--u) * .347); line-height: calc(var(--u) * .48); color: #999; }
}
