* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #f2f4f3;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { color: #111312; }
html.mp-dialog-open, html.mp-preview-open,
body.mp-dialog-open, body.mp-preview-open { overflow: hidden; }

.hero-lead, .page-lead, .band-desc, .table-lead, .teacher-lead,
.disclaimer, .sub, .lead, .tx-desc, .done-p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid #006b4f;
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 1100;
  padding: 8px 14px;
  border-radius: 999px;
  background: #111312;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 12px; }

.sr-only, #nav-tag.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.h5-deeplink #static-hero { display: none; }
h1.hero-display { margin: 0; }

page, view, scroll-view, picker, form, label { display: block; }
text { display: inline; }
img { display: inline-block; border: 0; }
button {
  margin: 0; padding: 0; border: 0; background: transparent;
  font: inherit; color: inherit; line-height: normal; text-align: inherit;
  cursor: pointer;
}
input, textarea {
  margin: 0; padding: 0; border: 0; outline: none; background: transparent;
  font: inherit; color: inherit; -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: #7c8782; }

#phone {
  position: relative;
  min-height: 100vh;
  background: #fafafa;
  overflow-x: clip;
  font-size: 16px;
  line-height: 1.4;
}

#root.h5-page-in > * {
  animation: h5-page-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
@keyframes h5-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #root.h5-page-in > * { animation: none; }
}

#nav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  background: rgba(250, 250, 250, 0.90);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(17, 19, 18, 0.09);
  color: #111312;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#scroll-rail {
  position: sticky;
  top: calc(48px + env(safe-area-inset-top));
  height: 2px;
  margin-top: -2px;
  background: #006b4f;
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 99;
  pointer-events: none;
  transition: transform 0.08s linear;
}
@media (prefers-reduced-motion: reduce) {
  #scroll-rail { transition: none; }
}

#root .teacher-archive .filters { top: calc(48px + env(safe-area-inset-top)); }
#root .chat {
  height: calc(100vh - 48px - env(safe-area-inset-top));
  height: calc(100dvh - 48px - env(safe-area-inset-top));
}
#root .chat .msgs { min-height: 0; }

#nav-back {
  width: 34px;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  margin-top: -2px;
  color: #006b4f;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#nav-back:active { transform: scale(0.9); }
#nav-back[hidden] { display: block; visibility: hidden; }

#nav-title {
  flex: 1;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 4px;
}

#nav-tag {
  font-size: 10.5px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(0, 107, 79, 0.28);
  color: #006b4f;
}

.boot {
  padding: 64px 0;
  text-align: center;
  color: #58635e;
  font-size: 14px;
  font-weight: 550;
}

/* 桌面端：Gallery Architectural Center Frame */
@media (min-width: 560px) {
  body {
    padding: 20px 0;
    background:
      radial-gradient(50% 45% at 50% 0%, rgba(0, 107, 79, 0.05), transparent 70%),
      #f2f4f3;
  }
  #phone {
    width: 412px;
    margin: 0 auto;
    min-height: calc(100vh - 40px);
    min-height: calc(100dvh - 40px);
    border-radius: 28px;
    box-shadow: 0 0 0 1px rgba(17, 19, 18, 0.10), 0 32px 72px -18px rgba(17, 19, 18, 0.16), 0 8px 20px -8px rgba(17, 19, 18, 0.06);
  }
  #phone #nav { border-radius: 28px 28px 0 0; }
  #phone .action-dock { max-width: 412px; border-radius: 0 0 28px 28px; }
  #root .chat {
    height: calc(100vh - 88px - env(safe-area-inset-top));
    height: calc(100dvh - 88px - env(safe-area-inset-top));
  }
}

/* toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(6px);
  max-width: 72vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 28, 24, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 10px 26px rgba(0, 0, 0, 0.24);
  color: #ffffff;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  z-index: 999;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast[hidden] { display: none; }

/* 预览大图 */
.mp-preview {
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 18, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  touch-action: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mp-preview-close {
  position: absolute;
  z-index: 1;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(10, 18, 15, 0.72);
  color: #ffffff;
  text-align: center;
  font-size: 26px;
}
.mp-preview-img {
  max-width: 96vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.mp-preview-media {
  max-width: 96vw;
  max-height: 86vh;
  overflow: auto;
  scrollbar-width: none;
}
.mp-preview-media::-webkit-scrollbar { display: none; }
.mp-preview.is-zoomed .mp-preview-img {
  width: min(160vw, 2000px);
  max-width: none;
  max-height: none;
}
.mp-preview-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: #ffffff;
  font-size: 13px;
  padding: 16px;
  background: linear-gradient(transparent, rgba(10, 18, 15, 0.82));
}
.mp-preview-bar .nv, .mp-preview-bar .nx {
  font-size: 24px;
  line-height: 1;
  padding: 4px 14px;
  cursor: pointer;
}
.mp-preview-bar .zoom {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
}
@media (min-resolution: 2dppx) {
  #nav, .mp-preview-close, .mp-preview-bar .zoom { border-width: 0.5px; }
}

/* modal */
.mp-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 18, 0.50);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  touch-action: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.mp-modal-box {
  width: 100%;
  max-width: 310px;
  background: #ffffff;
  border: 1px solid rgba(17, 19, 18, 0.10);
  border-radius: 20px;
  box-shadow: 0 24px 52px rgba(17, 19, 18, 0.24);
  overflow: hidden;
  text-align: center;
  animation: mp-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes mp-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.mp-modal-title { font-size: 16.5px; font-weight: 750; color: #111312; padding: 22px 18px 8px; }
.mp-modal-body { font-size: 14px; color: #58635e; padding: 0 20px 20px; line-height: 1.65; }
.mp-modal-foot { display: flex; border-top: 1px solid rgba(17, 19, 18, 0.08); }
.mp-modal-foot .mp-btn { flex: 1; padding: 14px; font-size: 15px; cursor: pointer; }
.mp-btn.cancel { color: #58635e; border-right: 1px solid rgba(17, 19, 18, 0.08); }
.mp-btn.primary { color: #006b4f; font-weight: 750; background: #fafafa; }

/* picker sheet */
.mp-sheet {
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 18, 0.48);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  touch-action: none;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
}
.mp-sheet-inner {
  width: 100%;
  max-width: 412px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  max-height: 70vh;
  overflow-y: auto;
  animation: sheet-up 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.mp-sheet-head { text-align: center; font-size: 13px; font-weight: 650; color: #7c8782; padding: 14px; background: #fafafa; }
.mp-sheet-row { text-align: center; font-size: 15.5px; padding: 14px; border-top: 1px solid rgba(17, 19, 18, 0.07); cursor: pointer; color: #111312; }
.mp-sheet-row.active { color: #006b4f; font-weight: 750; background: #ebf5f1; }
.mp-sheet-cancel { text-align: center; font-size: 15.5px; font-weight: 600; padding: 15px; margin-top: 6px; border-top: 6px solid #f2f4f3; color: #58635e; cursor: pointer; }
