:root {
  color-scheme: light;
  --ink: #18352c;
  --forest: #112e26;
  --forest-deep: #0e241e;
  --paper: #f7f5ed;
  --white: #fffdf7;
  --sage: #e9eee5;
  --gold: #cda766;
  --ochre: #775729;
  --muted: #526359;
  --line: #d6ddd1;
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 var(--font-sans); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #96703b; outline-offset: 3px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
.site-shell { width: min(100% - 5rem, 75rem); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 10; background: var(--white); padding: .5rem 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  box-shadow: inset 0 -1px #d9ded2;
}
.header-content { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; flex: none; }
.brand img { width: 3.6rem; height: auto; }
.brand-name { font-size: 1.35rem; font-weight: 700; letter-spacing: .13em; line-height: 1.2; }
.brand-name span { display: block; margin-top: .24rem; font: 600 .65rem/1.3 Georgia, serif; letter-spacing: .11em; }
.site-nav { display: flex; align-items: center; gap: clamp(.75rem, 3vw, 2.2rem); }
.site-nav a, .site-footer nav a { padding-block: .4rem; font-size: .92rem; font-weight: 600; white-space: nowrap; }
.site-nav a:hover, .site-footer nav a:hover { color: var(--ochre); }
.site-nav .nav-guide { padding: .42rem .95rem; border: 1px solid #819284; border-radius: 3px; }

.hero { background: var(--forest); color: var(--paper); overflow: hidden; }
.hero-layout { display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; min-height: 32.6rem; }
.hero-copy { padding-block: clamp(3rem, 7vw, 5.8rem); padding-right: clamp(1.2rem, 4vw, 3.6rem); }
.eyebrow { color: var(--ochre); font-weight: 700; font-size: .85rem; letter-spacing: .14em; }
.eyebrow[lang="en"] { font-family: Georgia, serif; letter-spacing: .19em; }
.hero-eyebrow { color: #e1c495; display: flex; align-items: center; gap: .75rem; margin-bottom: 1.3rem; }
.hero-eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--gold); }
.hero h1 { font: 700 clamp(3rem, 5.2vw, 5.4rem)/1.2 var(--font-serif); letter-spacing: -.045em; }
.hero h1 span { color: #e4c68b; }
.hero-description { max-width: 28rem; margin-top: 1.2rem; color: #e0e6da; font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.9; }
.hero-actions { display: flex; gap: 1.1rem 1.6rem; align-items: center; flex-wrap: wrap; margin-top: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1rem; min-height: 2.85rem; border: 1px solid transparent; border-radius: 3px; font-size: .94rem; font-weight: 700; }
.button-ivory { background: #f4ead1; color: var(--forest-deep); }
.button-ivory:hover { background: #e5c788; }
.hero-text-link { color: #f1e7cf; text-underline-offset: .33em; text-decoration: underline; font-size: .94rem; }
.hero-photo { height: 100%; min-height: 32.6rem; background: #293b2f; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 54%; }

.about { display: grid; grid-template-columns: .85fr 1fr; gap: clamp(2rem, 7vw, 7.2rem); align-items: start; padding-block: clamp(3.2rem, 7vw, 6.1rem); }
h2 { font: 700 clamp(2rem, 4vw, 3.35rem)/1.25 var(--font-serif); letter-spacing: -.038em; }
.about h2, .directory h2, .schedule h2 { margin-block: .55rem 1rem; }
.about-intro > p:last-child, .directory-heading > p { max-width: 28rem; color: var(--muted); }
.about-areas { border-top: 1px solid var(--line); }
.about-areas > div { padding: 1.1rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.about-areas dt { font-size: 1.12rem; font-weight: 700; }
.about-areas dd { margin-top: .3rem; color: var(--muted); }

.directory { padding-block: clamp(3.3rem, 6vw, 5.5rem); background: var(--sage); border-block: 1px solid #dbe2d8; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2.2rem; }
.directory-heading h2 { margin-bottom: 0; }
.directory-heading > p { padding-bottom: .25rem; }
.directory-toolbar { display: grid; grid-template-columns: 1fr minmax(14rem, 19rem); align-items: start; gap: 1rem 1.5rem; margin-top: 1.9rem; padding-bottom: 1rem; border-bottom: 1px solid #cbd6c9; }
.teacher-filters { display: flex; flex-wrap: wrap; gap: .35rem .45rem; }
.teacher-filter { padding: .36rem .68rem; min-height: 2.45rem; border: 1px solid #c4d0c3; border-radius: 3px; background: transparent; color: var(--ink); font-size: .89rem; white-space: nowrap; }
.teacher-filter:hover { background: #f4f7ef; }
.teacher-filter.is-active, .teacher-filter[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--white); }
.teacher-filter__count { margin-left: .27rem; opacity: .83; font-size: .8rem; font-variant-numeric: tabular-nums; }
.teacher-filters .teacher-reset { min-height: 2.45rem; padding: .3rem .64rem; font-size: .86rem; }
.teacher-reset:disabled { cursor: default; opacity: .6; background: transparent; color: var(--ink); border-color: #c4d0c3; }
.search { min-height: 2.5rem; display: flex; align-items: center; gap: .5rem; padding-inline: .65rem; background: var(--white); border: 1px solid #bac9bb; border-radius: 3px; }
.search:focus-within { outline: 2px solid #96703b; outline-offset: 2px; }
.search svg { flex: none; width: 1.1rem; color: var(--muted); }
.search input { border: 0; outline: 0; background: none; width: 100%; min-height: 2.4rem; padding: .2rem; color: var(--ink); font-size: 1rem; }
.search input::placeholder { color: #617065; }
.teacher-results { margin-block: .85rem .7rem; color: var(--muted); font-size: .9rem; }
.teacher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.teacher-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  border: 1px solid #cdd8ca;
  border-radius: 5px;
  background: var(--white);
}
.teacher-card__top { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; }
.teacher-card__initial, .teacher-detail__initial { width: 3.15rem; height: 3.15rem; display: inline-grid; flex: none; place-items: center; color: #ecd1a1; background: var(--forest); border: 1px solid #43634e; border-radius: 4px 4px 18px 4px; font: 600 1.65rem/1 Georgia, var(--font-serif); }
.teacher-card__subjects, .teacher-card__tags, .teacher-detail__subjects { display: flex; flex-wrap: wrap; gap: .28rem; padding: 0; margin: 0; list-style: none; }
.teacher-card__top .teacher-card__subjects { justify-content: flex-end; }
.teacher-card__subjects > *, .teacher-detail__subjects > * { display: inline-flex; padding: .11rem .42rem; background: #e7eee3; color: #335343; border-radius: 2px; font-size: .82rem; }
.teacher-card__name { font-size: 1.3rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.teacher-card__role { margin-top: .3rem; color: #405a4b; font-size: .93rem; font-weight: 600; }
.teacher-card__summary { margin-top: .65rem; color: #536158; line-height: 1.75; overflow-wrap: anywhere; }
.teacher-card__tags { margin-top: .8rem; color: #6f592e; }
.teacher-card__tags > * { font-size: .82rem; border: 1px solid #e1d7bf; padding: .11rem .38rem; border-radius: 2px; }
.teacher-card__footer { display: flex; justify-content: flex-start; margin-top: auto; padding-top: 1.15rem; }
.teacher-card__button, .teacher-reset, .teacher-share { border: 1px solid #8ea293; background: transparent; color: var(--ink); border-radius: 3px; min-height: 2.6rem; padding: .42rem .75rem; font-size: .92rem; font-weight: 700; }
.teacher-card__button:hover, .teacher-reset:hover, .teacher-share:hover { background: var(--forest); color: var(--white); border-color: var(--forest); }
.teacher-empty { grid-column: 1 / -1; background: var(--white); border: 1px solid var(--line); padding: 1.8rem; text-align: center; }
.teacher-empty__title { font-weight: 700; }
.teacher-empty__text { margin-block: .5rem 1rem; color: var(--muted); }

.schedule { padding-block: clamp(3.2rem, 6vw, 5.5rem); }
.schedule-panel { display: grid; grid-template-columns: .9fr 1fr; gap: clamp(1.8rem, 5vw, 5rem); align-items: center; padding: clamp(1.5rem, 5vw, 4rem); background: var(--forest); color: var(--white); border-radius: 4px; }
.schedule-panel .eyebrow { color: #e6c68d; }
.schedule-intro p:last-child { color: #d9e4d8; max-width: 25rem; }
.schedule-steps { list-style: none; counter-reset: schedule; margin: 0; padding: 0; border-top: 1px solid #597264; }
.schedule-steps li { display: grid; align-items: baseline; grid-template-columns: 1.8rem 1fr; gap: .4rem; padding-block: 1rem; border-bottom: 1px solid #597264; }
.schedule-steps li::before { counter-increment: schedule; content: counter(schedule, decimal-leading-zero); color: #e4c58a; font: 600 .97rem/1.4 Georgia, serif; }
.schedule-steps h3 { font-size: 1.05rem; font-weight: 700; }
.schedule-steps p { color: #d2dfd4; margin-top: .2rem; }

.contact { border-top: 1px solid var(--line); background: #edebde; padding-block: clamp(2.4rem, 5vw, 4.1rem); }
.contact-layout { display: grid; grid-template-columns: 1fr auto; gap: 1.35rem 4rem; align-items: center; }
.contact h2 { margin-block: .4rem .75rem; }
.contact p:not(.eyebrow) { color: var(--muted); }
.contact-download { margin-top: 1rem; border-color: #849788; }
.contact-download:hover { background: var(--forest); color: var(--white); }
.contact-qr { width: clamp(7.75rem, 14vw, 9.2rem); height: auto; background: #fff; padding: .38rem; border: 1px solid #d0d3c6; }
.contact figcaption { text-align: center; margin-top: .45rem; font-size: .9rem; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); }
.footer-content { padding-block: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem 1.5rem; }
.footer-brand img { width: 3rem; }
.footer-brand .brand-name { font-size: 1.15rem; }
.site-footer nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.site-footer p { color: var(--muted); font-size: .89rem; }

body:has(.teacher-dialog[open]) { overflow: hidden; }
.teacher-dialog { width: min(100% - 2rem, 43rem); max-height: min(90dvh, 56rem); padding: 0; border: 1px solid #869a88; border-radius: 6px; color: var(--ink); background: var(--white); box-shadow: 0 14px 65px #0c1c16a8; }
.teacher-dialog::backdrop { background: #0c1e19bb; }
.dialog-controls { display: flex; justify-content: flex-end; position: sticky; top: 0; padding: .7rem .95rem 0; background: var(--white); z-index: 1; }
.dialog-close { width: 2.55rem; height: 2.55rem; display: grid; place-items: center; border: 1px solid #becbbb; border-radius: 50%; background: var(--white); color: var(--ink); }
.dialog-close:hover { background: var(--sage); }
.dialog-close svg { width: 1.3rem; }
#teacher-dialog-body { padding: 0 clamp(1.2rem, 4vw, 2.3rem) clamp(1.2rem, 4vw, 2.3rem); }
.teacher-detail__eyebrow { color: var(--ochre); font-size: .87rem; font-weight: 700; letter-spacing: .08em; }
.teacher-detail__name { font-size: clamp(1.9rem, 4vw, 2.65rem); margin-block: .4rem .8rem; }
.teacher-detail__role, .teacher-detail__focus { color: var(--muted); }
.teacher-detail__subjects { margin-top: .6rem; }
.teacher-detail__section { border-top: 1px solid var(--line); margin-top: 1.3rem; padding-top: 1.1rem; }
.teacher-detail__section > h3 { font-size: 1.18rem; }
.teacher-detail__list { padding-left: 1.25rem; margin-block: .65rem 0; }
.teacher-detail__list li + li { margin-top: .52rem; }
.teacher-detail__expertise { margin-top: .65rem; }
.teacher-detail__expertise dt { font-weight: 700; }
.teacher-detail__expertise dd { color: var(--muted); margin-block: .2rem .65rem; }
.teacher-detail__expertise-item + .teacher-detail__expertise-item { margin-top: .7rem; }
.teacher-detail__tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 1rem; }
.teacher-detail__tags > * { padding: .14rem .45rem; border: 1px solid #e1d7bf; color: #6f592e; font-size: .85rem; }
.teacher-detail__share { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-top: 1.3rem; }
.teacher-share-link { flex: 1 1 15rem; min-width: 0; min-height: 2.6rem; background: #f5f6ee; color: var(--ink); border: 1px solid #bdcabb; border-radius: 3px; padding: .4rem .65rem; font-size: .89rem; }
.teacher-detail__share .teacher-share-status { flex-basis: 100%; }
.teacher-share-status { font-size: .88rem; }
.teacher-share-status.is-error { color: #8b422e; }

@media (max-width: 58rem) {
  .site-shell { width: min(100% - 3rem, 75rem); }
  .hero-layout { min-height: 27rem; }
  .hero-photo { min-height: 27rem; }
  .hero h1 { font-size: clamp(2.6rem, 6.8vw, 4.7rem); }
  .directory-toolbar { grid-template-columns: 1fr; }
  .search { max-width: 26rem; }
  .teacher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
  html { scroll-padding-top: 7rem; }
  .site-shell { width: calc(100% - 2rem); }
  .header-content { min-height: 0; flex-wrap: wrap; gap: .35rem 1rem; padding-block: .65rem; }
  .brand img { width: 2.7rem; }
  .brand-name { font-size: 1.16rem; }
  .site-nav { gap: .75rem; }
  .site-nav a { font-size: .88rem; padding-block: .24rem; }
  .site-nav .nav-guide { padding: .27rem .48rem; }
  .hero-layout, .about, .schedule-panel { grid-template-columns: 1fr; }
  .hero-copy { padding-block: 2.35rem; padding-right: 0; }
  .hero-photo { height: auto; min-height: 0; aspect-ratio: 5 / 3; width: calc(100% + 2rem); margin-inline: -1rem; }
  .hero h1 { font-size: clamp(2.55rem, 11vw, 4.15rem); }
  .directory-heading { align-items: start; flex-direction: column; }
  .teacher-grid { grid-template-columns: 1fr; }
  .schedule-panel { padding: 1.45rem; }
  .contact-layout { grid-template-columns: 1fr; }
  .contact-layout figure { justify-self: start; }
}

@media (max-width: 23rem) {
  .site-nav { width: 100%; justify-content: space-between; }
  .hero-actions { gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
