/* 甜蜜双排（网页版）+ Casdoor 登录按钮样式。
 * 全部基于 app.css 的设计变量（--primary/--card/--line…），移动优先。
 */

/* ---------- 登录页：统一身份登录 ---------- */

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text2);
  font-size: 13px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- 页面骨架 ---------- */

.duo-page {
  padding: 16px 16px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.duo-section h3 {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--text2);
  font-weight: 600;
}
.duo-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.duo-hint { font-size: 13px; color: var(--text2); margin-top: 6px; }
.duo-hint.center { text-align: center; }
.duo-empty-note {
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  padding: 18px 12px;
  line-height: 1.7;
}
.duo-banner {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.duo-banner.soft { background: #f4efe4; color: var(--text2); font-weight: 500; }

/* ---------- 大厅 ---------- */

.duo-create {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 16px;
  text-align: left;
}
.duo-create-icon { font-size: 26px; line-height: 1; }
.duo-create-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.duo-create-info b { font-size: 17px; }
.duo-create-info span { font-size: 13px; opacity: .85; }
.duo-create-arrow { font-size: 22px; opacity: .8; }

.duo-room-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 10px;
}
.duo-room-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.duo-room-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.duo-room-info b { font-size: 15px; }
.duo-room-sub { font-size: 13px; color: var(--text2); }
.duo-room-join { font-size: 14px; font-weight: 600; color: var(--primary); flex: none; }
.duo-badge {
  flex: none;
  font-size: 11px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 999px;
  padding: 2px 8px;
}
.duo-badge.soft { background: var(--primary-bg); color: var(--primary-dark); }
.duo-lobby-note { font-size: 12px; color: var(--text2); text-align: center; line-height: 1.6; }

/* ---------- 等待房 ---------- */

.duo-members {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px;
}
.duo-member {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.duo-member b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-member.pending b { color: var(--text2); }
.duo-member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.duo-member.pending .duo-member-avatar {
  background: transparent;
  border: 2px dashed var(--line);
  color: var(--text2);
}
.duo-member-role { font-size: 12px; color: var(--text2); }
.duo-heart { color: #e0565b; font-size: 22px; flex: none; }

.duo-field-label { font-size: 13px; color: var(--text2); margin: 14px 0 6px; }
.duo-card .duo-field-label:first-child { margin-top: 0; }

.duo-seg { display: flex; gap: 8px; }
.duo-seg-btn {
  flex: 1;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text);
}
.duo-seg-btn.on {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

.duo-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.duo-chip-grid.center { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.duo-chip {
  min-height: 44px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
}
.duo-chip.on {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.duo-tag-select {
  width: 100%;
  border: 1.5px dashed var(--primary);
  background: var(--primary-bg);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  color: var(--primary-dark);
  font-weight: 600;
}
.duo-tag-select.picked { border-style: solid; }

.duo-guest-wait { text-align: center; padding: 26px 16px; }
.duo-guest-miffy { font-size: 34px; color: var(--primary); }
.duo-guest-title { font-size: 16px; font-weight: 600; margin-top: 8px; }
.duo-guest-sub { font-size: 13px; color: var(--text2); margin-top: 4px; }

.duo-leave {
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  padding: 10px;
}

/* ---------- 弹层（专项选择 / 邀请 / 打气） ---------- */

.duo-sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(41, 40, 36, .45);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.duo-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  max-height: 78vh;
  display: flex;
  flex-direction: column;
}
.duo-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.duo-sheet-head b { font-size: 17px; }
.duo-sheet-body { overflow-y: auto; padding-bottom: 6px; }

.duo-online-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.duo-online-away { font-size: 12px; color: var(--text2); }
.duo-online-sp { flex: 1; }
.duo-online-busy { font-size: 13px; color: var(--text2); }
.duo-invite-btn {
  border: 1.5px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 14px;
}
.duo-invite-btn:active { background: var(--primary-bg); }

/* ---------- 会话（答题） ---------- */

.duo-wrong-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
}
.duo-wrong-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

.duo-filter-bar { display: flex; gap: 8px; }
.duo-filter-bar .duo-chip { min-height: 38px; padding: 6px 14px; flex: none; }

.duo-exam-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 10px;
}
.duo-exam-row.disabled { opacity: .75; }
.duo-exam-score {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.duo-exam-score.pass { background: var(--success-bg); color: var(--success); }
.duo-exam-score.fail { background: var(--danger-bg); color: var(--danger); }
.duo-exam-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.duo-exam-info b { font-size: 15px; }
.duo-exam-info span { font-size: 13px; color: var(--text2); }

/* ---------- 成绩 ---------- */

.duo-result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 16px 22px;
  text-align: center;
}
.duo-result-card.small { padding: 20px 16px 16px; }
.duo-result-miffy { font-size: 36px; color: var(--primary); }
.duo-score { margin-top: 10px; }
.duo-score b { font-size: 52px; font-weight: 700; line-height: 1.1; }
.duo-score span { font-size: 18px; color: var(--text2); margin-left: 4px; }
.duo-score.pass b { color: var(--success); }
.duo-score.fail b { color: var(--danger); }
.duo-result-msg { margin-top: 8px; font-size: 15px; color: var(--text); }

.duo-stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 16px;
}
.duo-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.duo-stat-row:last-child { border-bottom: 0; }
.duo-stat-row span { color: var(--text2); }
.duo-stat-row b { font-weight: 600; }

.duo-compare-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.duo-compare-card.me { border-color: var(--primary); }
.duo-compare-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.duo-compare-score { margin-top: 6px; display: flex; align-items: baseline; gap: 6px; }
.duo-compare-score b { font-size: 34px; font-weight: 700; }
.duo-compare-score b.pass { color: var(--success); }
.duo-compare-score b.fail { color: var(--danger); }
.duo-compare-score span { font-size: 13px; color: var(--text2); }
.duo-compare-sub { margin-top: 4px; font-size: 13px; color: var(--text2); }

/* ---------- versus 等待台 ---------- */

.duo-wait-status { display: flex; flex-direction: column; gap: 4px; }
.duo-wait-line { font-size: 14px; color: var(--text); }
.duo-enc-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 20px;
}
.duo-watch-head { font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.duo-watch-head + .qcard { margin-top: 0; }

.duo-game-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.duo-game-canvas {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  touch-action: none;
  max-width: 100%;
}

.duo-dpad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 48px);
  gap: 6px;
  justify-content: center;
}
.duo-dpad-btn {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text);
}
.duo-dpad-btn:active { background: var(--primary-bg); }
.duo-dpad-btn.up { grid-column: 2; grid-row: 1; }
.duo-dpad-btn.left { grid-column: 1; grid-row: 2; }
.duo-dpad-btn.down { grid-column: 2; grid-row: 2; }
.duo-dpad-btn.right { grid-column: 3; grid-row: 2; }

