:root {
  color-scheme: light;
  --bg: #f6efe4;
  --surface: #fffaf0;
  --surface-soft: #f1e5d4;
  --ink: #2b2021;
  --muted: #786b63;
  --line: #e3d4c2;
  --brand: #9a2332;
  --brand-strong: #741827;
  --accent: #c49a48;
  --blue: #4169a8;
  --rose: #b83a3d;
  --good: #257a55;
  --warn: #bd6c22;
  --bad: #a63a47;
  --shadow: 0 18px 45px rgba(35, 51, 72, 0.12);
  --radius: 8px;
  --topbar-height: 74px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(154, 35, 50, 0.11), transparent 28rem),
    linear-gradient(180deg, rgba(255, 250, 240, 0.72), rgba(246, 239, 228, 0.82)),
    url("campus-wallpaper-v2.png") center / cover fixed,
    linear-gradient(180deg, #fffaf0 0%, var(--bg) 34rem);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  min-height: 100dvh;
}

body.dark-theme {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #1a1d24;
  --surface-soft: #23262e;
  --ink: #e4e7ed;
  --muted: #8b95a5;
  --line: #2e3340;
  --brand: #d36a6a;
  --brand-strong: #b84a55;
  --accent: #d8ad67;
  --blue: #5b8bc0;
  --rose: #d47a8b;
  --good: #3da97a;
  --warn: #d4933a;
  --bad: #e07a88;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
  background:
    radial-gradient(circle at 12% 8%, rgba(216, 162, 76, 0.11), transparent 28rem),
    linear-gradient(180deg, rgba(15, 17, 23, 0.72), rgba(15, 17, 23, 0.86)),
    url("campus-wallpaper-v2.png") center / cover fixed,
    #0f1117;
}

body.font-small {
  font-size: 14px;
}

body.font-large {
  font-size: 17px;
}

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

button {
  cursor: pointer;
}

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

p,
h1,
h2,
h3 {
  margin-top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 420px) minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(220, 226, 234, 0.78);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

body.dark-theme .topbar {
  border-bottom-color: var(--line);
  background: rgba(15, 17, 23, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 132px;
}

.brand-mark,
.about-logo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: #f7efe2;
  color: #fff;
  font-weight: 850;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(116, 24, 39, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand-wordmark,
.share-card-brand span {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  font-family: "STXingkai", "华文行楷", "KaiTi", "楷体", "Microsoft YaHei", "PingFang SC", serif;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--brand-strong);
  text-shadow: 0 8px 18px rgba(116, 24, 39, 0.16);
}

.brand-wordmark::after {
  content: "";
  position: absolute;
  left: 0.04em;
  right: 0.04em;
  bottom: -0.16em;
  height: 0.16em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0.78;
}

.footer-brand .brand-wordmark,
.about-brand .brand-wordmark {
  font-size: 23px;
}

body.dark-theme .brand-wordmark,
body.dark-theme .share-card-brand span {
  color: #f2d7ba;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-inline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.search-hero .search-inline-bar {
  display: none;
}

.search-inline-bar input {
  width: 100%;
  min-height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 0 16px;
  background: #f3f6f8;
  color: var(--ink);
  outline: none;
}

.search-inline-bar button,
.primary-action,
.search-row button,
.submit-button,
.comparison-bar button,
.btn-sm,
.admin-actions button,
.settings-btn.primary,
.data-btn,
.nav-link {
  border: 0;
  border-radius: var(--radius);
  font-weight: 750;
}

.search-inline-bar button {
  min-height: 36px;
  background: var(--brand);
  color: #fff;
  padding: 0 15px;
  white-space: nowrap;
}

.topnav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 22px);
  color: var(--muted);
  font-size: 14px;
  padding-bottom: 12px;
}

.topnav a:hover,
.topnav a.active,
.nav-link:hover {
  color: var(--brand);
}

.nav-slider {
  position: absolute;
  left: 0;
  top: 0;
  bottom: auto;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 220ms ease, width 220ms ease, opacity 180ms ease;
  pointer-events: none;
}

.nav-slider.show {
  opacity: 1;
}

.nav-link {
  background: transparent;
  color: inherit;
  padding: 0;
}

.donate-link {
  color: var(--accent);
}

.icon-btn,
.user-btn,
.primary-action {
  min-height: 38px;
  white-space: nowrap;
}

.icon-btn,
.user-btn {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 700;
}

.notification-btn.has-unread {
  border-color: color-mix(in srgb, var(--brand) 52%, var(--line));
  color: var(--brand);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 900;
  line-height: 14px;
}

.icon-btn:hover,
.user-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.primary-action {
  background: var(--brand);
  color: #fff;
  padding: 0 16px;
}

.mobile-bottom-nav {
  display: none;
}

