/* ============================================================
 * 线上演练 · 扫码抽签剧本杀  —— 样式
 * 极简商务培训风 · 竖式标准卡片
 * ============================================================ */
:root {
  --blue: #0a5fb4;
  --blue-d: #084a8c;
  --blue-l: #e8f1fb;
  --ink: #1f2733;
  --ink-2: #4a5568;
  --line: #e2e8f0;
  --bg: #f4f6fa;
  --student: #1f9d72;
  --market: #c2410c;
  --danger: #b4232a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(10, 40, 80, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------------- 抽签页 ---------------- */
.draw-wrap, .view-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  min-height: 100vh;
}

.top { text-align: center; margin-bottom: 18px; }
.kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--blue);
  background: var(--blue-l);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.top h1 {
  margin: 12px 0 6px;
  font-size: 26px;
  letter-spacing: 1px;
}
.lead {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 420px;
}

#stage { margin: 22px 0; }

.placeholder {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.placeholder:hover { border-color: var(--blue); background: #f7fbff; }
.ph-icon { font-size: 54px; }
.ph-tip { margin-top: 10px; font-size: 14px; }

.draw-btn, .reset-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-d));
  box-shadow: var(--shadow);
  cursor: pointer;
  letter-spacing: 1px;
}
.draw-btn:disabled { opacity: .7; cursor: default; }
.reset-btn {
  margin-top: 12px;
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  box-shadow: none;
  font-weight: 600;
}

/* 抽签滚动动画 */
.rolling {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 20px;
  text-align: center;
}
.rolling-no {
  font-size: 56px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}
.rolling-name { margin-top: 8px; font-size: 16px; color: var(--ink-2); }

/* ---------------- 编号徽标 ---------------- */
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: .5px;
}
.badge-parent { background: var(--blue-l); color: var(--blue-d); }
.badge-student { background: #e6f6ef; color: var(--student); }
.badge-market { background: #fdeee3; color: var(--market); }

/* ---------------- 卡片 ---------------- */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(245,249,253,.94));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--line);
}
.card-head {
  background: linear-gradient(135deg, var(--blue), var(--blue-d));
  color: #fff;
  padding: 16px 18px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.card-head .sub {
  font-size: 12px;
  font-weight: 500;
  opacity: .85;
}
.card-body { padding: 16px 18px; }

.sec { margin-bottom: 14px; }
.sec:last-child { margin-bottom: 0; }
.sec-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-d);
  margin-bottom: 8px;
  padding-left: 9px;
  border-left: 3px solid var(--blue);
}
.sec-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}
.sec-danger .sec-title { color: var(--danger); border-color: var(--danger); }
.sec-danger .sec-text { color: #7a1d22; }

.kv {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.7;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.kv:last-child { border-bottom: none; }
.kv .k {
  flex: 0 0 64px;
  color: var(--ink-2);
  font-weight: 600;
}
.kv .v { flex: 1; color: var(--ink); }

.card-back {
  background: repeating-linear-gradient(45deg, #0a5fb4, #0a5fb4 10px, #084a8c 10px, #084a8c 20px);
  color: #fff;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 1px;
  padding: 10px;
  font-weight: 600;
}

/* ---------------- 卡片翻转：正面 = 家庭环境图 / 背面 = 卡片文字 ---------------- */
.flip {
  position: relative;
  transition: transform .3s ease-in;
  transform: perspective(1500px) rotateY(0deg);
  will-change: transform;
}
.flip.turning { transform: perspective(1500px) rotateY(90deg); }
.flip.turning-in { transition: none; transform: perspective(1500px) rotateY(-90deg); }

.flip-front { cursor: pointer; }
.flip-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(160deg, #eef3f9, #e2ebf5);
}
.flip-cap {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}
.flip-tip {
  margin-top: 9px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--blue-d);
  background: var(--blue-l);
  border: 1px dashed var(--blue);
  border-radius: 999px;
  padding: 8px 10px;
  animation: flipTipPulse 1.9s ease-in-out infinite;
}
@keyframes flipTipPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.flip-again {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 1.5px dashed var(--blue);
  background: var(--blue-l);
  color: var(--blue-d);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.flip-again:active { transform: translateY(1px); }

/* 隐藏信息翻看 */
.reveal { margin-top: 4px; }
.reveal-btn {
  width: 100%;
  border: 1.5px dashed var(--blue);
  background: var(--blue-l);
  color: var(--blue-d);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.reveal-body { margin-top: 12px; }

.warn-note {
  margin-top: 10px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #874d00;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 9px 11px;
  border-radius: 8px;
}

/* ---------------- 二维码区 ---------------- */
.qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
.qr-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.qr-box {
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  display: inline-block;
}
.qr-box img {
  width: 150px;
  height: 150px;
  display: block;
  image-rendering: pixelated;
}
.qr-label {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.qr-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

.hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-2);
  margin: 18px 0 0;
  line-height: 1.6;
}

/* 评分表跳转按钮（教练填写） */
.rate-btn {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 18px auto 0;
  padding: 14px 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.rate-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.rate-btn:active {
  transform: translateY(1px);
}
.rate-parent {
  background: linear-gradient(135deg, #2b6cb0, #2c5282);
}
.rate-student {
  background: linear-gradient(135deg, #2f8f6b, #276749);
}

.foot {
  margin-top: 26px;
  text-align: center;
  font-size: 11px;
  color: #9aa6b5;
  line-height: 1.6;
}

/* 查看页窄屏适配 */
.view-wrap { display: flex; flex-direction: column; }
.bad-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 18px;
  text-align: center;
  color: var(--danger);
  font-weight: 600;
}

/* ---------------- 返回首页链接 ---------------- */
.back-link {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* ---------------- 首页（标题 + 下拉 + 口令） ---------------- */
.home-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, #11332e 0%, #0c1f24 55%, #0a1418 100%);
}
.home-inner {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.home-title {
  margin: 14px 0 6px;
  font-size: 34px;
  letter-spacing: 4px;
  font-weight: 800;
  background: linear-gradient(135deg, #f3d27a, #7fd1b9 60%, #4fb89a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-sub {
  margin: 0 0 22px;
  font-size: 14px;
  color: #b9c6c2;
  letter-spacing: 1px;
}
.home-card {
  background: rgba(255,255,255,.97);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  text-align: left;
}
.home-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 14px 0 6px;
}
.home-label:first-child { margin-top: 0; }
.home-select, .home-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.home-select:focus, .home-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,95,180,.12);
}
.home-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.pwd-err {
  margin: 10px 0 0;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 11px;
  border-radius: 9px;
}
.enter-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px;
  margin-top: 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-d));
  box-shadow: var(--shadow);
  cursor: pointer;
}
.enter-btn:active { transform: translateY(1px); }
.home-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9aa6b5;
  line-height: 1.6;
  text-align: center;
}
.home-foot {
  margin-top: 22px;
  color: #7e8c88;
}

