/* ==========================================================================
   学员手机端：一屏一个动作，大按钮 / 大数字 / 大任务卡
   ========================================================================== */

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 顶栏：回合 + 倒计时，全程可见 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(4, 6, 13, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar__round {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--data-cyan);
}

.topbar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.25;
}

.topbar__clock {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.topbar__clock.is-hot {
  color: var(--unicom-red-soft);
  animation: clockPulse 1s infinite;
}

@keyframes clockPulse {
  50% {
    opacity: 0.55;
  }
}

.view {
  flex: 1;
  padding: 18px 16px 110px;
}

/* 英雄任务卡 */
.mission {
  position: relative;
  padding: 24px 20px;
  overflow: hidden;
}

.mission::after {
  content: attr(data-code);
  position: absolute;
  right: -12px;
  bottom: -34px;
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.035);
  letter-spacing: -0.04em;
  pointer-events: none;
}

.mission__round {
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  font-size: 13px;
  color: var(--data-cyan);
}

.mission__title {
  font-size: 34px;
  line-height: 1.1;
  margin: 8px 0 4px;
  color: var(--text-hi);
}

.mission__sub {
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--text-faint);
}

.mission__text {
  margin-top: 16px;
  color: var(--text);
  font-size: 15px;
}

.story {
  border-left: 2px solid var(--unicom-red);
  padding: 6px 0 6px 14px;
  white-space: pre-wrap;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.75;
}

/* 问题清单 */
.qlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: q;
}

.qitem {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.qitem__idx {
  font-family: var(--font-display);
  color: var(--unicom-red-soft);
  font-size: 13px;
  padding-top: 2px;
}

.qitem__label {
  font-weight: 600;
  color: var(--text-hi);
  font-size: 15px;
}

.qitem__hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* 资料折叠 */
.material {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.material > summary {
  cursor: pointer;
  padding: 13px 15px;
  font-weight: 600;
  color: var(--text-hi);
  font-size: 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.material > summary::-webkit-details-marker {
  display: none;
}

.material > summary::after {
  content: "+";
  color: var(--data-cyan);
  font-family: var(--font-display);
}

.material[open] > summary::after {
  content: "−";
}

.material__body {
  padding: 0 15px 15px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
  overflow-x: auto;
}

.material__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.material__body th,
.material__body td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
}

/* 底部主行动条 */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(4, 6, 13, 0), rgba(4, 6, 13, 0.96) 32%);
  max-width: 560px;
  margin: 0 auto;
}

.tabbar {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.tabbar button {
  flex: 1;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 4px;
  cursor: pointer;
}

.tabbar button.is-active {
  color: var(--text-hi);
  border-color: rgba(230, 0, 18, 0.6);
  background: rgba(230, 0, 18, 0.12);
}

/* 成绩 */
.score-hero {
  text-align: center;
  padding: 26px 20px;
}

.score-hero__value {
  font-family: var(--font-display);
  font-size: 76px;
  line-height: 1;
  font-weight: 700;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}

.score-hero__value small {
  font-size: 20px;
  color: var(--text-faint);
}

.dim {
  margin-bottom: 12px;
}

.dim__head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.dim__value {
  font-family: var(--font-display);
  color: var(--text-hi);
}

.bullets {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.8;
}

.bullets li::marker {
  color: var(--data-cyan);
}

.comment {
  border-left: 2px solid var(--data-cyan);
  padding-left: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
}

/* 排名 */
.rank-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: center;
  padding: 18px 0;
}

.rank-hero__num {
  font-family: var(--font-display);
  font-size: 68px;
  font-weight: 700;
  color: var(--unicom-red-soft);
  line-height: 1;
}

.taskscore {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.taskscore:last-child {
  border-bottom: 0;
}

/* 模拟拜访对话 */
.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.bubble {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  animation: bubbleIn var(--dur) var(--ease-out);
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.bubble--them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.bubble--me {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(230, 0, 18, 0.9), rgba(179, 0, 14, 0.9));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble__who {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 4px;
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 14px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: typing 1.2s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.chat-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input .textarea {
  min-height: 48px;
  max-height: 120px;
  font-size: 15px;
  padding: 12px;
}

/* 雷达图 */
.radar-wrap {
  display: grid;
  place-items: center;
  padding: 8px 0 4px;
}

.badge-award {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.1);
  color: #ffe0a8;
  font-size: 13px;
  font-weight: 600;
  margin: 4px 6px 4px 0;
}

/* ==========================================================================
   V2.0 新增：一键复制、开始本关、一页流作答
   ========================================================================== */

/* 复制条：一页流里视觉最重的一块，学员进来第一眼就该看到它 */
.copybar {
  display: grid;
  gap: 10px;
}

.copybar__main {
  width: 100%;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.copybar__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* 开始本关：把倒计时说清楚，避免学员先看题再开表 */
.startgate {
  text-align: center;
  padding: 26px 18px;
}

.startgate__time {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1;
  color: var(--text-hi);
  font-variant-numeric: tabular-nums;
}

.startgate__label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-top: 6px;
}

.startgate__note {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  margin: 18px 0 0;
}

.startgate__note strong {
  color: var(--data-amber);
}

/* 单份材料的复制按钮 */
.material__actions {
  padding: 8px 12px 0;
}

/* 已提交后的只读回显 */
.submitted__body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

/* 剪贴板不可用时的兜底层：让用户能长按全选 */
.copyfall {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 13, 0.86);
  backdrop-filter: blur(4px);
}

.copyfall__card {
  width: 100%;
  max-width: 520px;
  background: var(--ink-700);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.copyfall__title {
  font-size: 14px;
  color: var(--text-hi);
  font-weight: 600;
}

.copyfall__text {
  width: 100%;
  min-height: 44vh;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink-800);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.field__hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.6;
}
