/* ==================================================================
   爸妈课堂 · 样式
   学生/家长端：.pc-*     运营端：.pca-*

   ★ 两条纪律（这个项目踩过的坑）
   ----------------------------
   1. **全部限定在 `.pc-page` / `.pca-page` 内**，不写裸选择器 ——
      否则会污染主系统其它页面（主站有大量 .btn / .card 之类的通用类名）。
   2. **优先用字面色值，慎用「惰性引用」的 CSS 变量**。
      踩过的坑：`.gzh-scope` 上定义
          --g-primary-light: var(--primary-light, #dbeafe);
      Chromium 在**伪元素**（如 ::file-selector-button）上解析会拿到空串，
      导致整条声明失效（表现为「按钮样式没了」）。
      所以本文件不用 var()，全部写字面色值。
   3. `.pc-note` / `.pc-card` 若用 <button> 必须清掉默认样式。
   ================================================================== */

/* ================= 通用层（限定作用域） ================= */
.pc-page, .pca-page {
  padding: 18px 20px 40px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.6;
}
.pc-page *, .pca-page * { box-sizing: border-box; }

/* ================= toast ================= */
.pc-toast, .pca-toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  z-index: 9999; max-width: 80vw;
  padding: 10px 18px; border-radius: 8px;
  background: #1f2937; color: #fff; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
