/* 答题服务：共用样式。配色沿用原设计稿（#232F3E / #FF9900），扫码页和 Dashboard 为深色主题 */
:root {
  --navy: #232f3e;
  --navy-2: #37475a;
  --orange: #ff9900;
  --orange-dark: #e68a00;
  --blue: #0073bb;
  --blue-bg: #e3f2fd;
  --green: #1d7a33;
  --green-bg: #e8f5e9;
  --red: #c62828;
  --red-bg: #ffebee;
  --text: #16191f;
  --muted: #545b64;
  --line: #d5dbdb;
  --bg: #f2f3f3;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
button { font-family: inherit; }
.icon { width: 1em; height: 1em; vertical-align: -0.15em; flex-shrink: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------------- 手机答题页 ---------------- */
/* 答题页整体固定在可视区域内：顶部栏和底部操作栏不动，只有中间内容滚动
   不用 100vh：微信里 100vh 比实际可见高度大，短题目也会出现滚动 */
.p-html { height: 100%; overflow: hidden; background: #fff; }
.p-body { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
/* 顶部栏：左侧 D1C 角标，右侧 login · 队名 · 累计得分 */
.p-nav { flex: none; background: var(--navy); color: var(--orange); font-weight: 700; font-size: 16px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; }
/* 左上角角标（D1C）：宽度随文字撑开，至少保持正方形 */
.p-logo { min-width: 26px; height: 26px; padding: 0 6px; background: var(--orange); color: var(--navy); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; letter-spacing: .3px; flex: none; }
.p-nav #nav-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 顶部栏最右侧的"切换用户"：文字太长时让用户信息省略，按钮本身不缩 */
.p-nav-btn { flex: none; min-height: 32px; padding: 4px 10px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45); border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.p-nav-btn:active { background: rgba(255, 255, 255, .12); }
.p-nav-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
/* 中间内容：唯一的滚动区域；内容不满一屏时不能滚动 */
.p-main { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto; padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 底部操作栏：提交 / 下一题；没有按钮的页面这里是空的，不占高度 */
.p-foot { flex: none; }
.p-actions { background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.p-actions-in { max-width: 528px; margin: 0 auto; }
.p-actions .p-btn { margin-top: 0; }
.p-actions .p-error { margin: 0 0 8px; min-height: 0; }
.p-actions .p-error:empty { display: none; }
.p-card { background: #f7f8f8; border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.p-title { font-size: 20px; font-weight: 800; color: var(--navy); }
.p-hint { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.p-label { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 6px; color: var(--navy); }
.p-input { width: 100%; font-size: 18px; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); color: var(--text); background: #fff; }
.p-input:focus { border-color: var(--blue); outline: none; }
.p-btn { display: block; width: 100%; min-height: 50px; margin-top: 16px; border: none; border-radius: var(--radius); background: var(--orange); color: var(--navy); font-size: 17px; font-weight: 800; cursor: pointer; }
.p-btn:active { background: var(--orange-dark); }
/* 链接做成按钮的样子 */
.p-btn-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
/* 登录页、未开放提示上方的任务名称 */
.p-task-name { font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.p-center-text { text-align: center; margin-top: 18px; }
.p-btn[disabled] { opacity: .6; }
.p-btn.secondary { background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; min-height: 40px; }
.p-error { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 20px; }
.p-center { text-align: center; padding: 28px 0 8px; }
.p-badge { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 36px; }
.p-badge.ok { background: var(--green-bg); color: var(--green); }
.p-badge.bad { background: var(--red-bg); color: var(--red); }
.p-badge.info { background: var(--blue-bg); color: var(--blue); }
.p-big { font-size: 20px; font-weight: 800; color: var(--navy); }
.p-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }

.q-header { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; padding: 14px 16px; border-radius: var(--radius); }
.q-num { font-size: 13px; color: var(--orange); font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-tag { background: var(--orange); color: var(--navy); font-size: 12px; padding: 1px 8px; border-radius: 10px; font-weight: 800; }
.q-text { position: relative; font-size: 18px; margin-top: 8px; line-height: 1.5; word-break: break-word; }
/*
 * 防 AI 干扰层：盖在题干上方，只覆盖题干这一块
 * 用 opacity 0 完全透明（不用"前景色 = 背景色"，深色模式、强制配色、选中高亮都不会显形）；1px 字号、超出部分裁掉；
 * 不接收点击和长按（pointer-events none），不影响选项和按钮
 */
.q-decoy { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; opacity: 0; font-size: 1px; line-height: 1px; overflow: hidden; pointer-events: none; -webkit-text-size-adjust: none; text-size-adjust: none; }
.q-timer { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--orange); margin-top: 10px; font-weight: 700; }
.q-bar { height: 6px; background: rgba(255,255,255,.18); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.q-bar-fill { height: 100%; background: var(--orange); border-radius: 3px; width: 100%; transition: width .2s linear; }
.q-bar-fill.warn { background: #ff5a36; }
.q-hint { font-size: 13px; color: var(--muted); margin: 12px 2px 0; }

.opt { width: 100%; min-height: 54px; border: 2px solid var(--line); background: #fff; border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.opt .mark { width: 24px; height: 24px; border: 2px solid #aab7b8; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.opt[role=radio] .mark { border-radius: 50%; }
.opt[role=checkbox] .mark { border-radius: 5px; }
.opt .key { font-weight: 800; color: var(--navy); min-width: 1.2em; }
.opt[aria-checked=true] { border-color: var(--blue); background: var(--blue-bg); }
.opt[aria-checked=true] .mark { border-color: var(--blue); background: var(--blue); }

.countdown { text-align: center; padding: 48px 0; }
.countdown .num { font-size: 120px; font-weight: 900; color: var(--orange); line-height: 1; }
.countdown .lbl { font-size: 18px; color: var(--muted); margin-top: 12px; }

.reveal-row { display: flex; gap: 8px; font-size: 15px; margin-top: 8px; line-height: 1.5; }
.reveal-row .k { color: var(--muted); flex-shrink: 0; }
.reveal-row .v { font-weight: 700; color: var(--navy); word-break: break-word; }
.reveal-row .v.normal { font-weight: 400; color: var(--text); }
/* 解析页"正确答案"标签用绿色，和"你的答案"区分 */
.reveal-row.correct .k { color: var(--green); font-weight: 700; }
.wait-line { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }

.final-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.final-cell { background: #f7f8f8; border-radius: var(--radius); padding: 14px; text-align: center; }
.final-cell .k { font-size: 13px; color: var(--muted); }
.final-cell .v { font-size: 22px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.final-cell.wide { grid-column: span 2; background: var(--navy); }
.final-cell.wide .k { color: #c9d1d9; }
.final-cell.wide .v { color: var(--orange); font-size: 26px; }

/* ---------------- 扫码页（/screen）：一直显示答题页二维码，尺寸用 vh，投影任何分辨率都在一屏内 ---------------- */
.s-body { background: #0a0e27; color: #e8eaf6; height: 100vh; overflow: hidden; }
.s-wrap { padding: 3vh 4vw; height: 100vh; display: flex; flex-direction: column; }
.s-head { flex: none; display: flex; justify-content: space-between; align-items: center; color: #8e99c0; font-size: 2.4vh; }
.s-head .brand { color: var(--orange); font-weight: 800; letter-spacing: 2px; display: flex; align-items: center; gap: 1vh; }
.s-head .brand .p-logo { min-width: 3.6vh; height: 3.6vh; padding: 0 .9vh; font-size: 1.6vh; }
.s-center { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.s-title { font-size: 6vh; font-weight: 900; color: var(--orange); letter-spacing: 3px; }
.s-sub { font-size: 3.2vh; color: #b8c0e0; margin-top: 1.5vh; }
.s-qr { background: #fff; padding: 2vh; border-radius: 1.6vh; width: 58vh; height: 58vh; max-width: 86vw; max-height: 86vw; margin-top: 3vh; }
.s-qr img { width: 100%; height: 100%; display: block; }
.s-url { font-size: 2vh; color: #8e99c0; margin-top: 2vh; word-break: break-all; }

/* ---------------- 两个后台：左侧菜单 + 右侧内容 ---------------- */
.a-body { background: var(--bg); }
.a-layout { display: flex; min-height: 100vh; }
/* 左侧菜单：固定在可视区域，内容多时自己滚动 */
.a-side { flex: none; width: 220px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.a-side-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.a-side-title { color: var(--orange); font-weight: 800; font-size: 16px; }
.a-menu { flex: 1; padding: 8px 0; }
.a-menu a { display: block; padding: 10px 18px; color: #d5dbe0; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
.a-menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.a-menu a.active { background: rgba(255, 153, 0, .14); color: #fff; font-weight: 700; border-left-color: var(--orange); }
.a-menu a.sub { padding: 7px 18px 7px 32px; font-size: 13px; color: #b8c2cc; }
.a-menu a:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.a-menu-group { padding: 16px 18px 6px; font-size: 12px; color: #8e99a6; letter-spacing: .5px; word-break: break-all; }
.a-side-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; color: #c9d1d9; }
.a-side-user { margin-bottom: 10px; word-break: break-all; }
.a-side-btn { width: 100%; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.a-side-btn:hover { background: rgba(255, 255, 255, .08); }
/* 右侧内容 */
.a-content { flex: 1; min-width: 0; }
/* 窄屏：菜单移到上方，横向排列 */
@media (max-width: 860px) {
  .a-layout { flex-direction: column; }
  .a-side { width: auto; height: auto; position: static; align-self: stretch; }
  .a-menu { display: flex; flex-wrap: wrap; padding: 4px 8px; }
  .a-menu a { border-left: 0; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .a-menu a.active { border-bottom-color: var(--orange); }
  .a-menu a.sub { padding: 6px 10px; }
  .a-menu-group { width: 100%; padding: 8px 12px 2px; }
  .a-side-foot { display: flex; align-items: center; gap: 12px; }
  .a-side-user { margin: 0; flex: 1; }
  .a-side-btn { width: auto; }
}
.a-main { max-width: 1200px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a-sec { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.a-sec.wide { grid-column: span 2; }
.a-sec h2 { font-size: 16px; color: var(--navy); margin-bottom: 12px; border-left: 4px solid var(--orange); padding-left: 8px; }
.a-kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.a-kv .k { color: var(--muted); }
.a-kv .v { font-weight: 600; word-break: break-all; }
.a-phase { display: inline-block; padding: 2px 10px; border-radius: 10px; font-weight: 800; font-size: 13px; background: #eaeded; }
.a-phase.running { background: var(--green-bg); color: var(--green); }
.a-phase.lobby { background: #eaeded; color: var(--text); }
.a-phase.ended { background: var(--navy); color: #fff; }
.a-alert { background: #fff3e0; border-left: 4px solid var(--orange); padding: 10px 12px; margin-top: 12px; font-weight: 700; color: #7a4100; }
.a-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.a-btn { min-height: 42px; padding: 0 18px; border-radius: 8px; border: none; font-size: 15px; font-weight: 700; cursor: pointer; background: var(--orange); color: var(--navy); }
.a-btn.blue { background: var(--blue); color: #fff; }
.a-btn.gray { background: #eaeded; color: var(--text); }
.a-btn.red { background: var(--red); color: #fff; }
.a-btn[disabled] { opacity: .4; cursor: not-allowed; }
.a-links { margin-top: 12px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.a-links a { color: var(--blue); }
.a-form { display: grid; grid-template-columns: 220px 1fr; gap: 10px 12px; align-items: center; font-size: 14px; }
.a-form input[type=number], .a-form input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.a-form .radios { display: flex; flex-direction: column; gap: 6px; }
/* 名册表里手填小组人数的小输入框 */
.a-size { width: 64px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; text-align: right; }
.a-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.a-msg { font-size: 14px; margin-top: 10px; min-height: 20px; white-space: pre-wrap; }
.a-msg.err { color: var(--red); }
.a-msg.ok { color: var(--green); }
.a-textarea { width: 100%; min-height: 120px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
.a-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.a-table th, .a-table td { border-bottom: 1px solid #eaeded; padding: 6px 8px; text-align: left; }
.a-table th { background: #fafafa; color: var(--muted); font-weight: 600; }
.a-table td.num, .a-table th.num { text-align: right; }
.a-scroll { max-height: 420px; overflow: auto; }
.a-qbox { background: #f7f8f8; border-radius: 8px; padding: 12px; margin-top: 12px; font-size: 14px; }
.a-qbox .stem { font-weight: 700; margin-bottom: 6px; }
.a-qbox .opt-line { display: flex; justify-content: space-between; padding: 3px 0; }
.a-qbox .opt-line.correct { color: var(--green); font-weight: 700; }
.a-gate { max-width: 360px; margin: 12vh auto; background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.a-gate input { width: 100%; padding: 12px; font-size: 16px; border: 2px solid var(--line); border-radius: 8px; margin-top: 12px; }
@media (max-width: 860px) { .a-main { grid-template-columns: 1fr; } .a-sec.wide { grid-column: auto; } .a-form { grid-template-columns: 1fr; } }

/* ---------------- v2：类别标签、解析开关 ---------------- */
.q-cat { background: rgba(255,255,255,.14); color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 10px; font-weight: 700; }
.expl-toggle { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); cursor: pointer; min-height: 48px; }
.expl-toggle input { width: 22px; height: 22px; accent-color: var(--blue); flex-shrink: 0; }



/* ---------------- 小组平均分 Dashboard（深色，顶部卡片参照模板） ----------------
   尺寸全部用 vh / vw，列表行高由 JS 按可用高度计算，保证任意窗口大小下一屏放下 */
.d-body { background: #0e0f10; color: #e9e9ea; height: 100vh; overflow: hidden; }
.d-wrap { height: 100vh; padding: 2.4vh 3.2vw 1.6vh; display: flex; flex-direction: column; gap: 1.8vh; }
.d-head { flex: none; display: flex; align-items: baseline; gap: 1vw; }
/* 角标尺寸跟随屏幕高度 */
.d-head .p-logo { min-width: 3.4vh; height: 3.4vh; padding: 0 .9vh; font-size: 1.5vh; align-self: center; letter-spacing: .5px; }
.d-title { font-size: 2.8vh; font-weight: 800; color: #f2f2f2; letter-spacing: 1px; }
.d-sub { color: #6f7074; font-size: 1.6vh; }

/* 前三名卡片：金 / 银 / 铜描边，右上角奖牌 */
.d-podium { flex: none; height: 15vh; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4vw; }
.d-slot { position: relative; perspective: 80vh; min-width: 0; }
.d-card { position: relative; height: 100%; box-sizing: border-box; border-radius: 1vh; border: 1px solid #3a3b3f; background: #18191b; padding: 1.4vh 1.3vw; display: flex; flex-direction: column; justify-content: center; gap: 1.1vh; overflow: hidden; }
.d-card.g1 { border-color: #f0a500; }
.d-card.g2 { border-color: #a9acb2; }
.d-card.g3 { border-color: #cf8642; }
.d-card-top { display: flex; align-items: center; gap: .8vw; min-width: 0; }
.d-avatar { flex: none; width: 4.2vh; height: 4.2vh; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 2vh; color: #222; background: #2f3033; }
.g1 .d-avatar { background: linear-gradient(135deg, #ffe27a, #f0a500); }
.g2 .d-avatar { background: linear-gradient(135deg, #f4f5f7, #9ea2a8); }
.g3 .d-avatar { background: linear-gradient(135deg, #f3b47c, #a8602a); color: #fff; }
.d-card-name { font-size: 2.8vh; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6.4vh; }
.d-card-bottom { display: flex; align-items: baseline; gap: .7vw; }
.d-card-label { font-size: 1.3vh; color: #8b8c90; letter-spacing: 1px; }
.d-card-pts { display: inline-block; font-size: 4.4vh; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: #e9e9ea; }
.g1 .d-card-pts { color: #f5b301; }
.g2 .d-card-pts { color: #c9ccd1; }
.g3 .d-card-pts { color: #d98a46; }
.d-chip { align-self: center; margin-left: .6vw; background: #26272a; border-radius: .6vh; padding: .4vh .7vw; font-size: 1.6vh; color: #cfd0d3; }
/* 奖牌图片：贴着卡片上边，按比例缩放；图片地址相对本样式表（线上 static/、demo 的 ../web/ 都能找到） */
.d-medal { position: absolute; top: 0; right: 1.1vw; width: 6vh; height: 8.6vh; background: center top / contain no-repeat; }
.d-medal.m1 { background-image: url(medal-gold.png); }
.d-medal.m2 { background-image: url(medal-silver.png); }
.d-medal.m3 { background-image: url(medal-bronze.png); }
.d-card.vacant { border-style: dashed; border-color: #2c2d30; }
.d-card.vacant .d-card-name, .d-card.vacant .d-card-pts { color: #4a4b4f; }
/* 前三名内部换位：翻牌 */
.d-card.flip-out { animation: d-flip-out .32s ease-in forwards; }
.d-card.flip-in { animation: d-flip-in .4s ease-out; }
@keyframes d-flip-out { to { transform: rotateX(90deg); opacity: .2; } }
@keyframes d-flip-in { from { transform: rotateX(-90deg); opacity: .2; } to { transform: none; opacity: 1; } }
/* 晋级卡片落位后的光圈 */
.d-card.landed { animation: d-land 1s ease-out; }
@keyframes d-land { 0% { box-shadow: 0 0 0 0 rgba(255, 196, 40, .95); } 100% { box-shadow: 0 0 0 2.6vh rgba(255, 196, 40, 0); } }
/* 分数变化时跳一下 */
.d-card-pts.bump { animation: d-bump .6s ease-out; }
@keyframes d-bump { 40% { transform: scale(1.18); } }

/* 全部小组：左右两列，每组一个独立长方形；字号 --row-fs 和列间距 --col-gap 由 JS 按可用空间计算 */
.d-list { flex: 1; min-height: 0; display: flex; flex-direction: column; --row-fs: 16px; --col-gap: 1.6vw; }
.d-cols-pair { flex: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--col-gap); padding-bottom: .8vh; }
/* 组名都很短（如 O10、H13），名字列固定为 5 个字宽（留余量，超长时省略号），剩下的宽度都给对比条 */
.d-cols, .d-row { display: grid; grid-template-columns: 9% calc(var(--row-fs) * 5) minmax(0, 1fr) 13% 13%; align-items: center; column-gap: .8vw; padding: 0 1vw; }
.d-cols { font-size: max(1.3vh, calc(var(--row-fs) * .6)); color: #6f7074; letter-spacing: 1px; }
.d-cols .r, .d-row .r { text-align: right; }
.d-board { position: relative; flex: 1; min-height: 0; }
.d-row { position: absolute; left: 0; top: 0; box-sizing: border-box; border-radius: .8vh; background: #18191b; border: 1px solid #232427; font-size: var(--row-fs); transition: transform .9s cubic-bezier(.2, .8, .2, 1), background-color .6s, border-color .6s, box-shadow .3s; will-change: transform; }
/* 名次变化的行浮在静止的行上方；跨列移动时再抬高一层并加阴影 */
.d-row.up, .d-row.down { z-index: 1; }
.d-row.cross { z-index: 2; box-shadow: 0 .8vh 2.4vh rgba(0, 0, 0, .65); }
.d-row.no-anim { transition: none; }
.d-rank-cell { display: flex; align-items: center; gap: .45em; }
.d-rank { flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .72em; font-weight: 800; color: #ddd; background: #2f3033; }
.d-rank.r1 { background: linear-gradient(135deg, #ffe27a, #f0a500); color: #222; }
.d-rank.r2 { background: linear-gradient(135deg, #f4f5f7, #9ea2a8); color: #222; }
.d-rank.r3 { background: linear-gradient(135deg, #f3b47c, #a8602a); color: #fff; }
.d-move { font-size: .62em; font-weight: 900; }
.d-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-bar { height: .32em; background: #232427; border-radius: .2em; overflow: hidden; }
.d-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ff9900, #ff5a00); border-radius: .2em; transition: width .9s ease; }
/* 有答题人的组至少显示一个圆点（宽 = 条高），最低分就是这个点 */
.d-row:not(.empty) .d-bar-fill { min-width: .32em; }
.d-cnt { color: #8b8c90; font-size: .82em; }
.d-avg { font-weight: 800; font-variant-numeric: tabular-nums; }
.d-row.p1 .d-avg { color: #f5b301; }
.d-row.p2 .d-avg { color: #c9ccd1; }
.d-row.p3 .d-avg { color: #d98a46; }
.d-row.empty .d-avg, .d-row.empty .d-name { color: #55565a; }
.d-row.up { background: #10261a; border-color: #2e7d32; }
.d-row.up .d-move { color: #4ade80; }
.d-row.down { background: #2a1214; border-color: #8b2020; }
.d-row.down .d-move { color: #ff6b6b; }
.d-empty-msg { color: #666; font-size: 2.6vh; text-align: center; padding-top: 16vh; }

/* 底部：LIVE 和更新时间 */
.d-foot { flex: none; display: flex; gap: 2vw; font-size: 1.3vh; color: #6f7074; border-top: 1px solid #1f2023; padding-top: 1vh; }
.d-live, .d-updated { display: flex; align-items: center; gap: .5vw; }
.d-live::before, .d-updated::before { content: ''; width: .9vh; height: .9vh; border-radius: 50%; background: #22c55e; }
.d-live::before { animation: d-pulse 1.6s infinite; }
@keyframes d-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* 第四名及以后晋级前三：放大覆盖动画 */
.d-overlay { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .72); opacity: 0; pointer-events: none; transition: opacity .35s; }
.d-overlay.show { opacity: 1; }
.d-fly { position: fixed; z-index: 11; height: auto; transform-origin: center center; box-shadow: 0 2vh 6vh rgba(0, 0, 0, .7); }
.d-fly::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-100%); animation: d-shine 1.1s .45s ease-in-out; pointer-events: none; }
@keyframes d-shine { to { transform: translateX(100%); } }
.d-promo { position: absolute; top: .7vh; left: 50%; transform: translateX(-50%); padding: .25vh .9vw; border-radius: 1vh; background: linear-gradient(90deg, #f0a500, #ffd54a); color: #2a1a00; font-size: 1.3vh; font-weight: 900; letter-spacing: 2px; white-space: nowrap; }

/* 邀请码输入框：等宽、加大字间距，方便核对 */
.p-code { font-family: 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .35em; text-transform: uppercase; }
/* 输入框提示按原文显示（不转大写、不加字间距），只影响提示文字，输入的邀请码样式不变 */
.p-code::placeholder { text-transform: none; letter-spacing: normal; }

/* 已完成页、结束页：三格或四格（第一格名次占满一行） */
.final-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.final-grid.three .final-cell.wide { grid-column: span 3; }

/* ---------------- 两个后台的公共组件 ---------------- */
.a-crumb { font-size: 14px; }
.a-crumb a, .a-link { color: var(--blue); }
.a-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.a-card h3 { font-size: 16px; color: var(--navy); margin-bottom: 10px; }
.a-kv .v.pre { white-space: pre-wrap; }
.a-kv .v.warn { color: var(--red); }
/* 剩余时间倒计时：等宽数字，每秒跳动时宽度不变 */
.a-kv .a-countdown { font-variant-numeric: tabular-nums; }
.a-btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.a-btn.big { min-height: 52px; padding: 0 26px; font-size: 17px; }
.a-btn.attention { background: var(--red); color: #fff; box-shadow: 0 0 0 4px rgba(198, 40, 40, .18); }
.a-row-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.a-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; background: #eaeded; color: var(--text); white-space: nowrap; }
.a-tag.green { background: var(--green-bg); color: var(--green); }
.a-tag.orange { background: #fff3e0; color: #b35900; }
.a-tag.gray { background: #eaeded; color: var(--muted); }
.a-tag.red { background: var(--red-bg); color: var(--red); }
.a-label-line { font-size: 14px; font-weight: 700; color: var(--navy); margin-top: 16px; }
.a-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.a-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.a-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.a-check.strong { font-weight: 700; }
.a-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.a-inline-form input, .a-btns select, .a-btns input[type=search], .a-btns input[type=datetime-local], .a-card input[type=datetime-local], .a-form select, .a-form input[type=datetime-local], .a-form textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
.a-form select, .a-form input[type=datetime-local] { width: 100%; }
.a-btns input[type=search] { min-width: 220px; }
.a-two { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-top: 10px; }
.a-scroll.tall { max-height: 640px; }
.a-list { margin: 4px 0 0 18px; font-size: 14px; line-height: 1.8; }
.a-pre { background: #f7f8f8; border-radius: 6px; padding: 10px; font-size: 12px; overflow: auto; max-height: 320px; }
.a-errlist { margin: 8px 0 0 18px; color: var(--red); font-size: 13px; line-height: 1.6; max-height: 240px; overflow: auto; }
.a-table tr.deleted td { color: #9aa0a6; text-decoration: line-through; }
.a-table tr.deleted td:last-child { text-decoration: none; }
.a-pwform { max-width: 420px; }
.a-pwform input, .a-gate input { width: 100%; padding: 12px; font-size: 16px; border: 2px solid var(--line); border-radius: 8px; margin-top: 12px; }
.a-phone { max-width: 420px; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 12px; background: #fff; }

/* 同步题库：醒目的按钮 + 紧跟其后的醒目说明 */
.a-sync { display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: #fff8e1; border: 2px solid var(--orange); }
.a-sync.has-diff { background: var(--red-bg); border-color: var(--red); }
.a-sync-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.a-sync-main { font-size: 16px; font-weight: 800; color: var(--navy); }
.a-sync.has-diff .a-sync-main { color: var(--red); }
.a-sync-warn { color: var(--red); font-weight: 700; }
@media (max-width: 860px) { .a-two { grid-template-columns: 1fr; } .a-sync { flex-direction: column; } }

/* AWS login 输入框：后面固定跟着 @amazon.com */
.a-login-field { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.a-gate .a-login-field input { flex: 1; min-width: 0; margin-top: 0; }
.a-login-suffix { color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; }
.a-inline-form .a-login-field { margin-top: 0; }

/* ---------------- 开关（代替复选框） ---------------- */
.a-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; position: relative; user-select: none; }
.a-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a-switch-track { width: 44px; height: 24px; border-radius: 12px; background: #c4ccd3; position: relative; transition: background .2s; flex: none; }
.a-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.a-switch-input:checked + .a-switch-track { background: var(--green); }
.a-switch-input:checked + .a-switch-track::after { transform: translateX(20px); }
.a-switch-input:focus-visible + .a-switch-track { outline: 3px solid var(--blue); outline-offset: 2px; }
.a-switch-input:disabled + .a-switch-track { opacity: .55; }
.a-switch.readonly { cursor: default; }
.a-switch.readonly .a-switch-input:disabled + .a-switch-track { opacity: 1; }
.a-switch-state { font-size: 13px; font-weight: 700; color: var(--muted); min-width: 1.2em; }

/* ---------------- 设置行：左边标题和说明，右边控件，下面是随开关显示的内容 ---------------- */
.a-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.a-settings.single { grid-template-columns: 1fr; margin-top: 8px; }
.a-setting { padding: 12px 0; border-bottom: 1px solid #eef0f1; }
.a-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.a-setting-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.a-setting-hint { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.a-setting-hint.pre { white-space: pre-wrap; color: var(--text); }
.a-setting-control { flex: none; }
.a-setting-sub { margin-top: 10px; }
.a-setting-sub .a-textarea { margin-top: 0; min-height: 72px; font-family: inherit; font-size: 13px; }
.a-inline { display: inline-flex; align-items: center; gap: 6px; }
.unit { font-size: 13px; color: var(--muted); }
/* 小号数字输入框（秒数） */
.a-num-sm { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; text-align: right; font-family: inherit; }
.a-num-ro { font-weight: 700; font-variant-numeric: tabular-nums; }
/*
 * 每类每题时长：固定两列（只有 1 个类别时一列）
 * 每一项的"类别名：""输入框""秒"三格直接放进外层网格（.a-cat-time 为 display: contents），
 * 同一列里类别名右对齐，冒号和输入框都对齐
 */
.a-setting-sub { container-type: inline-size; }
.a-cat-times { display: grid; grid-template-columns: repeat(3, max-content); align-items: center; gap: 8px 4px; margin-top: 8px; font-size: 13px; }
.a-cat-times.two { grid-template-columns: repeat(6, max-content); }
.a-cat-time { display: contents; }
.a-cat-time .name { color: var(--text); text-align: right; max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-cat-time .unit { padding-left: 2px; }
/* 系统后台只读显示时，秒数也右对齐 */
.a-cat-times .a-num-ro { min-width: 2.5em; text-align: right; }
/* 左右两列之间留出间距 */
.a-cat-times.two .a-cat-time:nth-child(odd) .unit { padding-right: 32px; }
/* 放不下两列时退回一列 */
@container (max-width: 380px) {
  .a-cat-times.two { grid-template-columns: repeat(3, max-content); }
  .a-cat-times.two .a-cat-time:nth-child(odd) .unit { padding-right: 0; }
}
@media (max-width: 860px) { .a-settings { grid-template-columns: 1fr; } }

/* ---------------- 底部操作栏：几组功能并排，固定在页面底部 ---------------- */
.a-content.has-dock { padding-bottom: 130px; }
.a-dock { position: fixed; left: 220px; right: 0; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; padding: 10px 20px; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .10); }
.a-dock-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid; min-width: 0; }
/* 最重要的一组：暖色底，按钮正常大小 */
.a-dock-group.primary { background: #fff7e6; border-color: #ffc565; }
/* 次要的一组：冷色底，靠右，按钮小号 */
.a-dock-group.secondary { background: #f1f5f9; border-color: #c6d3df; margin-left: auto; }
.a-dock-label { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--navy); padding-right: 10px; margin-right: 2px; border-right: 1px solid rgba(35, 47, 62, .2); white-space: nowrap; }
.a-dock-group.secondary .a-dock-label { color: #3d5266; }
.a-dock-input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; width: 170px; font-family: inherit; background: #fff; }
@media (max-width: 860px) {
  .a-dock { left: 0; padding: 8px 10px; }
  .a-dock-group.secondary { margin-left: 0; }
  .a-content.has-dock { padding-bottom: 200px; }
}

/* ---------------- 弹窗提示：底部操作栏的操作结果 ---------------- */
.a-dialog { margin: auto; width: min(440px, calc(100vw - 32px)); border: none; border-radius: 12px; padding: 0; color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); border-top: 5px solid var(--green); }
.a-dialog.err { border-top-color: var(--red); }
.a-dialog::backdrop { background: rgba(22, 25, 31, .45); }
.a-dialog-head { padding: 16px 20px 0; font-size: 16px; font-weight: 800; color: var(--green); }
.a-dialog.err .a-dialog-head { color: var(--red); }
.a-dialog-text { padding: 10px 20px 4px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.a-dialog-btns { display: flex; justify-content: flex-end; padding: 12px 20px 16px; }
.a-dialog-btns .a-btn { min-height: 36px; min-width: 88px; }

/* ---------------- 对接外部系统：配置表单（区块左半边，标题列窄一些） ---------------- */
.a-form input[type=url] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
.a-form.a-form-narrow { grid-template-columns: 150px 1fr; align-items: start; }
.a-form.a-form-narrow > label { padding-top: 8px; }
#int-arn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.a-two.even { grid-template-columns: 1fr 1fr; margin-top: 0; }
@media (max-width: 860px) { .a-two.even { grid-template-columns: 1fr; } }

/* ---------------- 全部排名页（/t/<任务码>/ranking）：配色同 Dashboard，没有动画，页面可以滚动 ---------------- */
.rk-body { background: #0e0f10; color: #e9e9ea; min-height: 100vh; }
.rk-wrap { max-width: 1600px; margin: 0 auto; padding: 28px 3vw 24px; }
.rk-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 18px; }
.rk-head .p-logo { align-self: center; }
.rk-title { font-size: 26px; font-weight: 800; color: #f2f2f2; letter-spacing: 1px; }
.rk-sub { color: #8a8b90; font-size: 14px; }
.rk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3vw; align-items: start; }
.rk-cols.one { grid-template-columns: minmax(0, 820px); }
.rk-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 17px; }
.rk-table th { text-align: left; font-size: 13px; font-weight: 600; color: #6f7074; padding: 0 14px 2px; }
.rk-table th.r, .rk-table td.r { text-align: right; }
.rk-row td { background: #18191b; border-top: 1px solid #232427; border-bottom: 1px solid #232427; padding: 10px 14px; }
.rk-row td:first-child { border-left: 1px solid #232427; border-radius: 8px 0 0 8px; }
.rk-row td:last-child { border-right: 1px solid #232427; border-radius: 0 8px 8px 0; }
.rk-c-rank { width: 3.2em; }
.rk-rank { display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border-radius: 50%; font-size: 14px; font-weight: 800; color: #ddd; background: #2f3033; }
.rk-rank.r1 { background: linear-gradient(135deg, #ffe27a, #f0a500); color: #222; }
.rk-rank.r2 { background: linear-gradient(135deg, #f4f5f7, #9ea2a8); color: #222; }
.rk-rank.r3 { background: linear-gradient(135deg, #f3b47c, #a8602a); color: #fff; }
.rk-name { font-weight: 700; word-break: break-all; }
.rk-cnt { color: #9a9ba0; white-space: nowrap; }
.rk-val { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-row.p1 .rk-val { color: #f5b301; }
.rk-row.p2 .rk-val { color: #c9ccd1; }
.rk-row.p3 .rk-val { color: #d98a46; }
.rk-row.empty .rk-name, .rk-row.empty .rk-val { color: #55565a; }
.rk-empty { color: #777; font-size: 20px; text-align: center; padding: 14vh 0; }
.rk-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #1f2023; font-size: 13px; color: #6f7074; }
@media (max-width: 900px) { .rk-cols { grid-template-columns: 1fr; } .rk-table { font-size: 15px; } }
