:root {
  --ink: #171716;
  --paper: #f7f1e6;
  --paper-soft: #fffaf0;
  --jade: #355f55;
  --jade-2: #6f8f82;
  --seal: #b43f2f;
  --gold: #c19a55;
  --line: rgba(23, 23, 22, 0.14);
  --shadow: 0 18px 50px rgba(23, 23, 22, 0.14);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper-soft);
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 84px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 250, 240, 0.28);
  color: #fffaf0;
  background: rgba(23, 23, 22, 0.26);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo,
.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
}

.brand-logo {
  display: block;
  object-fit: contain;
  background: #fffaf0;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: var(--seal);
  font-family: SimSun, "Noto Serif CJK SC", serif;
  font-size: 26px;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
  font-size: 15px;
}

.site-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-color: var(--gold);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 250, 240, 0.38);
  border-radius: 6px;
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.08);
}

.hero {
  position: relative;
  min-height: 94vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #10100f;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(12, 12, 11, 0.9) 0%, rgba(12, 12, 11, 0.64) 42%, rgba(12, 12, 11, 0.16) 100%),
    linear-gradient(0deg, rgba(12, 12, 11, 0.45), rgba(12, 12, 11, 0.04) 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(740px, calc(100% - 36px));
  margin-left: clamp(18px, 8vw, 112px);
  padding-top: 84px;
  color: #fffaf0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(40px, 7vw, 82px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 610px;
  margin: 24px 0 0;
  color: rgba(255, 250, 240, 0.82);
  font-size: 18px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fffaf0;
  background: var(--seal);
  border-color: rgba(255, 250, 240, 0.18);
}

.button.secondary {
  color: #fffaf0;
  background: rgba(255, 250, 240, 0.08);
  border-color: rgba(255, 250, 240, 0.34);
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 42px 0 0;
  padding: 0;
}

.hero-stats div {
  min-width: 104px;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
}

.hero-stats dt {
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-stats dd {
  margin: 3px 0 0;
  color: rgba(255, 250, 240, 0.72);
}

.section,
.intro-band,
.signup-section {
  padding: clamp(58px, 8vw, 104px) 0;
}

.section-inner {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.intro-band {
  background: var(--jade);
  color: #fffaf0;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: clamp(24px, 6vw, 72px);
  align-items: start;
}

.intro-grid h2,
.section-heading h2,
.signup-copy h2 {
  margin: 0;
  font-family: "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.2;
  letter-spacing: 0;
}

.intro-grid p:last-child,
.signup-copy p {
  margin: 0;
  color: rgba(255, 250, 240, 0.82);
  font-size: 18px;
  line-height: 1.9;
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.course-card,
.work-card,
.signup-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
  box-shadow: 0 1px 0 rgba(23, 23, 22, 0.03);
}

.course-card {
  min-height: 250px;
  padding: 24px;
}

.course-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border-radius: 6px;
  color: #fffaf0;
  background: var(--jade);
  font-family: SimSun, serif;
  font-size: 24px;
}

.course-card h3,
.work-card h3 {
  margin: 0;
  font-size: 20px;
}

.course-card p,
.work-meta,
.work-card p,
.form-note {
  color: rgba(23, 23, 22, 0.68);
  line-height: 1.75;
}

.works-section {
  background:
    linear-gradient(180deg, rgba(53, 95, 85, 0.08), rgba(180, 63, 47, 0.04)),
    var(--paper);
}

.teacher-section {
  background: #fffaf0;
}

.filter-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.filter-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: rgba(23, 23, 22, 0.72);
  background: transparent;
  cursor: pointer;
}

.filter-tab.active {
  color: #fffaf0;
  background: var(--ink);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  overflow: hidden;
}

.work-media {
  aspect-ratio: 4 / 5;
  background: #ece3d4;
}

.teacher-card .work-media {
  aspect-ratio: 3 / 4;
}

.work-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-body {
  padding: 18px;
}

.work-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
}

.signup-section {
  color: #fffaf0;
  background: var(--ink);
}

.signup-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(28px, 7vw, 84px);
  align-items: center;
}

