/* Scoped addition: inherit the public site and manager's existing palette. */
.teaching-reviews {
  --tr-surface: var(--paper, var(--surface, #fffef9));
  --tr-soft: var(--mint-soft, var(--green-soft, #e7f7ef));
  --tr-primary: var(--green-deep, var(--green, #0a4635));
  max-width: 1120px;
  margin-inline: auto;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.teaching-reviews [hidden] { display: none !important; }
.teaching-reviews .tr-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; }
.teaching-reviews h1, .teaching-reviews h2 { text-wrap: balance; }
.teaching-reviews h1 { margin: 0; font-family: "Songti SC", "STSong", "Microsoft YaHei UI", serif; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.35; }
.teaching-reviews h2 { margin: 0 0 12px; font-size: 1.3rem; line-height: 1.5; }
.teaching-reviews p { margin: 0; }
.teaching-reviews .tr-header > p { margin-top: 16px; }
.teaching-reviews .tr-muted { color: var(--muted); font-size: .9rem; line-height: 1.7; }
.teaching-reviews .tr-summary { margin-block: 24px 36px; max-width: 640px; }
.teaching-reviews .tr-summary-value { margin-bottom: 8px; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.teaching-reviews .tr-disclosure { margin-bottom: 6px; font-weight: 650; }
.teaching-reviews .tr-layout { max-width: 860px; }
.teaching-reviews.tr-editor { width: min(540px, calc(100% - 32px)); max-height: 88dvh; margin: auto; padding: 28px; border: 0; border-radius: 14px; background: var(--tr-surface); box-shadow: 0 22px 60px rgba(23,46,56,.2); overflow-y: auto; overscroll-behavior: contain; }
.tr-editor::backdrop { background: rgba(23,46,56,.5); }
.teaching-reviews .tr-editor-close { float: right; margin: -8px -8px 6px 12px; }
.teaching-reviews.tr-editor h2 { padding-top: 4px; }
.teaching-reviews .tr-community { min-width: 0; }
.teaching-reviews .tr-form { margin-top: 20px; }
.teaching-reviews .tr-rating { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.teaching-reviews .tr-rating legend, .teaching-reviews .tr-label { display: block; margin-bottom: 10px; padding: 0; font-weight: 650; }
.teaching-reviews .tr-star-choices { display: flex; gap: 8px; }
.teaching-reviews .tr-star-choice { position: relative; display: grid; place-items: center; width: 48px; min-height: 48px; border-radius: 8px; cursor: pointer; color: var(--tr-primary); }
.teaching-reviews .tr-star-choice:hover { background: var(--tr-soft); }
.teaching-reviews .tr-star-choice:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 3px; }
.teaching-reviews .tr-star-choice:has(input:disabled) { cursor: default; opacity: .6; }
.teaching-reviews .tr-star-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.teaching-reviews .tr-star-copy { display: grid; justify-items: center; gap: 3px; font-size: .85rem; white-space: nowrap; }
.teaching-reviews .tr-star-copy svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.teaching-reviews .is-filled svg { fill: currentColor; }
.teaching-reviews .tr-rating .tr-status { margin-top: 12px; }
.teaching-reviews textarea { display: block; box-sizing: border-box; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--tr-surface); color: var(--ink); font: inherit; line-height: 1.7; resize: vertical; caret-color: var(--green); }
.teaching-reviews textarea::placeholder { color: var(--muted); opacity: 1; }
.teaching-reviews textarea[aria-invalid="true"] { border-color: var(--danger); }
.teaching-reviews textarea + .tr-muted { margin-top: 8px; }
.teaching-reviews .tr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.teaching-reviews .tr-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--tr-surface); color: var(--tr-primary); font: inherit; font-weight: 650; line-height: 1.5; cursor: pointer; }
.teaching-reviews .tr-button:hover { background: var(--tr-soft); border-color: var(--green); }
.teaching-reviews .tr-button-primary { background: var(--tr-primary); color: #fff; border-color: transparent; }
.teaching-reviews .tr-button-primary:hover { background: var(--green); border-color: transparent; }
.teaching-reviews .tr-button-danger { color: var(--danger); }
.teaching-reviews .tr-button-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.teaching-reviews .tr-button:disabled { opacity: .55; cursor: default; }
.teaching-reviews :is(button, textarea, a):focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.teaching-reviews .tr-status { color: var(--muted); font-size: .9rem; }
.teaching-reviews .tr-status:not(:empty), .teaching-reviews .tr-error:not(:empty) { margin-top: 12px; }
.teaching-reviews .tr-error { color: var(--danger); font-size: .9rem; }
.teaching-reviews .tr-list { list-style: none; margin: 20px 0 0; padding: 0; }
.teaching-reviews .tr-review { padding-block: 24px; border-bottom: 1px solid var(--line); }
.teaching-reviews .tr-review:first-child { border-top: 1px solid var(--line); }
.teaching-reviews .tr-review-heading { display: flex; align-items: flex-start; gap: 12px; }
.teaching-reviews .tr-avatar { flex: 0 0 40px; display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 50%; background: var(--tr-soft); color: var(--tr-primary); font-weight: 700; }
.teaching-reviews .tr-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.teaching-reviews .tr-identity { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; min-width: 0; }
.teaching-reviews .tr-identity time, .teaching-reviews .tr-identity > .tr-muted { flex-basis: 100%; font-size: .8rem; }
.teaching-reviews .tr-mine { color: var(--green); font-size: .8rem; }
.teaching-reviews .tr-row-score { flex-shrink: 0; color: var(--tr-primary); font-size: .9rem; font-variant-numeric: tabular-nums; }
.teaching-reviews .tr-review-body { margin-top: 16px; max-width: 70ch; white-space: pre-wrap; line-height: 1.85; }
.teaching-reviews .tr-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.teaching-reviews .tr-pagination > span { font-variant-numeric: tabular-nums; }
.teaching-reviews.tr-admin { max-width: none; }
.teaching-reviews.tr-admin > .tr-muted { margin-bottom: 16px; max-width: 75ch; }
.teaching-reviews.tr-admin .tr-review > .tr-muted { margin-bottom: 12px; }
.teaching-reviews .tr-moderation { width: min(100%, 640px); }
.teaching-reviews .tr-moderation .tr-button { margin-top: 10px; }
.teaching-reviews .tr-inline-confirmation, .teaching-reviews .tr-moderation-reason { margin-top: 16px; }
.teaching-reviews .tr-moderation-reason { max-width: 70ch; color: var(--muted); white-space: pre-wrap; }
.teaching-reviews .tr-moderation-time { margin-top: 8px; font-variant-numeric: tabular-nums; }

.tr-rating-panel { padding: 16px 18px 10px; background: #f8fcfd; border-radius: 12px; }
.tr-rating-stats { display: grid; grid-template-columns: minmax(86px, .75fr) minmax(0, 2fr); gap: 18px; align-items: center; }
.tr-score-block { display: flex; flex-direction: column; gap: 3px; }
.tr-score-number { color: #18576c; font-size: 2.4rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tr-score-number small { color: var(--muted); font-size: .82rem; font-weight: 500; white-space: nowrap; }
.tr-score-number.tr-score-empty { font-size: 1.1rem; }
.tr-distribution { display: grid; gap: 4px; }
.tr-distribution-row { display: grid; grid-template-columns: 22px minmax(20px, 1fr) 84px; align-items: center; gap: 6px; font-size: .72rem; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr-distribution-count { text-align: right; white-space: nowrap; }
.tr-distribution progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 3px; overflow: hidden; appearance: none; background: #dbe9ed; color: #33778c; }
.tr-distribution progress::-webkit-progress-bar { background: #dbe9ed; }
.tr-distribution progress::-webkit-progress-value { background: #33778c; }
.tr-distribution progress::-moz-progress-bar { background: #33778c; }
.tr-rating-prompt { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 8px; font-size: .9rem; }
.tr-quick-stars { display: flex; gap: 2px; }
.teaching-reviews .tr-quick-stars .tr-button { min-width: 44px; padding: 6px; border: 0; background: transparent; color: #18576c; }
.tr-quick-stars svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.tr-rating-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.teaching-reviews .tr-rating-foot, .teaching-reviews .tr-rating-foot .tr-muted { font-size: .72rem; }
.tr-rating-foot a { display: inline-flex; min-height: 32px; align-items: center; }

@media (max-width: 850px) {
  .teaching-reviews .tr-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .teaching-reviews .tr-summary { margin-bottom: 28px; }
}

@media (max-width: 440px) {
  .teaching-reviews .tr-review-heading { flex-wrap: wrap; }
  .teaching-reviews .tr-identity { flex-basis: calc(100% - 52px); }
  .teaching-reviews .tr-row-score { margin-left: 52px; }
  .teaching-reviews .tr-star-choices { gap: 4px; }
  .teaching-reviews .tr-pagination { gap: 8px; }
  .teaching-reviews .tr-pagination .tr-button { padding-inline: 10px; }
}

@media (max-width: 620px) {
  .teaching-reviews.tr-editor { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 88dvh; padding: 20px 20px max(20px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; margin: 0; }
  .teaching-reviews.tr-editor .tr-actions { position: sticky; bottom: -1px; padding-block: 8px; background: var(--tr-surface); }
  .tr-rating-panel { padding: 12px 12px 5px; }
  .tr-rating-stats { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .tr-distribution-row { grid-template-columns: 20px minmax(15px, 1fr) 80px; gap: 4px; }
  .tr-rating-prompt { gap: 4px; }
  .teaching-reviews .tr-rating-foot .tr-muted, .teaching-reviews .tr-rating-foot { font-size: .68rem; }
}