.duo-tpad {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.duo-tpad .duo-dpad-btn { width: 64px; height: 48px; }
.duo-tpad .duo-dpad-btn.wide { width: 136px; background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }

/* ---------- 打气动效 ---------- */

#duo-enc-root { pointer-events: none; }
.duo-enc {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 250, 240, .72);
  animation: duoEncBg 3.4s ease forwards;
}
.duo-enc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px 34px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(183, 75, 16, .18);
  animation: duoEncPop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.duo-enc-icon { font-size: 40px; color: #e0565b; animation: duoEncBeat 1s ease-in-out infinite; }
.duo-enc-title { font-size: 19px; font-weight: 700; margin-top: 10px; }
.duo-enc-text { font-size: 14px; color: var(--text2); margin-top: 4px; }
@keyframes duoEncPop {
  0% { transform: scale(.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes duoEncBeat {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
}
@keyframes duoEncBg {
  0%, 86% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- 稍后进入悬浮球 ---------- */

.duo-bubble {
  position: fixed;
  left: 16px;
  bottom: calc(72px + var(--safe-bottom));
  z-index: 70;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 6px 18px rgba(183, 75, 16, .35);
  touch-action: none;
  animation: duoBubbleIn .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.duo-bubble-icon { font-size: 20px; line-height: 1; }
.duo-bubble-text { font-size: 10px; line-height: 1; }
@keyframes duoBubbleIn {
  0% { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 邀请弹窗副标题 ---------- */

.duo-invite-sub { font-size: 13px; color: var(--text2); text-align: center; }
