/* 公共样式：干净、留白多、克制的品牌色。不引入任何外部字体/框架。 */
:root {
  --bg: #f6f6f3;
  --card: #ffffff;
  --line: #e7e5df;
  --ink: #1b1b19;
  --sub: #6d6b64;
  --brand: #2f6b4f;
  --brand-ink: #ffffff;
  --danger: #b4372c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(24, 24, 20, .04), 0 8px 24px rgba(24, 24, 20, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

.wrap { max-width: 780px; margin: 0 auto; padding: 26px 18px 70px; }
.wrap-wide { max-width: 980px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; }
.brand .dot {
  width: 26px; height: 26px; border-radius: 9px; background: var(--brand);
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700;
}
.topbar nav { display: flex; gap: 14px; font-size: 13px; color: var(--sub); }
.topbar nav a { color: var(--sub); }
.topbar nav a:hover { color: var(--ink); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--sub); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: 14px;
  cursor: pointer; transition: border-color .15s, background .15s, opacity .15s;
}
.btn:hover { border-color: #cfccc3; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #295f46; border-color: #295f46; }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 登录页 */
.login-card { padding: 34px 26px; text-align: center; }
.qr-box {
  width: 236px; height: 236px; margin: 22px auto 14px; padding: 10px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-box .mask {
  position: absolute; inset: 0; background: rgba(255,255,255,.94);
  display: grid; place-items: center; text-align: center; padding: 20px;
  font-size: 13px; color: var(--sub);
}
.steps { text-align: left; max-width: 300px; margin: 18px auto 0; color: var(--sub); font-size: 13px; }
.steps li { margin: 6px 0; }
.countdown { font-variant-numeric: tabular-nums; color: var(--sub); font-size: 13px; }
.dev-note {
  margin: 18px auto 0; max-width: 420px; text-align: left;
  background: #fff8e8; border: 1px solid #f0e2bd; color: #7a5d1a;
  border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6;
}
.dev-note code { background: #fff; padding: 1px 5px; border-radius: 4px; }

/* 课程列表 */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.course-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(24,24,20,.07), 0 16px 36px rgba(24,24,20,.08); }
.course-cover { aspect-ratio: 16 / 9; background: #eeece7 center/cover no-repeat; position: relative; }
.course-cover .initials { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: #b9b5a9; letter-spacing: .1em; }
.course-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-title { font-weight: 600; font-size: 15px; line-height: 1.45; }
.progress { height: 4px; border-radius: 4px; background: #efede8; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; }
.course-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--sub); }

/* 播放页 */
.player-shell { position: relative; background: #0d0d0c; border-radius: 14px; overflow: hidden; }
.player-shell video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
#wmLayer { position: absolute; inset: 0; pointer-events: none; opacity: .34; }
.video-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tip { font-size: 12.5px; color: var(--sub); }

/* 设备页 */
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.device-row:last-child { border-bottom: 0; }
.device-main { display: flex; flex-direction: column; gap: 2px; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 20px; border: 1px solid #cfe3d8; color: var(--brand); background: #eef5f0; }

.empty { padding: 42px 20px; text-align: center; color: var(--sub); font-size: 14px; }
.err { color: var(--danger); font-size: 13.5px; min-height: 20px; }

@media (max-width: 560px) {
  .wrap { padding: 18px 14px 60px; }
  h1 { font-size: 19px; }
  .login-card { padding: 26px 18px; }
  .qr-box { width: 218px; height: 218px; }
  .code-digits { font-size: 38px; letter-spacing: 5px; }
}

/* 手输登录码：个人主体小程序生成不了小程序码时的等价通道 */
.code-box { text-align: center; padding: 10px 0 4px; }
.code-digits {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 8px;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 8px 0 12px;
}
.code-hint { font-size: 13px; color: var(--sub); line-height: 1.75; }

/* 激活码输入 */
.code-form { margin: 22px auto 0; max-width: 320px; }
.code-input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 14px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--brand);
  background: #fff;
  border: 1.5px solid #ded9cf;
  border-radius: 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.code-input::placeholder {
  font-size: 17px;
  letter-spacing: 3px;
  font-weight: 400;
  color: #c2bfb6;
}
.code-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, .1);
}
.code-form .btn { width: 100%; margin-top: 14px; padding: 14px; font-size: 15px; }
.code-form .err { margin-top: 12px; }
.code-form .err a { color: var(--brand); text-decoration: underline; }

.switch-mode { margin-top: 22px; font-size: 12.5px; color: var(--sub); }
.switch-mode a { color: var(--brand); text-decoration: underline; }

@media (max-width: 560px) {
  .code-input { font-size: 22px; letter-spacing: 4px; padding: 14px 10px; }
}