.pc-toast.err, .pca-toast.err { background: #dc2626; }

/* ================= 学生端：头部 ================= */
.pc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.pc-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.pc-sub { margin: 0; color: #6b7280; font-size: 13px; }
.pc-wallet-mini {
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: #fef3c7; color: #92400e; font-size: 13px;
}
.pc-wallet-mini b { font-weight: 700; }

/* ================= Tab ================= */
.pc-tabs, .pca-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb; flex-wrap: wrap;
}
.pc-tab, .pca-tab {
  position: relative; appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 16px; font-size: 14px; color: #6b7280;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.pc-tab:hover, .pca-tab:hover { color: #374151; }
.pc-tab.on, .pca-tab.on { color: #f97316; border-bottom-color: #f97316; font-weight: 600; }
.pc-dot, .pca-dot {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 11px; font-style: normal; line-height: 16px;
  vertical-align: middle;
}

/* ================= 学生端：课程卡片 ================= */
.pc-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.pc-card {
  border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column;
  transition: box-shadow .16s, transform .16s;
}
.pc-card:hover { box-shadow: 0 6px 20px rgba(17, 24, 39, .1); transform: translateY(-2px); }
.pc-card.owned { border-color: #bbf7d0; }
.pc-cover {
  position: relative; height: 140px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
}
.pc-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-cover-ph {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #fde68a, #fdba74);
}
.pc-lock {
  position: absolute; right: 8px; top: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(17, 24, 39, .62); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.pc-lock::after { content: '🔒'; }
.pc-card-b { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.pc-card-t { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.pc-card-s {
  margin: 0 0 10px; color: #6b7280; font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 38px;
}
.pc-card-m {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; margin-top: auto;
}
.pc-author { color: #9ca3af; font-size: 12px; }
.pc-price { font-size: 15px; font-weight: 700; color: #f97316; }
.pc-price.free { color: #16a34a; }

/* ================= 按钮 ================= */
.pc-btn {
  appearance: none; -webkit-appearance: none;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  padding: 7px 14px; border-radius: 8px; font-size: 13px;
  cursor: pointer; font-family: inherit; transition: all .14s;
}
.pc-btn:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }
.pc-btn:disabled { opacity: .5; cursor: not-allowed; }
.pc-btn-buy {
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-color: #f97316; color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .25);
}
.pc-btn-buy:hover:not(:disabled) { background: linear-gradient(135deg, #f97316, #ea580c); border-color: #ea580c; }
.pc-btn-play { border-color: #16a34a; color: #15803d; background: #f0fdf4; }
.pc-btn-play:hover { background: #dcfce7; }
.pc-btn-sm { padding: 5px 10px; font-size: 12px; }
.pc-btn.danger { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }
.pc-btn.danger:hover { background: #fee2e2; }

/* ================= 空态 / 骨架 ================= */
.pc-empty, .pca-empty {
  padding: 60px 20px; text-align: center; color: #9ca3af;
}
.pc-empty-ico {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fdba74);
}
.pc-empty p { margin: 0 0 6px; }
.pc-empty-sub { font-size: 13px; color: #b6bcc6; }
.pc-skel, .pca-skel {
  border-radius: 10px; background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
  background-size: 200% 100%; animation: pcShine 1.3s infinite;
}
.pc-skel-lg { height: 26px; width: 220px; margin-bottom: 10px; }
.pc-skel-sm { height: 14px; width: 340px; }
.pc-skel-block { height: 260px; margin-top: 20px; }
.pca-skel { height: 90px; margin-bottom: 14px; }
.pca-skel-b { height: 320px; }
@keyframes pcShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ================= 学生端：我的投稿 ================= */
.pc-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; font-size: 13px; color: #6b7280;
}
.pc-bar-2 { margin-top: 22px; }
/* ★ 余额不够提现时，代替按钮的位置给一句说明，避免「点了才报错」 */
.pc-wd-tip {
  font-size: 12px; color: #9ca3af; font-style: normal;
}
.pc-tip {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.pc-tip.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.pc-mine { display: flex; flex-direction: column; gap: 10px; }
.pc-mine-item {
  display: flex; gap: 14px; justify-content: space-between;
  padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
}
.pc-mine-item[data-pcstage="pending"] { border-left: 3px solid #f59e0b; }
.pc-mine-item[data-pcstage="approved"] { border-left: 3px solid #22c55e; }
.pc-mine-item[data-pcstage="rejected"] { border-left: 3px solid #ef4444; }
.pc-mine-main { flex: 1; min-width: 0; }
.pc-mine-main h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.pc-mine-s { margin: 0 0 8px; color: #6b7280; font-size: 13px; }
.pc-mine-meta { display: flex; gap: 14px; color: #9ca3af; font-size: 12px; flex-wrap: wrap; }
.pc-mine-act { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.pc-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; vertical-align: middle;
}
.pc-badge.pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pc-badge.approved { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pc-badge.rejected { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.pc-reject {
  margin-top: 8px; padding: 6px 10px; border-radius: 6px;
  background: #fef2f2; color: #b91c1c; font-size: 12px;
}

/* ================= 学生端：收益 ================= */
.pc-wallet {
  display: grid; gap: 12px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.pc-cell {
  padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  display: flex; flex-direction: column; gap: 6px;
}
.pc-cell.main {
  background: linear-gradient(135deg, #fff7ed, #ffedd5); border-color: #fed7aa;
}
.pc-cell-l { color: #6b7280; font-size: 12px; }
.pc-cell-v { font-size: 20px; font-weight: 700; color: #1f2937; }
.pc-cell.main .pc-cell-v { color: #ea580c; }
.pc-earn-list { display: flex; flex-direction: column; gap: 8px; }
.pc-earn {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border: 1px solid #f3f4f6; border-radius: 8px; background: #fff;
}
.pc-earn-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pc-earn-l b { font-size: 14px; font-weight: 600; }
.pc-earn-d { color: #9ca3af; font-size: 12px; }
.pc-earn-r { text-align: right; display: flex; flex-direction: column; gap: 3px; }
.pc-earn-v { color: #16a34a; font-size: 15px; font-weight: 700; }
.pc-earn-g { color: #9ca3af; font-size: 12px; }

/* ================= 弹窗 ================= */
.pc-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(17, 24, 39, .5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pc-dlg, .pc-player {
  width: 100%; max-width: 520px; background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  max-height: 90vh; display: flex; flex-direction: column;
}
.pc-player { max-width: 760px; }
.pc-dlg-h, .pc-player-h {
  padding: 14px 18px; font-size: 16px; font-weight: 600;
  border-bottom: 1px solid #f3f4f6;
  display: flex; align-items: center; justify-content: space-between;
}
.pc-dlg-b { padding: 18px; overflow-y: auto; }
.pc-dlg-f {
  padding: 14px 18px; border-top: 1px solid #f3f4f6;
  display: flex; justify-content: flex-end; gap: 10px;
}
.pc-x {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: #9ca3af; padding: 0 4px;
}
.pc-x:hover { color: #374151; }
.pc-field { display: block; margin-bottom: 14px; }
.pc-field > span { display: block; margin-bottom: 6px; font-size: 13px; color: #4b5563; }
.pc-field input, .pc-field textarea, .pc-field select {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: #1f2937;
}
.pc-field input:focus, .pc-field textarea:focus, .pc-field select:focus {
  outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}
.pc-note {
  padding: 10px 12px; border-radius: 8px; font-size: 12px;
  background: #f9fafb; color: #6b7280; border: 1px solid #f3f4f6;
}
.pc-media { width: 100%; max-height: 62vh; background: #000; display: block; }
.pc-player-tip { margin: 0; padding: 10px 18px 14px; color: #9ca3af; font-size: 12px; }
.pc-wd-avail { margin: 0 0 14px; font-size: 14px; color: #374151; }
.pc-wd-avail b { color: #ea580c; font-size: 17px; }
.pc-up-name { margin: 0 0 10px; font-size: 13px; word-break: break-all; color: #4b5563; }
.pc-prog { height: 8px; border-radius: 999px; background: #f3f4f6; overflow: hidden; }
.pc-prog > i { display: block; height: 100%; background: linear-gradient(90deg, #fb923c, #f97316); transition: width .2s; }
.pc-up-st { margin: 10px 0 0; color: #6b7280; font-size: 13px; }
.pc-up-st.err { color: #dc2626; }

/* ==================================================================
   运营端
   ================================================================== */
.pca-head { margin-bottom: 16px; }
.pca-head h2 { margin: 0 0 12px; font-size: 20px; font-weight: 700; }
.pca-kpi { display: flex; gap: 10px; flex-wrap: wrap; }
.pca-kpi-i {
  padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 9px; background: #fff;
  display: flex; flex-direction: column; gap: 4px; min-width: 108px;
}
.pca-kpi-i span { color: #6b7280; font-size: 12px; }
.pca-kpi-i b { font-size: 16px; font-weight: 700; color: #1f2937; }
.pca-kpi-i.warn { background: #fffbeb; border-color: #fde68a; }
.pca-kpi-i.warn b { color: #b45309; }

.pca-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pca-chip {
  appearance: none; border: 1px solid #e5e7eb; background: #fff; color: #6b7280;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.pca-chip:hover { border-color: #fdba74; color: #ea580c; }
.pca-chip.on { background: #fff7ed; border-color: #f97316; color: #ea580c; font-weight: 600; }

.pca-list { display: flex; flex-direction: column; gap: 10px; }
.pca-item {
  display: flex; gap: 16px; justify-content: space-between;
  padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
}
.pca-item[data-pcastage="pending"] { border-left: 3px solid #f59e0b; }
.pca-item[data-pcastage="approved"] { border-left: 3px solid #22c55e; }
.pca-item[data-pcastage="rejected"] { border-left: 3px solid #ef4444; }
.pca-item-m { flex: 1; min-width: 0; }
.pca-item-m h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.pca-item-s { margin: 0 0 8px; color: #6b7280; font-size: 13px; }
.pca-item-meta { display: flex; gap: 14px; color: #9ca3af; font-size: 12px; flex-wrap: wrap; }
.pca-item-act { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.pca-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; vertical-align: middle;
}
.pca-badge.pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pca-badge.approved { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pca-badge.rejected { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.pca-badge.media { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pca-badge.nop { background: #f9fafb; color: #9ca3af; border: 1px solid #e5e7eb; }
.pca-reject {
  margin-top: 8px; padding: 6px 10px; border-radius: 6px;
  background: #fef2f2; color: #b91c1c; font-size: 12px;
}

.pca-btn {
  appearance: none; -webkit-appearance: none;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  padding: 6px 13px; border-radius: 8px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .14s; white-space: nowrap;
}
.pca-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.pca-btn.ok { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.pca-btn.ok:hover { background: #dcfce7; }
.pca-btn.danger { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.pca-btn.danger:hover { background: #fee2e2; }
.pca-dim { color: #d1d5db; }

.pca-sum { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pca-note {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 12px;
  background: #f9fafb; color: #6b7280; border: 1px solid #f3f4f6;
}
.pca-bar {
  margin: 22px 0 12px; font-size: 13px; font-weight: 600; color: #4b5563;
  padding-bottom: 8px; border-bottom: 1px solid #f3f4f6;
}
.pca-table {
  width: 100%; border-collapse: collapse; font-size: 13px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
}
.pca-table th {
  text-align: left; padding: 10px 12px; background: #f9fafb;
  color: #6b7280; font-weight: 600; font-size: 12px; white-space: nowrap;
}
.pca-table td { padding: 10px 12px; border-top: 1px solid #f3f4f6; }
.pca-table tbody tr:hover { background: #fafafa; }
.pca-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pca-table .pos { color: #15803d; font-weight: 600; }

.pca-cfg { max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.pca-field { display: block; }
.pca-field > span { display: block; margin-bottom: 6px; font-size: 13px; color: #4b5563; }
.pca-field input {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
.pca-field input:focus {
  outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}
.pca-split-show {
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa;
}
.pca-split-show b { font-size: 15px; }

/* ================= 窄屏 ================= */
@media (max-width: 640px) {
  .pc-page, .pca-page { padding: 14px 12px 30px; }
  .pc-mine-item, .pca-item { flex-direction: column; }
  .pc-mine-act, .pca-item-act { flex-direction: row; flex-wrap: wrap; }
  .pca-table { display: block; overflow-x: auto; white-space: nowrap; }
}
