@font-face {
  font-family: "Smiley Sans";
  src: url("https://cdn.jsdelivr.net/npm/@fontpkg/smiley-sans@2.0.4/SmileySans-Oblique.ttf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ece7df;
  --bg-deep: #d9d2c6;
  --ink: #1a1c1b;
  --ink-soft: #3d433f;
  --muted: #6b736e;
  --accent: #0d8f7a;
  --accent-ink: #064c41;
  --line: rgba(26, 28, 27, 0.14);
  --surface: rgba(255, 252, 247, 0.72);
  --font-display: "Smiley Sans", "得意黑", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Smiley Sans", sans-serif;
  --max: 1080px;
  --tone: #0d8f7a;
  --tone-soft: rgba(13, 143, 122, 0.14);
}

[data-studio="rb"] { --tone: #2a7ab5; --tone-soft: rgba(42, 122, 181, 0.14); }
[data-studio="phoenix"] { --tone: #c45c3e; --tone-soft: rgba(196, 92, 62, 0.14); }
[data-studio="mp"] { --tone: #c47a2a; --tone-soft: rgba(196, 122, 42, 0.14); }
[data-studio="gh5"] { --tone: #8a7a2a; --tone-soft: rgba(138, 122, 42, 0.16); }
[data-studio="okey"] { --tone: #0d8f7a; --tone-soft: rgba(13, 143, 122, 0.14); }
[data-studio="oneway"] { --tone: #5a6bb5; --tone-soft: rgba(90, 107, 181, 0.14); }
[data-studio="default"] { --tone: #0d8f7a; --tone-soft: rgba(13, 143, 122, 0.14); }

[data-studio="phoenix"][data-store="世纪大道"] { --tone: #3a8fc4; --tone-soft: rgba(58, 143, 196, 0.14); }
[data-studio="phoenix"][data-store="中山公园"] { --tone: #2a9a78; --tone-soft: rgba(42, 154, 120, 0.14); }
[data-studio="phoenix"][data-store="新天地"] { --tone: #c45c7a; --tone-soft: rgba(196, 92, 122, 0.14); }
[data-studio="phoenix"][data-store="长寿路"] { --tone: #b89a2a; --tone-soft: rgba(184, 154, 42, 0.16); }
[data-studio="mp"][data-store="陆家嘴"] { --tone: #c47a2a; --tone-soft: rgba(196, 122, 42, 0.14); }
[data-studio="mp"][data-store="苏河湾"] { --tone: #c45c5c; --tone-soft: rgba(196, 92, 92, 0.14); }

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(13, 143, 122, 0.28), transparent 60%),
    radial-gradient(700px 480px at 100% 0%, rgba(232, 112, 58, 0.18), transparent 55%),
    linear-gradient(165deg, #f3efe7 0%, #e4ddd2 45%, #d7d0c4 100%);
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 4.2vw, 2.1rem);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}
.brand:hover { color: var(--accent); }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover,
.nav a.is-active { color: var(--accent); }

main { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem 4rem; }

.hero {
  padding: clamp(3.5rem, 12vh, 7rem) 0 2.5rem;
  max-width: 36rem;
  animation: rise 0.7s ease both;
}
.hero-compact { padding-top: 2.5rem; padding-bottom: 1.5rem; max-width: 42rem; }
.hero-panel,
.hero-studio {
  padding-top: 1.75rem;
  padding-bottom: 0.75rem;
  background: none;
  border: none;
  box-shadow: none;
  clip-path: none;
}
.hero-panel::before { display: none; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 0.75rem;
  color: var(--ink);
  line-height: 1.05;
  text-shadow: none;
}
.brand-mark-sm { font-size: clamp(1.35rem, 3.5vw, 1.9rem); }
.hero-studio .brand-mark { margin-bottom: 0.35rem; }
.hero-studio .lede { margin: 0.15rem 0 0; font-size: 0.95rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}
.lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 28rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  background: var(--ink);
  color: #f7f4ee;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  clip-path: none;
  box-shadow: none;
}
.btn:hover { background: var(--accent-ink); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); background: transparent; }
.btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 1.25rem;
}
.pagination .btn {
  min-width: 2.4rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
}
.pagination-ellipsis {
  color: var(--muted);
  padding: 0 0.2rem;
}

.section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  background: none;
  box-shadow: none;
  clip-path: none;
  animation: rise 0.8s ease 0.08s both;
}
.section-stores-brief { margin-top: 1.25rem; }
.section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
}
.section-note { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.95rem; }

.studio-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.studio-chip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone, var(--accent));
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.studio-chip:hover {
  border-color: var(--tone, var(--accent));
  transform: translateY(-1px);
  color: inherit;
}
.studio-chip-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.studio-chip-meta { color: var(--muted); font-size: 0.8rem; }

.studio-list, .store-list, .card-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.studio-list li + li { margin-top: 0.65rem; }
.studio-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease, padding-left 0.25s ease;
}
.studio-link:hover { color: var(--accent-ink); padding-left: 0.35rem; }
.studio-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
}
.studio-meta { color: var(--muted); font-size: 0.92rem; }

.store-list {
  display: grid;
  gap: 0.65rem;
}
.store-list > li { list-style: none; }
.store-card {
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone, var(--accent));
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}
a.store-card:hover {
  border-color: var(--tone, var(--accent));
  background: #fff;
  color: inherit;
}
.store-card.is-active {
  background: #fff;
  border-color: var(--tone, var(--accent));
}
.store-card-body { display: flex; flex-direction: column; gap: 0.25rem; }
.store-card-title { font-size: 1rem; }
.store-card-cta {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-ink);
}
.addr { margin: 0.25rem 0 0.4rem; color: var(--muted); font-size: 0.92rem; }
.text-link { font-size: 0.9rem; }
.muted { color: var(--muted); }

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 1rem 0.85rem;
}
.teacher-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}
.teacher-tile:hover { transform: translateY(-3px); color: inherit; }
.teacher-tile img,
.avatar-fallback,
.teacher-hero-avatar,
.teacher-avatar {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-deep);
}
.teacher-hero-avatar,
.teacher-avatar {
  width: 120px;
  flex-shrink: 0;
}
.avatar-fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent-ink);
  background:
    linear-gradient(145deg, rgba(13, 143, 122, 0.2), transparent),
    var(--bg-deep);
}
.t-name { font-weight: 600; font-size: 0.95rem; }
.t-meta { color: var(--muted); font-size: 0.8rem; }

