:root {
  --page-bg: #fbf5ed;
  --page-bg-strong: #fffaf3;
  --text-main: #121212;
  --text-soft: #8d877f;
  --student-start: #fff2bc;
  --student-end: #fff8e7;
  --student-accent-start: #ffb320;
  --student-accent-end: #ff9d08;
  --teacher-start: #ece9ff;
  --teacher-end: #f8f4ff;
  --teacher-accent-start: #6c59ff;
  --teacher-accent-end: #5247f3;
  --community-accent: #f29a26;
  --community-accent-strong: #e68118;
  --community-accent-soft: #fff3df;
  --community-accent-soft-strong: #ffe6bc;
  --community-surface: rgba(255, 255, 255, 0.92);
  --community-border: rgba(236, 222, 204, 0.92);
  --community-shadow: 0 12px 28px rgba(215, 193, 164, 0.16);
  --community-shadow-soft: 0 8px 18px rgba(215, 193, 164, 0.12);
  --community-radius-lg: 22px;
  --community-radius-md: 16px;
  --community-radius-sm: 12px;
  --community-gap: 14px;
  /* Unified radius system */
  --r-xs: 10px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-round: 999px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

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

[hidden] {
  display: none !important;
}

.page-home {
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 248, 231, 0.95) 0, rgba(255, 248, 231, 0) 36%),
    linear-gradient(180deg, #fffdf9 0%, var(--page-bg) 100%);
}

.home-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  padding: 30px 22px 26px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0.16) 100%),
    var(--page-bg-strong);
}

.home-shell::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 248, 232, 0.92) 0, rgba(255, 248, 232, 0) 32%),
    radial-gradient(circle at 52% 102%, rgba(255, 237, 177, 0.92) 0, rgba(255, 237, 177, 0.44) 14%, rgba(255, 237, 177, 0) 34%);
  content: "";
  pointer-events: none;
}

.home-shell::after {
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: 54px;
  height: 148px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 247, 213, 0.85) 0, rgba(255, 247, 213, 0.32) 44%, rgba(255, 247, 213, 0) 70%);
  content: "";
  pointer-events: none;
}

.spark {
  position: absolute;
  z-index: 1;
  font-size: 1.95rem;
  line-height: 1;
  text-shadow: 0 10px 24px rgba(255, 193, 33, 0.18);
}

.spark--left {
  top: 126px;
  left: 34px;
  color: #f6c538;
}

.spark--right {
  top: 236px;
  right: 44px;
  font-size: 1.45rem;
  color: #9fd048;
}

.leaf-cluster {
  position: absolute;
  left: 10px;
  bottom: 140px;
  z-index: 1;
  width: 90px;
  height: 140px;
}

