:root {
  --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-soft: linear-gradient(135deg, #f5f7fa 0%, #e6e9f5 100%);
  --ink: #2c3e50;
  --ink-soft: #5d6c7d;
  --muted: #8a94a6;
  --line: #e4e8f2;
  --indigo: #667eea;
  --purple: #764ba2;
  --ok: #2f9e63;
  --err: #e14c5a;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  line-height: 1.7;
  background: var(--grad-soft);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.1rem; color: #3e3fae; }
.brand-text small { font-size: 0.74rem; color: var(--muted); letter-spacing: 0.05em; }

.topbar.with-nav { display: flex; align-items: center; gap: 12px; }
.topbar.with-nav .brand { flex: 1; margin: 0; max-width: none; }

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.intro {
  text-align: center;
  padding: 34px 24px;
  border-radius: 22px;
  background: var(--grad);
  color: #fff;
  margin-bottom: 28px;
  box-shadow: 0 18px 40px rgba(102, 126, 234, 0.28);
}

.intro h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.intro p {
  margin: 0 auto;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.98rem;
}

.form-card {
  background: #fff;
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 22px;
  padding: 30px 30px 34px;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
}

.form-head {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.form-head h2 { margin: 0 0 5px; color: #3e3fae; font-size: 1.32rem; }
.form-head p { margin: 0; color: var(--muted); font-size: 0.85rem; }

.required { color: var(--err); }

.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; margin-bottom: 7px; color: #3a4a63; font-size: 0.95rem; }

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcff;
  color: var(--ink);
  font-size: 0.96rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--indigo);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

textarea { resize: vertical; min-height: 84px; }

.radio-row { display: flex; gap: 22px; padding: 6px 2px; }
.radio { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: #3a4a63; cursor: pointer; }
.radio input { accent-color: var(--indigo); width: 17px; height: 17px; }

.err { display: block; min-height: 16px; margin-top: 4px; color: var(--err); font-size: 0.82rem; }

.submit-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: var(--grad);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(102, 126, 234, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.feedback {
  margin-top: 16px;
  min-height: 24px;
  text-align: center;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 12px;
  display: none;
}
.feedback.ok { display: block; background: #e8f7ee; color: var(--ok); }
.feedback.error { display: block; background: #fdecee; color: var(--err); }

.footer {
  text-align: center;
  padding: 26px 16px 34px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- 管理页 ---------- */
.admin-body { background: #eef1f8; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 34px 20px 60px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-head h1 { margin: 0 0 4px; color: #3e3fae; }
.muted { color: var(--muted); margin: 0; }
.back-link { color: var(--indigo); text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

.alert {
  background: #fff;
  border: 1px solid rgba(225, 76, 90, 0.25);
  color: #b23a46;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.alert a { color: var(--indigo); }

.table-scroll { overflow-x: auto; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(44,62,80,0.06); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 720px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f5f7fc; color: #4a5a75; font-weight: 600; }
tbody tr:hover { background: #fafbff; }
.tag { padding: 3px 11px; border-radius: 50px; background: #eef1ff; color: #4a55b0; font-size: 0.8rem; }
.note { margin-top: 14px; font-size: 0.84rem; }

@media (max-width: 560px) {
  .page { padding: 26px 14px 44px; }
  .form-card { padding: 22px 18px 26px; border-radius: 18px; }
  .intro { padding: 26px 18px; }
  .admin-head { flex-direction: column; align-items: flex-start; }
}

/* ---------- 课程中心（公开页） ---------- */
.page-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  padding-right: 20px;
}

.page-nav a {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 50px;
  background: #eef1ff;
  transition: background 0.2s ease, transform 0.2s ease;
}

.page-nav a:hover { background: var(--grad); color: #fff; transform: translateY(-1px); }

.page-courses { max-width: 1080px; }
.course-intro { margin-bottom: 30px; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.course-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.07);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.course-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(102, 126, 234, 0.16); }

.course-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.course-cat {
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--grad);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.course-price {
  padding: 4px 12px;
  border-radius: 50px;
  background: #fff3e0;
  color: #b36a00;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.course-type {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #eef1ff;
  color: #4a55b0;
  font-size: 0.78rem;
  font-weight: 600;
}

.course-enroll-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f4f6ff;
}

.course-count {
  font-weight: 800;
  color: var(--indigo);
  font-size: 0.92rem;
}
.course-count.full { color: #b23a46; }

.course-deadline { color: var(--ink-soft); font-size: 0.82rem; }

.enroll-notice {
  text-align: center;
  background: #fdecee;
  color: #b23a46;
  border-radius: 12px;
  padding: 20px;
  font-weight: 600;
}
.enroll-notice .course-cta { margin-top: 14px; }

.course-card h2 { margin: 0 0 10px; color: #3a3f9e; font-size: 1.18rem; line-height: 1.45; }
.course-desc { color: var(--ink-soft); font-size: 0.93rem; flex: 1; }

.course-meta { margin: 14px 0 0; }
.course-meta div {
  display: flex;
  gap: 8px;
  font-size: 0.86rem;
  padding: 4px 0;
  border-top: 1px dashed #e8ebf5;
}
.course-meta dt { color: var(--muted); flex-shrink: 0; }
.course-meta dd { margin: 0; color: var(--ink-soft); }

.course-cta {
  display: block;
  margin-top: 16px;
  text-align: center;
  padding: 11px;
  border-radius: 50px;
  background: #eef1ff;
  color: #4a55b0;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.course-cta:hover { background: var(--grad); color: #fff; }

.course-empty {
  background: #fff;
  border-radius: 18px;
  text-align: center;
  padding: 52px 24px;
  border: 1px dashed rgba(102, 126, 234, 0.35);
  color: var(--ink-soft);
}
.course-empty a { color: var(--indigo); font-weight: 600; }

@media (max-width: 620px) {
  .page-nav { padding-right: 16px; }
  .course-grid { grid-template-columns: 1fr; }
}

/* ---------- 课程详情 / 报名 ---------- */
.muted { color: var(--muted); margin: 0; }

.page-detail { max-width: 860px; }

.detail-card,
.enroll-card {
  background: #fff;
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.07);
  margin-bottom: 26px;
}

.detail-card h1 {
  margin: 8px 0 12px;
  color: #3a3f9e;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.4;
}

.course-cover {
  margin: 14px 0 4px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: #f6f8fd;
}

.course-cover img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.course-cover.card-thumb {
  margin: 0 0 12px;
  border-radius: 12px;
}

.course-cover.card-thumb img {
  height: 160px;
}

.detail-card .course-card-head { margin-bottom: 4px; }

.detail-meta { margin: 18px 0 0; }
.detail-meta div {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px dashed #e8ebf5;
  font-size: 0.96rem;
}
.detail-meta dt { color: var(--muted); min-width: 76px; flex-shrink: 0; }
.detail-meta dd { margin: 0; color: var(--ink-soft); }

.detail-desc h2 { margin: 22px 0 8px; color: #3e3f9e; font-size: 1.12rem; }
.detail-desc p { color: var(--ink-soft); line-height: 1.9; }

.enroll-head { margin-bottom: 18px; }
.enroll-head h2 { margin: 0 0 6px; color: #3e3f9e; }

.site-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.site-form .form-field { margin-bottom: 16px; }
.site-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #3a4a63;
  font-size: 0.95rem;
}
.site-form .req { color: #e14c5a; }

.site-form input[type="text"],
.site-form input[type="tel"],
.site-form select,
.site-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #e4e8f2;
  border-radius: 11px;
  background: #fbfcff;
  color: var(--ink);
  font-size: 0.96rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.site-form input:focus,
.site-form select:focus,
.site-form textarea:focus {
  outline: none;
  border-color: var(--indigo);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.site-form textarea { resize: vertical; }
.site-form .radio-row { display: flex; gap: 20px; padding: 6px 2px; }
.site-form .radio-row label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: #3a4a63; margin: 0; }
.site-form .radio-row input { accent-color: var(--indigo); width: 17px; height: 17px; }

.site-form .agree-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #3a4a63;
  font-size: 0.92rem;
  cursor: pointer;
}
.site-form .agree-line input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--indigo);
}
.site-form .notice {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed #cdd6f5;
  border-radius: 10px;
  background: #f8f9ff;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.7;
}
.site-form .notice summary {
  cursor: pointer;
  font-weight: 600;
  color: #4a55b0;
}
.site-form .notice p { margin: 8px 0 0; }

.form-err { display: block; min-height: 15px; margin-top: 4px; color: #e14c5a; font-size: 0.8rem; }
.signup-submit { width: 100%; margin-top: 6px; }
.signup-feedback {
  margin-top: 14px;
  min-height: 26px;
  text-align: center;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px;
  display: none;
}
.signup-feedback.ok { display: block; background: #e8f7ee; color: #2f9e63; }
.signup-feedback.error { display: block; background: #fdecee; color: #e14c5a; }

@media (max-width: 620px) {
  .detail-card, .enroll-card { padding: 22px 18px; }
  .site-form .form-row { grid-template-columns: 1fr; }
  .detail-meta div { flex-direction: column; gap: 2px; }
}
