/* ============ 课程详情 ============ */
.course-hero {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-2);
  padding: 44px 0 52px;
}
.course-hero .inner {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: start;
}
.ch-title { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: .05em; margin-bottom: 14px; }
.ch-sub { font-family: var(--serif); font-size: 17px; color: var(--ink-2); line-height: 1.95; margin-bottom: 22px; }
.ch-facts { display: flex; gap: 26px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
.ch-facts b { color: var(--ink); font-family: var(--serif); font-weight: 600; }

.buy-card {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  position: sticky; top: 92px;
}
.buy-card .cover { aspect-ratio: 16/10; background: linear-gradient(150deg,#DED5C2,#B9AC91); position: relative; }
.buy-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.buy-card .body { padding: 22px; }
.buy-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.buy-price .now { font-family: var(--serif); font-size: 38px; color: var(--cinnabar); font-weight: 600; line-height: 1; }
.buy-price .now small { font-size: 18px; }
.buy-price .was { text-decoration: line-through; color: var(--ink-4); font-size: 15px; }
.buy-note { font-size: 13px; color: var(--ink-4); margin-bottom: 18px; }
.buy-card .btn { width: 100%; }
.buy-perks { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.buy-perks li {
  list-style: none; font-size: 13.5px; color: var(--ink-3);
  padding: 5px 0 5px 22px; position: relative;
}
.buy-perks li::before {
  content: ''; position: absolute; left: 4px; top: 12px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--cinnabar); opacity: .6;
}
.buy-perks { padding-left: 0; margin: 20px 0 0; }


/* hero 左栏:简介与「你将获得/适合谁学」——右侧购买卡很高,左边不能空着 */
.ch-summary {
  font-size: 15.5px; line-height: 2.05; color: var(--ink-2);
  margin: 22px 0 0; max-width: 640px;
  padding-left: 16px; border-left: 2px solid rgba(168,56,44,.3);
}
.ch-block { margin-top: 30px; }
.ch-block h2 {
  font-size: 17px; letter-spacing: .12em; margin: 0 0 14px;
  color: var(--ink); position: relative; padding-bottom: 9px;
}
.ch-block h2::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 38px; height: 2px; background: var(--cinnabar); opacity: .75;
}
.ch-gains {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px 28px; max-width: 660px;
}
.ch-gains li {
  position: relative; padding-left: 22px;
  font-size: 14.5px; line-height: 1.95; color: var(--ink-2);
}
.ch-gains li::before {
  content: ''; position: absolute; left: 2px; top: 9px;
  width: 11px; height: 11px; border: 1px solid var(--cinnabar);
  border-radius: 50%; opacity: .65;
}
.ch-gains li::after {
  content: ''; position: absolute; left: 5.5px; top: 12.5px;
  width: 4px; height: 4px; background: var(--cinnabar); border-radius: 50%;
}
@media (max-width: 720px) {
  .ch-gains { grid-template-columns: 1fr; }
}

/* 详情主体 */
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 48px; padding: 56px 0 80px; align-items: start; }
.detail-main h2 {
  font-size: 23px; letter-spacing: .1em; padding-bottom: 12px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line); position: relative;
}
.detail-main h2::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 54px; height: 2px; background: var(--cinnabar);
}
.detail-main .prose { color: var(--ink-2); }
.detail-main .prose h3 { margin: 28px 0 12px; font-size: 18px; }
.detail-main .prose ul { padding-left: 20px; }
.detail-main .prose li { margin-bottom: 7px; }
.detail-block { margin-bottom: 52px; }

.gain-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; }
.gain-list li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.9; }
.gain-list li::before {
  content: '';
  position: absolute; left: 0; top: 10px; width: 13px; height: 13px;
  border: 1px solid var(--cinnabar); border-radius: 50%; opacity: .7;
}
.gain-list li::after {
  content: ''; position: absolute; left: 4.5px; top: 14.5px;
  width: 4px; height: 4px; background: var(--cinnabar); border-radius: 50%;
}

/* 课时目录 */
.toc { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper-card); }
.toc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  transition: background .2s;
}
.toc-item:last-child { border-bottom: 0; }
.toc-item:hover { background: rgba(168,56,44,.03); }
.toc-item .no {
  font-family: var(--serif); font-size: 14px; color: var(--ink-4);
  width: 26px; flex: none; text-align: center;
}
.toc-item .tt { flex: 1; min-width: 0; }
.toc-item .tt b { display: block; font-weight: 500; font-size: 15.5px; color: var(--ink); }
.toc-item .tt span { font-size: 13px; color: var(--ink-4); }
.toc-item .dur { font-size: 13px; color: var(--ink-4); font-family: var(--mono); flex: none; }
.toc-item.locked .tt b { color: var(--ink-3); }
.toc-item .lock { width: 14px; height: 14px; flex: none; opacity: .35; }