/* ============================================================
 *  页内评分表（家校关爱，直接渲染在卡片下方）
 * ============================================================ */
.score-form {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #e8eef4;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(10, 40, 80, 0.05);
}

/* —— 头部：标题 + 展开/收起 —— */
.sf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sf-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  color: var(--blue-d, #084a8c);
}
.sf-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 1px solid #d3dfea;
  border-radius: 999px;
  background: #fff;
  color: var(--blue, #0a5fb4);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sf-toggle:hover { background: var(--blue-l, #e8f1fb); border-color: var(--blue, #0a5fb4); }
.sf-caret { font-size: 11px; transition: transform .2s; }
.sf-toggle.open .sf-caret { transform: rotate(180deg); }
.sf-body { margin-top: 14px; }

/* —— 姓名 —— */
.sf-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sf-name > label { flex: none; font-size: 13.5px; font-weight: 600; color: #3b4a57; }
.sf-name .sf-input { width: 200px; max-width: 100%; padding: 8px 11px; }

/* —— 表格：只留横向细分隔线，去掉边框噪声 —— */
.sf-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.sf-table col.c-rate { width: 210px; }
.sf-table th, .sf-table td { padding: 10px 12px; text-align: left; vertical-align: middle; border: 0; }
.sf-table thead th {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  color: #8296a6;
  background: transparent;
  border-bottom: 1px solid #eaf0f5;
}
.sf-table thead th:last-child { text-align: right; }
.sf-table tbody td { border-bottom: 1px dashed #eaf0f5; }
.sf-table tbody tr.sf-row:last-of-type td { border-bottom: 0; }
.sf-step-name { font-weight: 600; color: #26333e; line-height: 1.35; }
.sf-hint { margin-top: 2px; font-size: 12.5px; line-height: 1.55; color: #7c8b99; word-break: break-word; }
.sf-hint-empty { color: #c3ccd4; }
.sf-rate { white-space: nowrap; text-align: right; }
.sf-table tr.sf-flash td { background: #fff7dd !important; }

/* —— 星级：SVG 图标，粗细/大小一致 —— */
.sf-stars { display: inline-flex; align-items: center; gap: 2px; }
.sf-star {
  border: 0;
  background: none;
  padding: 1px;
  line-height: 0;
  cursor: pointer;
  color: #dae2ea;
  transition: color .12s, transform .12s;
}
.sf-star svg { width: 21px; height: 21px; display: block; fill: currentColor; }
.sf-star:hover { transform: scale(1.12); }
.sf-star.on { color: #f7a824; }
.sf-stars.err { box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12); border-radius: 8px; }
.sf-stars.err .sf-star { color: #e26a6a; }
.sf-rate-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 21px;
  padding: 0 7px;
  margin-left: 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #8b98a5;
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
}
.sf-rate-val:empty { visibility: hidden; }
.sf-rate-val.on { background: #fff2d4; color: #a4650a; }

/* —— ≤2 星时的「不达标原因」：内嵌浅色块 —— */
.sf-reason-cell { padding: 0 12px 12px !important; border-bottom: 1px dashed #eaf0f5 !important; }
.sf-reason-box {
  background: #fffaf1;
  border-left: 3px solid #f0a33a;
  border-radius: 8px;
  padding: 10px 12px;
}
.sf-reason-label { font-size: 12.5px; font-weight: 700; color: #9a6208; margin-bottom: 6px; }
.sf-reason-tip { font-weight: 400; color: #b3bcc4; margin-left: 5px; font-size: 11.5px; }
.sf-reason { font-size: 13px; background: #fff; }

/* —— 输入控件 —— */
.sf-field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.sf-field > label { font-size: 13.5px; font-weight: 600; color: #3b4a57; }
.req { color: #d64545; }
.sf-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
  color: #1f2a30;
  background: #fff;
}
.sf-input:focus { outline: none; border-color: var(--blue, #0a5fb4); box-shadow: 0 0 0 3px rgba(10, 95, 180, 0.1); }
.sf-input.err { border-color: #d64545; box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12); }

/* —— 提交 —— */
.sf-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.sf-submit {
  padding: 10px 22px;
  border: 0;
  border-radius: 9px;
  background: var(--blue, #0a5fb4);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.sf-submit:hover { filter: brightness(1.06); }
.sf-submit:disabled { opacity: .6; cursor: default; }
.sf-msg { font-size: 12.5px; }
.sf-msg.ok { color: #1f9d57; font-weight: 600; }
.sf-msg.err { color: #d64545; font-weight: 600; }

/* —— 悬浮按钮：小圆形，仅一个向下箭头 —— */
.sf-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue, #0a5fb4);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10, 60, 120, .3);
  transition: transform .15s, filter .15s, background .2s;
}
.sf-fab svg { width: 20px; height: 20px; display: block; }
.sf-fab:hover { transform: translateY(-2px); filter: brightness(1.06); }
.sf-fab-done { background: #1f9d57; box-shadow: 0 6px 18px rgba(31, 157, 87, .3); }

@media (max-width: 560px) {
  .score-form { padding: 14px; }
  .sf-head h3 { font-size: 16px; }
  .sf-name .sf-input { width: 100%; }

  /* 窄屏改为堆叠式：步骤/要点一行，星级单独一行，避免两列互相挤压 */
  .sf-table, .sf-table tbody, .sf-table tr, .sf-table td { display: block; }
  .sf-table colgroup, .sf-table thead { display: none; }
  .sf-table tbody tr.sf-row { padding: 11px 12px; border-bottom: 1px dashed #eaf0f5; }
  .sf-table tbody td { padding: 0; border: 0; }
  .sf-hint { margin-top: 3px; }
  .sf-rate { text-align: left; margin-top: 9px; }
  .sf-stars { gap: 4px; }
  .sf-star svg { width: 25px; height: 25px; }
  .sf-rate-val { min-width: 36px; height: 22px; }
  .sf-table tr.sf-flash td { background: transparent !important; }
  .sf-table tbody tr.sf-flash { background: #fff7dd; }
  .sf-reason-cell { padding: 0 12px 12px !important; }

  .sf-fab { right: 12px; bottom: 12px; width: 40px; height: 40px; }
}
