:root {
  --bg: #f7f3ed;
  --bg-card: #fffdf9;
  --ink: #1a1f2e;
  --ink-muted: #5c6478;
  --accent: #0d6e6e;
  --accent-light: #e6f3f3;
  --accent-warm: #c45c26;
  --border: rgba(26, 31, 46, 0.1);
  --shadow: 0 20px 60px rgba(26, 31, 46, 0.08);
  --radius: 16px;
  --font-display: "Noto Serif SC", "Songti SC", serif;
  --font-body: "DM Sans", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(13, 110, 110, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(196, 92, 38, 0.08), transparent);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }

.corp-page { min-height: 100vh; }

/* Poster-style site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #0d4f4f 0%, #0a3d3d 38%, #062929 72%, #041f1f 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 32px rgba(6, 41, 41, 0.35);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-identity-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-identity-link {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.header-identity-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.header-identity-teacher { border-color: rgba(26, 95, 180, 0.45); }
.header-identity-parent { border-color: rgba(13, 110, 110, 0.45); }
.header-identity-org { border-color: rgba(45, 90, 61, 0.45); }
.header-identity-admin { border-color: rgba(92, 64, 51, 0.45); }

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: min(420px, 42vw);
  font-family: var(--font-body);
  font-size: inherit;
  font-weight: inherit;
  color: #fff;
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

.logo-text { display: grid; gap: 2px; min-width: 0; }

.logo-title {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-tagline {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.4;
}

.site-header .nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.site-header .nav-links a {
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.2s ease;
}

.site-header .nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.usage-chip {
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(230, 243, 243, 0.14);
  color: #b8ecec;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.usage-chip.logged-in {
  background: rgba(72, 187, 120, 0.22);
  color: #d4ffe8;
  border-color: rgba(104, 211, 145, 0.45);
  font-weight: 600;
  padding-left: 10px;
}

.usage-chip.logged-in::before {
  content: "✓ ";
  opacity: 0.9;
}

body.ft-logged-in #authBtn,
body.ft-logged-in #loginBtn,
body.ft-logged-in #registerBtn {
  display: none !important;
}

body.ft-logged-in #logoutBtn {
  display: inline-flex !important;
}

body.ft-logged-in #userChip {
  display: inline-flex !important;
}

body.ft-logged-in .login-hub .section-title::after {
  content: " ✓";
  color: var(--accent, #2d5a3d);
  font-size: 0.85em;
}

body.ft-logged-in .login-hub-steps {
  color: var(--accent, #2d5a3d);
}

body.ft-logged-in .login-hub-steps::before {
  content: "已登录 · ";
  font-weight: 600;
}

.site-header .btn.ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border: none;
  box-shadow: none;
  padding: 8px 16px;
}

.site-header .btn.ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: none;
}

.site-header .btn.primary {
  background: linear-gradient(135deg, var(--accent), #0a8585);
  color: #fff;
  padding: 8px 18px;
  font-size: 0.88rem;
  box-shadow: 0 8px 20px rgba(13, 110, 110, 0.35);
}

.page-doc .doc-edition-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  align-items: center;
  justify-content: flex-end;
}

.page-doc .doc-edition-nav a {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
  white-space: nowrap;
  transition: color 0.2s;
}

.page-doc .doc-edition-nav a:hover {
  color: #fff;
}

@media (max-width: 720px) {
  .page-doc .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .page-doc .doc-edition-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.nav .logo span { color: var(--ink); font-weight: 400; font-size: 0.85rem; margin-left: 8px; }

/* site-header 内所有标题文字强制白色（避免被 .nav .logo span 等规则覆盖） */
.site-header .logo-title,
.site-header .logo-tagline,
.site-header .logo-text span {
  color: #fff !important;
}

.site-header .logo-tagline {
  color: rgba(255, 255, 255, 0.88) !important;
}

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 0.92rem; color: var(--ink-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }

