/* ===========================================================
   前台样式 v2 —— 少线、多留白、柔和分层
   =========================================================== */

:root {
  --paper: #FBFAF7;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #56514A;
  --ink-3: #8E887E;
  --line: #EFEBE3;
  --brand: #2F6DB5;
  --brand-ink: #1F4E85;
  --brand-soft: #EAF1FA;
  --accent: #C9502F;
  --soft: #F3F0E8;
  --shadow-sm: 0 1px 2px rgba(28, 25, 20, .045);
  --shadow-md: 0 2px 6px rgba(28, 25, 20, .05), 0 14px 30px -18px rgba(28, 25, 20, .16);
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 250, 247, .86);
  backdrop-filter: saturate(150%) blur(10px);
}
.site-header-inner { height: 68px; display: flex; align-items: center; gap: 22px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14.5px;
  font-weight: 600;
  flex: 0 0 auto;
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: .09em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 4px;
}

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  transition: background .16s, color .16s;
}
.site-nav a:hover { background: var(--soft); color: var(--ink); }
.site-nav a.on { color: var(--ink); font-weight: 500; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn-login {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: background .16s, transform .16s;
}
.btn-login:hover { background: #000; color: #fff; transform: translateY(-1px); }

.hamburger {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.hamburger:hover { background: var(--soft); }

/* ---------- 用户菜单 ---------- */
.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background .16s;
}
.user-btn:hover { background: var(--soft); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  flex: 0 0 auto;
}
.user-name { font-size: 13.5px; font-weight: 500; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { color: var(--ink-3); display: inline-flex; }
.user-drop {
  position: absolute;
  right: 0; top: calc(100% + 10px);
  min-width: 200px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 70;
}
.user-menu.open .user-drop { display: block; }
.user-drop .u-head { padding: 9px 11px 11px; }
.user-drop .u-name { font-size: 14px; font-weight: 500; }
.user-drop .u-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.user-drop a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
}
.user-drop a:hover { background: var(--soft); color: var(--ink); }
.user-drop a.danger { color: var(--accent); }
.user-drop a.danger:hover { background: #FBEDE8; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(26, 24, 20, .34);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 60;
}
.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 272px;
  max-width: 84vw;
  background: var(--surface);
  transform: translateX(-102%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  z-index: 61;
  display: flex;
  flex-direction: column;
  padding: 20px 0 28px;
  border-radius: 0 18px 18px 0;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
body.drawer-open { overflow: hidden; }

.drawer-head { padding: 0 20px 18px; }
.drawer-nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
}
.drawer-nav a:hover { background: var(--soft); }
.drawer-foot { margin-top: auto; padding: 16px 20px 0; }

/* ---------- 首屏 ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 64px;
  align-items: center;
}
.hero-grid.solo { grid-template-columns: minmax(0, 1fr); }
.hero-main { min-width: 0; }

.feature {
  display: block;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: var(--ink);
  transition: transform .22s cubic-bezier(.32,.72,0,1), box-shadow .22s;
}
.feature:hover { transform: translateY(-4px); color: var(--ink); }
.feature-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.feature-cover .wm {
  font-size: 68px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #DED5C1;
}
.feature-cover .tag {
  position: absolute;
  left: 14px; bottom: 14px;
  background: rgba(255, 255, 255, .95);
  color: var(--ink-2);
  font-size: 11px;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.feature-cover .tag .ico { width: 13px; height: 13px; color: var(--ink-3); }
.feature-body { padding: 18px 20px 22px; }
.feature-title { font-size: 17px; font-weight: 500; line-height: 1.45; margin-top: 9px; letter-spacing: -0.01em; }
.feature-meta {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.feature-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #DBD5C8; }
.feature-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brand);
}
.hero { padding: 76px 0 58px; }
.hero .eyebrow { color: var(--ink-3); }
.hero h1 {
  font-size: 46px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 16px 0 0;
  font-weight: 600;
  max-width: 780px;
}
.hero-lead {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 560px;
}
.hero-note {
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.75;
  max-width: 560px;
}
.hero-meta {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.hero-meta b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #D9D3C7; }

/* ---------- 区块 ---------- */
.section { padding: 34px 0 52px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.section-head .sub { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.section-link {
  font-size: 13.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background .16s;
}
.section-link:hover { background: var(--soft); color: var(--ink); }

/* ---------- 分类筛选 ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  height: 34px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background .16s, color .16s;
}
.chip:hover { background: #EBE6DA; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; }
.chip .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.on .n { color: rgba(255, 255, 255, .62); }

/* ---------- 课件卡 ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 18px;
}
.course-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.32,.72,0,1), box-shadow .2s;
}
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.course-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: background .2s;
}
.course-card:hover .course-cover { background: #EDE8DC; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-cover .wm {
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #DED5C1;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.course-card:hover .course-cover .wm { color: #D0C4A8; }
.course-cover .tag {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(255, 255, 255, .95);
  color: var(--ink-2);
  font-size: 11px;
  height: 23px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.course-cover .tag .ico { width: 13px; height: 13px; color: var(--ink-3); }
.course-body { padding: 14px 16px 17px; }
.course-title {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}
.course-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.course-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #DBD5C8; }

/* ---------- 公告 ---------- */
.notice-list { display: grid; gap: 10px; }
.notice {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 18px;
  align-items: start;
}
.notice-date {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.notice-title { font-size: 14.5px; font-weight: 500; }
.notice-body { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.7; }

/* ---------- 用法说明 ---------- */
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step + .step { margin-top: 18px; }
.step-num {
  width: 24px; height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink-2);
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.step-title { font-size: 14.5px; font-weight: 500; }
.step-desc { font-size: 13px; color: var(--ink-3); line-height: 1.7; margin-top: 4px; }

/* ---------- 页脚 ---------- */
.site-footer { padding: 18px 0 56px; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.footer-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.8; max-width: 480px; margin-top: 12px; }
.footer-meta { font-size: 12px; color: var(--ink-3); text-align: right; line-height: 1.9; }

/* ---------- 播放页 ---------- */
body.player-page { background: #F2F0EA; }
.player-bar {
  height: 56px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shadow-sm);
}
.player-bar .title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-bar .meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.player-stage {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  display: flex;
  background: #EDEBE4;
}
.player-frame { flex: 1; border: 0; width: 100%; height: 100%; background: #fff; display: block; }
.player-video-wrap { flex: 1; display: grid; place-items: center; padding: 24px; }
.player-video-wrap video { max-height: 100%; background: #000; border-radius: 10px; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 48px 16px 72px; }
.auth-card { width: 100%; max-width: 384px; }
.auth-card .card-pad { padding: 30px; }
.auth-title { font-size: 21px; letter-spacing: -0.02em; }
.auth-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.7; }

/* ---------- 我的 ---------- */
.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-size: 19px; font-weight: 600;
  flex: 0 0 auto;
}
.me-head { display: flex; align-items: center; gap: 16px; padding: 40px 0 30px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .feature { max-width: 420px; }
}

@media (max-width: 900px) {
  .hero { padding: 46px 0 34px; }
  .hero h1 { font-size: 35px; }
  .howto { gap: 32px; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hamburger { display: inline-flex; }
  .nav-actions .btn-login { display: none; }
  .nav-actions .user-menu { display: none; }
  .site-header-inner { height: 60px; gap: 12px; }
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 27px; line-height: 1.32; letter-spacing: -0.02em; }
  .hero-lead { font-size: 15px; margin-top: 16px; }
  .hero-note { font-size: 12.5px; margin-top: 18px; }
  .hero-meta { margin-top: 24px; font-size: 12.5px; }
  .section { padding: 22px 0 34px; }
  .section-head { margin-bottom: 16px; }
  .section-head h2 { font-size: 17px; }
  .course-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .course-cover .wm { font-size: 34px; }
  .course-body { padding: 11px 12px 13px; }
  .course-title { font-size: 13.5px; min-height: 2.9em; }
  .course-meta { margin-top: 7px; font-size: 11.5px; }
  .notice { grid-template-columns: 1fr; gap: 4px; padding: 14px 15px; }
  .notice-date { padding-top: 0; }
  .howto { grid-template-columns: 1fr; }
  .player-bar { height: 52px; }
  .player-stage { height: calc(100vh - 52px); height: calc(100dvh - 52px); }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
}

@media (max-width: 380px) {
  .course-grid { grid-template-columns: 1fr; }
}