.teacher-hero-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.filters select,
.filters input {
  min-width: 140px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px; /* avoid iOS zoom on focus */
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(6px);
}
.course-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.course-table th,
.course-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.course-table th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}
.course-table tr:last-child td { border-bottom: none; }
.course-table tbody tr { transition: background 0.15s ease; }
.course-table tbody tr:hover { background: rgba(13, 143, 122, 0.06); }
.course-venue {
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
}
.course-venue:hover { color: var(--accent); }
.course-name { font-weight: 500; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
  margin-left: 0.35rem;
  vertical-align: middle;
  box-shadow: none;
}
.tag-double {
  background: rgba(196, 92, 62, 0.12);
  color: #a34a32;
  border-color: rgba(196, 92, 62, 0.28);
}
.tag-basics {
  background: rgba(196, 48, 48, 0.14);
  color: #b42318;
  border-color: rgba(196, 48, 48, 0.35);
  font-weight: 600;
}
.tag-level {
  letter-spacing: 0.04em;
  font-weight: 600;
  background: rgba(40, 90, 120, 0.1);
  color: #2a5a78;
  border-color: rgba(40, 90, 120, 0.25);
  margin-left: 0;
  white-space: nowrap;
}
.course-table td:has(.tag-level) { white-space: nowrap; }