.leaf {
  position: absolute;
  bottom: 0;
  border-radius: 999px 999px 20px 999px;
  background: linear-gradient(180deg, #c7ec89 0%, #8fca53 100%);
  box-shadow: inset -10px -10px 18px rgba(255, 255, 255, 0.28);
  transform-origin: bottom center;
}

.leaf::after {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 2px;
  height: 80%;
  background: rgba(109, 167, 76, 0.45);
  content: "";
  transform: translateX(-50%);
}

.leaf--left {
  left: 4px;
  width: 26px;
  height: 74px;
  transform: rotate(-28deg);
}

.leaf--center {
  left: 30px;
  width: 34px;
  height: 116px;
}

.leaf--right {
  left: 58px;
  width: 24px;
  height: 72px;
  transform: rotate(20deg);
}

.hero,
.role-list,
.switch-hint {
  position: relative;
  z-index: 2;
}

.hero {
  padding-top: 112px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.brand__word {
  font-size: clamp(3.5rem, 11vw, 4.6rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.06em;
  color: #2f389f;
}

.brand__plus {
  margin-bottom: 4px;
  font-size: clamp(3rem, 9vw, 3.7rem);
  font-weight: 900;
  line-height: 1;
  color: #ffb320;
}


.hero__title {
  margin: 22px 0 0;
  font-size: clamp(2.1rem, 5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero__subtitle {
  margin: 16px 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-soft);
}

.role-list {
  margin-top: 44px;
  display: grid;
  gap: 20px;
}

.role-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 30px;
  padding: 30px 24px;
  box-shadow: 0 20px 48px rgba(216, 196, 164, 0.18);
}

.role-card::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.role-card--student {
  background: linear-gradient(135deg, var(--student-start) 0%, #fff7da 48%, var(--student-end) 100%);
}

.role-card--student::before {
  background:
    radial-gradient(circle at 26% 14%, rgba(255, 255, 255, 0.46) 0, rgba(255, 255, 255, 0) 34%),
    linear-gradient(90deg, rgba(255, 231, 149, 0.18) 0, rgba(255, 231, 149, 0) 48%);
}

.role-card--teacher {
  background: linear-gradient(135deg, var(--teacher-start) 0%, #f8f3ff 52%, var(--teacher-end) 100%);
}

.role-card--teacher::before {
  background:
    radial-gradient(circle at 26% 14%, rgba(255, 255, 255, 0.52) 0, rgba(255, 255, 255, 0) 34%),
    linear-gradient(90deg, rgba(112, 96, 255, 0.05) 0, rgba(112, 96, 255, 0) 48%);
}

.role-card__content {
  position: relative;
  z-index: 2;
  max-width: 52%;
}

.role-card__title {
  margin: 16px 0 0;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.role-card__text {
  margin: 24px 0 0;
  font-size: 1rem;
  line-height: 1.9;
  color: #6f6a62;
}

.role-card__button {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  border-radius: 999px;
  padding: 0 30px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.role-card__button--student {
  background: linear-gradient(135deg, var(--student-accent-start) 0%, var(--student-accent-end) 100%);
  box-shadow: 0 16px 30px rgba(255, 170, 26, 0.28);
}

.role-card__button--teacher {
  background: linear-gradient(135deg, var(--teacher-accent-start) 0%, var(--teacher-accent-end) 100%);
  box-shadow: 0 16px 30px rgba(88, 74, 255, 0.25);
}

.role-card__visual {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.role-card__visual--student {
  width: 52%;
}

.role-card__visual--teacher {
  width: 52%;
}

.role-card__image {
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: drop-shadow(0 8px 18px rgba(157, 116, 29, 0.08));
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.36) 14%, #000 28%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.36) 14%, #000 28%);
}

.role-card__image--student {
  transform: translate(6px, 0);
}

.role-card__image--teacher {
  transform: translate(4px, 0);
}

.switch-hint {
  margin-top: auto;
  padding-top: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #98918b;
  font-size: 1.02rem;
}

.switch-hint__icon {
  font-size: 1.2rem;
}

.page-placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 248, 232, 0.92) 0, rgba(255, 248, 232, 0) 38%),
    linear-gradient(180deg, #fffdf9 0%, var(--page-bg) 100%);
}

.placeholder-shell {
  width: min(100%, 760px);
  border-radius: 30px;
  padding: 40px 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 60px rgba(213, 190, 153, 0.18);
  backdrop-filter: blur(10px);
}

.page-placeholder--student .placeholder-shell {
  border: 1px solid rgba(255, 192, 78, 0.25);
}

.page-placeholder--teacher .placeholder-shell {
  border: 1px solid rgba(102, 90, 255, 0.18);
}

.placeholder-shell__badge {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9b948c;
}

.placeholder-shell__title {
  margin: 14px 0 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.placeholder-shell__text {
  margin: 16px 0 0;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.9;
  color: #6f6a62;
}

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

.placeholder-card {
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.76);
}

.page-placeholder--student .placeholder-card {
  box-shadow: inset 0 0 0 1px rgba(255, 182, 34, 0.12);
}

.page-placeholder--teacher .placeholder-card {
  box-shadow: inset 0 0 0 1px rgba(92, 76, 255, 0.1);
}

.placeholder-card h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.placeholder-card p,
.placeholder-card li {
  font-size: 0.98rem;
  line-height: 1.85;
  color: #6f6a62;
}

.placeholder-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.placeholder-shell__actions {
  margin-top: 28px;
}

.placeholder-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 26px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.page-placeholder--student .placeholder-link--primary {
  background: linear-gradient(135deg, var(--student-accent-start) 0%, var(--student-accent-end) 100%);
  box-shadow: 0 14px 30px rgba(255, 170, 26, 0.24);
}

.page-placeholder--teacher .placeholder-link--primary {
  background: linear-gradient(135deg, var(--teacher-accent-start) 0%, var(--teacher-accent-end) 100%);
  box-shadow: 0 14px 30px rgba(88, 74, 255, 0.2);
}

.page-student-subpage {
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 248, 231, 0.95) 0, rgba(255, 248, 231, 0) 34%),
    linear-gradient(180deg, #fffdf9 0%, var(--page-bg) 100%);
}

.student-app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0, rgba(255, 255, 255, 0.12) 100%),
    #fffaf3;
}

.surface-card {
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(217, 206, 191, 0.18);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  margin: 18px 0 0;
  font-size: clamp(1.6rem, 5.5vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.page-header p {
  margin: 10px 0 0;
  color: #5d5952;
  font-size: 1rem;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
}

.page-header__spark {
  color: #f6c538;
  font-size: 1.4rem;
  vertical-align: top;
}

.icon-only-button,
.more-button,
.round-icon-button {
  border: 0;
  background: transparent;
  color: #4a4a4a;
  cursor: pointer;
}

.icon-only-button {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.icon-only-button svg,
.round-icon-button svg,
.pill-outline-button svg {
  width: 28px;
  height: 28px;
}

.icon-only-button--dot::after {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a5f;
  content: "";
}

.subpage-topbar {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
}

.subpage-topbar__title {
  margin: 0;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.round-icon-button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #8c8377;
  box-shadow: inset 0 0 0 1px rgba(228, 214, 191, 0.85);
}

.round-icon-button--accent {
  color: #ffab1a;
}

.pill-outline-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(228, 214, 191, 0.85);
  color: #9a8140;
  font-weight: 700;
}

.create-steps {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.create-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: #7a7268;
}

.create-step__icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(228, 219, 207, 0.9);
}

.create-step__icon svg {
  width: 24px;
  height: 24px;
}

.create-step--active {
  color: #ffab1a;
  font-weight: 700;
}

.create-step--active .create-step__icon {
  background: linear-gradient(135deg, #ffb320 0%, #ff9d08 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 170, 26, 0.22);
}

.create-step__label {
  font-size: 0.88rem;
  line-height: 1.35;
}

.create-step__line {
  align-self: start;
  margin-top: 22px;
  height: 2px;
  background: linear-gradient(90deg, rgba(229, 218, 203, 0.2) 0%, rgba(229, 218, 203, 0.9) 40%, rgba(229, 218, 203, 0.2) 100%);
}

.create-card {
  margin-top: 18px;
  padding: 22px 18px 20px;
}

.surface-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.surface-card__title h2 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.surface-card__emoji {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1rem;
}

.surface-card__emoji--orange {
  background: #fff2d7;
}

.surface-card__emoji--blue {
  background: #ecf3ff;
}

.surface-card__emoji--green {
  background: #ecfff2;
}

.surface-card__spark {
  margin-left: 4px;
  color: #f6c538;
}

.field-group {
  display: block;
  margin-top: 22px;
}

.field-group__label {
  display: block;
  margin-bottom: 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.field-group__label em {
  color: #ff7759;
  font-style: normal;
}

.field-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(230, 223, 214, 0.95);
}

.field-box input,
.field-box select {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #2f2f2f;
  font: inherit;
}

.field-box input::placeholder {
  color: #b1aaa2;
}

.field-box small {
  color: #b1aaa2;
  font-size: 0.92rem;
}

.field-box--select select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6f6a62 50%), linear-gradient(135deg, #6f6a62 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

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

.segmented-choice__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border-radius: 16px;
  border: 0;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(230, 223, 214, 0.95);
  font: inherit;
  font-weight: 700;
  color: #4b4742;
}

.segmented-choice__item--active {
  color: #ffab1a;
  box-shadow: inset 0 0 0 2px rgba(255, 171, 26, 0.6);
}

.upload-panel {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 142px;
  padding: 22px;
  border-radius: 20px;
  border: 1px dashed rgba(224, 216, 205, 0.92);
}

.upload-option {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(230, 223, 214, 0.95);
  font: inherit;
  font-weight: 700;
  color: #2e2e2e;
}

.upload-option svg {
  width: 30px;
  height: 30px;
}

.upload-panel__or {
  color: #a8a39c;
}

.create-helper {
  margin: 16px 0 0;
  text-align: center;
  color: #8f8a83;
}

.mint-note {
  margin-top: 16px;
  border-radius: 14px;
  padding: 12px 14px;
  background: #eefcf7;
  color: #5c9c80;
  font-size: 0.94rem;
}

/* ── Publish page ── */
.publish-card .field-group {
  position: relative;
}
.publish-textarea {
  width: 100%;
  min-height: 140px;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  background: #f7f2eb;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #2d2a26;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.publish-textarea:focus {
  box-shadow: inset 0 0 0 2px #ffb320;
}
.publish-card .char-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 0.78rem;
  color: #9d958d;
}
.publish-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.publish-image-item {
  position: relative;
  width: calc(33.33% - 7px);
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f0ebe4;
}
.publish-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.publish-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-cta-button {
  margin-top: 18px;
  display: inline-flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--r-round);
  background: linear-gradient(135deg, #ffb320 0%, #ff9800 100%);
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(255, 170, 26, 0.28);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.primary-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(255, 170, 26, 0.32);
}

.primary-cta-button:active {
  transform: translateY(0);
}

.stats-bar {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.stats-bar__item {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stats-bar__item + .stats-bar__item {
  box-shadow: inset 1px 0 0 rgba(231, 224, 215, 0.9);
}

.stats-bar__icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.stats-bar__icon--blue {
  background: #7fb0ff;
}

.stats-bar__icon--green {
  background: #60c96c;
}

.stats-bar__icon--orange {
  background: #ffb320;
}

.stats-bar__icon--gray {
  background: #8d98a8;
}

.stats-bar__label {
  font-size: 0.94rem;
  color: #4d4d4d;
}

.stats-bar strong {
  font-size: 1.6rem;
  line-height: 1.1;
}

.stats-bar small {
  font-size: 1rem;
  font-weight: 500;
}

.logs-toolbar {
  margin-top: 18px;
  padding: 18px;
}

.segmented-tabs {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-tabs--wide {
  width: calc(100% - 104px);
}

.segmented-tabs__item {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: #4a4640;
}

.segmented-tabs__item--active {
  background: linear-gradient(135deg, #ffb320 0%, #ff9d08 100%);
  color: #fff;
  box-shadow: 0 14px 26px rgba(255, 170, 26, 0.2);
}

.pill-select-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(230, 223, 214, 0.95);
  font: inherit;
  font-weight: 600;
  color: #4a4640;
}

.logs-toolbar__filters {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-toggle {
  margin-left: auto;
  display: inline-flex;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(230, 223, 214, 0.95);
}

.view-toggle__item {
  display: inline-flex;
  width: 54px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #827a70;
}

.view-toggle__item svg {
  width: 22px;
  height: 22px;
}

.view-toggle__item--active {
  color: #ffab1a;
}

.logs-list,
.community-feed {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.logs-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(217, 206, 191, 0.14);
  align-items: stretch;
  min-height: 0;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.logs-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(217, 206, 191, 0.2);
}

.logs-card__thumb {
  position: relative;
  width: 80px;
  min-height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f5ede3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logs-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.logs-card__thumb--fallen {
  background: linear-gradient(135deg, #fbeee6 0%, #f5e3d4 100%);
}

.logs-card__thumb-fallback {
  display: none;
  font-size: 1.6rem;
  font-weight: 800;
  color: #d4b99b;
  line-height: 1;
  user-select: none;
}

.logs-card__thumb--fallen .logs-card__thumb-fallback {
  display: block;
}

/* When image fails but there's still a .logs-card__thumb with img inside,
   the img gets display:none via onerror, so we show fallback via sibling selector.
   We use .logs-card__thumb--fallen (added by onerror JS) to reveal it. */

.logs-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.logs-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logs-card__word {
  font-size: 1.05rem;
  font-weight: 700;
  color: #121212;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logs-card__trans {
  font-size: 0.92rem;
  color: #6e6962;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logs-card__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 2px;
}

.logs-card__loc,
.logs-card__time {
  font-size: 0.78rem;
  color: #a0988e;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill--green {
  background: #e6f7e6;
  color: #2e9a4a;
}

.status-pill--blue {
  background: #eef1ff;
  color: #5577d4;
}

.status-pill--gray {
  background: #f0eeec;
  color: #7a726a;
}

.community-card__body h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

.community-card__translation {
  margin: 6px 0 0;
  color: #2f2f2f;
  font-size: 1rem;
  font-weight: 600;
}

.community-card__sentence {
  margin: 12px 0 0;
  color: #333;
  line-height: 1.5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-list span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 12px;
  background: #f6fbef;
  color: #5e8f5a;
}

.tag-list span:nth-child(2n) {
  background: #fff7df;
  color: #8e7c42;
}

.tag-list span:nth-child(3n) {
  background: #eef4ff;
  color: #5f74a4;
}

.community-card__meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #65615c;
  font-size: 0.94rem;
}

.community-card__social {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #7f7a72;
}

.community-tabs {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px;
}

.community-tabs__item {
  min-height: 54px;
  border: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
  font: inherit;
  font-weight: 700;
  color: #403d39;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.community-tabs__item:hover {
  color: #ffab1a;
}

.community-tabs__item--active {
  color: #ffab1a;
  border-color: #ffab1a;
}

.community-card {
  padding: 18px;
}

.community-card[hidden] {
  display: none;
}

/* ── Image post card ── */
.community-card__images {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin: -2px 0 10px;
  padding-bottom: 4px;
}
.community-card__images::-webkit-scrollbar {
  height: 4px;
}
.community-card__images::-webkit-scrollbar-thumb {
  background: #ddd8d0;
  border-radius: 4px;
}
.community-card__images img {
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  scroll-snap-align: start;
  flex-shrink: 0;
  aspect-ratio: auto;
}
.community-card__content-text {
  white-space: pre-wrap;
  line-height: 1.65;
  color: #2d2a26;
  font-size: 0.95rem;
}

.community-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.community-user__avatar,
.leaderboard__photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.community-user__avatar--pink,
.community-user__avatar--blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
}

.community-user__avatar--pink {
  background: linear-gradient(135deg, #ff9db4 0%, #ff6e8c 100%);
}

.community-user__avatar--blue {
  background: linear-gradient(135deg, #86b6ff 0%, #5e89f2 100%);
}

.community-user__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-user__name-row strong {
  font-size: 1.15rem;
}

.community-user__class {
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff2d7;
  color: #b8882b;
  font-size: 0.82rem;
}

.community-user p {
  margin: 4px 0 0;
  color: #7c776f;
}

.community-user__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.follow-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff7ea;
  color: #ffab1a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.follow-button--active {
  background: #fff1d0;
  color: #c98b14;
}

.more-button {
  min-width: 32px;
  font-size: 1.2rem;
  color: #8f8a83;
}

.community-card__content {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  margin-top: 14px;
  border-radius: 22px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.community-card__content:hover {
  transform: translateY(-1px);
}

.community-card__content:focus-visible {
  outline: 3px solid rgba(255, 171, 26, 0.28);
  outline-offset: 4px;
}

.community-card--expanded .community-card__content {
  background: rgba(255, 247, 234, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 171, 26, 0.14);
}

.community-comments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(236, 231, 223, 0.9);
}

.community-comments p {
  margin: 6px 0 0;
  color: #57524c;
  line-height: 1.45;
}

.community-comments [hidden] {
  display: none !important;
}

.community-comments a {
  display: inline-block;
  margin-top: 10px;
  color: #4a84d9;
}

.community-comments__toggle {
  font-weight: 600;
}

.community-comment-input {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.community-comment-input input {
  flex: 1;
  border: 1px solid #e0d8ce;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 0.82rem;
  background: #f9f6f0;
  outline: none;
}

.community-comment-input input:focus {
  border-color: var(--community-accent);
  background: #fff;
}

.community-comment-input button {
  border: 0;
  border-radius: 18px;
  padding: 6px 16px;
  background: var(--community-accent);
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.community-comment-input button:hover {
  background: var(--community-accent-strong);
}

.community-social-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.community-social-button[aria-expanded="true"] {
  color: #4a84d9;
}

.community-social-button--liked {
  color: #ff8b1f;
}

.community-empty-state {
  margin-top: 16px;
  padding: 18px 20px;
  text-align: center;
}

.community-empty-state[hidden] {
  display: none;
}

.community-empty-state strong {
  display: block;
  color: #403d39;
  font-size: 1rem;
}

.community-empty-state p {
  margin: 8px 0 0;
  color: #756f68;
  line-height: 1.5;
}

.media-visual {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #f4efe7 0%, #ede6da 100%);
}

.community-card__media {
  min-height: 200px;
}

.community-card__media--fallback {
  background: linear-gradient(135deg, #e8e0d6 0%, #ddd4c8 100%);
}

.media-visual--mini {
  width: 46px;
  height: 46px;
  min-height: 46px;
  border-radius: 12px;
}

.media-visual--noodles .media-visual__plate,
.media-visual--soup .media-visual__bowl {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 74%;
  height: 56%;
  border-radius: 50% 50% 38% 38%;
  background: #ffffff;
  transform: translateX(-50%);
  box-shadow: inset 0 -20px 0 #d9dadf;
}

.media-visual--noodles .media-visual__plate::before {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 62%;
  height: 34%;
  border-radius: 50%;
  background:
    repeating-linear-gradient(0deg, #cc9658 0, #cc9658 3px, #dba867 3px, #dba867 6px);
  content: "";
  transform: translateX(-50%);
}

.media-visual__sticks {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 66px;
  height: 6px;
  background: #e1c196;
  transform: rotate(52deg);
  box-shadow: 10px -10px 0 #f4dfbf;
}

.media-visual--orange .media-visual__fruit {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffd98a 0, #ffca55 16%, #ff9f18 58%, #f77a00 100%);
  transform: translateX(-50%);
  box-shadow: 0 18px 26px rgba(242, 128, 0, 0.18);
}

.media-visual--orange .media-visual__leaf {
  position: absolute;
  left: 28px;
  top: 12px;
  width: 34px;
  height: 18px;
  border-radius: 999px 999px 2px 999px;
  background: linear-gradient(135deg, #8ecf5b 0%, #4ea83f 100%);
  transform: rotate(-24deg);
}

.media-visual__stick {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 112px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #90653a 0%, #6b4627 100%);
}

.media-visual__stick--a {
  transform: translateX(-50%) rotate(41deg);
}

.media-visual__stick--b {
  transform: translateX(-50%) rotate(37deg);
}

.media-visual__fork {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 12px;
  height: 88px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b8bec8 0%, #7a8492 100%);
  transform: translateX(-50%) rotate(33deg);
}

.media-visual__fork::before {
  position: absolute;
  top: -10px;
  left: -6px;
  width: 24px;
  height: 20px;
  background:
    linear-gradient(90deg, #0000 0 4px, #b8bec8 4px 7px, #0000 7px 10px, #b8bec8 10px 13px, #0000 13px 16px, #b8bec8 16px 19px, #0000 19px 100%);
  content: "";
}

.media-visual--soup .media-visual__bowl {
  bottom: 22px;
  box-shadow: inset 0 -20px 0 #d6d4d0;
}

.media-visual__soup-piece {
  position: absolute;
  border-radius: 50%;
  background: #e4a34b;
}

.media-visual__soup-piece--a {
  left: 44px;
  top: 54px;
  width: 36px;
  height: 24px;
  border-radius: 40% 60% 55% 45%;
  background: #c68b4c;
}

.media-visual__soup-piece--b {
  left: 88px;
  top: 72px;
  width: 14px;
  height: 14px;
}

.media-visual__soup-piece--c {
  left: 130px;
  top: 62px;
  width: 16px;
  height: 16px;
}

.media-visual--pencil .media-visual__pencil {
  position: absolute;
  left: 16px;
  width: 118px;
  height: 12px;
  border-radius: 999px;
  background: #f1c14f;
}

.media-visual__pencil::after {
  position: absolute;
  right: -16px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 16px solid currentColor;
  content: "";
}

.media-visual__pencil--yellow {
  top: 44px;
  background: #f0c23f;
  color: #f0c23f;
  transform: rotate(22deg);
}

.media-visual__pencil--green {
  top: 74px;
  background: #60b766;
  color: #60b766;
  transform: rotate(18deg);
}

.media-visual__pencil--orange {
  top: 102px;
  background: #f2993d;
  color: #f2993d;
  transform: rotate(-12deg);
}

.media-visual__pencil--blue {
  top: 132px;
  background: #43a3de;
  color: #43a3de;
  transform: rotate(-18deg);
}

.floating-create-button {
  position: sticky;
  left: calc(100% - 84px);
  bottom: 96px;
  display: inline-flex;
  width: 66px;
  height: 66px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb320 0%, #ff9d08 100%);
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  box-shadow: 0 20px 30px rgba(255, 170, 26, 0.28);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.floating-create-button:hover {
  transform: scale(1.06);
  box-shadow: 0 24px 36px rgba(255, 170, 26, 0.34);
}

.floating-create-button:active {
  transform: scale(0.96);
}

.profile-header-actions {
  display: flex;
  gap: 18px;
  padding-top: 8px;
}

.profile-header-action {
  display: flex;
  min-width: 58px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #4f4a44;
}

.profile-header-action__icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(230, 223, 214, 0.95);
  font-size: 1.3rem;
}

.profile-hero {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 14px;
  padding: 22px 18px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #ffe8a9 0%, #ffe9b8 55%, #ffefcc 100%);
  box-shadow: 0 18px 44px rgba(226, 199, 145, 0.22);
}

.profile-hero__main {
  display: flex;
  gap: 14px;
}

.profile-hero__avatar {
  width: 94px;
  height: 94px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 20px rgba(255, 190, 74, 0.22);
}

.profile-hero__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-hero__name-row h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
}

.profile-hero__text p {
  margin: 8px 0 0;
  color: #59534d;
}

.profile-hero__exp {
  margin-top: 14px;
}

.profile-progress {
  margin-top: 10px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

.profile-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb320 0%, #ff9900 100%);
}

.level-pill {
  display: inline-flex;
  margin-top: 12px;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 154, 24, 0.18);
  color: #ff8b00;
  font-weight: 800;
}

.profile-hero__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.badge-emblem {
  position: relative;
  width: 88px;
  height: 96px;
  clip-path: polygon(50% 0, 86% 18%, 86% 60%, 50% 100%, 14% 60%, 14% 18%);
  background: linear-gradient(180deg, #ffcf58 0%, #fca928 100%);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.45);
}

.badge-emblem__star {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
}

.profile-hero__badge strong {
  text-align: center;
  font-size: 1.15rem;
}

.profile-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 14px 0;
}

.profile-stats__item {
  display: flex;
  min-height: 100px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-stats__item:nth-child(-n+3) {
  border-bottom: 1px solid rgba(231, 224, 215, 0.5);
}

.profile-stats__item + .profile-stats__item {
  box-shadow: inset 1px 0 0 rgba(231, 224, 215, 0.9);
}

.profile-stats__item:nth-child(4) {
  box-shadow: none;
}

.profile-stats__icon {
  font-size: 1.4rem;
}

.profile-stats__item strong {
  font-size: 1.3rem;
  line-height: 1.1;
}

.profile-stats__item small,
.profile-stats__item span:last-child {
  font-size: 0.9rem;
  color: #5e5952;
}

.section-card {
  margin-top: 18px;
  padding: 18px;
}

.section-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-card__head h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.section-card__head a,
.section-card__action {
  color: #7f7a72;
}

.section-card__action {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

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

.study-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.study-grid__icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.08);
}

.study-grid__icon--orange {
  background: linear-gradient(135deg, #ffb320 0%, #ff8f00 100%);
}

.study-grid__icon--blue {
  background: linear-gradient(135deg, #66a8ff 0%, #367df2 100%);
}

.study-grid__icon--green {
  background: linear-gradient(135deg, #6ddc72 0%, #35bb55 100%);
}

.study-grid__icon--purple {
  background: linear-gradient(135deg, #bf87ff 0%, #8d52e7 100%);
}

.study-grid__icon--gold {
  background: linear-gradient(135deg, #ffcb3f 0%, #ffb100 100%);
}

.study-grid__icon--pink {
  background: linear-gradient(135deg, #ff90a6 0%, #f95d7f 100%);
}

.study-grid__icon--cyan {
  background: linear-gradient(135deg, #79d0ff 0%, #40a6e7 100%);
}

.study-grid__icon--leaf {
  background: linear-gradient(135deg, #7cd97f 0%, #35bd55 100%);
}

.recent-list {
  margin-top: 14px;
}

.recent-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.recent-item + .recent-item {
  border-top: 1px solid rgba(235, 229, 221, 0.9);
}

.recent-item__text strong {
  display: block;
  font-size: 1.12rem;
}

.recent-item__text small,
.recent-item__meta small {
  display: block;
  margin-top: 4px;
  color: #6e6962;
}

.recent-item__meta {
  text-align: right;
}

.recent-item__meta .status-pill {
  margin-top: 6px;
}

.profile-bottom-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.section-card--leaderboard {
  width: 100%;
}

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

.achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.achievement__badge {
  display: inline-flex;
  width: 82px;
  height: 82px;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.08);
}

.achievement__badge--mint {
  background: linear-gradient(135deg, #8de3b4 0%, #46bf81 100%);
}

.achievement__badge--orange {
  background: linear-gradient(135deg, #ffcb6a 0%, #f7971e 100%);
}

.achievement__badge--blue {
  background: linear-gradient(135deg, #72b0ff 0%, #347be2 100%);
}

.achievement strong {
  font-size: 1.02rem;
}

.achievement small {
  color: #6e6962;
}

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

.leaderboard--profile {
  gap: 10px;
}

.leaderboard__item {
  display: grid;
  grid-template-columns: 30px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(235, 229, 221, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.leaderboard__item--active {
  border-color: rgba(246, 194, 83, 0.5);
  background: linear-gradient(135deg, #fff4d9 0%, #fffaf0 100%);
  box-shadow: 0 12px 24px rgba(244, 194, 82, 0.12);
}

.leaderboard__rank {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
}

.leaderboard__rank--gold {
  background: #f7b427;
}

.leaderboard__rank--silver {
  background: #9aa3b5;
}

.leaderboard__rank--bronze {
  background: #c97f45;
}

.leaderboard__rank--default {
  background: #b8b0a3;
}

.leaderboard__photo,
.leaderboard__avatar {
  width: 42px;
  height: 42px;
}

.leaderboard__identity {
  min-width: 0;
}

.leaderboard__identity strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
  word-break: break-word;
}

.leaderboard__identity small {
  display: block;
  margin-top: 4px;
  color: #7d766d;
  font-size: 0.8rem;
}

.leaderboard__score {
  color: #333;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.leaderboard-toggle {
  transition: color 160ms ease;
}

.leaderboard-toggle:hover,
.leaderboard-toggle:focus-visible {
  color: #5f5950;
}

.focus-hero-card {
  margin-top: 22px;
  padding: 22px 18px;
}

.focus-hero-card--orange {
  background: linear-gradient(135deg, #fff1bc 0%, #fff7df 58%, #fffdf5 100%);
}

.focus-hero-card--blue {
  background: linear-gradient(135deg, #eaf2ff 0%, #f4f8ff 58%, #ffffff 100%);
}

.focus-hero-card--gold {
  background: linear-gradient(135deg, #fff6d8 0%, #fffaf0 58%, #ffffff 100%);
}

.focus-hero-card__eyebrow {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #9a8450;
}

.focus-hero-card__title {
  margin: 10px 0 0;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.focus-hero-card__text {
  margin: 12px 0 0;
  color: #635b52;
  line-height: 1.8;
}

.focus-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.focus-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.75);
  color: #6d6357;
  font-size: 0.88rem;
  font-weight: 700;
}

.task-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.task-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border-radius: 18px;
  padding: 0 14px;
  background: #fffaf1;
}

.task-item--done {
  background: #f3fbef;
}

.task-item__check {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffe4a8;
  color: #b57200;
  font-weight: 900;
}

.task-item--done .task-item__check {
  background: #6dd07d;
  color: #fff;
}

.task-item strong {
  display: block;
  font-size: 1rem;
}

.task-item p {
  margin: 5px 0 0;
  color: #6a635a;
  font-size: 0.9rem;
}

.task-item__meta {
  color: #8b847b;
  font-size: 0.88rem;
  white-space: nowrap;
}

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

.insight-card {
  border-radius: 20px;
  padding: 16px 14px;
  background: #fff9ee;
}

.insight-card--blue {
  background: #f0f6ff;
}

.insight-card--green {
  background: #effbf0;
}

.insight-card--pink {
  background: #fff2f4;
}

.insight-card__value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
}

.insight-card__label {
  display: block;
  margin-top: 6px;
  color: #6c655c;
  line-height: 1.65;
}

.progress-skill-list {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.progress-skill__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-skill__row strong {
  font-size: 1rem;
}

.progress-skill__row span {
  color: #6f695f;
  font-size: 0.92rem;
}

.reflection-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.reflection-entry {
  border-radius: 20px;
  padding: 16px 14px;
  background: #fffaf2;
}

.reflection-entry__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reflection-entry__meta strong {
  font-size: 1rem;
}

.reflection-entry__meta span {
  color: #8b837a;
  font-size: 0.88rem;
}

.reflection-entry__quote {
  margin: 12px 0 0;
  color: #4f4942;
  line-height: 1.8;
}

.reflection-entry .tag-list {
  margin-top: 14px;
}

.subpage-link-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.subpage-link-row .pill-outline-button {
  min-height: 42px;
}

.page-student-home {
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 248, 231, 0.95) 0, rgba(255, 248, 231, 0) 34%),
    linear-gradient(180deg, #fffdf9 0%, var(--page-bg) 100%);
}

.student-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  padding: 26px 18px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0, rgba(255, 255, 255, 0.12) 100%),
    #fffaf3;
}

.student-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.student-brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.student-brand__word {
  font-size: clamp(3.1rem, 9vw, 3.8rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.06em;
  color: #2f389f;
}

.student-brand__plus {
  margin-bottom: 5px;
  font-size: clamp(2.7rem, 8vw, 3.2rem);
  font-weight: 900;
  line-height: 0.92;
  color: #ffb11c;
}

.student-topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #4a4a4a;
}

.icon-button svg {
  width: 30px;
  height: 30px;
}

.icon-button__badge {
  position: absolute;
  top: 2px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff604e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(255, 96, 78, 0.22);
}

.student-avatar {
  display: inline-flex;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(255, 193, 44, 0.2);
}

.student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-hero {
  position: relative;
  margin-top: 26px;
  min-height: 246px;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 28px 22px 24px;
  background: linear-gradient(135deg, #fff1b4 0%, #fff7d8 52%, #fff2c7 100%);
  box-shadow: 0 18px 44px rgba(226, 199, 145, 0.22);
}

.student-hero::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.42) 0, rgba(255, 255, 255, 0) 38%),
    linear-gradient(90deg, rgba(255, 229, 145, 0.16) 0, rgba(255, 229, 145, 0) 50%);
  content: "";
  pointer-events: none;
}

.student-hero::after {
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.8) 0, rgba(255, 255, 255, 0.34) 42%, rgba(255, 255, 255, 0) 74%);
  content: "";
  pointer-events: none;
}

.student-hero__content {
  position: relative;
  z-index: 2;
  max-width: 64%;
}

.student-hero__title {
  margin: 6px 0 0;
  font-size: clamp(1.55rem, 5vw, 2.2rem);
  font-weight: 900;
  line-height: 1.34;
  letter-spacing: -0.04em;
}

.student-hero__subtitle {
  margin: 18px 0 0;
  font-size: 0.98rem;
  line-height: 1.85;
  color: #4e463e;
}

.student-hero__button {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-radius: var(--r-round);
  padding: 0 26px;
  background: linear-gradient(135deg, var(--student-accent-start) 0%, var(--student-accent-end) 100%);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(255, 170, 26, 0.28);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.student-hero__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(255, 170, 26, 0.34);
}

.student-hero__decor {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.student-hero__decor--star {
  top: 74px;
  right: 48px;
  color: #f6c538;
  font-size: 1.85rem;
  line-height: 1;
}

.student-hero__decor--leaf {
  right: 52px;
  bottom: 92px;
  width: 26px;
  height: 14px;
  border-radius: 999px 999px 4px 999px;
  background: linear-gradient(135deg, #9bd46b 0%, #72bc46 100%);
  transform: rotate(18deg);
  box-shadow:
    -12px -4px 0 -6px #ffd24a,
    8px 5px 0 -6px #98cf4f;
}

.student-hero__decor--tag {
  right: 92px;
  bottom: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd74a 0%, #ffbf1c 100%);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  transform: rotate(22deg);
  box-shadow: 0 12px 20px rgba(255, 177, 28, 0.18);
}

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

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform 180ms ease;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-card__full-image {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(222, 208, 186, 0.16);
}

.feature-card__title-en {
  margin-top: auto;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.22;
  color: #171717;
}

.feature-card__title-zh {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.32;
  color: #171717;
}

.feature-card__label {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a5349;
  line-height: 1.3;
}

.student-panel {
  margin-top: 18px;
  border-radius: var(--r-xl);
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(217, 206, 191, 0.18);
}

.student-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.student-panel__head h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.student-panel__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4e4e4e;
  font-size: 0.98rem;
  font-weight: 600;
}

.summary-stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-stat {
  padding: 0 12px;
}

.summary-stat + .summary-stat {
  border-left: 1px solid rgba(186, 186, 186, 0.26);
}

.summary-stat__icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.summary-stat__icon svg {
  width: 26px;
  height: 26px;
}

.summary-stat__icon--green {
  background: #69d67a;
  color: #fff;
}

.summary-stat__icon--violet {
  background: #7b63f5;
  color: #fff;
}

.summary-stat__icon--gold {
  background: #ffcf46;
  color: #fff;
}

.summary-stat__label {
  display: block;
  margin-top: 10px;
  font-size: 0.95rem;
  color: #66605a;
}

.summary-stat__value {
  display: block;
  margin-top: 8px;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  color: #121212;
}

.summary-stat__value small {
  font-size: 1rem;
  font-weight: 500;
  color: #4d4d4d;
}

.goal-progress {
  position: relative;
  margin-top: 24px;
}

.goal-progress__content {
  max-width: 100%;
}

.goal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.goal-row--spaced {
  margin-top: 28px;
}

.goal-row__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1rem;
  color: #222;
}

.goal-row__labels strong {
  font-size: 1rem;
  font-weight: 800;
}

.goal-row__value {
  flex: none;
  font-size: 0.98rem;
  font-weight: 600;
  color: #2c2c2c;
}

.progress-bar {
  margin-top: 14px;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-bar--green span {
  background: linear-gradient(90deg, #67d871 0%, #c8ee57 100%);
}

.progress-bar--orange span {
  background: linear-gradient(90deg, #ffa730 0%, #ffba27 100%);
}

.goal-progress__trophy {
  position: absolute;
  right: 8px;
  bottom: 0;
  width: 80px;
  opacity: 0.6;
  pointer-events: none;
}

.student-nav {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: auto;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid rgba(224, 224, 224, 0.92);
  border-radius: 20px 20px 0 0;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.student-nav__item {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #888;
  font-size: 0.88rem;
  transition: color 180ms ease;
}

.student-nav__item:hover {
  color: #666;
}

.student-nav__item svg {
  width: 30px;
  height: 30px;
  transition: transform 180ms ease;
}

.student-nav__item:hover svg {
  transform: scale(1.08);
}

.student-nav__item--active {
  color: #ffad1a;
  font-weight: 700;
}

.student-nav__item--active:hover {
  color: #ffad1a;
}

.student-nav__item--active:hover svg {
  transform: none;
}

.page-student-community .student-app-shell {
  position: relative;
  overflow: hidden;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    16px
    calc(18px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 240, 214, 0.92) 0, rgba(255, 240, 214, 0) 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 247, 232, 0.88) 0, rgba(255, 247, 232, 0) 26%),
    linear-gradient(180deg, #fffdf9 0%, #faf2e8 100%);
}

.page-student-community .student-app-shell::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0, rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 50% 100%, rgba(255, 226, 179, 0.28) 0, rgba(255, 226, 179, 0) 42%);
  content: "";
  pointer-events: none;
}

.page-student-community .student-app-shell > * {
  position: relative;
  z-index: 1;
}

.page-student-community .page-header {
  margin-top: 4px;
  align-items: flex-start;
}

.page-student-community .page-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.page-student-community .page-header h1 {
  margin: 4px 0 0;
  font-size: clamp(1.9rem, 7vw, 2.35rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.page-student-community .page-header p {
  margin: 8px 0 0;
  max-width: 19em;
  color: #75695d;
  font-size: 0.96rem;
  line-height: 1.58;
}

.page-student-community .page-header__actions {
  gap: 8px;
  padding-top: 4px;
}

.page-student-community .page-header__spark {
  color: var(--community-accent);
  font-size: 1.02rem;
}

.page-student-community .icon-only-button {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: #756658;
  box-shadow: inset 0 0 0 1px rgba(238, 227, 212, 0.95);
}

.page-student-community .icon-only-button svg {
  width: 24px;
  height: 24px;
}

.page-student-community .icon-only-button--dot::after {
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--community-accent-strong);
}

.page-student-community .community-tabs {
  margin-top: 18px;
  gap: 6px;
  padding: 6px;
  border-radius: var(--community-radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--community-shadow-soft);
  backdrop-filter: blur(18px);
}

.page-student-community .community-tabs__item {
  min-height: 42px;
  border-bottom: 0;
  border-radius: 14px;
  padding: 0 10px;
  color: #6f655b;
  font-size: 0.92rem;
  font-weight: 700;
}

.page-student-community .community-tabs__item:hover {
  color: var(--community-accent-strong);
  background: rgba(255, 243, 223, 0.82);
  transform: none;
}

.page-student-community .community-tabs__item--active {
  color: var(--community-accent-strong);
  background: linear-gradient(180deg, #fff8ec 0%, #fff1dc 100%);
  box-shadow: inset 0 0 0 1px rgba(242, 154, 38, 0.18);
}

.page-student-community .community-feed {
  margin-top: 16px;
  gap: var(--community-gap);
  padding-bottom: 18px;
}

.page-student-community .community-card {
  padding: 14px;
  border: 1px solid var(--community-border);
  border-radius: var(--community-radius-lg);
  background: var(--community-surface);
  box-shadow: var(--community-shadow);
}

.page-student-community .community-card__top {
  gap: 10px;
}

.page-student-community .community-user {
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
}

.page-student-community .community-user > div {
  min-width: 0;
}

.page-student-community .community-user__avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  font-size: 1rem;
  box-shadow: 0 10px 18px rgba(220, 188, 147, 0.18);
}

.page-student-community .community-user__avatar--pink,
.page-student-community .community-user__avatar--blue,
.page-student-community .community-user__avatar--green,
.page-student-community .community-user__avatar--orange,
.page-student-community .community-user__avatar--purple,
.page-student-community .community-user__avatar--gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
}

.page-student-community .community-user__avatar--pink {
  background: linear-gradient(135deg, #ffb88d 0%, #f28e56 100%);
}

.page-student-community .community-user__avatar--blue {
  background: linear-gradient(135deg, #f2b861 0%, #df9134 100%);
}

.page-student-community .community-user__avatar--green {
  background: linear-gradient(135deg, #a9c878 0%, #7ba554 100%);
}

.page-student-community .community-user__avatar--orange {
  background: linear-gradient(135deg, #ffba59 0%, #ee8f1e 100%);
}

.page-student-community .community-user__avatar--purple {
  background: linear-gradient(135deg, #d9b287 0%, #b98250 100%);
}

.page-student-community .community-user__avatar--gold {
  background: linear-gradient(135deg, #e3c673 0%, #c99e37 100%);
}

.page-student-community .community-user__name-row {
  flex-wrap: wrap;
  gap: 6px;
}

.page-student-community .community-user__name-row strong {
  font-size: 0.98rem;
  line-height: 1.3;
  color: #30271f;
}

.page-student-community .community-user__class {
  padding: 3px 8px;
  background: #fff4df;
  color: #ae7219;
  font-size: 0.74rem;
}

.page-student-community .community-user p {
  margin: 3px 0 0;
  color: #8b8074;
  font-size: 0.82rem;
}

.page-student-community .community-user__actions {
  flex-shrink: 0;
  gap: 6px;
}

.page-student-community .follow-button {
  min-height: 32px;
  padding: 0 12px;
  background: #fff7e8;
  color: var(--community-accent-strong);
  font-size: 0.84rem;
  box-shadow: inset 0 0 0 1px rgba(242, 154, 38, 0.12);
}

.page-student-community .follow-button--active {
  background: #fff1d7;
  color: #b77118;
}

.page-student-community .more-button {
  display: inline-flex;
  width: 32px;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(247, 241, 234, 0.98);
  color: #9b8a79;
  box-shadow: inset 0 0 0 1px rgba(235, 225, 213, 0.95);
  font-size: 1rem;
}

.page-student-community .community-card__content {
  grid-template-columns: 108px 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.94) 0%, rgba(255, 255, 255, 0.82) 100%);
  box-shadow: inset 0 0 0 1px rgba(243, 229, 210, 0.86);
}

.page-student-community .community-card__content:hover {
  transform: none;
}

.page-student-community .community-card__content:focus-visible {
  outline: 2px solid rgba(242, 154, 38, 0.26);
  outline-offset: 3px;
}

.page-student-community .community-card--expanded .community-card__content {
  background: linear-gradient(180deg, rgba(255, 246, 232, 0.98) 0%, rgba(255, 250, 242, 0.98) 100%);
  box-shadow: inset 0 0 0 1px rgba(242, 154, 38, 0.18);
}

.page-student-community .community-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-student-community .community-card__body h2 {
  font-size: 1.02rem;
  line-height: 1.28;
}

.page-student-community .community-card__translation {
  margin-top: 4px;
  color: #51463c;
  font-size: 0.92rem;
}

.page-student-community .community-card__sentence {
  margin-top: 8px;
  color: #6b6056;
  font-size: 0.9rem;
  line-height: 1.55;
}

.page-student-community .community-card__content-text {
  color: #3b3128;
  font-size: 0.92rem;
}

.page-student-community .community-card__images {
  gap: 8px;
  margin: 0;
  padding: 0 0 2px;
}

.page-student-community .community-card__images img {
  width: 100%;
  min-width: 100%;
  height: 148px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(206, 185, 159, 0.18);
}

.page-student-community .community-card__media,
.page-student-community .media-visual {
  min-height: 148px;
  border-radius: 14px;
}

.page-student-community .media-visual {
  background: linear-gradient(180deg, #f8f1e6 0%, #eee5d8 100%);
}

.page-student-community .community-card__meta {
  margin-top: auto;
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
  color: #7a6d61;
  font-size: 0.83rem;
}

.page-student-community .community-card__social {
  gap: 8px;
  margin-left: auto;
}

.page-student-community .community-social-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #86786c;
  font-size: 0.82rem;
  box-shadow: inset 0 0 0 1px rgba(235, 224, 211, 0.96);
}

.page-student-community .community-social-button[aria-expanded="true"] {
  color: var(--community-accent-strong);
  background: var(--community-accent-soft);
}

.page-student-community .community-social-button--liked {
  color: var(--community-accent-strong);
  background: rgba(255, 244, 226, 0.94);
}

.page-student-community .community-card__social > span:last-child {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(235, 224, 211, 0.96);
}

.page-student-community .community-comments {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(236, 227, 215, 0.92);
}

.page-student-community .community-comments p {
  margin: 8px 0 0;
  color: #65594f;
  font-size: 0.84rem;
  line-height: 1.55;
}

.page-student-community .community-comments a {
  margin-top: 10px;
  color: var(--community-accent-strong);
}

.page-student-community .community-comments__toggle {
  font-size: 0.84rem;
}

.page-student-community .community-comment-input {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.page-student-community .community-comment-input input {
  flex: 1;
  border: 1px solid #e0d8ce;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 0.82rem;
  background: #f9f6f0;
  outline: none;
}

.page-student-community .community-comment-input input:focus {
  border-color: var(--community-accent);
  background: #fff;
}

.page-student-community .community-comment-input button {
  border: 0;
  border-radius: 18px;
  padding: 6px 16px;
  background: var(--community-accent);
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.page-student-community .community-comment-input button:hover {
  background: var(--community-accent-strong);
}

.page-student-community .community-empty-state {
  margin-top: 14px;
  padding: 22px 18px;
  border: 1px dashed rgba(242, 154, 38, 0.2);
  border-radius: var(--community-radius-lg);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--community-shadow-soft);
}

.page-student-community .community-empty-state strong {
  font-size: 0.96rem;
}

.page-student-community .community-empty-state p {
  font-size: 0.88rem;
}

.page-student-community .floating-create-button {
  z-index: 5;
  align-self: flex-end;
  left: auto;
  margin: 2px 10px 0 auto;
  bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffba4b 0%, #f49723 100%);
  box-shadow: 0 10px 22px rgba(242, 154, 38, 0.24);
}

.page-student-community .floating-create-button span {
  transform: translateY(-1px);
  font-size: 1.95rem;
}

.page-student-community .student-nav {
  border-top: 0;
  border-radius: 22px 22px 0 0;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -12px 28px rgba(220, 205, 184, 0.18);
  backdrop-filter: blur(18px);
}

.page-student-community .student-nav__item {
  position: relative;
  z-index: 0;
  min-height: 60px;
  gap: 4px;
  color: #7d7267;
  font-size: 0.76rem;
  font-weight: 600;
}

.page-student-community .student-nav__item::before {
  position: absolute;
  inset: 5px 4px;
  border-radius: 16px;
  background: transparent;
  content: "";
  transition: background 160ms ease, box-shadow 160ms ease;
  z-index: -1;
}

.page-student-community .student-nav__item svg {
  width: 23px;
  height: 23px;
}

.page-student-community .student-nav__item span {
  line-height: 1;
}

.page-student-community .student-nav__item--active {
  color: var(--community-accent-strong);
  font-weight: 700;
}

.page-student-community .student-nav__item--active::before {
  background: rgba(255, 244, 226, 0.96);
  box-shadow: inset 0 0 0 1px rgba(242, 154, 38, 0.14);
}

.page-teacher-home {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(113, 92, 255, 0.12) 0, rgba(113, 92, 255, 0) 24%),
    linear-gradient(180deg, #f6f4ff 0%, #efedf8 100%);
}

.teacher-home {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.teacher-sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px 20px 22px;
  background:
    radial-gradient(circle at top right, rgba(116, 102, 255, 0.3) 0, rgba(116, 102, 255, 0) 24%),
    linear-gradient(180deg, #232845 0%, #1d2139 100%);
  color: #fff;
}

.teacher-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 10px;
}

.teacher-brand__mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c6dff 0%, #f4b537 100%);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 14px 30px rgba(82, 71, 243, 0.35);
}

.teacher-brand strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.teacher-brand p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
}

.teacher-sidebar__nav {
  display: grid;
  gap: 8px;
}

.teacher-sidebar__nav-item {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.teacher-sidebar__nav-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.teacher-sidebar__nav-item--active {
  background: linear-gradient(135deg, rgba(115, 97, 255, 0.98) 0%, rgba(86, 72, 244, 0.98) 100%);
  color: #fff;
  box-shadow: 0 20px 36px rgba(89, 78, 240, 0.34);
}

.teacher-sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.teacher-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-profile__avatar {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffcf78 0%, #ff9c6f 100%);
  color: #4d2f1d;
  font-size: 1.2rem;
  font-weight: 900;
}

.teacher-profile strong {
  display: block;
  font-size: 1.05rem;
}

.teacher-profile p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
}

.teacher-sidebar__logout {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
}

.teacher-stage {
  padding: 28px 30px 36px;
}

.teacher-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.teacher-topbar__eyebrow {
  margin: 0;
  color: #766cf2;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teacher-topbar h1 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.teacher-topbar__intro > p:last-child {
  margin: 10px 0 0;
  color: #68657a;
  font-size: 1rem;
}

.teacher-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.teacher-class-switch,
.teacher-notification {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(117, 108, 242, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 28px rgba(74, 61, 165, 0.06);
  color: #3c3955;
  font: inherit;
  cursor: pointer;
}

.teacher-class-switch {
  padding: 0 18px;
  font-weight: 700;
}

.teacher-class-switch__icon {
  color: #6f61f5;
}

.teacher-notification {
  position: relative;
  width: 54px;
  padding: 0;
}

.teacher-notification__badge {
  position: absolute;
  top: -6px;
  right: -2px;
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 6px;
  background: #ff5f6d;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
}

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

.teacher-kpi-card,
.teacher-panel {
  border: 1px solid rgba(116, 109, 236, 0.08);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(92, 84, 164, 0.08);
}

.teacher-kpi-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  min-height: 162px;
  padding: 18px 18px 16px;
}

.teacher-kpi-card__icon {
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 1.55rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.teacher-kpi-card--violet .teacher-kpi-card__icon {
  background: linear-gradient(135deg, #ece9ff 0%, #d7d2ff 100%);
}

.teacher-kpi-card--green .teacher-kpi-card__icon {
  background: linear-gradient(135deg, #e4fbef 0%, #d0f5e3 100%);
}

.teacher-kpi-card--amber .teacher-kpi-card__icon {
  background: linear-gradient(135deg, #fff4d9 0%, #ffe7a7 100%);
}

.teacher-kpi-card--blue .teacher-kpi-card__icon {
  background: linear-gradient(135deg, #e4f1ff 0%, #d6ebff 100%);
}

.teacher-kpi-card--pink .teacher-kpi-card__icon {
  background: linear-gradient(135deg, #ffe5f0 0%, #ffd7e9 100%);
}

.teacher-kpi-card__title {
  margin: 4px 0 0;
  color: #676379;
  font-size: 0.95rem;
  font-weight: 700;
}

.teacher-kpi-card__value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

.teacher-kpi-card__value {
  font-size: clamp(2rem, 2.6vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.teacher-kpi-card__unit {
  color: #6f6b7d;
  font-weight: 700;
}

.teacher-kpi-card__delta {
  margin: 10px 0 0;
  color: #574bdc;
  font-size: 0.92rem;
  font-weight: 800;
}

.teacher-kpi-card__note {
  margin: 8px 0 0;
  color: #8a8695;
  font-size: 0.88rem;
  line-height: 1.5;
}

.teacher-main-grid {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.95fr);
}

.teacher-bottom-grid {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.06fr);
}

.teacher-panel {
  padding: 22px 22px 20px;
}

.teacher-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.teacher-panel__head h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.teacher-panel__head p {
  margin: 8px 0 0;
  color: #7a7689;
  font-size: 0.95rem;
}

.teacher-panel__link {
  color: #675af2;
  font-weight: 800;
}

.teacher-segmented-control {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: #f4f1ff;
}

.teacher-segmented-control button {
  min-width: 74px;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #675e7f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.teacher-segmented-control button[aria-pressed="true"] {
  background: linear-gradient(135deg, #6d5dff 0%, #5347f3 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(92, 79, 243, 0.3);
}

.teacher-chart {
  display: grid;
  gap: 12px;
}

.teacher-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #5e5970;
  font-size: 0.92rem;
  font-weight: 700;
}

.teacher-chart__legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.teacher-chart__legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.teacher-chart__legend-dot--line {
  background: linear-gradient(135deg, #6e5bff 0%, #8f86ff 100%);
}

.teacher-chart__legend-dot--bar {
  background: linear-gradient(180deg, #7ce1a6 0%, #4abf88 100%);
}

.teacher-chart__canvas {
  overflow: hidden;
  border-radius: 24px;
  padding: 8px 8px 0;
  background:
    linear-gradient(180deg, rgba(246, 244, 255, 0.94) 0%, rgba(252, 252, 255, 0.84) 100%);
}

.teacher-chart__canvas svg {
  display: block;
  width: 100%;
  height: auto;
}

.teacher-chart__grid line {
  stroke: rgba(102, 97, 135, 0.13);
  stroke-width: 1;
}

.teacher-chart__area {
  fill: rgba(111, 96, 255, 0.12);
}

.teacher-chart__bar {
  fill: url(#teacher-bar-gradient);
}

.teacher-chart__line {
  fill: none;
  stroke: #6859ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.teacher-chart__point {
  fill: #fff;
  stroke: #6859ff;
  stroke-width: 3;
}

.teacher-chart__axis-label {
  fill: #6f6b7b;
  font-size: 13px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  text-anchor: middle;
}

.teacher-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(111, 101, 175, 0.08);
}

.teacher-rank-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.teacher-rank-item__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.teacher-rank-item__badge {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: #8d879f;
  font-size: 0.92rem;
  font-weight: 800;
}

.teacher-rank-item__avatar,
.teacher-watch-item__avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd98f 0%, #ffb47c 100%);
  color: #5b3417;
  font-weight: 900;
}

.teacher-rank-item__meta strong,
.teacher-watch-item__body strong {
  display: block;
  font-size: 1rem;
}

.teacher-rank-item__meta span,
.teacher-watch-item__body p {
  display: block;
  margin-top: 6px;
  color: #7c7788;
  font-size: 0.9rem;
}

.teacher-rank-item__score {
  white-space: nowrap;
  font-size: 1.1rem;
  font-weight: 900;
  color: #24213b;
}

.teacher-goal {
  display: grid;
  align-items: center;
  gap: 18px;
  grid-template-columns: 210px minmax(0, 1fr);
}

.teacher-goal__donut {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.65);
}

.teacher-goal__donut-core {
  position: absolute;
  inset: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(118, 108, 186, 0.08);
}

.teacher-goal__donut-core strong {
  font-size: 2rem;
  font-weight: 900;
}

.teacher-goal__donut-core span {
  margin-top: 6px;
  color: #716c80;
  font-size: 0.92rem;
  font-weight: 700;
}

.teacher-goal__legend {
  display: grid;
  gap: 12px;
}

.teacher-goal__legend p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #4e4a5f;
}

.teacher-goal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.teacher-goal__dot--done {
  background: #5fd29b;
}

.teacher-goal__dot--progress {
  background: #76a8ff;
}

.teacher-goal__dot--todo {
  background: #ff7c66;
}

.teacher-goal__rate {
  margin-top: 10px;
  color: #3bb27b;
  font-size: 1rem;
}

.teacher-watch-item,
.teacher-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(111, 101, 175, 0.08);
}

.teacher-watch-item:first-child,
.teacher-activity-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.teacher-watch-item__body {
  min-width: 0;
  flex: 1;
}

.teacher-watch-item__tag {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff0d8;
  color: #cb8b1b;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.teacher-activity-item__icon {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.teacher-activity-item__icon::before {
  font-size: 1.08rem;
}

.teacher-activity-item__icon--record {
  background: #ece9ff;
}

.teacher-activity-item__icon--record::before {
  content: "📝";
}

.teacher-activity-item__icon--community {
  background: #e3faf0;
}

.teacher-activity-item__icon--community::before {
  content: "🌿";
}

.teacher-activity-item__icon--goal {
  background: #fff0d8;
}

.teacher-activity-item__icon--goal::before {
  content: "🎯";
}

.teacher-activity-item__icon--reflection {
  background: #e3efff;
}

.teacher-activity-item__icon--reflection::before {
  content: "✍";
}

.teacher-activity-item__body {
  min-width: 0;
  flex: 1;
}

.teacher-activity-item__body strong {
  display: block;
  font-size: 1rem;
}

.teacher-activity-item__body p {
  margin: 6px 0 0;
  color: #615d70;
  line-height: 1.55;
}

.teacher-activity-item__time {
  color: #8d879f;
  font-size: 0.88rem;
  white-space: nowrap;
}

@media (max-width: 389px) {
  .home-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .role-card {
    min-height: 208px;
    padding: 24px 18px;
  }

  .role-card__content {
    max-width: 54%;
  }

  .role-card__title {
    font-size: 1.8rem;
  }

  .role-card__text {
    font-size: 0.92rem;
  }

  .role-card__button {
    padding: 0 22px;
    font-size: 0.98rem;
  }

  .student-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .student-app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .student-hero {
    min-height: 228px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .student-hero__content {
    max-width: 68%;
  }

  .student-hero__title {
    font-size: 1.4rem;
  }

  .student-feature-grid {
    gap: 10px;
  }

  .feature-card {
    min-height: 0;
  }

  .feature-card__title-en {
    font-size: 0.94rem;
  }

  .feature-card__title-zh {
    font-size: 0.84rem;
  }

  .summary-stats {
    gap: 6px;
  }

  .summary-stat {
    padding-left: 8px;
    padding-right: 8px;
  }

  .summary-stat__value {
    font-size: 1.55rem;
  }

  .goal-progress__trophy {
    width: 68px;
    right: 2px;
    opacity: 0.5;
  }

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

  .create-step__label {
    font-size: 0.78rem;
  }

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

  .stats-bar__item:nth-child(n + 3) {
    box-shadow: inset 0 1px 0 rgba(231, 224, 215, 0.9);
  }

  .community-card__content {
    grid-template-columns: 1fr;
  }

  .page-student-community .community-tabs {
    gap: 4px;
    padding: 5px;
  }

  .page-student-community .community-tabs__item {
    min-height: 40px;
    padding: 0 6px;
    font-size: 0.84rem;
  }

  .page-student-community .community-card {
    padding: 12px;
  }

  .page-student-community .community-card__content {
    gap: 10px;
    padding: 8px;
  }

  .page-student-community .community-card__images img,
  .page-student-community .community-card__media,
  .page-student-community .media-visual {
    min-height: 136px;
    height: 136px;
  }

  .page-student-community .floating-create-button {
    width: 54px;
    height: 54px;
    margin-right: 6px;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .page-student-community .floating-create-button span {
    font-size: 1.8rem;
  }

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

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

  .profile-bottom-grid {
    grid-template-columns: 1fr;
  }

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

@media (min-width: 900px) {
  .page-home {
    align-items: center;
    padding: 28px;
  }

  .home-shell {
    min-height: min(920px, calc(100vh - 56px));
    border-radius: 34px;
    box-shadow: 0 26px 80px rgba(213, 190, 153, 0.22);
  }

  .page-student-home {
    align-items: center;
    padding: 28px;
  }

  .student-shell {
    min-height: min(920px, calc(100vh - 56px));
    border-radius: 34px;
    box-shadow: 0 26px 80px rgba(213, 190, 153, 0.22);
  }

  .page-student-subpage {
    align-items: center;
    padding: 28px;
  }

  .student-app-shell {
    min-height: min(920px, calc(100vh - 56px));
    border-radius: 34px;
    box-shadow: 0 26px 80px rgba(213, 190, 153, 0.22);
  }
}

@media (max-width: 720px) {
  .placeholder-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Login Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #fff;
  border-radius: 20px;
  padding: 36px 30px 30px;
  width: min(92%, 380px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: modalSlideUp 0.25s ease;
  position: relative;
}

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

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: #333;
}

.modal-title {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-role {
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0ddd8;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
  border-color: var(--student-accent-start);
  box-shadow: 0 0 0 3px rgba(255, 179, 32, 0.15);
  background: #fff;
}

.modal-error {
  margin: 0;
  font-size: 0.88rem;
  color: #e54545;
  min-height: 1.3em;
}

.modal-submit {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--student-accent-start) 0%, var(--student-accent-end) 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-submit:hover {
  opacity: 0.9;
}

.modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Wide modal (for student management table) ── */
.modal-dialog--wide {
  width: min(94%, 700px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.mgmt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.mgmt-add-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teacher-accent-start) 0%, var(--teacher-accent-end) 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.mgmt-add-btn:hover {
  opacity: 0.9;
}

.mgmt-count {
  font-size: 0.88rem;
  color: var(--text-soft);
}

.mgmt-table-wrap {
  overflow-x: auto;
  flex: 1;
  overflow-y: auto;
}

.mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mgmt-table th {
  text-align: left;
  padding: 10px 8px 8px;
  border-bottom: 2px solid #eee;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}

.mgmt-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f0eee8;
}

.mgmt-table code {
  background: #f3f1ec;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.mgmt-empty {
  text-align: center;
  color: var(--text-soft);
  padding: 40px 0 !important;
}

.mgmt-status-done {
  color: #3ba55d;
  font-size: 0.85rem;
}

.mgmt-status-pending {
  color: #e5a23b;
  font-size: 0.85rem;
}

.mgmt-delete-btn {
  padding: 4px 12px;
  border: 1px solid #e5c5c5;
  border-radius: 6px;
  background: #fff6f6;
  color: #c44;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
}

.mgmt-delete-btn:hover {
  background: #fee;
}

/* ── Setup avatar row ── */
.setup-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setup-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e2dc;
  flex-shrink: 0;
}

.setup-avatar-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.setup-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1.5px dashed #ccc;
  border-radius: 10px;
  background: #fafafa;
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.setup-avatar-btn:hover {
  border-color: var(--student-accent-start);
  background: #fff8e7;
}

.setup-avatar-hint {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ── Settings logout button ── */
.settings-logout-btn {
  display: inline-block;
  padding: 10px 32px;
  border: 1.5px solid #e5c5c5;
  border-radius: 8px;
  background: #fff6f6;
  color: #c44;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-logout-btn:hover {
  background: #fee;
}

/* ── Teacher: Action button ── */
.teacher-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid #d5cee0;
  border-radius: 10px;
  background: #faf8ff;
  color: #4a3f8a;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.teacher-action-btn:hover {
  border-color: #7b6cd9;
  background: #f0eeff;
}
/* ── Teacher: Unit card ── */
.unit-card {
  background: rgba(255,255,255,0.6);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
}
.unit-card:hover {
  border-color: #d5cee0;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.unit-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.unit-card__title {
  font-size: 1rem;
  line-height: 1.35;
}
.unit-card__desc {
  margin: 0;
  font-size: 0.88rem;
  color: #666;
  line-height: 1.5;
}
.unit-card__meta {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  color: #888;
}
/* ── Teacher: Unit status badges ── */
.unit-status {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.unit-status--published { background: #e6f7e6; color: #2e9a4a; }
.unit-status--draft { background: #fff3df; color: #c97d1a; }
.unit-status--archived { background: #f0eeec; color: #7a726a; }
/* ── Teacher: Unit word rows in modal ── */
.unit-word-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f0eee8;
}
.unit-word-num { width: 24px; color: #999; font-size: 0.82rem; text-align: center; }
.unit-word-trans { flex: 1; color: #777; font-size: 0.9rem; }
.unit-word-del {
  border: 0; background: transparent; color: #ccc; font-size: 1.2rem;
  cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all 0.15s;
}
.unit-word-del:hover { color: #e74c3c; background: #fef0f0; }

/* ── Teacher: Scrollable word list in modal ── */
#unitWordList {
  max-height: 220px;
  min-height: 72px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Teacher: Scrollable word list field in modal ── */
.modal-field--wordlist {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}

.modal-dialog--wide {
  overflow: hidden;
}

.modal-dialog--wide .modal-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  flex-shrink: 0;
  border-top: 1px solid #f0eee8;
}

.modal-footer .modal-submit {
  flex: 1;
  min-width: 100px;
  width: auto;
  white-space: nowrap;
}

.modal-footer .modal-submit--danger {
  flex: 0 1 auto;
  min-width: 80px;
  padding: 13px 20px;
  background: #e74c3c !important;
}

@media (max-width: 440px) {
  .modal-footer {
    flex-direction: column;
  }
  .modal-footer .modal-submit {
    width: 100%;
  }
}

.modal-add-word {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.modal-add-word .modal-input {
  flex: 1;
  min-width: 100px;
}

.modal-add-word .teacher-action-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Teacher: Word preview (uwp) ── */
.unit-word-preview {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #f0eee8;
  border-radius: 14px;
  background: #fbfaf7;
}
.unit-word-preview__head,
.uwp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.unit-word-preview__title,
.uwp-header__title { font-size: 0.9rem; font-weight: 600; color: #444; }
.unit-word-preview__count,
.uwp-header__count { font-size: 0.78rem; font-weight: 700; color: #fff; background: var(--teacher-accent-start); padding: 2px 10px; border-radius: 999px; }
.unit-word-preview__list { display: block; }
.unit-word-preview__empty,
.uwp-empty { text-align: center; padding: 18px 14px; color: #aaa; font-size: 0.9rem; }
.unit-word-preview__empty span,
.uwp-empty span { font-size: 0.8rem; color: #bbb; }
.unit-word-preview__item,
.uwp-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #f0eee8; margin-bottom: 6px; transition: background 0.15s, border-color 0.15s; }
.unit-word-preview__item:hover,
.uwp-item:hover { background: #fffaf1; border-color: #ffe0a3; }
.unit-word-preview__body,
.uwp-item__body { flex: 1; cursor: pointer; min-width: 0; }
.unit-word-preview__word,
.uwp-item__word { display: block; font-size: 0.95rem; font-weight: 700; color: #333; }
.unit-word-preview__trans,
.uwp-item__trans { display: block; font-size: 0.82rem; color: #888; margin-top: 1px; }
.unit-word-preview__actions,
.uwp-item__actions { display: flex; gap: 2px; flex-shrink: 0; }
.unit-word-preview__edit,
.unit-word-preview__del,
.uwp-item__edit, .uwp-item__del { border: 0; background: transparent; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 1rem; color: #bbb; transition: all 0.15s; line-height: 1; }
.unit-word-preview__edit:hover,
.uwp-item__edit:hover { color: var(--teacher-accent-start); background: #eee9ff; }
.unit-word-preview__del:hover,
.uwp-item__del:hover { color: #e74c3c; background: #fef0f0; }

/* ── Student: Learning page ── */
.learn-header { text-align: center; padding: 20px 0 4px; }
.learn-header h1 { margin: 0 0 4px; font-size: 1.35rem; }
.learn-header p { margin: 0; color: #888; font-size: 0.88rem; }
.learn-unit-select {
  display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 14px;
  -webkit-overflow-scrolling: touch;
}
.learn-unit-chip {
  flex-shrink: 0; padding: 10px 18px; border: 1.5px solid #e0d8ce;
  border-radius: 12px; background: #fff; font-size: 0.88rem; cursor: pointer;
  transition: all 0.15s; text-align: center; min-width: 100px;
}
.learn-unit-chip:hover { border-color: var(--student-accent-start); }
.learn-unit-chip--active {
  border-color: var(--student-accent-start); background: #fff8e7; font-weight: 700;
}
.learn-flashcard-area {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0; min-height: 280px;
}
.learn-flashcard {
  width: 100%; max-width: 360px; min-height: 200px; border-radius: 20px;
  background: #fff; box-shadow: 0 8px 30px rgba(215,193,164,0.2);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 24px; cursor: pointer;
  user-select: none; transition: transform 0.15s;
}
.learn-flashcard:active { transform: scale(0.97); }
.learn-flashcard__word { font-size: 2rem; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.02em; }
.learn-flashcard__trans { font-size: 1.3rem; color: #666; opacity: 0; transition: opacity 0.25s; }
.learn-flashcard__trans--show { opacity: 1; }
.learn-flashcard__hint { margin-top: 12px; font-size: 0.82rem; color: #bbb; }
.learn-progress-bar { width: 100%; max-width: 360px; height: 6px; border-radius: 3px; background: #f0ece6; margin: 16px 0; overflow: hidden; }
.learn-progress-bar__fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--student-accent-start), var(--student-accent-end)); transition: width 0.3s; }
.learn-progress-text { font-size: 0.85rem; color: #888; margin: 8px 0 12px; }
.learn-nav-buttons { display: flex; gap: 12px; margin-top: 16px; }
.learn-nav-btn {
  padding: 10px 28px; border: 1.5px solid #e0d8ce; border-radius: 12px;
  background: #fff; font-size: 0.92rem; font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.learn-nav-btn:hover { border-color: var(--student-accent-start); background: #fff8e7; }
.learn-nav-btn--primary { background: var(--student-accent-start); border-color: var(--student-accent-start); color: #fff; font-weight: 700; }
.learn-nav-btn--primary:hover { background: var(--student-accent-end); border-color: var(--student-accent-end); }
.learn-empty { text-align: center; padding: 40px 20px; color: #888; }
.learn-empty p { margin: 8px 0; font-size: 0.95rem; }
.modal-submit--danger { background: #e74c3c !important; }
.modal-submit--danger:hover { background: #c0392b !important; }
textarea.modal-input { resize: vertical; font-family: inherit; }

/* ═══════════════════════════════════════════
   Student: Learning Page (Redesigned)
   Flip-card memory training system
   ═══════════════════════════════════════════ */

/* Layout overrides */
.page-student-learn .student-app-shell {
  overflow: hidden;
}

.page-student-learn .learn-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-student-learn .learn-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  animation: learnFadeIn 0.3s ease;
}

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

/* ── Stats bar ── */
.learn-stats {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 0 12px;
  flex-wrap: wrap;
}

.learn-stats__item {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  white-space: nowrap;
  font-weight: 600;
  color: #4a3f35;
}

/* ── Card container ── */
.learn-card-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px 0;
}

.learn-card {
  perspective: 1000px;
  width: 100%;
  max-width: 360px;
  height: 280px;
  cursor: pointer;
  transition: opacity 0.25s, transform 0.25s;
}

.learn-card--enter {
  animation: cardEnter 0.3s ease;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.learn-card--exit {
  opacity: 0;
  transform: translateY(-20px) scale(0.94);
}

.learn-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.learn-card__inner--resetting {
  transition: none !important;
}

.learn-card__inner--flipped {
  transform: rotateY(180deg);
}

.learn-card__face,
.learn-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(215, 193, 164, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  overflow: hidden;
}

.learn-card__back {
  transform: rotateY(180deg);
}

.learn-card__word {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #222;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.learn-card__hint-text {
  margin: 16px 0 0;
  font-size: 0.95rem;
  color: #999;
}

.learn-card__tap-hint {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 20px;
  border: 1.5px solid #e0d8ce;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #bbb;
  transition: all 0.2s;
}

.learn-card:hover .learn-card__tap-hint {
  border-color: var(--student-accent-start);
  color: var(--student-accent-start);
}

.learn-card__trans {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

/* ── Feedback buttons ── */
.learn-feedback {
  display: flex;
  gap: 10px;
  padding: 16px 0 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.learn-feedback--show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.learn-feedback__btn {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1.5px solid #e0d8ce;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.learn-feedback__btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.learn-feedback__btn:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.learn-feedback__btn:not(:disabled):active {
  transform: translateY(0);
}

.learn-feedback__btn--forgot:not(:disabled):hover {
  border-color: #e74c3c;
  background: #fff5f5;
}

.learn-feedback__btn--fuzzy:not(:disabled):hover {
  border-color: #f39c12;
  background: #fffdf0;
}

.learn-feedback__btn--known:not(:disabled):hover {
  border-color: #2ecc71;
  background: #f0fff4;
}

.learn-feedback__emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.learn-feedback__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
}

/* ── Deck info ── */
.learn-deck-info {
  font-size: 0.78rem;
  color: #aaa;
  padding: 6px 0;
  text-align: center;
}

/* ── Quiz area ── */
.learn-quiz {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.learn-quiz__header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.learn-quiz__badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--student-accent-start);
  color: #fff;
}

.learn-quiz__progress {
  font-size: 0.82rem;
  color: #888;
  font-weight: 600;
}

.learn-quiz__question {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: #333;
  margin: 8px 0;
  line-height: 1.4;
}

.learn-quiz__options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.learn-quiz__option {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid #e0d8ce;
  border-radius: 14px;
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.learn-quiz__option:hover {
  border-color: var(--student-accent-start);
  background: #fff8e7;
}

.learn-quiz__option--correct {
  border-color: #2ecc71 !important;
  background: #f0fff4 !important;
  color: #1a7a3a;
  font-weight: 700;
}

.learn-quiz__option--wrong {
  border-color: #e74c3c !important;
  background: #fff5f5 !important;
  color: #c0392b;
  font-weight: 700;
}

.learn-quiz__option--submit {
  text-align: center;
  background: var(--student-accent-start);
  border-color: var(--student-accent-start);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}

.learn-quiz__option--submit:hover {
  background: var(--student-accent-end);
  border-color: var(--student-accent-end);
}

.learn-quiz--answered .learn-quiz__option {
  pointer-events: none;
}

.learn-quiz__result {
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  padding: 8px 0;
}

.learn-quiz__next {
  padding: 12px 36px;
  border: 0;
  border-radius: 14px;
  background: var(--student-accent-start);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.learn-quiz__next:hover {
  background: var(--student-accent-end);
  transform: translateY(-1px);
}

/* ── Spelling ── */
.learn-spelling {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.learn-spelling__input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e0d8ce;
  border-radius: 14px;
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}

.learn-spelling__input:focus {
  border-color: var(--student-accent-start);
  box-shadow: 0 0 0 3px rgba(255, 179, 32, 0.15);
}

.learn-spelling__hint {
  text-align: center;
  font-size: 0.85rem;
  color: #e74c3c;
  font-weight: 600;
  margin: 4px 0 0;
}

/* ── Completion screen ── */
.learn-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 20px;
  text-align: center;
  animation: learnFadeIn 0.5s ease;
}

.learn-complete__icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.learn-complete__title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #222;
  margin: 0 0 24px;
}

.learn-complete__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 20px;
}

.learn-complete__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(215, 193, 164, 0.15);
}

.learn-complete__stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--student-accent-start);
}

.learn-complete__stat-label {
  font-size: 0.78rem;
  color: #999;
  margin-top: 2px;
}

.learn-complete__detail {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.learn-complete__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
}

.learn-complete__btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: 1.5px solid #e0d8ce;
  border-radius: 14px;
  background: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: #555;
  transition: all 0.15s;
}

.learn-complete__btn:hover {
  border-color: var(--student-accent-start);
}

.learn-complete__btn--primary {
  background: var(--student-accent-start);
  border-color: var(--student-accent-start);
  color: #fff;
  font-weight: 700;
}

.learn-complete__btn--primary:hover {
  background: var(--student-accent-end);
  border-color: var(--student-accent-end);
}

/* ── Unit select chips (refined) ── */
.page-student-learn .learn-header {
  text-align: center;
  padding: 16px 0 8px;
}

.page-student-learn .learn-header h1 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.page-student-learn .learn-header p {
  margin: 0;
  color: #888;
  font-size: 0.82rem;
}

.page-student-learn .learn-unit-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ═══════════════════════════════════════════
   Student: Goal Page (Editable)
   ═══════════════════════════════════════════ */
.goal-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.goal-form {
  margin-top: 16px;
}

.goal-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0ede8;
}

.goal-form__label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #444;
}

.goal-form__input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-form__input {
  width: 90px;
  padding: 8px 12px;
  border: 1.5px solid #e0d8ce;
  border-radius: 10px;
  font-size: 1.05rem;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.goal-form__input:focus {
  border-color: var(--student-accent-start);
  box-shadow: 0 0 0 3px rgba(255, 179, 32, 0.12);
}

.goal-form__suffix {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
}

.goal-form__save {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--student-accent-start);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.goal-form__save:hover {
  background: var(--student-accent-end);
}

.goal-form__save:disabled {
  opacity: 0.6;
  cursor: default;
}

.goal-form__hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
}

/* Clickable tasks */
.page-student-goal .task-item {
  cursor: pointer;
  transition: background 0.15s;
}

.page-student-goal .task-item:hover {
  background: #fff5e6;
}

.page-student-goal .task-item--done:hover {
  background: #e8f8e8;
}

/* ── Messages / Notifications Page ── */
.page-student-messages .student-app-shell {
  position: relative;
  overflow: hidden;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    16px
    calc(18px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 240, 214, 0.92) 0, rgba(255, 240, 214, 0) 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 247, 232, 0.88) 0, rgba(255, 247, 232, 0) 26%),
    linear-gradient(180deg, #fffdf9 0%, #faf2e8 100%);
}

.page-student-messages .student-app-shell > * {
  position: relative;
  z-index: 1;
}

.page-student-messages .page-header h1 {
  margin: 4px 0 0;
  font-size: clamp(1.9rem, 7vw, 2.35rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.page-student-messages .page-header p {
  margin: 8px 0 0;
  max-width: 19em;
  color: #75695d;
  font-size: 0.96rem;
  line-height: 1.58;
}

.page-student-messages .page-header__actions {
  gap: 8px;
  padding-top: 4px;
}

.page-student-messages .page-header__spark {
  color: var(--community-accent);
  font-size: 1.02rem;
}

.page-student-messages .icon-only-button {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: #756658;
  box-shadow: inset 0 0 0 1px rgba(238, 227, 212, 0.95);
}

.messages-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.message-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--community-radius-md);
  background: var(--community-surface);
  border: 1px solid var(--community-border);
  box-shadow: var(--community-shadow-soft);
  transition: background 0.15s;
}

.message-item:hover {
  background: rgba(255, 247, 234, 0.72);
}

.message-item--unread {
  background: rgba(255, 247, 234, 0.6);
  border-color: rgba(242, 154, 38, 0.2);
}

.message-item__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff7ea;
  font-size: 1.2rem;
}

.message-item__body {
  flex: 1;
  min-width: 0;
}

.message-item__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2d2a26;
}

.message-item__time {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: #9d958d;
}

.message-item__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--community-accent-strong);
}

.messages-empty-state {
  margin-top: 16px;
  padding: 32px 20px;
  text-align: center;
}

.messages-empty-state[hidden] {
  display: none;
}

.messages-empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.messages-empty-state strong {
  display: block;
  color: #403d39;
  font-size: 1rem;
}

.messages-empty-state p {
  margin: 8px 0 0;
  color: #756f68;
  line-height: 1.5;
}