main {
  display: flex;
  width: 100%;
  height: calc(100dvh - var(--topbar-height));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

main::-webkit-scrollbar {
  display: none;
}

main > section {
  flex: 0 0 100vw;
  width: 100vw;
  min-width: 100vw;
  max-width: none;
  height: 100%;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px clamp(18px, 4vw, 56px);
  scroll-snap-align: start;
}

main > .site-footer {
  flex: 0 0 100vw;
  width: 100vw;
  min-width: 100vw;
  height: 100%;
  overflow-y: auto;
  scroll-snap-align: start;
}

.site-footer {
  display: grid;
  align-items: center;
  padding: 32px clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.site-footer-inner {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.75fr) minmax(220px, 0.8fr);
  gap: 24px;
  align-items: start;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.footer-brand img {
  width: 36px;
  height: 36px;
}

.footer-brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-footer p,
.footer-records span {
  color: var(--muted);
  line-height: 1.7;
}

.footer-links,
.footer-records {
  display: grid;
  gap: 9px;
}

.footer-links a {
  color: var(--brand);
  font-weight: 800;
}

.home-panel {
  padding-top: 28px;
}

.hero-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 28px;
  align-items: stretch;
  padding: 42px 0 20px;
}

.hero-copy {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 650px;
  margin-bottom: 18px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.06;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.hero-text,
.review-copy p:last-child,
.guidance p,
.form-note,
.modal-bio,
.scale-note {
  color: var(--muted);
  line-height: 1.75;
}

.search-panel,
.insight-card,
.ranking-panel,
.teacher-card,
.stat-card,
.review-section,
.admin-section,
.panel,
.settings-card,
.donate-qr-card,
.login-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.search-panel {
  align-self: center;
  position: relative;
  overflow: visible;
  padding: 26px;
}

.search-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.search-label,
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.search-row {
  position: relative;
  display: flex;
  gap: 10px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

input[type="search"],
input[type="text"],
input[type="tel"],
input[type="password"],
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input[type="search"],
input[type="text"],
input[type="tel"],
input[type="password"],
select {
  min-height: 42px;
  padding: 0 12px;
}

select[multiple] {
  min-height: 150px;
  padding: 8px;
}

select[multiple] option {
  padding: 7px 8px;
  border-radius: 6px;
}

select.native-soft-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.soft-select {
  position: relative;
  width: 100%;
  margin-top: 7px;
  z-index: 1;
}

.soft-select.open {
  z-index: 70;
}

.soft-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--ink);
  padding: 0 12px 0 15px;
  text-align: left;
  box-shadow: 0 10px 22px rgba(116, 24, 39, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.soft-select-trigger:hover,
.soft-select.open .soft-select-trigger {
  border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
  background: color-mix(in srgb, var(--surface) 98%, var(--brand) 2%);
  box-shadow: 0 14px 30px rgba(116, 24, 39, 0.12);
}

.soft-select.open .soft-select-trigger {
  transform: translateY(-1px);
}

.soft-select-value {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soft-select-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease;
}

.soft-select.open .soft-select-icon {
  transform: rotate(180deg);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
}

.soft-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: min(280px, 48vh);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 20px 45px rgba(35, 51, 72, 0.16);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(16px);
}

.soft-select.open .soft-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.soft-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  padding: 0 11px;
  text-align: left;
  font-weight: 750;
  line-height: 1.35;
}

.soft-select-option:hover,
.soft-select-option:focus-visible {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  outline: none;
}

.soft-select-option.selected {
  background: color-mix(in srgb, var(--brand) 15%, transparent);
  color: var(--brand);
}

.soft-select-option.selected::after {
  content: "✓";
  margin-left: auto;
  font-weight: 900;
}

.soft-select.disabled {
  opacity: 0.62;
}

.search-row input {
  flex: 1;
  min-height: 50px;
  padding-left: 42px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

input[type="file"] {
  width: 100%;
  margin-top: 7px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 10px;
}

.search-row button {
  min-height: 50px;
  background: #26323f;
  color: #fff;
  padding: 0 18px;
}

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

.filter-reset {
  align-self: end;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-weight: 800;
}

.stats-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 28px;
}

.home-highlights {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: -6px 0 18px;
}

.home-rank-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(35, 51, 72, 0.07);
}

.home-rank-head span,
.home-rank-head small {
  display: block;
}

.home-rank-head span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.home-rank-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.home-rank-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 66%, transparent);
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.home-rank-item > strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

.home-rank-item span,
.profile-favorite-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-rank-item small,
.profile-favorite-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.home-rank-item em {
  font-style: normal;
  font-weight: 900;
}

.campus-hub {
  display: grid;
  align-content: start;
  gap: 18px;
}

.hub-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.9fr;
  gap: 16px;
}

.hub-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 18px;
  box-shadow: 0 14px 30px rgba(35, 51, 72, 0.08);
}

.hub-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.hub-panel h3 {
  margin-bottom: 12px;
}

.public-course-zone,
.contribution-board,
.guide-steps {
  display: grid;
  gap: 10px;
}

.public-course-card,
.contribution-item,
.guide-steps article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 12px;
}

.public-course-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.public-course-main,
.contribution-item {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.public-course-main strong,
.public-course-main span,
.contribution-item span,
.guide-steps span {
  display: block;
}

.public-course-main span,
.guide-steps span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.public-course-card > div {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.public-course-card em {
  font-style: normal;
  font-size: 20px;
  font-weight: 900;
}

.contribution-item {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
}

.contribution-item > strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}

.contribution-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.contribution-item em {
  color: var(--brand);
  font-style: normal;
  font-weight: 900;
}

.stat-card {
  padding: 18px;
  box-shadow: none;
}

.stat-card span {
  display: block;
  font-size: 30px;
  font-weight: 850;
}

.stat-card small {
  color: var(--muted);
  font-weight: 750;
}

.workspace {
  width: 100vw;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.content-column {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.ranking-section {
  display: grid;
  align-content: start;
}

.rankings-shell {
  width: min(1180px, 100%);
  display: grid;
  gap: 16px;
  margin: 0 auto;
}

.ranking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.ranking-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  box-shadow: none;
}

.ranking-panel.wide {
  grid-column: 1 / -1;
}

.ranking-highlights {
  margin-top: 0;
}

body.sidebar-collapsed .workspace {
  grid-template-columns: 1fr;
}

body.sidebar-collapsed .side-column {
  display: none;
}

body.sidebar-collapsed #tagCloudCard,
body.sidebar-collapsed .ranking-panel.guidance {
  display: none;
}

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

.section-heading.compact {
  align-items: start;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.teacher-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(35, 51, 72, 0.07);
}

.toolbar-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.toolbar-search input {
  margin-top: 0;
}

.toolbar-search button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: #26323f;
  color: #fff;
  padding: 0 16px;
  font-weight: 750;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.mobile-filter-toggle {
  display: none;
}

.teacher-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.teacher-card:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  box-shadow: 0 12px 28px rgba(35, 51, 72, 0.1);
  transform: translateY(-2px);
}

body.compact .teacher-card {
  gap: 9px;
  padding: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.card-avatar,
.avatar-preview-lg {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  color: #fff;
  font-weight: 850;
}

.card-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  font-size: 20px;
}

.teacher-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-title,
.card-meta,
.teacher-bio,
.review-date,
.review-course,
.leader-item small,
.metric-strip span,
.phone-display {
  color: var(--muted);
  font-size: 13px;
}

.card-meta {
  display: grid;
  gap: 3px;
}

.card-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
}

.star {
  color: #b9c2cd;
}

.star.filled {
  color: var(--accent);
}

.rating-num {
  margin-left: auto;
  color: var(--muted) !important;
  font-size: 13px;
  font-weight: 800;
}

.rating-hero {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
  padding: 12px;
}

.rating-hero strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.rating-hero span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.rating-hero.bad strong {
  color: var(--bad);
}

.rating-hero.warn strong {
  color: var(--warn);
}

.rating-hero.mid strong {
  color: var(--blue);
}

.rating-hero.good strong,
.rating-hero.great strong {
  color: var(--good);
}

