:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f4f9;
  --text: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #5b5bd6;
  --primary-dark: #4141b8;
  --accent: #18a777;
  --warning: #f59e0b;
  --danger: #d64545;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% 0%, rgba(91, 91, 214, 0.10), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(24, 167, 119, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  min-height: 78px;
  padding: 14px clamp(20px, 5vw, 76px);
  background: rgba(247, 248, 251, 0.86);
  border-bottom: 1px solid rgba(228, 231, 236, 0.9);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(91, 91, 214, .25);
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 18px; letter-spacing: -0.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); }

.main-nav { display: flex; justify-content: center; gap: 8px; }
.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 650;
  transition: .2s ease;
}
.main-nav a:hover,
.main-nav a.active { color: var(--text); background: var(--surface); box-shadow: 0 6px 18px rgba(23, 32, 51, .07); }
.header-actions { display: flex; gap: 10px; align-items: center; }

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 750;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-btn { color: #fff; background: var(--primary); box-shadow: 0 10px 24px rgba(91, 91, 214, .22); }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.primary-btn.compact { min-height: 40px; padding: 0 15px; }
.secondary-btn { background: var(--surface); border-color: var(--line); color: var(--text); }
.secondary-btn:hover, .ghost-btn:hover { border-color: #cdd3df; background: #fff; }
.ghost-btn { background: transparent; border-color: var(--line); color: var(--muted); }
.danger-btn { color: #fff; background: var(--danger); }
.wide { width: 100%; }

main { flex: 1; }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 80px; }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  align-items: center;
  gap: 54px;
  min-height: 610px;
  padding: clamp(32px, 6vw, 76px);
  border-radius: 36px;
  background: linear-gradient(135deg, #161b2e, #27245b 58%, #314d66);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}
.hero::before { width: 300px; height: 300px; right: -70px; top: -90px; background: rgba(126, 96, 255, .28); }
.hero::after { width: 260px; height: 260px; left: 44%; bottom: -150px; background: rgba(24, 167, 119, .23); }
.hero-copy, .hero-visual { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: #bfc7ff; font-weight: 750; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1 { margin: 0; max-width: 720px; font-size: clamp(42px, 6.2vw, 76px); line-height: .98; letter-spacing: -0.06em; }
.hero p { max-width: 610px; margin: 26px 0 30px; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .secondary-btn { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; color: rgba(255,255,255,.72); font-size: 14px; }
.hero-trust span::before { content: "✓"; margin-right: 6px; color: #6ee7b7; }

.schedule-preview {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 28px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 25px 60px rgba(0,0,0,.24);
  backdrop-filter: blur(18px);
}
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.preview-header strong { font-size: 17px; }
.live-pill { padding: 7px 10px; border-radius: 999px; background: rgba(110,231,183,.14); color: #8ef0ca; font-size: 12px; font-weight: 800; }
.preview-tutor { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.10); }
.avatar { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 54px; height: 54px; border-radius: 18px; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--avatar-a, #6d5dfc), var(--avatar-b, #18a777)); }
.avatar.large { width: 88px; height: 88px; border-radius: 26px; font-size: 24px; }
.online-dot { position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border: 3px solid #fff; border-radius: 50%; background: #22c55e; }
.preview-tutor p, .teacher-summary p { margin: 4px 0 0; color: inherit; opacity: .72; font-size: 14px; }
.preview-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.preview-slots span { padding: 12px 8px; text-align: center; border-radius: 14px; background: rgba(255,255,255,.10); font-size: 13px; }
.preview-slots span.active { color: #211f4d; background: #fff; font-weight: 800; }
.preview-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.preview-footer strong { font-size: 20px; }
.preview-footer small { color: rgba(255,255,255,.6); }

.section { margin-top: 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }
.section-heading p { max-width: 620px; margin: 10px 0 0; color: var(--muted); line-height: 1.7; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card, .policy-card, .metric-card, .panel, .teacher-card, .booking-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  box-shadow: 0 14px 34px rgba(23, 32, 51, .06);
}
.feature-card { padding: 26px; border-radius: 24px; }
.feature-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #ececff; color: var(--primary); font-size: 20px; font-weight: 900; }
.feature-card h3 { margin: 20px 0 8px; font-size: 19px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.65; }

.topic-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.topic-chip { padding: 11px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 650; }

.callout {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  align-items: center;
  gap: 40px;
  padding: 40px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(135deg, #5653cf, #7c3aed);
  box-shadow: var(--shadow);
}
.callout h2 { margin: 0; font-size: 36px; letter-spacing: -0.035em; }
.callout p { color: rgba(255,255,255,.78); line-height: 1.7; }
.callout .primary-btn { color: var(--primary); background: #fff; justify-self: end; box-shadow: none; }

.page-hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; }
.page-hero h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); letter-spacing: -0.05em; }
.page-hero p { max-width: 650px; margin: 12px 0 0; color: var(--muted); line-height: 1.7; }

.filter-bar { display: grid; grid-template-columns: 1.5fr repeat(3, .8fr); gap: 12px; margin-bottom: 22px; }
.field { display: grid; gap: 8px; }
.field label { color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
}
.field textarea { min-height: 110px; padding-top: 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #a7a7f2; box-shadow: 0 0 0 4px rgba(91,91,214,.10); }

.teacher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.teacher-card { overflow: hidden; border-radius: 24px; transition: transform .2s ease, box-shadow .2s ease; }
.teacher-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(23, 32, 51, .12); }
.teacher-banner { height: 116px; background: linear-gradient(135deg, var(--banner-a), var(--banner-b)); }
.teacher-body { padding: 0 22px 22px; }
.teacher-top { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-top: -36px; }
.teacher-top .avatar { border: 5px solid #fff; }
.price-tag { margin-top: 46px; text-align: right; }
.price-tag strong { font-size: 20px; }
.price-tag small { display: block; color: var(--muted); }
.teacher-body h3 { margin: 14px 0 4px; font-size: 22px; }
.teacher-meta { color: var(--muted); font-size: 14px; }
.teacher-bio { min-height: 70px; color: var(--muted); line-height: 1.6; }
.badge-row, .slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 999px; background: var(--surface-soft); color: #475467; font-size: 12px; font-weight: 750; }
.badge.good { color: #087b58; background: #e7f7f1; }
.badge.warn { color: #9a6400; background: #fff5dc; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.rating { font-weight: 800; }
.rating span { color: var(--warning); }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; }
.profile-main, .booking-panel { min-width: 0; }
.profile-card, .booking-panel { padding: 28px; border-radius: 28px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head h1 { margin: 0 0 6px; font-size: 36px; }
.profile-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.detail-box { padding: 16px; border-radius: 16px; background: var(--surface-soft); }
.detail-box strong { display: block; font-size: 18px; }
.detail-box span { color: var(--muted); font-size: 13px; }
.profile-section { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.profile-section h2 { margin: 0 0 12px; }
.profile-section p { color: var(--muted); line-height: 1.75; }
.booking-panel { position: sticky; top: 104px; height: fit-content; }
.booking-panel h2 { margin-top: 0; }
.duration-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 18px; }
.duration-btn, .time-slot-btn {
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 750;
}
.duration-btn.active, .time-slot-btn.active { color: var(--primary); border-color: #a7a7f2; background: #f1f1ff; }
.date-group { margin-top: 18px; }
.date-group h4 { margin: 0 0 10px; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-grid .time-slot-btn { padding: 10px 6px; font-size: 13px; }
.booking-summary { display: grid; gap: 10px; margin: 18px 0; padding: 16px; border-radius: 16px; background: var(--surface-soft); }
.summary-line { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.summary-line strong { color: var(--text); }
.booking-note { color: var(--muted); font-size: 12px; line-height: 1.55; }

.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric-card { padding: 22px; border-radius: 20px; }
.metric-card small { color: var(--muted); }
.metric-card strong { display: block; margin-top: 8px; font-size: 28px; }
.panel { padding: 24px; border-radius: 24px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.booking-list { display: grid; gap: 12px; }
.booking-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; }
.booking-info h3 { margin: 0 0 5px; }
.booking-info p { margin: 0; color: var(--muted); font-size: 14px; }
.booking-status { display: flex; flex-direction: column; align-items: end; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-pill.booked { color: #3f3fb3; background: #ececff; }
.status-pill.completed { color: #087b58; background: #e7f7f1; }
.status-pill.cancelled { color: #9f2f2f; background: #fdecec; }
.status-pill.pending { color: #9a6400; background: #fff5dc; }
.card-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.mini-btn { padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 12px; font-weight: 750; }
.mini-btn:hover { background: var(--surface-soft); }
.mini-btn.danger { color: var(--danger); border-color: #f0b8b8; }

.calendar-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.slot-manager { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.manage-slot { display: grid; gap: 6px; padding: 14px; border-radius: 15px; border: 1px solid var(--line); background: #fff; }
.manage-slot.selected { border-color: #a7a7f2; background: #f1f1ff; }
.manage-slot strong { font-size: 13px; }
.manage-slot span { color: var(--muted); font-size: 12px; }

.policy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.policy-card { padding: 26px; border-radius: 24px; }
.policy-card h2 { margin: 0 0 10px; }
.policy-card p { color: var(--muted); line-height: 1.7; }
.policy-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.policy-table th, .policy-table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.policy-table th { color: var(--muted); font-size: 13px; }
.policy-table td strong { display: block; margin-bottom: 4px; }
.notice { padding: 16px 18px; border-radius: 16px; background: #fff7e8; color: #7a5510; line-height: 1.65; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(13, 18, 31, .62); backdrop-filter: blur(8px); }
.modal-backdrop.hidden { display: none; }
.modal { position: relative; width: min(620px, 100%); max-height: min(88vh, 780px); overflow: auto; padding: 30px; border-radius: 26px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.modal-close { position: absolute; right: 18px; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 24px; }
.modal h2 { margin: 0 48px 8px 0; }
.modal p { color: var(--muted); line-height: 1.65; }
.checkout-box { margin: 18px 0; padding: 18px; border-radius: 18px; background: var(--surface-soft); }
.checkout-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.checkout-row.total { margin-top: 8px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 850; }
.checkbox-row { display: flex; align-items: start; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 140; display: grid; gap: 10px; }
.toast { min-width: 260px; max-width: 380px; padding: 14px 16px; border-radius: 14px; color: #fff; background: #172033; box-shadow: var(--shadow); animation: toastIn .25s ease; }
.toast.success { background: #087b58; }
.toast.error { background: #b63838; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

.empty-state { padding: 50px 20px; text-align: center; border: 1px dashed #cdd3df; border-radius: 20px; background: #fbfcfe; }
.empty-icon { font-size: 34px; color: var(--primary); }
.empty-state h3 { margin: 10px 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }

.site-footer { display: flex; justify-content: space-between; gap: 30px; padding: 34px clamp(20px, 5vw, 76px); border-top: 1px solid var(--line); background: rgba(255,255,255,.7); }
.site-footer p { margin: 7px 0 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; color: var(--muted); }
.footer-links a:hover { color: var(--text); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: auto 1fr; }
  .main-nav { display: none; }
  .header-actions { justify-content: end; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; }
  .feature-grid, .teacher-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-layout, .calendar-layout { grid-template-columns: 1fr; }
  .booking-panel { position: static; }
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-details { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .site-header { gap: 12px; padding-inline: 14px; }
  .brand-copy small, .ghost-btn { display: none; }
  .page { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .hero { min-height: auto; padding: 30px 22px; border-radius: 26px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 16px; }
  .preview-slots { grid-template-columns: 1fr; }
  .feature-grid, .teacher-grid, .policy-grid, .filter-bar, .dashboard-grid, .callout { grid-template-columns: 1fr; }
  .callout .primary-btn { justify-self: stretch; }
  .teacher-grid { gap: 14px; }
  .page-hero, .section-heading, .site-footer { align-items: start; flex-direction: column; }
  .booking-card { grid-template-columns: auto 1fr; }
  .booking-status { grid-column: 1 / -1; align-items: stretch; }
  .card-actions { justify-content: start; }
  .slot-manager { grid-template-columns: repeat(2, 1fr); }
  .profile-head { align-items: start; }
  .profile-details { grid-template-columns: 1fr 1fr; }
  .slot-grid { grid-template-columns: repeat(2, 1fr); }
}
