/* xw-prog.css — 编程大挑战（2026-11-05）自包含样式，前缀 xw-prog- */

.xw-prog-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 12px 40px;
  font-family: inherit;
}
.xw-prog-wrap * { box-sizing: border-box; }

/* ---------- toast ---------- */
.xw-prog-toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  z-index: 99999;
  background: rgba(20, 30, 25, .92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  animation: xwprogIn .25s ease;
  max-width: 86vw;
  text-align: center;
}
@keyframes xwprogIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- 头部 ---------- */
.xw-prog-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(120deg, #10a37f 0%, #0d8a6c 55%, #0a6e55 100%);
  border-radius: 18px;
  padding: 22px 26px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(16, 163, 127, .28);
  overflow: hidden;
  flex-wrap: wrap;
}
.xw-prog-hero::after {
  content: '{ }';
  position: absolute;
  right: 130px;
  top: -12px;
  font-size: 90px;
  font-weight: 800;
  opacity: .08;
  font-family: Consolas, monospace;
  pointer-events: none;
}
.xw-prog-hero-badge {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}
.xw-prog-hero-info { flex: 1 1 320px; min-width: 260px; }
.xw-prog-hero-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.xw-prog-hero-title em {
  font-style: normal;
  background: #ffd76a;
  color: #7a4c00;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 800;
}
.xw-prog-hero-title b { color: #ffe9b8; font-size: 17px; }
.xw-prog-hero-points { font-size: 13.5px; opacity: .95; margin-bottom: 12px; }
.xw-prog-hero-points b { color: #ffd76a; font-size: 17px; }
.xw-prog-sub { margin-left: 12px; opacity: .85; }
.xw-prog-progress { max-width: 460px; }
.xw-prog-progress-bar {
  height: 12px;
  background: rgba(0, 0, 0, .25);
  border-radius: 8px;
  overflow: hidden;
}
.xw-prog-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffe27a, #ffc93c);
  border-radius: 8px;
  transition: width .5s ease;
}
.xw-prog-progress-text { font-size: 12.5px; margin-top: 6px; opacity: .9; }
.xw-prog-hero-stats { display: flex; gap: 12px; }
.xw-prog-stat {
  background: rgba(255, 255, 255, .13);
  border-radius: 14px;
  padding: 10px 18px;
  text-align: center;
  min-width: 88px;
}
.xw-prog-stat b { display: block; font-size: 22px; color: #ffd76a; }
.xw-prog-stat span { font-size: 12px; opacity: .85; }

/* ---------- 布局 ---------- */
.xw-prog-cols {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  align-items: flex-start;
}
.xw-prog-main { flex: 1 1 640px; min-width: 0; }
.xw-prog-side { flex: 0 0 320px; }
@media (max-width: 900px) {
  .xw-prog-cols { flex-direction: column; }
  .xw-prog-side { flex: 1 1 auto; width: 100%; }
}

/* ---------- 卡片 ---------- */
.xw-prog-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.xw-prog-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #1f3d33;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.xw-prog-card-title i { color: #10a37f; }
.xw-prog-card-title small { font-size: 12px; color: #9ab0a8; font-weight: 400; }
.xw-prog-empty { color: #9ab0a8; text-align: center; padding: 26px 0; font-size: 14px; }

/* ---------- 课程网格 ---------- */
.xw-prog-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.xw-prog-course {
  border: 1px solid #e4efe9;
  border-radius: 14px;
  overflow: hidden;
  background: #fbfefd;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
.xw-prog-course:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(16, 163, 127, .16);
}
.xw-prog-course-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 118px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
}
.xw-prog-course-cover img { width: 100%; height: 100%; object-fit: cover; }
.xw-prog-course-cover.cat-html  { background: linear-gradient(130deg, #ff8b4c, #e8602a); }
.xw-prog-course-cover.cat-css   { background: linear-gradient(130deg, #4c9aff, #2a6fe8); }
.xw-prog-course-cover.cat-js    { background: linear-gradient(130deg, #f7c948, #e8a20a); }
.xw-prog-course-cover.cat-python{ background: linear-gradient(130deg, #3fb27f, #1d8a5a); }
.xw-prog-course-cover.cat-scratch { background: linear-gradient(130deg, #b06ce8, #8a3fd1); }
.xw-prog-course-cover.cat-other { background: linear-gradient(130deg, #63c9a8, #2e9b78); }
.xw-prog-course-icon { font-size: 40px; line-height: 1; }
.xw-prog-course-cat { font-size: 12.5px; margin-top: 6px; opacity: .9; letter-spacing: 1px; }
.xw-prog-course-diff {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  padding: 2px 9px;
  border-radius: 10px;
}
.xw-prog-course-soon, .xw-prog-course-passed {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  font-style: normal;
  padding: 2px 9px;
  border-radius: 10px;
  color: #fff;
}
.xw-prog-course-soon { background: rgba(0, 0, 0, .45); }
.xw-prog-course-passed { background: #10a37f; }
.xw-prog-course-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.xw-prog-course-name { font-weight: 700; font-size: 15px; color: #17332a; }
.xw-prog-course-desc {
  font-size: 12.5px;
  color: #8ba39a;
  margin: 4px 0 8px;
  min-height: 18px;
}
.xw-prog-course-meta { font-size: 12px; color: #8ba39a; display: flex; gap: 10px; }
.xw-prog-course-meta b { color: #0d8a6c; }
.xw-prog-course-bar {
  height: 6px;
  background: #e8f3ee;
  border-radius: 4px;
  margin: 8px 0 10px;
  overflow: hidden;
}
.xw-prog-course-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2ec48f, #10a37f);
  border-radius: 4px;
}
.xw-prog-btn {
  display: block;
  text-align: center;
  background: linear-gradient(120deg, #16b78d, #0d8a6c);
  color: #fff !important;
  border-radius: 10px;
  padding: 8px 0;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  margin-top: auto;
  transition: opacity .15s ease;
}
.xw-prog-btn:hover { opacity: .88; }
.xw-prog-btn.ing { background: linear-gradient(120deg, #ffb340, #f08c00); }
.xw-prog-btn.done { background: linear-gradient(120deg, #9db8ae, #7c998d); }
.xw-prog-btn.disabled { background: #d9e5df; color: #93a89f !important; cursor: default; }
.xw-prog-btn.full { margin-top: 12px; }

/* ---------- 荣誉墙 ---------- */
.xw-prog-honors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.xw-prog-honor {
  border: 1px solid #e4efe9;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  filter: grayscale(1);
  opacity: .5;
  background: #f7fbf9;
}
.xw-prog-honor.got {
  filter: none;
  opacity: 1;
  border-color: #ffd76a;
  background: linear-gradient(160deg, #fffdf4, #fdf6df);
}
.xw-prog-honor-icon { font-size: 30px; display: block; }
.xw-prog-honor-name { display: block; font-size: 13.5px; font-weight: 700; color: #17332a; margin-top: 4px; }
.xw-prog-honor-desc { display: block; font-size: 11px; color: #9ab0a8; margin-top: 2px; }
.xw-prog-honor-tip {
  margin-top: 12px;
  font-size: 12px;
  color: #9ab0a8;
}
.xw-prog-honor-tip i { color: #4c9aff; margin-right: 4px; }

/* ---------- 每日任务 ---------- */
.xw-prog-daily-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed #e4efe9;
}
.xw-prog-daily-item:last-child { border-bottom: none; }
.xw-prog-daily-info { flex: 1; min-width: 0; }
.xw-prog-daily-name { font-size: 14px; font-weight: 700; color: #17332a; }
.xw-prog-daily-name i { color: #f08c00; margin-right: 5px; }
.xw-prog-daily-desc { font-size: 12px; color: #9ab0a8; margin: 2px 0 6px; }
.xw-prog-daily-bar {
  height: 5px;
  background: #e8f3ee;
  border-radius: 4px;
  overflow: hidden;
}
.xw-prog-daily-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2ec48f, #10a37f);
  border-radius: 4px;
}
.xw-prog-daily-act { text-align: center; flex-shrink: 0; }
.xw-prog-daily-exp { display: block; font-size: 12px; color: #0d8a6c; font-weight: 700; margin-bottom: 5px; white-space: nowrap; }
.xw-prog-daily-btn {
  display: inline-block;
  min-width: 62px;
  text-align: center;
  border-radius: 14px;
  font-size: 12.5px;
  padding: 5px 12px;
  background: #eef5f1;
  color: #8ba39a;
  border: none;
}
.xw-prog-daily-btn.claim {
  background: linear-gradient(120deg, #ffb340, #f08c00);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  animation: xwprogPulse 1.6s infinite;
}
@keyframes xwprogPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 140, 0, .45); }
  50% { box-shadow: 0 0 0 6px rgba(240, 140, 0, 0); }
}
.xw-prog-daily-btn.claimed { background: #eef5f1; color: #8ba39a; }

/* ---------- 玩法说明 ---------- */
.xw-prog-help { margin: 0; padding-left: 2px; list-style: none; }
.xw-prog-help li { font-size: 13px; color: #5d7a70; line-height: 2; }
.xw-prog-help b { color: #0d8a6c; }

/* ---------- 课程页 ---------- */
.xw-prog-ctop {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  flex-wrap: wrap;
}
.xw-prog-back {
  color: #0d8a6c !important;
  font-size: 13.5px;
  text-decoration: none !important;
  white-space: nowrap;
}
.xw-prog-back i { margin-right: 3px; }
.xw-prog-ctop-info { flex: 1; min-width: 200px; }
.xw-prog-ctop-name { font-size: 17px; font-weight: 700; color: #17332a; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xw-prog-ctop-name em {
  font-style: normal;
  background: #eef5f1;
  color: #0d8a6c;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 10px;
}
.xw-prog-ctop-name em.xw-prog-passed-tag { background: #10a37f; color: #fff; }
.xw-prog-ctop-desc { font-size: 12.5px; color: #9ab0a8; margin-top: 3px; }
.xw-prog-ctop-reward { text-align: center; font-size: 11.5px; color: #9ab0a8; }
.xw-prog-ctop-reward b { display: block; color: #f08c00; font-size: 15px; }
.xw-prog-cgrid { display: flex; gap: 16px; margin-top: 16px; align-items: flex-start; }
.xw-prog-cmain { flex: 1 1 640px; min-width: 0; }
.xw-prog-cside { flex: 0 0 320px; }
@media (max-width: 900px) {
  .xw-prog-cgrid { flex-direction: column; }
  .xw-prog-cside { flex: 1 1 auto; width: 100%; }
}

/* 游戏舞台 */
.xw-prog-stage {
  background: #10241c;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.xw-prog-frame-box { position: relative; width: 100%; padding-top: 62%; }
.xw-prog-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.xw-prog-stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0b1a14;
  color: #9fd8c2;
  font-size: 12.5px;
}
.xw-prog-stage-bar b { color: #ffd76a; }
.xw-prog-save-tip i { margin-right: 4px; color: #2ec48f; }
.xw-prog-save-tip i.err { color: #ff6b6b; }
.xw-prog-stage-empty {
  text-align: center;
  padding: 70px 20px;
  color: #9fd8c2;
}
.xw-prog-stage-empty i { font-size: 44px; color: #2ec48f; }
.xw-prog-stage-empty-t { font-size: 18px; font-weight: 700; color: #fff; margin: 14px 0 6px; }
.xw-prog-stage-empty-d { font-size: 13px; opacity: .8; margin-bottom: 18px; }
.xw-prog-stage-empty .xw-prog-btn { display: inline-block; padding: 9px 26px; }

/* 上报说明 */
.xw-prog-intro {
  margin-top: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  color: #5d7a70;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.xw-prog-intro summary { cursor: pointer; font-weight: 600; color: #17332a; }
.xw-prog-intro summary i { color: #4c9aff; margin-right: 5px; }
.xw-prog-intro-body { margin-top: 8px; line-height: 1.9; }
.xw-prog-intro-body code {
  background: #eef5f1;
  color: #0d8a6c;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.xw-prog-intro-body ul { margin: 6px 0 0; padding-left: 18px; }

/* 关卡列表 */
.xw-prog-lessons { max-height: 420px; overflow-y: auto; }
.xw-prog-lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px dashed #e4efe9;
}
.xw-prog-lesson:last-child { border-bottom: none; }
.xw-prog-lesson-state { font-size: 17px; color: #c6d6cf; }
.xw-prog-lesson.passed .xw-prog-lesson-state { color: #10a37f; }
.xw-prog-lesson-info { flex: 1; min-width: 0; }
.xw-prog-lesson-name { font-size: 13.5px; font-weight: 600; color: #17332a; }
.xw-prog-lesson.passed .xw-prog-lesson-name { color: #0d8a6c; }
.xw-prog-lesson-meta { font-size: 11.5px; color: #9ab0a8; }
.xw-prog-lesson-meta em { font-style: normal; margin-left: 6px; color: #f08c00; }

/* 我的档案 */
.xw-prog-mini-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #5d7a70;
  padding: 7px 2px;
  border-bottom: 1px dashed #e4efe9;
}
.xw-prog-mini-row:last-of-type { border-bottom: none; }
.xw-prog-mini-row b { color: #17332a; }

/* ---------- 设置页开关行 ---------- */
.xw-setting-prog-honor {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xw-setting-prog-honor label { font-weight: 600; color: #17332a; cursor: pointer; }
.xw-setting-prog-honor input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: #10a37f;
  cursor: pointer;
}
#xw-prog-honor-tip {
  display: none;
  font-size: 12px;
  color: #0d8a6c;
}

/* ---------- 个人主页编程荣誉卡 ---------- */
.xw-prog-profile-card .xw-prog-pc-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.xw-prog-pc-lv {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(130deg, #16b78d, #0d8a6c);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.xw-prog-pc-lv b { font-size: 17px; line-height: 1.1; }
.xw-prog-pc-lv span { font-size: 10px; opacity: .85; }
.xw-prog-pc-info { flex: 1; min-width: 0; }
.xw-prog-pc-name { font-size: 15px; font-weight: 700; color: #17332a; }
.xw-prog-pc-name small { font-weight: 400; color: #9ab0a8; font-size: 12px; margin-left: 6px; }
.xw-prog-pc-nums { font-size: 12px; color: #8ba39a; margin-top: 3px; }
.xw-prog-pc-nums b { color: #0d8a6c; }
.xw-prog-pc-honors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.xw-prog-pc-honor {
  background: linear-gradient(160deg, #fffdf4, #fdf3d5);
  border: 1px solid #ffd76a;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  color: #8a6d1a;
}
.xw-prog-pc-more { font-size: 12px; color: #9ab0a8; align-self: center; }

/* ===== v2 游戏大厅（2026-11-05 精简版：纯游戏入口） ===== */
.xw-prog-wrap { display: block; }
.xw-prog-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fbfefd; border: 1px solid #e4efe9; border-radius: 14px;
  padding: 12px 18px; margin-bottom: 14px;
}
.xw-prog-top-title { font-size: 18px; font-weight: 800; color: #17332a; }
.xw-prog-top-title .fa { color: #10a37f; margin-right: 4px; }
.xw-prog-top-title small { display: block; font-size: 12px; font-weight: 400; color: #8ba39a; margin-top: 2px; }
.xw-prog-top-stats { display: flex; gap: 14px; font-size: 13px; color: #5c7a6e; white-space: nowrap; }
.xw-prog-top-stats b { color: #0d8a6c; }

.xw-prog-course { color: inherit; text-decoration: none; }
.xw-prog-course-icon.small {
  font-size: 21px; font-weight: 800; letter-spacing: .5px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}
.xw-prog-course-body { gap: 7px; }
.xw-prog-course-meta { align-items: center; }
.xw-prog-course-meta em {
  font-style: normal; background: rgba(16, 163, 127, .1); color: #0d8a6c;
  border-radius: 8px; padding: 1px 8px; font-size: 11px;
}
.xw-prog-course-meta i { font-style: normal; color: #8ba39a; font-size: 12px; }
.xw-prog-course-go {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700; color: #10a37f; padding-top: 4px;
}
.xw-prog-course-go.done { color: #8ba39a; }
.xw-prog-course-go .fa { transition: transform .18s ease; }
.xw-prog-course:hover .xw-prog-course-go .fa { transform: translateX(3px); }
@media (max-width: 480px) {
  .xw-prog-courses { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .xw-prog-course-icon { font-size: 32px; }
  .xw-prog-course-icon.small { font-size: 17px; }
}

/* ---------- 课程容器页 v2（2026-11-05）：纯游戏本体直出，不套卡片 ---------- */
.xw-prog-coursepage {
  max-width: 1080px;
  padding: 10px 10px 16px;
}
.xw-prog-coursepage .xw-prog-stage {
  height: calc(100vh - 120px);
  min-height: 480px;
  border-radius: 10px;
  box-shadow: none;
}
.xw-prog-coursepage .xw-prog-frame {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
}
@media (max-width: 768px) {
  .xw-prog-coursepage { padding: 6px 6px 10px; }
  .xw-prog-coursepage .xw-prog-stage {
    height: calc(100vh - 96px);
    min-height: 420px;
    border-radius: 0;
  }
}