.signup-copy h2 {
  margin-bottom: 18px;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.contact-strip a {
  padding: 10px 14px;
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 6px;
  color: #fffaf0;
}

.signup-form {
  padding: clamp(20px, 4vw, 34px);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.signup-form label {
  display: block;
  margin-bottom: 16px;
}

.signup-form span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.signup-form input,
.signup-form select,
.signup-form textarea {
  width: 100%;
  border: 1px solid rgba(23, 23, 22, 0.18);
  border-radius: 6px;
  padding: 12px 13px;
  background: #fffaf0;
  outline: none;
}

.signup-form input:focus,
.signup-form select:focus,
.signup-form textarea:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(53, 95, 85, 0.14);
}

.form-note {
  margin: 12px 0 0;
  font-size: 14px;
}

.form-note.success {
  color: #286b4a;
}

.form-note.error {
  color: #a83228;
}

.form-note.loading {
  color: rgba(23, 23, 22, 0.72);
}

.site-footer {
  padding: 28px 0;
  color: #fffaf0;
  background: #0e0e0d;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer p {
  margin: 8px 0 0;
  color: rgba(255, 250, 240, 0.62);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
  color: rgba(23, 23, 22, 0.68);
}

.admin-page {
  min-height: 100vh;
  background: var(--paper);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 48px);
  color: #fffaf0;
  background: var(--ink);
}

.admin-brand small {
  color: rgba(255, 250, 240, 0.72);
}

.is-hidden {
  display: none !important;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-login {
  width: min(520px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(38px, 7vw, 86px) 0;
}

.admin-login-card {
  display: grid;
  gap: 18px;
}

.admin-login-card label span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.admin-login-card input {
  width: 100%;
  border: 1px solid rgba(23, 23, 22, 0.18);
  border-radius: 6px;
  padding: 12px 13px;
  background: #fffaf0;
  outline: none;
}

.admin-main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 70px) 0;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.9fr);
  gap: 22px;
}

.admin-panel {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
}

.admin-panel-wide {
  grid-column: 1 / -1;
}

.admin-panel h1,
.admin-panel h2 {
  margin: 0;
  font-family: "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form label,
.admin-form .wide {
  display: block;
}

.admin-form .wide {
  grid-column: 1 / -1;
}

.admin-form span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.json-output {
  width: 100%;
  border: 1px solid rgba(23, 23, 22, 0.18);
  border-radius: 6px;
  padding: 12px 13px;
  background: #fffaf0;
  outline: none;
}

.json-output {
  min-height: 310px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.55;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.admin-actions.compact {
  margin-top: 0;
}

.admin-actions .button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: rgba(23, 23, 22, 0.24);
}

.admin-note {
  color: rgba(23, 23, 22, 0.66);
  line-height: 1.75;
}

.appointment-list {
  overflow-x: auto;
}

.appointment-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.appointment-table th,
.appointment-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.appointment-table th {
  color: rgba(23, 23, 22, 0.72);
  background: rgba(53, 95, 85, 0.07);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255, 250, 240, 0.84);
}

@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    inset: 84px 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 18px 18px;
    background: rgba(23, 23, 22, 0.96);
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .site-nav a {
    padding: 15px 4px;
    border-bottom: 1px solid rgba(255, 250, 240, 0.14);
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero {
    min-height: 92vh;
  }

  .hero-content {
    margin-inline: 18px;
  }

  .hero-shade {
    background: linear-gradient(90deg, rgba(12, 12, 11, 0.88), rgba(12, 12, 11, 0.52));
  }

  .intro-grid,
  .signup-grid {
    grid-template-columns: 1fr;
  }

  .course-grid,
  .works-grid,
  .teacher-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading.split,
  .footer-grid,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    height: 72px;
    padding-inline: 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo,
  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .brand small {
    display: none;
  }

  .brand {
    flex: 1 1 auto;
  }

  .nav-toggle {
    flex: 0 0 42px;
  }

  .site-nav {
    inset: 72px 0 auto;
  }

  .hero-content {
    padding-top: 72px;
    width: min(520px, calc(100vw - 36px));
    max-width: min(520px, calc(100vw - 36px));
    margin-left: 18px;
    margin-right: auto;
  }

  .hero h1 {
    font-size: 30px;
    line-height: 1.2;
  }

  .hero-copy {
    font-size: 15px;
    line-height: 1.8;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }

  .hero-stats div {
    min-width: 0;
    padding-left: 10px;
  }

  .hero-stats dt {
    font-size: 24px;
  }

  .hero-stats dd {
    font-size: 13px;
  }

  .course-grid,
  .works-grid,
  .teacher-grid {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .filter-tab {
    flex: 1 0 auto;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }
}