/* Buttons */
a.btn { text-decoration: none; }
a.btn-primary { color: #fff; }
a.btn-secondary { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 110, 110, 0.25);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-warm {
  background: var(--accent-warm);
  color: #fff;
  box-shadow: 0 8px 24px rgba(196, 92, 38, 0.25);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 80px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.25;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  background: var(--accent-light);
  border-radius: 12px;
  padding: 16px;
}

.stat strong { display: block; font-size: 1.5rem; color: var(--accent); }
.stat span { font-size: 0.82rem; color: var(--ink-muted); }

/* Sections */
section { padding: 64px 0; }

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin-bottom: 36px;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.feature h3 { font-size: 1rem; margin-bottom: 8px; }
.feature p { font-size: 0.88rem; color: var(--ink-muted); }

/* Teachers preview */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.teacher-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.teacher-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0a5252);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.teacher-card img.avatar.teacher-photo,
.teacher-card img.teacher-photo {
  object-fit: cover;
  display: block;
  background: #eee;
}

.profile-avatar.teacher-photo {
  object-fit: cover;
  background: #eee;
}

.teacher-card h4 { font-size: 1rem; margin-bottom: 4px; }
.teacher-card .meta { font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 10px; }
.teacher-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
}

.teacher-card .price { font-weight: 700; color: var(--accent-warm); font-size: 0.95rem; }

.grade-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.grade-S { background: #fff3cd; color: #856404; }
.grade-A { background: #e6f4ea; color: #1e7e34; }
.grade-B { background: var(--accent-light); color: var(--accent); }
.grade-C, .grade-D { background: #f5f5f5; color: var(--ink-muted); }

.promo-banner {
  background: linear-gradient(135deg, #fff8e6, #fffdf9);
  border: 1px solid rgba(196, 92, 38, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

.cs-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.cs-panel h3 { font-family: var(--font-display); margin-bottom: 12px; }

.teacher-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}

.teacher-detail-card .detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 8px 0;
}

.institution-page { max-width: 820px; margin: 0 auto; padding: 48px 24px 80px; }
.institution-page h1 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 8px; }
.institution-page h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 32px 0 12px; color: var(--accent); }
.institution-page p, .institution-page li { color: var(--ink-muted); font-size: 0.95rem; }
.institution-page table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; font-size: 0.88rem; }
.institution-page th, .institution-page td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.institution-page th { background: var(--accent-light); color: var(--accent); }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.step {
  text-align: center;
  padding: 16px 8px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 auto 10px;
}

.step p { font-size: 0.78rem; color: var(--ink-muted); }

/* Form pages */
.page-header {
  padding: 48px 0 32px;
  text-align: center;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 10px;
}

.page-header p { color: var(--ink-muted); }

.form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-bottom: 80px;
}

.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-panel {
  min-height: 400px;
}

.result-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-muted);
}

.result-empty .icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }

