/* ============================================================
   星光少年 · 素质教育官网  —  品牌设计系统 v2
   主色：活力橙 #F59E0B / 深海蓝 #1E3A5F / 生机绿 #22C55E / 探索紫 #8B5CF6
   设计原则：温暖有活力 · 易读易用 · 品牌一致 · 无障碍(WCAG AA)
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand */
  --orange: #F59E0B;
  --orange-d: #D97706;
  --orange-l: #FBBF24;
  --navy: #1E3A5F;
  --navy-d: #142840;
  --navy-l: #2E4D77;
  --green: #22C55E;
  --purple: #8B5CF6;
  --purple-d: #7C3AED;

  /* Brand signature gradient */
  --brand-grad: linear-gradient(120deg, var(--orange) 0%, var(--purple) 100%);
  --brand-grad-soft: linear-gradient(120deg, rgba(245,158,11,.16), rgba(139,92,246,.16));

  /* Surfaces & text */
  --bg: #F6F8FC;
  --bg-soft: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EEF2F8;
  --text: #16202E;
  --text-soft: #5B6878;
  --border: #E5EAF2;

  /* Semantic */
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #2563EB;

  /* Spacing scale (4pt) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Radius */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Shadows */
  --shadow-sm: 0 4px 14px rgba(20,40,64,.06);
  --shadow: 0 10px 30px rgba(20,40,64,.08);
  --shadow-lg: 0 22px 56px rgba(20,40,64,.16);
  --ring: 0 0 0 4px rgba(245,158,11,.22);

  --maxw: 1200px;
  --header-h: 68px;
  --ease: cubic-bezier(.22,.8,.3,1);
}

html.dark {
  --bg: #0E141F;
  --bg-soft: #131C2B;
  --surface: #18202E;
  --surface-2: #1F2937;
  --text: #EAF0F8;
  --text-soft: #9FB0C4;
  --border: #28323F;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 22px 56px rgba(0,0,0,.5);
  --ring: 0 0 0 4px rgba(245,158,11,.3);
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: rgba(245,158,11,.28); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }
.gradient-text {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.muted { color: var(--text-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; min-height: 44px;
  font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 10px 22px rgba(245,158,11,.32);
  background-size: 160% 160%; background-position: 0% 0%;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(139,92,246,.4); background-position: 100% 100%; }
.btn-primary:active { transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-d); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-size: 20px;
  box-shadow: 0 6px 16px rgba(245,158,11,.4);
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 9px 15px; border-radius: 10px; font-size: 15px; color: var(--text-soft);
  transition: .2s var(--ease); font-weight: 600;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--orange-d); background: var(--brand-grad-soft); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 17px; display: grid; place-items: center; transition: .25s var(--ease);
}
.theme-toggle:hover { transform: rotate(18deg) scale(1.06); border-color: var(--orange); }
.btn-cta {
  padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--brand-grad); color: #fff; box-shadow: 0 8px 18px rgba(245,158,11,.34); transition: .2s var(--ease);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(139,92,246,.4); }
.nav-toggle { display: none; width: 42px; height: 42px; border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(620px 320px at 82% -12%, rgba(245,158,11,.20), transparent 70%),
    radial-gradient(540px 320px at 8% 6%, rgba(139,92,246,.18), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(8px); opacity: .55;
  background: var(--brand-grad); z-index: 0;
}
.hero-bg::before { width: 260px; height: 260px; right: -40px; top: 40px; animation: float 9s ease-in-out infinite; }
.hero-bg::after { width: 180px; height: 180px; left: -30px; bottom: 20px; opacity: .35; animation: float 11s ease-in-out infinite reverse; }
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(30px, 5.2vw, 54px); margin: 0 0 var(--sp-4); line-height: 1.16; font-weight: 850; letter-spacing: -.5px; }
.hero p.lead { font-size: clamp(16px, 2vw, 20px); color: var(--text-soft); max-width: 640px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .stat { position: relative; padding-left: 2px; }
.hero-stats .stat .num { font-size: 36px; font-weight: 850; line-height: 1; }
.hero-stats .stat .lbl { color: var(--text-soft); font-size: 14px; margin-top: 4px; }
.hero-stats .stat:not(:last-child)::after {
  content: ""; position: absolute; right: -20px; top: 6px; bottom: 6px; width: 1px; background: var(--border);
}

@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-22px) } }