.rating-num.bad,
.detail-score.bad,
.leader-score.bad {
  color: var(--bad);
}

.rating-num.warn,
.detail-score.warn,
.leader-score.warn {
  color: var(--warn);
}

.rating-num.mid,
.detail-score.mid,
.leader-score.mid {
  color: var(--blue);
}

.rating-num.good,
.rating-num.great,
.detail-score.good,
.detail-score.great,
.leader-score.good,
.leader-score.great {
  color: var(--good);
}

.metric-strip,
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-strip span,
.detail-metrics span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 8px;
}

.metric-strip strong,
.detail-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.dimension-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.dimension-strip span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dimension-strip strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.teacher-bio {
  margin: 0;
}

.card-tags,
.tag-cloud,
.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  border: 0;
  border-radius: 999px;
  background: #edf2f7;
  color: #334155;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
}

body.dark-theme .tag {
  background: #23262e;
  color: #b0b9c8;
}

.tag.good,
.tag.great {
  background: #e8f5ef;
  color: var(--good);
}

.tag.warn,
.tag.bad {
  background: #fff1df;
  color: var(--warn);
}

.tag.mid {
  background: #edf2ff;
  color: var(--blue);
}

.tag-button {
  cursor: pointer;
}

.card-actions,
.review-footer,
.admin-actions,
.data-actions,
.avatar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.btn-sm,
.submit-button {
  background: var(--brand);
  color: #fff;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon.filled-icon {
  fill: currentColor;
}

.btn-sm.outline,
.data-btn,
.settings-btn.ghost,
.btn-text {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.favorite-btn.active {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.btn-text {
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--muted);
}

.side-column {
  display: grid;
  gap: 14px;
}

.insight-card {
  padding: 18px;
  box-shadow: none;
}

.leader-filter {
  margin-bottom: 12px;
}

.leaderboard {
  display: grid;
  gap: 9px;
}

.course-explorer {
  display: grid;
  gap: 12px;
}

.course-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.course-search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 13px;
  background: var(--surface);
  color: var(--ink);
}

.course-search-box button {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 12%);
}

.course-explorer-results {
  display: grid;
  gap: 9px;
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.course-result-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
}

.course-result-main {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0;
}

.course-result-main strong,
.course-result-main span {
  display: block;
}

.course-result-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.course-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.course-result-actions em {
  font-style: normal;
  font-weight: 900;
  margin-right: auto;
}

.leader-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
}

.leader-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.leader-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.leader-share {
  white-space: nowrap;
}

.rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #26323f;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.leader-main strong,
.leader-main small {
  display: block;
}

.leader-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  font-size: 18px;
  font-weight: 850;
}

.review-section,
.admin-section {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-padding-bottom: 120px;
}

#adminPanel {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
  gap: 16px;
  padding-bottom: 42px;
}

#adminPanel[hidden] {
  display: none !important;
}

.review-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 28px;
}

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

.full-span {
  grid-column: 1 / -1;
}

.course-picker {
  display: grid;
  gap: 10px;
}

.course-options,
.selected-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-options {
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  padding: 10px;
}

.course-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.course-chip.active,
.course-chip.selected {
  border-color: color-mix(in srgb, var(--brand) 56%, var(--line));
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand);
}

.course-chip span {
  margin-left: 8px;
}

.course-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.form-note {
  margin: 0;
  font-size: 13px;
}

.submit-button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
}

.admin-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.admin-lock {
  width: min(680px, 100%);
  max-width: 680px;
  margin: 8vh auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 28px;
  box-shadow: var(--shadow);
}

.admin-lock p {
  color: var(--muted);
  line-height: 1.75;
}

.admin-unlock-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.admin-unlocked {
  color: var(--brand) !important;
}

.admin-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.admin-stats article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 14px;
}

.admin-stats strong,
.admin-stats span {
  display: block;
}

.admin-stats strong {
  font-size: 24px;
}

.admin-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.admin-todos {
  margin: 14px 0;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.todo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 14px;
}

.todo-card.ok {
  border-color: color-mix(in srgb, var(--good) 35%, var(--line));
}

.todo-card.warn {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}

.todo-card.danger {
  border-color: color-mix(in srgb, var(--bad) 42%, var(--line));
}

.todo-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.admin-guide {
  margin: 14px 0;
}

.admin-guide-card {
  display: grid;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-soft) 72%, transparent));
  padding: 16px;
  box-shadow: 0 12px 28px rgba(154, 35, 50, 0.08);
}

.admin-guide-card h3 {
  margin: 0;
}

.admin-guide-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.admin-guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-action-help {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.review-stepper,
.review-step-actions,
.review-step-confirm {
  display: none;
}

.confirm-card {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  padding: 14px;
}

.confirm-card h3,
.confirm-card p {
  margin: 0;
}

.confirm-card small {
  color: var(--muted);
  line-height: 1.6;
}

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

.confirm-grid span {
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.admin-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-tools input,
.admin-tools select {
  min-width: 0;
  height: 40px;
}

.admin-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
}

.admin-subhead h3 {
  margin: 0;
  color: var(--ink);
}

.admin-card {
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  box-shadow: none;
}

.admin-card.approved {
  border-color: color-mix(in srgb, var(--good) 42%, var(--line));
}

.admin-card.rejected {
  border-color: color-mix(in srgb, var(--rose) 42%, var(--line));
}

.admin-card.hidden,
.admin-card.report-card.hidden {
  border-color: color-mix(in srgb, var(--bad) 48%, var(--line));
}

.admin-card.resolved {
  border-color: color-mix(in srgb, var(--good) 42%, var(--line));
}

.admin-card.dismissed {
  opacity: 0.78;
}

.admin-card.user-admin-card.muted {
  border-color: color-mix(in srgb, var(--warn) 42%, var(--line));
}

.admin-card.user-admin-card.banned {
  border-color: color-mix(in srgb, var(--bad) 48%, var(--line));
}

.user-admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.user-admin-meta span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.status-active {
  color: var(--good);
}

.status-muted {
  color: var(--warn);
}

.status-banned {
  color: var(--bad);
}

.admin-snippet {
  border-left: 3px solid var(--brand);
  padding-left: 10px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.evidence-box {
  display: grid;
  gap: 6px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.evidence-box a {
  color: var(--blue);
  text-decoration: underline;
}

.admin-actions button {
  min-height: 36px;
  background: #26323f;
  color: #fff;
  padding: 0 12px;
  white-space: normal;
}

.admin-actions button.danger {
  background: #b42318;
  box-shadow: 0 8px 20px rgba(180, 35, 24, 0.18);
}

.admin-actions button.danger:hover {
  background: #9f1f17;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.admin-pager button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.admin-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-log-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-logs {
  display: grid;
  gap: 10px;
}

.audit-log-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.audit-log-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.audit-log-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.share-modal-body {
  display: grid;
  gap: 16px;
}

.share-image-canvas {
  width: min(420px, 100%);
  aspect-ratio: 900 / 1180;
  justify-self: center;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(35, 51, 72, 0.14);
}

.share-card-preview {
  display: grid;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-soft) 76%, transparent)),
    radial-gradient(circle at 10% 8%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 12rem);
  padding: 20px;
}