.venue-map {
  width: 100%;
  height: min(62vh, 520px);
  min-height: 320px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #e8e4dc;
}
.venue-map-page { margin-bottom: 1rem; }
.venue-map .leaflet-container { width: 100%; height: 100%; font: inherit; }
.venue-map .leaflet-popup-content { margin: 0.65rem 0.85rem; font-size: 0.9rem; }
.venue-map .leaflet-popup-content a { color: var(--accent-ink); }
.venue-map .leaflet-tooltip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  box-shadow: none;
  padding: 0.25rem 0.45rem;
  font-size: 0.82rem;
}
.map-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.map-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.map-legend li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.map-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--tone, var(--accent));
  flex-shrink: 0;
}
.map-legend a {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.map-legend a:hover { color: var(--accent); }
.map-address {
  display: block;
  width: 100%;
  margin-top: 0.1rem;
  margin-left: 1.1rem;
  color: var(--muted);
  font-size: 0.84rem;
}
.map-pop-addr { color: var(--muted); font-size: 0.85rem; }
@media (min-width: 720px) {
  .map-legend { grid-template-columns: 1fr 1fr; }
}

.detail { max-width: 280px; color: var(--muted); font-size: 0.88rem; }
.empty { color: var(--muted); padding: 1rem 0; }
code {
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer strong { color: var(--ink-soft); }

.feedback {
  margin-top: 1.4rem;
  padding: 1.2rem 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
.feedback h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.feedback-lede {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 36rem;
}
.feedback-form {
  display: grid;
  gap: 0.75rem;
  max-width: 32rem;
}
.feedback-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.feedback-form textarea,
.feedback-form input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  resize: vertical;
}
.feedback-form .btn { justify-self: start; }
.flash-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.flash {
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
}
.flash-ok { background: rgba(13, 143, 122, 0.12); }
.flash-error { background: rgba(196, 48, 48, 0.12); }

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

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem 0;
    padding-top: max(1rem, env(safe-area-inset-top));
  }
  .brand {
    font-size: clamp(1.25rem, 7vw, 1.7rem);
    max-width: 100%;
    word-break: break-word;
  }
  .nav {
    width: 100%;
    gap: 0.35rem;
  }
  .nav a {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.55rem 0.7rem;
    font-size: 0.88rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav a.is-active {
    border-color: var(--accent);
    background: rgba(13, 143, 122, 0.1);
  }

  main {
    padding: 0 1rem 3rem;
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }

  .hero,
  .hero-compact,
  .hero-studio {
    padding-top: 1.35rem;
    padding-bottom: 1rem;
    max-width: none;
  }
  .hero h1 { font-size: 1.25rem; }
  .lede { font-size: 0.95rem; margin-bottom: 1rem; }

  .studio-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .studio-chip { padding: 0.7rem 0.75rem; }
  .studio-chip-name { font-size: 0.92rem; }

  .section { margin-top: 1.6rem; padding-top: 1.1rem; }
  .section-stores-brief { margin-top: 0.85rem; }
  .section h2 { font-size: 1.2rem; }

  .store-card { padding: 0.85rem 0.9rem; }
  .store-card-cta { font-size: 0.85rem; }

  .studio-link { flex-direction: column; align-items: flex-start; }
  .teacher-hero-row { flex-direction: column; align-items: flex-start; }
  .teacher-hero-avatar,
  .teacher-avatar { width: 96px; }

  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    padding: 0.85rem;
  }
  .filters label { width: 100%; }
  .filters select,
  .filters input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  .filters .btn {
    width: 100%;
    min-height: 44px;
  }

  .table-wrap {
    margin: 0 -0.15rem;
    border-radius: 6px;
    position: relative;
  }
  .table-wrap::after {
    content: "左右滑动查看完整课表";
    display: block;
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.5);
  }
  .course-table {
    min-width: 520px;
    font-size: 0.84rem;
  }
  .course-table th,
  .course-table td {
    padding: 0.55rem 0.6rem;
  }

  .pagination {
    gap: 0.3rem;
    justify-content: center;
  }
  .pagination .btn {
    min-width: 2.6rem;
    min-height: 40px;
  }

  .teacher-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.75rem 0.55rem;
  }

  .venue-map,
  .venue-map-page {
    height: min(52vh, 380px);
    min-height: 260px;
    border-radius: 6px;
  }
  .map-legend {
    grid-template-columns: 1fr;
  }
  .map-address { margin-left: 1rem; }

  .site-footer {
    padding: 1rem 1rem max(2rem, env(safe-area-inset-bottom));
    font-size: 0.8rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.65rem 1rem;
  }
}

@media (max-width: 380px) {
  .studio-strip { grid-template-columns: 1fr; }
  .brand { font-size: 1.2rem; }
}
