:root {
  --bg: #ffffff;
  --soft: #f4f7fb;
  --soft-2: #eef3f9;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ee;
  --brand: #0b4a86;
  --brand-2: #123a67;
  --accent: #b51d2a;
  --gold: #b98121;
  --ok: #1f8a56;
  --shadow: 0 16px 42px rgba(15, 43, 74, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: #0a3761;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.topbar-inner,
.nav-inner,
.container,
.footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 310px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 6px;
  font-weight: 800;
}

.brand-title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--brand-2);
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav button {
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  color: #1f2a3d;
  border-radius: 4px;
  font-size: 15px;
}

.nav button:hover,
.nav button.active {
  background: #eaf1f8;
  color: var(--brand);
}

.hero {
  background: linear-gradient(90deg, rgba(7, 42, 78, 0.93) 0%, rgba(7, 42, 78, 0.72) 42%, rgba(7, 42, 78, 0.08) 100%),
    url("./public/hero-youth-competition.png") center / cover no-repeat;
  min-height: 430px;
  color: #fff;
}

.hero .container {
  min-height: 430px;
  display: flex;
  align-items: center;
}

.hero-copy {
  width: min(620px, 100%);
  padding: 54px 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.12;
  font-weight: 800;
}

.hero p {
  margin: 18px 0 28px;
  max-width: 550px;
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 4px;
  color: #fff;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.btn:hover {
  background: #083d72;
}

.btn.secondary {
  color: var(--brand);
  background: #e7f0f9;
}

.btn.ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: transparent;
}

.btn.danger {
  background: var(--accent);
}

.btn.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.section {
  padding: 54px 0;
}

.section.alt {
  background: var(--soft);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  color: var(--brand-2);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.card,
.news-row,
.admin-panel,
.form-panel,
.lesson-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(19, 58, 103, 0.04);
}

.course-card {
  overflow: hidden;
}

.thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #dbe8f6, #f5f8fc);
  position: relative;
  overflow: hidden;
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./public/hero-youth-competition.png") center / cover no-repeat;
  opacity: 0.42;
}

.thumb::after {
  content: "课程视频";
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(11, 74, 134, 0.88);
  border-radius: 3px;
  font-size: 12px;
}

.card-body {
  padding: 18px;
}

.card h3,
.news-row h3,
.admin-panel h3,
.form-panel h3 {
  margin: 0 0 10px;
  color: #16233a;
  font-size: 19px;
  line-height: 1.4;
}

.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.summary {
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 16px;
}

.price {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.progress-line {
  height: 7px;
  background: #e8eef5;
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-line span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--ok);
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-row {
  padding: 18px;
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 18px;
  align-items: center;
}

.date-box {
  height: 76px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #edf4fb;
  border-radius: 4px;
  text-align: center;
}

.date-box strong {
  display: block;
  font-size: 26px;
}

.date-box span {
  font-size: 13px;
}

.sidebar {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}

.sidebar h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--brand-2);
}

.side-link {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: #2e3b50;
  line-height: 1.55;
}

.article {
  background: #fff;
  border-top: 4px solid var(--brand);
  padding: 32px;
}

.article h1 {
  margin: 0 0 16px;
  font-size: 32px;
  color: var(--brand-2);
  line-height: 1.35;
}

.article-content {
  color: #2a3447;
  line-height: 2;
  font-size: 16px;
  white-space: pre-line;
}

.contact-shell {
  display: grid;
  gap: 24px;
}

.contact-image-frame {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4fa;
  box-shadow: var(--shadow);
}

.contact-image-frame img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: block;
  object-fit: cover;
}

.empty-image {
  display: grid;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(11, 74, 134, 0.12), rgba(181, 29, 42, 0.05)),
    #eef4fa;
}

.empty-image strong {
  display: block;
  color: var(--brand-2);
  font-size: 22px;
}

.empty-image p {
  margin: 10px 0 0;
  color: var(--muted);
}

.contact-info {
  border-top-color: var(--accent);
}

.admin-image-preview {
  width: min(360px, 100%);
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
}

.admin-image-preview img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.course-hero {
  padding: 30px;
  background: linear-gradient(120deg, #f6f9fd, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  margin-top: 12px;
}

.status {
  display: inline-flex;
  min-height: 26px;
  padding: 0 9px;
  align-items: center;
  border-radius: 3px;
  font-size: 12px;
  color: var(--brand);
  background: #e9f2fb;
}

.status.done {
  color: var(--ok);
  background: #e8f6ee;
}

.video-box {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0a315a, #0d5e98);
  border-radius: 6px;
  margin-bottom: 22px;
}

.video-box .play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.36);
  font-size: 32px;
}

.form-panel,
.admin-panel {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #31415a;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: #2f4058;
  background: #fff;
  border-radius: 4px;
}

.tabs button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
}

.admin-menu {
  display: grid;
  gap: 8px;
  align-content: start;
}

.admin-menu button {
  min-height: 40px;
  color: #26364e;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: left;
  padding: 0 12px;
}

.admin-menu button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: #26364e;
  background: #f1f5fa;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.footer {
  background: #0a2e52;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 40px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  padding: 34px 0;
  line-height: 1.8;
  font-size: 14px;
}

.footer h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 18px;
}

.footer a {
  display: block;
  color: rgba(255, 255, 255, 0.78);
}

.footer a.inline-link {
  display: inline;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(17, 31, 49, 0.94);
  padding: 10px 16px;
  border-radius: 4px;
  z-index: 30;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .nav-inner,
  .topbar-inner,
  .section-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .grid,
  .two-col,
  .admin-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .news-row {
    grid-template-columns: 1fr;
  }

  .hero,
  .hero .container {
    min-height: 360px;
  }

  .article {
    padding: 22px;
  }

  .footer-inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .contact-image-frame {
    min-height: 300px;
  }

  .contact-image-frame img {
    min-height: 300px;
  }
}