.share-card-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--brand);
  font-weight: 900;
}

.share-card-brand img {
  width: 34px;
  height: 34px;
}

.share-card-lines {
  display: grid;
  gap: 8px;
  line-height: 1.65;
}

.share-card-lines strong {
  color: var(--ink);
  font-size: 18px;
}

.share-card-lines span,
.share-card-preview p {
  color: var(--muted);
}

.share-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.restore-help article {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
}

.restore-help p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.compact-admin-form {
  margin-top: 8px;
}

.comparison-bar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
  border: 1px solid rgba(23, 32, 42, 0.18);
  border-radius: var(--radius);
  background: rgba(23, 32, 42, 0.94);
  color: #fff;
  padding: 13px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.comparison-bar span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.comparison-items {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
}

.compare-chip {
  display: grid;
  min-width: 150px;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
}

.compare-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-bar button,
.icon-btn-sm {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 8px 12px;
}

.icon-btn-sm {
  border: 0;
  border-radius: var(--radius);
}

.comparison-modal {
  width: min(980px, calc(100% - 28px));
}

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

.compare-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.compare-table th:last-child,
.compare-table td:last-child {
  border-right: 0;
}

.compare-table tr:last-child td {
  border-bottom: 0;
}

.compare-table th {
  background: var(--surface-soft);
}

.compare-table th span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

dialog {
  border: 0;
  padding: 0;
}

dialog::backdrop {
  background: rgba(10, 14, 23, 0.55);
  backdrop-filter: blur(5px);
}

.teacher-modal {
  width: min(940px, calc(100% - 28px));
  max-height: min(88vh, 860px);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
}

.modal-close.inline {
  position: static;
  justify-self: end;
}

.modal-body {
  padding: 26px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 44px;
}

.subtitle {
  color: var(--muted);
}

.detail-score {
  min-width: 84px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
  text-align: center;
}

.detail-score strong {
  display: block;
  font-size: 26px;
}

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

.detail-review-btn {
  margin-top: 12px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 44px;
}

.profile-avatar {
  width: 56px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.profile-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
}

.profile-favorites,
.mini-notice-list,
.notice-list {
  display: grid;
  gap: 10px;
}

.profile-favorite-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.profile-favorite-item strong {
  font-size: 18px;
}

.notice-card,
.mini-notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.notice-card.unread,
.mini-notice.unread {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.notice-card div,
.mini-notice {
  display: grid;
  gap: 3px;
}

.notice-card strong,
.mini-notice strong {
  color: var(--ink);
}

.notice-card span,
.mini-notice span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.notice-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.course-teacher-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
}

.course-teacher-item span,
.course-teacher-item small {
  display: block;
  min-width: 0;
}

.course-teacher-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.course-teacher-item em {
  font-style: normal;
  font-weight: 900;
}

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

.panel {
  padding: 16px;
  box-shadow: none;
}

.distribution {
  display: grid;
  gap: 9px;
}