.report { animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.report h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.report h3:first-child { margin-top: 0; }

.report ul { padding-left: 18px; margin: 8px 0; }
.report li { font-size: 0.9rem; margin-bottom: 4px; color: var(--ink-muted); }

.match-card {
  background: var(--accent-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.match-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.match-score {
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.match-card .reasons { font-size: 0.85rem; color: var(--ink-muted); }

.loading {
  text-align: center;
  padding: 40px;
  color: var(--accent);
}

footer {
  text-align: center;
  padding: 32px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .features, .teacher-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .form-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .site-header .logo-tagline { display: none; }
  .header-identity-link { font-size: 0.75rem; padding: 6px 9px; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; padding: 8px 12px; }
  .header-right { width: 100%; justify-content: space-between; }
  .header-identity-nav { flex: 1; justify-content: flex-start; }
}

/* Portal pages */
.page-parent { --accent: #0d6e6e; }
.page-teacher { --accent: #1a5fb4; --accent-light: #e8f0fc; }
.page-admin { --accent: #5c4033; --accent-light: #f5ede6; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink-muted);
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-info { background: var(--accent-light); color: var(--accent); }
.alert-success { background: #e6f4ea; color: #1e7e34; }
.alert-error { background: #fdecea; color: #c0392b; }
.alert-warn { background: #fff8e6; color: #b8860b; }

.meta-line { font-size: 0.85rem; color: var(--ink-muted); margin: 4px 0; }
.intro-snippet { font-size: 0.9rem; line-height: 1.7; margin: 8px 0; color: var(--ink); }
.sub-heading { font-size: 1rem; margin: 16px 0 10px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.status-banner {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.status-pending { background: #fff8e6; color: #8a6d00; }
.status-approved { background: #e6f4ea; color: #1e7e34; }
.status-rejected { background: #fdecea; color: #c0392b; }

.status-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.status-badge.status-pending { background: #fff3cd; color: #856404; }
.status-badge.status-confirmed { background: #d4edda; color: #155724; }
.status-badge.status-completed { background: #cce5ff; color: #004085; }
.status-badge.status-cancelled { background: #f8d7da; color: #721c24; }

.booking-item, .admin-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}

.booking-item .header, .admin-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 31, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.modal-box h3 { font-family: var(--font-display); margin-bottom: 16px; }

.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-row label { font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }

.error { color: #c0392b; }
.reasons.warn { color: #b8860b; }

.portal-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.portal-card h3 { font-family: var(--font-display); margin-bottom: 8px; }
.portal-card p { font-size: 0.88rem; color: var(--ink-muted); margin-bottom: 16px; }

@media (max-width: 900px) {
  .portal-cards { grid-template-columns: 1fr; }
}

/* Home page login hub */
.page-home { --accent: #0d6e6e; }

.login-hub {
  padding: 64px 0;
  background: linear-gradient(180deg, transparent, rgba(13, 110, 110, 0.04));
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.section-desc {
  color: var(--ink-muted);
  margin: -24px 0 32px;
  font-size: 1rem;
}

.hero-desc-sub { margin-top: -12px !important; font-size: 0.95rem !important; }

.login-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1100px) {
  .login-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .login-cards { grid-template-columns: 1fr; }
}

.identity-hint {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: -4px 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
}
.identity-hint-muted {
  color: var(--ink-muted);
  background: var(--bg-muted, #f5f3ef);
  border: 1px solid var(--border);
}
.identity-hint-ok {
  color: var(--accent, #2d5a3d);
  background: var(--accent-light, #e8f3ec);
  border: 1px solid rgba(45, 90, 61, 0.15);
}

.login-hub-steps {
  text-align: center;
  margin: -8px 0 16px;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.login-hub .identity-hint strong {
  color: var(--accent, #2d5a3d);
}

#authBtn.auth-btn-pulse {
  animation: auth-btn-pulse 0.9s ease-in-out 3;
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.35);
}
@keyframes auth-btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.login-card-icon { font-size: 2.2rem; margin-bottom: 12px; }
.login-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 8px; }
.login-card > p { font-size: 0.88rem; color: var(--ink-muted); margin-bottom: 16px; flex: 1; }

.login-card-list {
  list-style: none;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.login-card-list li {
  padding: 4px 0 4px 18px;
  position: relative;
}

.login-card-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.login-card-parent { border-top: 3px solid #0d6e6e; }
.login-card-teacher { border-top: 3px solid #1a5fb4; }
.login-card-admin { border-top: 3px solid #5c4033; }
.login-card-org { border-top: 3px solid #2d5a3d; }

.login-card-parent .btn-primary { background: #0d6e6e; }
.login-card-teacher .btn-primary { background: #1a5fb4; box-shadow: 0 8px 24px rgba(26, 95, 180, 0.25); }
.login-card-admin .btn-primary { background: #5c4033; box-shadow: 0 8px 24px rgba(92, 64, 51, 0.25); }
.login-card-org .btn-primary { background: #2d5a3d; box-shadow: 0 8px 24px rgba(45, 90, 61, 0.25); }

.login-card-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.login-card-agent { border-top: 3px solid #7c5cbf; }
.login-card-agent .btn-primary { background: #7c5cbf; box-shadow: 0 8px 24px rgba(124, 92, 191, 0.25); }

.recruit-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.recruit-banner-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: center;
}

.recruit-banner-item strong {
  display: block;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.recruit-banner-item span {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.agent-section {
  background: linear-gradient(135deg, #f8f4ff 0%, #fffdf9 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-top: 16px;
}

.agent-section .section-desc { margin-bottom: 24px; }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.agent-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.agent-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 8px;
}

.agent-card p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.agent-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ede7f6;
  color: #5e35b1;
}

@media (max-width: 900px) {
  .recruit-banner, .agent-grid { grid-template-columns: 1fr; }
}

.process-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.process-col h4 {
  font-family: var(--font-display);
  text-align: center;
  margin-bottom: 16px;
  color: var(--accent);
}

.steps-col { grid-template-columns: 1fr 1fr; }

.modal-box-lg { max-width: 480px; position: relative; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink-muted);
  line-height: 1;
}

.modal-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label { font-size: 0.85rem; color: var(--ink-muted); }

.gate-panel {
  text-align: center;
  padding: 80px 24px;
  max-width: 480px;
  margin: 0 auto;
}

.gate-panel h2 { font-family: var(--font-display); margin-bottom: 12px; }

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 12px 0;
}

.check-row input { margin-top: 4px; flex-shrink: 0; }

.anti-fly-banner { font-size: 0.88rem; }

.chat-messages {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  background: var(--bg-card);
}

.chat-msg { margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: var(--accent-light); }
.chat-msg-teacher { background: #f5efe8; }
.chat-msg-blocked { opacity: 0.65; border: 1px dashed var(--accent-warm); }
.chat-role { font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.chat-blocked { color: var(--accent-warm); display: block; margin-top: 4px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 999px; }
.chat-tip { font-size: 0.82rem; }
.modal-head-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.warn-line { color: var(--accent-warm); }
.ok-line { color: var(--accent); font-size: 0.85rem; }

@media (max-width: 900px) {
  .process-columns { grid-template-columns: 1fr; }
}

.ai-chat-section { padding-top: 48px; }

.ai-chat-embed {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ai-chat-embed-head {
  padding: 16px 20px;
  background: linear-gradient(135deg, #0d4f4f, #062929);
  color: #fff;
}

.ai-chat-embed-head .meta-line { color: rgba(255,255,255,0.75); font-size: 0.78rem; margin-top: 4px; }

.ai-messages-inline {
  min-height: 280px;
  max-height: 420px;
  padding: 16px;
  background: #fafafa;
}

.ai-form-inline {
  padding: 12px 16px 8px;
  border-top: 1px solid var(--border);
}

.ai-form-inline input { font-size: 0.95rem; }

.ai-chat-embed .ai-quick { padding: 0 16px 16px; }

.ai-messages {
  overflow-y: auto;
}

.ai-msg { margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; font-size: 0.88rem; }
.ai-msg-user { background: var(--accent-light); margin-left: 24px; }
.ai-msg-assistant { background: #f5f5f5; margin-right: 16px; }
.ai-msg-role { font-size: 0.72rem; font-weight: 700; color: var(--accent); display: block; margin-bottom: 4px; }

.ai-form {
  display: flex;
  gap: 8px;
}

.ai-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
}

.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-quick-btn {
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  color: var(--ink-muted);
}

.ai-quick-btn:hover { border-color: var(--accent); color: var(--accent); }

.ai-handoff {
  margin: 0 16px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e6;
  font-size: 0.82rem;
  color: #856404;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.flow-step {
  text-align: center;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.flow-step strong { display: block; color: var(--accent); margin-bottom: 6px; }

@media (max-width: 700px) {
  .flow-steps { grid-template-columns: 1fr; }
}

/* —— 家教个人主页 —— */
.page-profile {
  background: var(--bg);
  min-height: 100vh;
}

.profile-site-header {
  background: var(--ink);
  color: #fff;
  padding: 12px 0;
}

.profile-site-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-back {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 0.9rem;
}

.profile-back:hover { color: #fff; }

#profile-root {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.profile-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 32px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-hero-text h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin: 8px 0 6px;
}

.profile-sub { color: var(--ink-muted); margin: 0 0 4px; }
.profile-meta { font-size: 0.88rem; color: var(--ink-muted); }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.profile-block {
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.profile-block h3 {
  font-size: 1rem;
  margin: 0 0 12px;
  color: var(--accent);
}

.profile-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.profile-list li:last-child { border-bottom: none; }

.profile-cta { grid-column: 1 / -1; text-align: center; }

.profile-link-box {
  margin: 16px 0;
  padding: 16px;
  background: var(--accent-light);
  border-radius: 10px;
}

.profile-link-box .btn { margin-right: 8px; margin-top: 8px; }

.profile-card-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.profile-card-link:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; align-items: center; text-align: center; }
}

/* —— 管理端平台配置 —— */
.settings-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 8px;
  margin: 12px 0;
}

.settings-fieldset legend {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  padding: 0 6px;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.readiness-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.readiness-item.ready { border-color: #b8dfc4; background: #f6fff8; }
.readiness-item.pending { border-color: #f0d9a8; background: #fffdf6; }

.readiness-item strong { display: block; margin-bottom: 6px; font-size: 0.92rem; }

.admin-tabs .btn.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35); }
