/* 织梦课程 —— 全站样式。纯手写 CSS，不依赖任何 CDN 与构建工具。 */

:root {
  --brand-50: #eef4ff;
  --brand-100: #dbe6fe;
  --brand-200: #bfd3fe;
  --brand-500: #3b68f6;
  --brand-600: #2549eb;
  --brand-700: #1d37d8;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;
  --radius: 16px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink-900);
  font-family: system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

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

::selection {
  background: var(--brand-100);
  color: var(--brand-700);
}

img {
  max-width: 100%;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.35;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 48px 0;
}

.section-tight {
  padding: 32px 0 48px;
}

.muted {
  color: var(--ink-500);
}

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

.center {
  text-align: center;
}

.error-text {
  margin-top: 12px;
  color: #dc2626;
  font-size: 14px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-600);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-700);
}

.btn-secondary {
  background: #fff;
  border-color: var(--ink-300);
  color: var(--ink-900);
}

.btn-secondary:hover {
  background: var(--ink-100);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--ink-100);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* ---------- 卡片 ---------- */

.card {
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 24px;
}

/* ---------- 页头 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-100);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--brand-600);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.main-nav {
  display: none;
  gap: 4px;
  margin-left: 12px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-700);
}

.main-nav a:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-user {
  padding: 0 4px;
  font-size: 14px;
  color: var(--ink-500);
}

.nav-toggle {
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--ink-300);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
}

.mobile-menu {
  border-top: 1px solid var(--ink-100);
  background: #fff;
  padding: 8px 0 16px;
}

.mobile-menu a,
.mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 4px;
  border: none;
  background: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink-700);
  border-bottom: 1px solid var(--ink-100);
  cursor: pointer;
}

@media (min-width: 900px) {
  .main-nav,
  .header-actions {
    display: flex;
  }

  .nav-toggle,
  .mobile-menu {
    display: none !important;
  }
}

/* ---------- 首页 ---------- */

.hero {
  border-bottom: 1px solid var(--ink-100);
  background: linear-gradient(to bottom, var(--brand-50), #fff);
  padding: 56px 0;
}

.hero-inner {
  max-width: 720px;
}

.tagline {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-700);
}

.hero h1 {
  margin-top: 20px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-desc {
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-700);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 460px;
  margin-top: 36px;
}

.hero-stats dt {
  font-size: 12px;
  color: var(--ink-500);
}

.hero-stats dd {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 44px;
  }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2,
.section > .container > h2 {
  font-size: 22px;
  font-weight: 700;
}

.link-more {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-600);
}

.band {
  border-top: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  background: rgba(241, 245, 249, 0.5);
}

/* ---------- 栅格 ---------- */

.grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3,
.grid-4 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- 课程卡片 ---------- */

.course-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, transform 0.15s;
}

.course-card:hover {
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.25);
  transform: translateY(-2px);
}

.course-cover {
  position: relative;
  display: grid;
  place-items: center;
  height: 128px;
  font-size: 40px;
}

.course-cover .cat {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
}

.course-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.course-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card:hover .course-title {
  color: var(--brand-600);
}

.course-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-meta {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-500);
}

.course-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}

.price {
  color: var(--brand-600);
  font-weight: 700;
  font-size: 20px;
}

.price-unit {
  font-size: 14px;
  font-weight: 500;
}

.price-old {
  margin-left: 6px;
  font-size: 12px;
  color: var(--ink-300);
  text-decoration: line-through;
}

.rating {
  color: #d97706;
  font-weight: 500;
}

/* ---------- 筛选 ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.filters a {
  padding: 8px 16px;
  border: 1px solid var(--ink-300);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
}

.filters a:hover {
  background: var(--ink-100);
}

.filters a.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

/* ---------- 课程详情 ---------- */

.course-hero {
  padding: 40px 0;
  color: #fff;
}

.course-hero .pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 500;
}

.course-hero h1 {
  max-width: 760px;
  margin-top: 16px;
  font-size: 26px;
  font-weight: 700;
}

.course-hero .sub {
  max-width: 640px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.course-hero .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 640px) {
  .course-hero h1 {
    font-size: 36px;
  }
}

.detail-layout {
  display: grid;
  gap: 32px;
  padding: 40px 0;
}

@media (min-width: 960px) {
  .detail-layout {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }

  .detail-side {
    position: sticky;
    top: 88px;
  }
}

.stack > * + * {
  margin-top: 24px;
}

.block-title {
  font-size: 18px;
  font-weight: 700;
}

.note-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ink-100);
}