/* ============ 播放页 ============ */
.player-page { background: #14120F; min-height: 100vh; color: #D8D2C6; }
.player-top {
  height: 58px; display: flex; align-items: center; gap: 18px;
  padding: 0 22px; border-bottom: 1px solid rgba(244,239,228,.1);
  background: #191713;
}
.player-top a { color: rgba(244,239,228,.72); font-size: 14px; }
.player-top a:hover { color: var(--gold); }
.player-top .ptitle {
  font-family: var(--serif); font-size: 16px; color: #EDE6D8;
  letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-layout { display: grid; grid-template-columns: 1fr 340px; min-height: calc(100vh - 58px); }
.player-stage { background: #000; display: flex; flex-direction: column; }
.player-stage video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.lesson-info { padding: 24px 28px; background: #191713; flex: 1; }
.lesson-info h1 { font-size: 21px; color: #EDE6D8; margin-bottom: 10px; letter-spacing: .04em; }
.lesson-info p { color: rgba(216,210,198,.65); font-size: 14.5px; }

.playlist { background: #1E1B16; border-left: 1px solid rgba(244,239,228,.08); overflow-y: auto; max-height: calc(100vh - 58px); }
.playlist-head {
  padding: 18px 20px; border-bottom: 1px solid rgba(244,239,228,.08);
  font-family: var(--serif); letter-spacing: .18em; font-size: 14px; color: #C9C2B2;
  position: sticky; top: 0; background: #1E1B16; z-index: 2;
}
.pl-item {
  display: flex; gap: 12px; padding: 13px 20px;
  border-bottom: 1px solid rgba(244,239,228,.05);
  color: rgba(216,210,198,.8); font-size: 14.5px; transition: background .2s;
}
.pl-item:hover { background: rgba(244,239,228,.05); color: #EDE6D8; }
.pl-item.on { background: rgba(168,56,44,.16); color: #F0E9DA; box-shadow: inset 3px 0 0 var(--cinnabar); }
.pl-item .no { font-family: var(--serif); color: rgba(216,210,198,.4); width: 22px; flex: none; }
.pl-item .t { flex: 1; min-width: 0; }
.pl-item .t b { display: block; font-weight: 400; line-height: 1.6; }
.pl-item .t span { font-size: 12px; color: rgba(216,210,198,.45); font-family: var(--mono); }
.pl-item.locked { opacity: .45; cursor: not-allowed; }
.pl-progress { height: 2px; background: var(--cinnabar); margin-top: 6px; border-radius: 1px; }

.paywall {
  aspect-ratio: 16/9; display: grid; place-items: center; text-align: center;
  background: radial-gradient(60% 60% at 50% 40%, #241F19, #100E0B);
  padding: 30px;
}
.paywall h2 { color: #EDE6D8; font-size: 22px; margin-bottom: 10px; }
.paywall p { color: rgba(216,210,198,.6); margin-bottom: 22px; }

/* ============ 我的 / 订单 ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.tabs a {
  padding: 12px 22px; font-family: var(--serif); font-size: 15.5px;
  color: var(--ink-3); letter-spacing: .1em; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--ink); border-bottom-color: var(--cinnabar); }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--paper-card); }
.table th {
  text-align: left; font-family: var(--serif); font-weight: 600; font-size: 14px;
  color: var(--ink-2); padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: var(--paper-2); white-space: nowrap; letter-spacing: .06em;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(168,56,44,.025); }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }

.pill { display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 2px; letter-spacing: .04em; }
.pill-paid    { background: rgba(92,107,76,.14);  color: #46553A; }
.pill-pending { background: rgba(176,141,87,.16); color: #8A6A32; }
.pill-closed  { background: rgba(28,26,23,.08);   color: var(--ink-3); }
.pill-refund  { background: rgba(168,56,44,.12);  color: var(--cinnabar-d); }

.my-course {
  display: grid; grid-template-columns: 190px 1fr auto; gap: 22px; align-items: center;
  padding: 20px; background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 16px;
}
.my-course .cv { aspect-ratio: 16/10; border-radius: 2px; overflow: hidden; background: linear-gradient(150deg,#DED5C2,#B9AC91); }
.my-course .cv img { width: 100%; height: 100%; object-fit: cover; }
.my-course h3 { font-size: 18px; margin-bottom: 6px; }
.bar { height: 5px; background: var(--paper-3); border-radius: 3px; overflow: hidden; margin-top: 10px; max-width: 320px; }
.bar i { display: block; height: 100%; background: var(--cinnabar); opacity: .75; }

/* ============ 后台 ============ */
.admin { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.admin-side { background: #1C1A17; color: rgba(244,239,228,.66); padding: 22px 0; }
.admin-side .brand { padding: 0 22px 22px; border-bottom: 1px solid rgba(244,239,228,.1); margin-bottom: 16px; }
.admin-side .brand .name { color: var(--paper); font-size: 18px; }
.admin-side .brand .name small { color: rgba(244,239,228,.4); }
.admin-side nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 22px;
  color: rgba(244,239,228,.62); font-size: 14.5px; letter-spacing: .04em;
}
.admin-side nav a:hover { background: rgba(244,239,228,.06); color: var(--paper); }
.admin-side nav a.on { background: rgba(168,56,44,.22); color: #F3ECDD; box-shadow: inset 3px 0 0 var(--cinnabar); }
.admin-side .grp {
  padding: 16px 22px 7px; font-size: 11.5px; letter-spacing: .22em;
  color: rgba(244,239,228,.3);
}
.admin-main { background: var(--paper); padding: 30px 34px 70px; min-width: 0; }
.admin-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-head h1 { font-size: 25px; margin: 0; }
.admin-head .sp { margin-left: auto; display: flex; gap: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.stat .k { font-size: 12.5px; color: var(--ink-4); letter-spacing: .1em; margin-bottom: 6px; }
.stat .v { font-family: var(--serif); font-size: 28px; color: var(--ink); font-weight: 600; line-height: 1.2; }
.stat .v small { font-size: 15px; color: var(--ink-3); }
.stat .d { font-size: 12.5px; color: var(--ink-4); margin-top: 5px; }
.stat.accent .v { color: var(--cinnabar); }

.panel {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 24px;
}
.panel-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: .08em; }
.panel-head .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 20px; }
.panel .table { border: 0; }
.panel > .table-wrap { border: 0; border-radius: 0; }

.chart { width: 100%; height: 240px; display: block; }
.chart-legend { display: flex; gap: 20px; font-size: 12.5px; color: var(--ink-3); padding: 0 20px 14px; }
.chart-legend i { display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.form-grid .full { grid-column: 1 / -1; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 180px; }

.upload-zone {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 34px; text-align: center; background: rgba(255,255,255,.4);
  transition: border-color .2s, background .2s; cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--cinnabar); background: rgba(168,56,44,.04); }
.upload-zone p { margin: 0; color: var(--ink-3); font-size: 14.5px; }

.vstatus { font-size: 12.5px; }
.vstatus.ready { color: var(--pine); }
.vstatus.processing { color: var(--gold); }
.vstatus.failed { color: var(--cinnabar); }
.vstatus.pending { color: var(--ink-4); }

.mini-bar { height: 4px; background: var(--paper-3); border-radius: 2px; overflow: hidden; width: 92px; margin-top: 4px; }
.mini-bar i { display: block; height: 100%; background: var(--gold); }

.pager { display: flex; gap: 6px; justify-content: center; padding: 22px 0; }
.pager a, .pager span {
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 2px;
  font-size: 14px; color: var(--ink-2); background: var(--paper-card);
}
.pager .on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager .off { opacity: .4; }

.row-actions { display: flex; gap: 8px; white-space: nowrap; }
.row-actions a, .row-actions button {
  font-size: 13px; color: var(--azurite); background: none; border: 0;
  cursor: pointer; padding: 2px 0; font-family: var(--sans);
}
.row-actions .danger { color: var(--cinnabar); }

@media (max-width: 1080px) {
  .detail-layout { grid-template-columns: 1fr; }
  .buy-card { position: static; max-width: 420px; }
  .course-hero .inner { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .player-layout { grid-template-columns: 1fr; }
  .playlist { max-height: none; border-left: 0; border-top: 1px solid rgba(244,239,228,.08); }
  .admin { grid-template-columns: 1fr; }
  .admin-side { display: flex; overflow-x: auto; padding: 0; align-items: center; }
  .admin-side .brand { display: none; }
  .admin-side .grp { display: none; }
  .admin-side nav { display: flex; }
  .admin-side nav a { white-space: nowrap; padding: 14px 16px; }
  .admin-main { padding: 20px 16px 60px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .my-course { grid-template-columns: 120px 1fr; }
  .my-course > :last-child { grid-column: 1 / -1; }
  .gain-list { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ============ 窄屏吸底购买条 ============ */
.buy-bar { display: none; }

@media (max-width: 1080px) {
  .buy-bar {
    display: flex; align-items: center; gap: 14px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 11px 18px calc(11px + env(safe-area-inset-bottom, 0px));
    background: rgba(251,248,241,.97);
    backdrop-filter: saturate(160%) blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px -12px rgba(28,26,23,.3);
  }
  .buy-bar .bb-price { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
  .buy-bar .bb-price b {
    font-family: var(--serif); font-size: 26px; color: var(--cinnabar);
    font-weight: 600; line-height: 1;
  }
  .buy-bar .bb-price b small { font-size: 15px; }
  .buy-bar .bb-price .was { text-decoration: line-through; color: var(--ink-4); font-size: 13px; }
  .buy-bar .bb-price span { font-size: 12.5px; color: var(--ink-4); }
  .buy-bar .btn { padding: 11px 26px; flex: none; }
  .buy-bar form { margin: 0; }
  /* 给页脚让出高度,别让吸底条盖住最后一行 */
  .site-foot { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