.dist-row {
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.dist-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.dist-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.dist-fill.bad {
  background: var(--bad);
}

.dist-fill.warn {
  background: var(--warn);
}

.dist-fill.good,
.dist-fill.great {
  background: var(--good);
}

.review-list-wrap {
  margin-top: 18px;
}

.review-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

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

.review-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.review-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.author-link {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.teacher-profile-link {
  margin-left: 8px;
  color: var(--ink);
}

.badge {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.badge.bad {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.badge.warn {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

.badge.mid {
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
}

.badge.good,
.badge.great {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.review-comment {
  margin: 10px 0;
  line-height: 1.75;
}

.reply-thread {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  border-left: 3px solid color-mix(in srgb, var(--brand) 38%, transparent);
  padding-left: 12px;
}

.reply-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.reply-item {
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.reply-item div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.reply-item p {
  margin: 6px 0 0;
  line-height: 1.65;
}

.report-reply {
  margin-left: auto;
  font-size: 12px;
}

.reply-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin: 10px 0;
}

.reaction-row {
  gap: 8px;
}

.reaction-btn.active {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  color: var(--brand);
  font-weight: 800;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--brand) 12%, white 88%);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.profile-badge.muted {
  color: var(--muted);
  background: var(--surface);
}

.reply-input {
  min-height: 42px;
  resize: vertical;
  margin-top: 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 40;
  max-width: min(360px, calc(100% - 40px));
  transform: translateY(18px);
  border-radius: var(--radius);
  background: #17202a;
  color: #fff;
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

.disclaimer-modal {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: auto;
}

.disclaimer-modal::backdrop {
  background: rgba(16, 24, 34, 0.58);
  backdrop-filter: blur(5px);
}

.disclaimer-card {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.disclaimer-card h2 {
  margin: 0;
  color: var(--brand-strong);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.18;
}

.disclaimer-card p,
.disclaimer-card ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.disclaimer-alert {
  border: 1px solid color-mix(in srgb, var(--brand) 42%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand-strong);
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
}

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

.disclaimer-points p {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 66%, transparent);
  padding: 9px 10px;
  font-size: 13px;
}

.disclaimer-points strong,
.disclaimer-points span {
  color: var(--brand-strong);
}

.disclaimer-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.disclaimer-features span {
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 76%, transparent);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.disclaimer-agreement {
  font-size: 13px;
}

.settings-modal {
  width: min(820px, calc(100% - 28px));
  height: min(620px, calc(100vh - 70px));
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100%;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 14px 10px;
}

.settings-tab {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}

.settings-tab:hover,
.settings-tab.active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}

.settings-tab.danger:hover {
  background: color-mix(in srgb, var(--rose) 13%, transparent);
  color: var(--rose);
}

.settings-tab-spacer {
  flex: 1;
}

.settings-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.settings-pane {
  display: none;
  flex: 1;
  overflow: auto;
  padding: 26px 28px 0;
}

.settings-pane.active {
  display: block;
}

.pane-header {
  margin-bottom: 20px;
}

.pane-header h2 {
  margin-bottom: 4px;
}

.pane-header p {
  margin: 0;
  color: var(--muted);
}

.settings-card {
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: none;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.settings-row:last-child {
  border-bottom: 0;
}

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

.row-label strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 14px;
}

.row-label span {
  color: var(--muted);
  font-size: 12px;
}

.avatar-upload-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-preview-lg {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 50%;
}

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

.upload-label,
.settings-btn,
.data-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 700;
}

.upload-label {
  border: 1px solid var(--line);
  background: var(--surface);
}

.segmented-control {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 4px;
}

.segmented-control.wrap {
  flex-wrap: wrap;
}

.seg-btn {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 750;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--brand);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.settings-footer {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 28px;
}

.settings-btn {
  border: 0;
}

.settings-btn.primary {
  background: var(--brand);
  color: #fff;
}

.about-card {
  padding: 22px;
}

.about-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.about-ver {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.data-btn {
  border: 1px solid var(--line);
}

.data-btn.danger {
  color: var(--rose);
}

.donate-modal {
  width: min(920px, calc(100% - 28px));
  height: min(520px, calc(100vh - 70px));
}

.donate-layout {
  grid-template-columns: 180px 1fr;
}

.donate-content {
  overflow: auto;
}

.donate-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: center;
  min-height: 100%;
  padding: 34px;
}

.donate-copy h2 {
  max-width: 560px;
  margin-bottom: 14px;
  font-size: 30px;
  line-height: 1.18;
}

.donate-copy p,
.donate-copy li {
  color: var(--muted);
  line-height: 1.85;
}

.donate-copy ul {
  margin: 14px 0;
  padding-left: 20px;
}

.donate-thanks {
  font-weight: 800;
  color: var(--ink) !important;
}

.donate-qr-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: none;
}

.donate-qr-card img {
  width: min(230px, 100%);
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.qr-label {
  color: var(--ink);
  font-weight: 850;
}

.donate-qr-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.donate-qr-card a {
  color: var(--brand);
  font-weight: 750;
}

.login-modal {
  width: min(420px, calc(100% - 28px));
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
}

#reportModal {
  width: min(520px, calc(100% - 28px));
}

.login-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 26px;
}

.login-card h2 {
  margin-bottom: 2px;
}

.captcha-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.captcha-box strong,
.captcha-box span {
  display: block;
}

.captcha-box strong {
  color: var(--brand);
  font-size: 18px;
}

.captcha-box span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.login-card select,
.login-card textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
}

.login-card textarea {
  resize: vertical;
}

.qq-login-btn {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: #12b7f5;
  color: #fff;
  font-weight: 850;
}

.qq-login-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.qq-login-note.highlight {
  border-color: #12b7f5;
  box-shadow: 0 0 0 4px rgba(18, 183, 245, 0.14);
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

body.dark-theme .search-inline-bar input {
  background: #15171d;
}

body.dark-theme .rank,
body.dark-theme .search-row button,
body.dark-theme .toolbar-search button,
body.dark-theme .admin-actions button {
  background: #2e3340;
}

body.dark-theme .admin-actions button.danger {
  background: #d34a3f;
  color: #fff;
}

body.dark-theme .toast {
  background: #2e3340;
  color: var(--ink);
}

body.dark-theme .comparison-bar {
  background: rgba(10, 12, 18, 0.96);
  border-color: var(--line);
}

body.dark-theme .tag.good,
body.dark-theme .tag.great {
  background: color-mix(in srgb, var(--good) 16%, transparent);
}

body.dark-theme .tag.warn,
body.dark-theme .tag.bad {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: auto 1fr auto auto auto auto;
  }

  .topnav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 940px) {
  .hero-shell,
  .workspace,
  .review-section,
  .modal-grid,
  .donate-page,
  .hub-grid,
  .ranking-grid,
  .site-footer-inner,
  .restore-help {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  .side-column {
    position: static;
  }

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

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

  .home-highlights {
    grid-template-columns: 1fr;
  }

  .public-course-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-course-card > div {
    display: flex;
    justify-content: space-between;
    justify-items: stretch;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  main {
    display: block;
    height: auto;
    min-height: calc(100dvh - var(--topbar-height));
    overflow: visible;
    scroll-snap-type: none;
    scroll-behavior: smooth;
  }

  main > section,
  main > .site-footer {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: auto;
    overflow: visible;
    scroll-snap-align: none;
    scroll-margin-top: calc(var(--topbar-height) + 10px);
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    z-index: 28;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 16px 34px rgba(34, 24, 20, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 0;
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
  }

  .mobile-bottom-nav button span {
    display: grid;
    width: 28px;
    height: 24px;
    place-items: center;
    font-size: 18px;
    line-height: 1;
  }

  .mobile-bottom-nav button strong {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .mobile-bottom-nav button.active {
    background: color-mix(in srgb, var(--brand) 12%, var(--surface-soft));
    color: var(--brand-strong);
  }

  .mobile-bottom-nav .mobile-home-tab {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 20px rgba(116, 24, 39, 0.22);
  }

  .mobile-bottom-nav .mobile-home-tab.active {
    background: var(--brand-strong);
    color: #fff;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 10px;
    padding: 10px 12px 8px;
  }

  .brand {
    min-width: 0;
  }

  .search-inline-bar {
    grid-column: 1 / -1;
    order: 2;
  }

  .topnav {
    grid-column: 1 / -1;
    order: 3;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav a,
  .topnav button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .soft-select-trigger {
    min-height: 46px;
    border-radius: 17px;
  }

  .soft-select-menu {
    max-height: min(300px, 42vh);
    border-radius: 16px;
  }

  .soft-select-option {
    min-height: 42px;
    padding: 0 12px;
  }

  .primary-action {
    display: none;
  }

  h1 {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.1;
  }

  .stats-grid,
  .home-highlights,
  .hub-grid,
  .admin-stats,
  .todo-grid,
  .admin-tools,
  .filter-grid,
  .toolbar-filters,
  .review-form,
  .metric-strip,
  .detail-metrics,
  .settings-row,
  .comparison-bar {
    grid-template-columns: 1fr;
  }

  .search-row {
    flex-wrap: wrap;
  }

  .search-row input,
  .search-row button {
    width: 100%;
  }

  .result-count {
    white-space: normal;
  }

  .toolbar-search,
  .reply-box,
  .captcha-box,
  .admin-unlock-form {
    grid-template-columns: 1fr;
  }

  #adminPanel {
    gap: 12px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .admin-head-actions {
    justify-content: stretch;
  }

  .admin-head-actions .settings-btn,
  .admin-head-actions .result-count {
    width: 100%;
  }

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

  .admin-actions button {
    width: 100%;
  }

  .teacher-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .teacher-card .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .teacher-card .metric-strip span {
    text-align: center;
  }

  .review-section,
  .admin-section,
  .campus-hub,
  .ranking-section,
  .search-panel,
  .modal-body {
    padding: 18px;
  }

  .home-panel,
  .workspace,
  .campus-hub,
  .ranking-section,
  .review-section,
  .admin-section,
  main > .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .teacher-modal,
  .login-modal,
  .settings-modal,
  .donate-modal,
  .disclaimer-modal {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: calc(100dvh - 10px);
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .teacher-modal,
  .login-modal,
  .disclaimer-modal {
    overflow: auto;
  }

  .teacher-modal::backdrop,
  .login-modal::backdrop,
  .settings-modal::backdrop,
  .donate-modal::backdrop,
  .disclaimer-modal::backdrop {
    background: rgba(43, 32, 33, 0.42);
    backdrop-filter: blur(8px);
  }

  .modal-close {
    position: sticky;
    top: 8px;
    float: right;
    width: 42px;
    height: 42px;
    margin: 8px 8px 0 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 8px 22px rgba(34, 24, 20, 0.12);
  }

  .hub-panel,
  .site-footer-inner {
    padding: 16px;
  }

  .hub-panel-head {
    display: grid;
  }

  .contribution-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .modal-header,
  .review-header {
    display: grid;
    padding-right: 38px;
  }

  .admin-card .review-header {
    padding-right: 0;
  }

  .settings-layout,
  .donate-layout {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-tab {
    width: auto;
  }

  .settings-tab-spacer {
    display: none;
  }

  .settings-modal,
  .donate-modal {
    height: calc(100dvh - 10px);
  }

  .disclaimer-card {
    gap: 9px;
    padding: 18px;
  }

  .disclaimer-points {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .disclaimer-points p {
    padding: 8px 10px;
  }

  .donate-page {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px;
  }

  .donate-qr-card {
    order: -1;
  }

  .donate-copy {
    order: 1;
  }

  .donate-copy h2 {
    font-size: 25px;
  }

  .donate-qr-card img {
    width: min(210px, 100%);
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  body {
    background-attachment: scroll;
  }

  main > section {
    height: auto;
    padding-bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  }

  main > .site-footer {
    padding-bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  }

  .hero-shell {
    align-content: start;
  }

  .hero-copy {
    justify-content: start;
  }

  .search-panel,
  .teacher-toolbar,
  .teacher-card,
  .review-section,
  .admin-section,
  .side-card {
    border-radius: 14px;
  }

  .modal-header {
    align-items: stretch;
  }

  .review-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 2px;
  }

  .review-stepper span {
    display: grid;
    min-width: 0;
    min-height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
  }

  .review-stepper span.active {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    background: color-mix(in srgb, var(--brand) 12%, var(--surface));
    color: var(--brand-strong);
  }

  .review-stepper span.done {
    color: var(--good);
  }

  .review-form.review-stepped .review-step-field {
    display: none;
  }

  .review-form.review-stepped.review-step-1 .review-step-1,
  .review-form.review-stepped.review-step-2 .review-step-2,
  .review-form.review-stepped.review-step-3 .review-step-3,
  .review-form.review-stepped.review-step-4 .review-step-4 {
    display: grid;
  }

  .review-form.review-stepped .review-step-confirm.review-step-4 {
    display: none;
  }

  .review-form.review-stepped.review-step-4 .review-step-confirm.review-step-4 {
    display: block;
  }

  .review-step-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .review-step-actions button[hidden] {
    display: none !important;
  }

  .review-step-actions:has(button[hidden]) {
    grid-template-columns: 1fr;
  }

  .review-form.review-stepped .submit-button.mobile-step-hidden {
    display: none;
  }

  .admin-guide-card {
    padding: 14px;
  }

  .admin-guide-card ol {
    padding-left: 18px;
    font-size: 13px;
  }

  .admin-action-help {
    font-size: 12px;
  }

  .admin-lock {
    margin-top: 18px;
    padding: 18px;
  }
}

@media (max-width: 480px) {
  :root {
    --radius: 7px;
  }

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  main {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    max-width: 100vw;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    padding: 10px 12px 9px;
  }

  .brand {
    gap: 8px;
  }

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

  .brand strong {
    font-size: 16px;
  }

  .brand .brand-wordmark {
    font-size: 19px;
  }

  .brand .brand-wordmark::after {
    bottom: -0.12em;
    height: 0.13em;
  }

  .brand small {
    font-size: 11px;
  }

  .icon-btn,
  .user-btn {
    min-height: 34px;
    padding: 0 10px;
  }

  .user-btn {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .icon-btn {
    width: 36px;
    padding: 0;
  }

  .search-inline-bar {
    gap: 6px;
  }

  .search-inline-bar input {
    min-height: 36px;
    padding: 0 12px;
  }

  .search-inline-bar button {
    min-height: 36px;
    padding: 0 12px;
  }

  .search-panel .filter-grid {
    margin-top: 14px;
  }

  .topnav {
    margin: 0 -12px;
    padding: 0 12px 14px;
    font-size: 13px;
  }

  .topnav a,
  .topnav button {
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
    padding: 7px 10px;
  }

  main > section {
    padding: 16px 14px calc(98px + env(safe-area-inset-bottom, 0px));
  }

  .home-panel {
    padding-top: 14px;
  }

  .hero-shell {
    gap: 16px;
    padding: 12px 0 12px;
  }

  .hero-copy {
    min-height: auto;
  }

  h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  .hero-text {
    font-size: 15px;
  }

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

  .home-highlights {
    gap: 10px;
    margin: 0 0 16px;
  }

  .home-rank-card {
    padding: 12px;
  }

  .home-rank-item {
    min-height: 42px;
    margin-top: 7px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card span {
    font-size: 24px;
  }

  .stat-card small {
    font-size: 12px;
  }

  .workspace,
  .review-section {
    gap: 16px;
  }

  .section-heading {
    display: grid;
    gap: 8px;
  }

  .teacher-toolbar {
    padding: 12px;
  }

  .toolbar-search {
    gap: 8px;
  }

  .teacher-card,
  .review-section,
  .admin-section,
  .search-panel,
  .side-card,
  .modal-body,
  .login-card {
    padding: 16px;
  }

  .admin-stats article,
  .todo-card,
  .admin-tools,
  .admin-card,
  .audit-log-item {
    padding: 12px;
  }

  .admin-stats strong {
    font-size: 20px;
  }

  .admin-subhead {
    align-items: start;
  }

  .admin-subhead span {
    font-size: 12px;
  }

  .teacher-card {
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
  }

  .card-header {
    gap: 10px;
  }

  .card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 20px;
  }

  .teacher-name {
    font-size: 22px;
  }

  .rating-hero {
    padding: 13px 14px;
    border-radius: 18px;
  }

  .rating-hero strong {
    font-size: 32px;
    line-height: 1.08;
  }

  .rating-hero span {
    font-size: 13px;
  }

  .metric-strip {
    gap: 6px;
  }

  .dimension-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .teacher-bio {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 2px;
    font-size: 14px;
    line-height: 1.55;
  }

  .card-meta {
    gap: 5px;
    font-size: 13px;
  }

  .card-stars {
    gap: 3px;
    font-size: 13px;
  }

  .card-tags .tag:nth-child(n+4) {
    display: none;
  }

  .metric-strip span {
    padding: 10px 6px;
    border-radius: 14px;
    font-size: 13px;
  }

  .metric-strip strong {
    font-size: 18px;
  }

  .soft-select {
    margin-top: 6px;
  }

  .soft-select-trigger {
    min-height: 44px;
    padding-left: 13px;
    border-radius: 16px;
  }

  .soft-select-icon {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
  }

  .soft-select-menu {
    max-height: min(270px, 40vh);
    padding: 7px;
  }

  .soft-select-option {
    min-height: 41px;
    font-size: 14px;
  }

  .teacher-card h3 {
    font-size: 19px;
  }

  .card-actions,
  .detail-actions {
    gap: 7px;
  }

  .card-actions .btn-sm {
    flex: 1 1 calc(50% - 7px);
    min-width: 0;
    padding: 0 10px;
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
  }

  .card-actions .btn-sm:first-child {
    flex-basis: 100%;
  }

  .detail-actions .btn-sm {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    border-radius: 14px;
    padding: 0 10px;
    font-size: 14px;
  }

  .profile-head {
    grid-template-columns: auto minmax(0, 1fr);
    display: grid;
    padding-right: 34px;
  }

  .profile-avatar {
    width: 48px;
    font-size: 20px;
  }

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

  .profile-metrics span:last-child {
    grid-column: 1 / -1;
  }

  .profile-favorite-item,
  .course-teacher-item,
  .notice-card,
  .mini-notice {
    border-radius: 13px;
  }

  .review-form {
    gap: 12px;
  }

  .review-card {
    padding: 14px;
  }

  .reply-box {
    gap: 8px;
  }

  .comparison-bar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: calc(100% - 20px);
    padding: 12px;
    gap: 9px;
  }

  .comparison-items {
    max-width: 100%;
  }

  .compare-chip {
    min-width: 132px;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .comparison-bar button {
    width: 100%;
    min-height: 38px;
  }

  .teacher-modal,
  .login-modal,
  .settings-modal,
  .donate-modal,
  .disclaimer-modal {
    width: 100%;
    max-height: 100dvh;
    border-radius: 22px 22px 0 0;
  }

  .settings-modal,
  .donate-modal {
    height: 100dvh;
  }

  .login-modal {
    max-height: 100dvh;
    overflow: auto;
  }

  .settings-content,
  .donate-content {
    padding: 14px;
  }

  .donate-page {
    gap: 14px;
    min-height: auto;
    padding: 12px;
  }

  .donate-copy h2 {
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.25;
  }

  .donate-copy > p:not(.eyebrow):not(.donate-thanks) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 13px;
    line-height: 1.55;
  }

  .donate-copy ul {
    margin: 8px 0;
    padding-left: 18px;
  }

  .donate-copy p,
  .donate-copy li {
    font-size: 13px;
    line-height: 1.55;
  }

  .donate-qr-card {
    gap: 7px;
    padding: 10px;
    border-radius: 16px;
  }

  .donate-qr-card img {
    width: min(220px, 68vw);
  }

  .donate-qr-card p {
    font-size: 12px;
    line-height: 1.35;
  }

  .settings-row {
    gap: 12px;
  }

  .disclaimer-card {
    padding: 16px;
  }

  .disclaimer-card h2 {
    font-size: 22px;
  }

  .disclaimer-alert {
    font-size: 13px;
    padding: 8px 10px;
  }

  .disclaimer-points p,
  .disclaimer-agreement {
    font-size: 12px;
  }

  .disclaimer-features span {
    padding: 4px 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 6px;
    padding: 8px 10px 7px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 11px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    margin-top: 0;
    font-size: 10px;
  }

  .icon-btn,
  .user-btn {
    min-height: 32px;
    border-radius: 12px;
    font-size: 14px;
  }

  .search-inline-bar input,
  .search-inline-bar button {
    min-height: 34px;
    font-size: 14px;
  }

  .search-inline-bar {
    display: none;
  }

  .search-inline-bar input {
    border-radius: 17px;
  }

  .search-inline-bar button {
    border-radius: 14px;
  }

  .topnav {
    width: 100%;
    margin: 0;
    gap: 8px;
    padding: 0 0 10px;
    font-size: 13px;
  }

  .topnav a,
  .topnav button {
    padding: 6px 10px;
  }

  .hero-shell {
    gap: 10px;
    padding: 8px 0;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
  }

  h1 {
    margin-bottom: 8px;
    font-size: 26px;
    line-height: 1.12;
  }

  .hero-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.55;
  }

  .search-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .search-row,
  .toolbar-search,
  .course-search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
    align-items: stretch;
  }

  .search-row input,
  .search-row button,
  .toolbar-search input,
  .toolbar-search button,
  .course-search-box input,
  .course-search-box button {
    width: auto;
    min-height: 40px;
    font-size: 14px;
  }

  .search-row input {
    padding-left: 36px;
  }

  .search-icon {
    left: 12px;
  }

  .search-row button,
  .toolbar-search button,
  .course-search-box button {
    padding: 0 10px;
    border-radius: 14px;
  }

  .filter-grid,
  .toolbar-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .filter-grid label,
  .toolbar-filters label {
    min-width: 0;
    font-size: 12px;
  }

  .filter-reset {
    grid-column: 1 / -1;
    min-height: 38px;
    border-radius: 14px;
  }

  .filter-grid .soft-select,
  .toolbar-filters .soft-select {
    margin-top: 5px;
  }

  .filter-grid .soft-select-trigger,
  .toolbar-filters .soft-select-trigger {
    min-height: 38px;
    border-radius: 14px;
    padding-left: 11px;
  }

  .filter-grid .soft-select-icon,
  .toolbar-filters .soft-select-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .stats-grid {
    margin: 8px 0 12px;
  }

  .workspace,
  .review-section,
  .campus-hub,
  .ranking-section {
    gap: 12px;
  }

  .section-heading {
    gap: 8px;
    margin-bottom: 10px;
  }

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

  .result-count {
    font-size: 12px;
  }

  .teacher-toolbar {
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .mobile-filter-toggle {
    display: block;
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand) 8%, var(--surface));
    color: var(--brand-strong);
    font-weight: 900;
  }

  .teacher-toolbar:not(.mobile-filters-open) .toolbar-filters {
    display: none;
  }

  .teacher-grid {
    gap: 10px;
  }

  .teacher-card,
  body.compact .teacher-card {
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
  }

  .card-header {
    gap: 9px;
  }

  .card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 18px;
  }

  .teacher-name {
    font-size: 19px;
  }

  .teacher-title {
    font-size: 12px;
  }

  .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    font-size: 12px;
  }

  .card-meta span:first-child {
    display: none;
  }

  .rating-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 15px;
  }

  .rating-hero strong {
    flex: 0 0 auto;
    font-size: 26px;
    line-height: 1;
    white-space: nowrap;
  }

  .rating-hero span {
    min-width: 0;
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
  }

  .card-stars {
    display: none;
  }

  .metric-strip {
    gap: 5px;
  }

  .metric-strip span {
    padding: 7px 4px;
    border-radius: 12px;
    font-size: 11px;
  }

  .metric-strip strong {
    font-size: 16px;
  }

  .teacher-bio {
    -webkit-line-clamp: 1;
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .card-tags {
    gap: 5px;
  }

  .card-tags .tag:nth-child(n+3) {
    display: none;
  }

  .tag {
    padding: 4px 8px;
    font-size: 11px;
  }

  .card-actions {
    gap: 6px;
  }

  .card-actions .btn-sm,
  .card-actions .btn-sm:first-child {
    flex: 1 1 calc(50% - 6px);
    min-height: 38px;
    border-radius: 13px;
    padding: 0 8px;
    font-size: 13px;
  }

  .card-actions .btn-sm:nth-child(4) {
    display: none;
  }

  .teacher-modal .modal-body,
  .login-modal .modal-body {
    padding: 16px;
  }

  .modal-header {
    gap: 10px;
  }

  .modal-header h2 {
    font-size: 22px;
  }

  .subtitle,
  .modal-bio,
  .scale-note {
    font-size: 12px;
    line-height: 1.6;
  }

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

  .detail-actions .btn-sm {
    min-height: 38px;
    border-radius: 13px;
    padding: 0 8px;
    font-size: 13px;
  }

  .modal-grid {
    gap: 10px;
  }

  .detail-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .detail-metrics span {
    padding: 7px 5px;
    font-size: 11px;
  }

  .detail-metrics strong {
    font-size: 16px;
  }

  .review-card,
  .panel {
    padding: 12px;
  }
}

@media (max-width: 430px) and (orientation: portrait) {
  .brand span {
    min-width: 0;
  }

  .brand .brand-wordmark {
    font-size: 18px;
  }

  .brand small {
    max-width: 94px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .search-inline-bar {
    display: none;
  }

  .search-inline-bar button {
    min-width: 64px;
  }

  .home-rank-head {
    align-items: start;
  }

  .hub-panel h3 {
    font-size: 18px;
  }

  .public-course-card,
  .contribution-item,
  .guide-steps article {
    border-radius: 14px;
    padding: 11px;
  }

  .site-footer-inner {
    gap: 16px;
  }

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

  .home-rank-item {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    padding: 8px 0;
  }

  .home-rank-item span {
    min-width: 0;
  }

  .card-tags,
  .review-tags {
    gap: 6px;
  }

  .tag {
    padding: 5px 8px;
    font-size: 11px;
  }

  .modal-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-score {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    text-align: left;
  }

  .detail-score strong {
    font-size: 24px;
  }

  .dist-row {
    grid-template-columns: 38px 1fr 26px;
    gap: 6px;
  }
}

@media (max-width: 370px) {
  .brand small {
    display: none;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand .brand-wordmark {
    font-size: 17px;
  }

  .search-inline-bar button {
    min-width: 56px;
    padding: 0 9px;
    font-size: 13px;
  }

  h1 {
    font-size: 27px;
  }

  .topnav {
    font-size: 12px;
  }

  .notification-badge {
    top: -5px;
    right: -5px;
  }

  .teacher-card,
  .review-section,
  .admin-section,
  .ranking-section,
  .search-panel,
  .modal-body,
  .login-card {
    padding: 14px;
  }

  .card-actions .btn-sm,
  .detail-actions .btn-sm {
    min-height: 42px;
    padding: 0 8px;
    font-size: 13px;
  }

  .rating-hero strong {
    font-size: 29px;
  }

  .profile-head {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .profile-avatar {
    width: 42px;
    font-size: 18px;
  }

  .soft-select-value {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .share-modal-body {
    gap: 10px;
    max-height: calc(100dvh - 18px);
    overflow: auto;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .share-modal-body .section-heading {
    padding-right: 44px;
  }

  .share-image-canvas {
    width: min(300px, 92vw);
    max-height: calc(100dvh - 260px);
    border-radius: 16px;
  }

  .share-card-preview {
    display: none;
  }

  .share-preview-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
    background: linear-gradient(180deg, transparent, var(--surface) 22%);
  }

  .share-preview-actions button {
    width: 100%;
    min-height: 42px;
  }
}