/* ---------- Section ---------- */
.section { padding: 60px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 38px; }
.section-head .eyebrow {
  display: inline-block; color: var(--orange-d); font-weight: 800; letter-spacing: 2.5px;
  font-size: 13px; text-transform: uppercase; padding: 4px 12px; border-radius: 999px;
  background: var(--brand-grad-soft); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 6px 0 10px; font-weight: 820; letter-spacing: -.3px; }
.section-head p { color: var(--text-soft); margin: 0; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-c2 { grid-template-columns: repeat(2, 1fr); }
.grid-c3 { grid-template-columns: repeat(3, 1fr); }
.grid-c4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.card .cover { aspect-ratio: 16/10; object-fit: cover; width: 100%; transition: transform .5s var(--ease); }
.card:hover .cover { transform: scale(1.06); }
.card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .tag {
  align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px;
  background: var(--brand-grad-soft); color: var(--orange-d);
}
.card h3 { margin: 2px 0; font-size: 18px; line-height: 1.35; }
.card .meta { color: var(--text-soft); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.card .desc { color: var(--text-soft); font-size: 14px; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.card .price { font-weight: 800; color: var(--orange-d); font-size: 18px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-soft); }

/* ---------- Category pills ---------- */
.pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.pill {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); font-weight: 600; font-size: 14px; cursor: pointer; transition: .2s var(--ease);
}
.pill:hover { border-color: var(--orange); color: var(--orange-d); transform: translateY(-1px); }
.pill.active { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 16px rgba(245,158,11,.3); }

/* ---------- Filters ---------- */
.filterbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.filterbar select, .filterbar input {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 14px; font-family: inherit; min-height: 42px;
}

/* ---------- Teacher card ---------- */
.teacher-card { align-items: center; text-align: center; }
.teacher-card .avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin: 20px auto 0;
  border: 3px solid #fff; box-shadow: var(--shadow); transition: transform .3s var(--ease);
}
.teacher-card:hover .avatar { transform: scale(1.06); }
.teacher-card .body { align-items: center; }
.teacher-card .subject { color: var(--orange-d); font-weight: 700; font-size: 13px; }