.check-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  list-style: none;
}

@media (min-width: 640px) {
  .check-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.check-list li {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-700);
}

.check-list .tick {
  color: var(--brand-600);
}

.chapter {
  padding: 16px 0;
  border-top: 1px solid var(--ink-100);
}

.chapter:first-child {
  border-top: none;
}

.chapter h3 {
  font-size: 15px;
  font-weight: 600;
}

.lesson-list {
  margin-top: 8px;
  list-style: none;
}

.lesson-list li {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
  color: var(--ink-700);
}

.lesson-list .idx {
  width: 24px;
  flex-shrink: 0;
  color: var(--ink-300);
}

.teacher {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.teacher-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 18px;
  font-weight: 700;
}

.buy-box .price {
  font-size: 30px;
}

.spec-list {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-100);
  font-size: 14px;
}

.spec-list div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.spec-list dt {
  color: var(--ink-500);
}

.mobile-buy-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--ink-100);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.mobile-buy-bar .btn {
  flex: 1;
}

@media (min-width: 960px) {
  .mobile-buy-bar {
    display: none;
  }
}

.has-buy-bar {
  padding-bottom: 88px;
}

@media (min-width: 960px) {
  .has-buy-bar {
    padding-bottom: 0;
  }
}

/* ---------- 表单 ---------- */

.auth-wrap {
  padding: 40px 0 64px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 28px;
}

.field-group + .field-group {
  margin-top: 16px;
}

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.field {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--ink-300);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-100);
}

.agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-500);
}

.agree input {
  margin-top: 4px;
}

.link {
  color: var(--brand-600);
}

.link:hover {
  text-decoration: underline;
}

/* ---------- 订单与收银台 ---------- */

.checkout-layout {
  display: grid;
  gap: 24px;
  padding: 32px 0 56px;
}

@media (min-width: 960px) {
  .checkout-layout {
    grid-template-columns: 1fr 380px;
    align-items: start;
  }

  .checkout-side {
    position: sticky;
    top: 88px;
  }
}

.order-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.order-line dt {
  color: var(--ink-500);
}

.order-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
  font-size: 16px;
}

.order-total .price {
  font-size: 22px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.course-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 14px;
  font-size: 26px;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 2px solid var(--brand-500);
  border-radius: 12px;
  background: var(--brand-50);
}

.pay-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #07c160;
  color: #fff;
  font-size: 18px;
}

.pay-note {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--ink-100);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-500);
}

.pay-done {
  padding: 32px 24px;
  text-align: center;
}

.pay-done .tick-circle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 26px;
}

.status-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: #fef3c7;
  color: #b45309;
}

.status-paid {
  background: #dcfce7;
  color: #15803d;
}

.status-closed {
  background: var(--ink-100);
  color: var(--ink-500);
}

.order-item {
  padding: 16px;
}

.order-item + .order-item {
  margin-top: 16px;
}

.order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-100);
}

.order-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.order-main .grow {
  flex: 1;
  min-width: 160px;
}

.empty-state {
  margin-top: 32px;
  padding: 48px 24px;
  text-align: center;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head h1 {
  font-size: 24px;
  font-weight: 700;
}

.my-course-cover {
  display: grid;
  place-items: center;
  height: 96px;
  font-size: 32px;
}

/* ---------- 文档页 ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0 64px;
}

.doc h1 {
  font-size: 26px;
  font-weight: 700;
}

.doc h2 {
  margin-top: 32px;
  font-size: 18px;
  font-weight: 600;
}

.doc h3 {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
}

.doc p,
.doc li {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-700);
}

.doc ul,
.doc ol {
  padding-left: 20px;
}

.doc ul {
  list-style: disc;
}

.doc ol {
  list-style: decimal;
}

/* ---------- 步骤与评价 ---------- */

.step-no {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-600);
}

.icon-lg {
  font-size: 24px;
}

.quote {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-700);
}

.quote-by {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
  font-size: 12px;
  color: var(--ink-500);
}

figure {
  margin: 0;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--ink-100);
  background: rgba(241, 245, 249, 0.6);
  padding: 40px 0;
}

.footer-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-grid h3 {
  font-size: 14px;
  font-weight: 600;
}

.footer-grid ul {
  margin-top: 12px;
  list-style: none;
  font-size: 14px;
  color: var(--ink-500);
}

.footer-grid li {
  padding: 4px 0;
}

.footer-grid a:hover {
  color: var(--brand-600);
}

.footer-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 15px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(203, 213, 225, 0.6);
  font-size: 12px;
  color: var(--ink-500);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