/* ---------- Review ---------- */
.review-card { padding: 22px; }
.review-card .stars { color: var(--orange); letter-spacing: 2px; }
.review-card .who { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.review-card .who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 40px 0 8px; flex-wrap: wrap; }
.pager a, .pager .pager-num {
  min-width: 42px; height: 42px; padding: 0 14px; display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; transition: .2s var(--ease);
}
.pager a:hover, .pager .pager-num:hover { border-color: var(--orange); color: var(--orange-d); transform: translateY(-1px); }
.pager a.active, .pager .pager-num.active { background: var(--brand-grad); color: #fff; border-color: transparent; }
.pager a.disabled { opacity: .4; pointer-events: none; }
.pager .pager-dot { color: var(--text-soft); padding: 0 4px; }

/* ---------- Detail page ---------- */
.detail-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; padding: 40px 0; }
.detail-hero img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.detail-hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 10px; line-height: 1.25; }
.detail-hero .sub { color: var(--text-soft); font-size: 17px; margin-bottom: 18px; }
.detail-hero .price { font-weight: 800; color: var(--orange-d); font-size: 24px; }
.info-list { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-list li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.info-list .k { font-size: 12px; color: var(--text-soft); }
.info-list .v { font-weight: 700; font-size: 16px; }
.prose { max-width: 780px; line-height: 1.9; color: var(--text); }
.prose h3 { margin: 28px 0 10px; font-size: 21px; }
.prose p { margin: 0 0 14px; color: var(--text-soft); }
.breadcrumb { padding: 18px 0 0; font-size: 13px; color: var(--text-soft); }
.breadcrumb a:hover { color: var(--orange-d); }

/* ---------- Forms ---------- */
.form-wrap { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.form { padding: 26px; }                 /* 修复：卡片型表单缺内边距 */
.appointment-steps { padding: var(--sp-6); }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }
.form-row label .req { color: var(--danger); }
.input, .form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 15px; font-family: inherit; transition: .2s var(--ease);
}
.input:focus, .form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--orange); outline: none; box-shadow: var(--ring);
}
.form-row .err { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.form-row.invalid input, .form-row.invalid select { border-color: var(--danger); }
.form-row.invalid .err { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.alert-ok { background: rgba(34,197,94,.16); color: #15803d; }
.alert-err { background: rgba(239,68,68,.14); color: #b91c1c; }

/* ---------- Floating consult ---------- */
.float-consult { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.float-consult a {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-lg); transition: .2s var(--ease);
}
.float-consult a:hover { transform: translateY(-3px) scale(1.06); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #C7D2E0; margin-top: 64px; }
.site-footer a { color: #C7D2E0; transition: color .2s; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding: 48px 0 30px; }
.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.site-footer .col a, .site-footer .col p { display: block; padding: 4px 0; font-size: 14px; opacity: .9; }
.site-footer .col a:hover { color: var(--orange-l); }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: 13px; opacity: .7; text-align: center; }
.site-footer .brand-f { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 12px; }

/* ---------- About / Contact ---------- */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; margin: 30px 0; }
.feature-row.flip .media { order: 2; }
.timeline { border-left: 3px solid var(--orange); padding-left: 22px; margin: 20px 0; }
.timeline .item { position: relative; margin-bottom: 22px; }
.timeline .item::before { content: ""; position: absolute; left: -29px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); }
.timeline .item .yr { font-weight: 800; color: var(--orange-d); }
.campus-card .cover { aspect-ratio: 16/9; object-fit: cover; }
.map-frame { width: 100%; height: 280px; border: 0; border-radius: var(--radius); }

/* ---------- 404 / 500 ---------- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.error-page .code { font-size: 96px; font-weight: 900; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page p { color: var(--text-soft); font-size: 18px; margin: 10px 0 24px; }
.error-code { font-size: 96px; font-weight: 900; }

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative; overflow: hidden; padding: 52px 0 36px;
  background:
    radial-gradient(520px 240px at 85% -20%, rgba(245,158,11,.20), transparent 70%),
    radial-gradient(440px 240px at 8% 0%, rgba(139,92,246,.16), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.page-hero .eyebrow { display:inline-block; color: var(--orange-d); font-weight: 800; letter-spacing: 2.5px; font-size: 13px; padding: 4px 12px; border-radius: 999px; background: var(--brand-grad-soft); margin-bottom: 10px; }
.page-hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 8px 0 10px; font-weight: 840; }
.page-hero p { color: var(--text-soft); margin: 0; max-width: 640px; }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.contact-info h2 { font-size: 26px; margin: 0 0 8px; }
.contact-info .info-list { grid-template-columns: 1fr; }
.contact-info .info-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-info .ico { font-size: 22px; line-height: 1.4; }
.contact-form { padding: 26px; }
.contact-form h3 { margin: 0 0 16px; }

/* ---------- Stepper (appointment 4-step) ---------- */
.stepper { display: flex; gap: 8px; margin-bottom: 28px; position: relative; }
.stepper::before {
  content: ""; position: absolute; top: 13px; left: 13px; right: 13px; height: 2px;
  background: var(--border); z-index: 0;
}
.stepper .step {
  flex: 1; text-align: center; font-size: 13px; color: var(--text-soft); position: relative;
  padding-top: 36px; font-weight: 600; z-index: 1;
}
.stepper .step span {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--text-soft);
  display: grid; place-items: center; font-weight: 700; border: 2px solid var(--border); transition: .3s var(--ease);
}
.stepper .step.active span { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(245,158,11,.35); }
.stepper .step.active { color: var(--text); font-weight: 700; }
.stepper .step.done span { background: var(--green); color: #fff; border-color: transparent; }
.step-pane { display: none; }
.step-pane.active { display: block; animation: fadeUp .35s var(--ease); }
.step-pane h3 { margin: 0 0 18px; font-size: 19px; }
.step-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; gap: 12px; }
.appointment-no { margin: 4px 0 0; font-weight: 800; color: var(--green); text-align: center; font-size: 15px; }

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

/* ---------- Banners ---------- */
.banner-slider { position: relative; border-radius: var(--radius); overflow: hidden; }
.banner-slide { display: block; transition: opacity .6s var(--ease); }
.banner-slide img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); aspect-ratio: 10/3; object-fit: cover; }
.banner-cap { position: absolute; left: 36px; bottom: 30px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.banner-cap div:first-child { font-size: 26px; font-weight: 800; }
.banner-cap div:last-child { font-size: 16px; opacity: .95; }

/* ---------- Responsive (H5) ---------- */
@media (max-width: 920px) {
  .grid-c4 { grid-template-columns: repeat(2, 1fr); }
  .grid-c3 { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 1fr; }
  .feature-row, .feature-row.flip { grid-template-columns: 1fr; }
  .feature-row.flip .media { order: 0; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; gap: 4px; box-shadow: var(--shadow);
  }
  .grid-c4, .grid-c3, .grid-c2 { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
  .hero-stats .stat:not(:last-child)::after { display: none; }
  .section { padding: 40px 0; }
  .contact-wrap { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
