/* 英语口语与互动能力测评 —— 暖色调主题 */
:root {
  --bg: #fdf7f0;
  --bg-2: #f8ede1;
  --card: #fffdfb;
  --ink: #3b2f28;
  --muted: #8b7a6d;
  --line: #eeddcb;
  --brand: #b85c2e;
  --brand-2: #cf7a45;
  --brand-soft: #fbe9db;
  --ok: #4d7c3a;
  --warn: #a8721a;
  --err: #b23a2c;
  --rec: #c0392b;
  --amber-bg: #fdf4e3;
  --amber-line: #f0dcb4;
  --amber-ink: #8a5a12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 50% -220px, #fbe6d3 0%, rgba(251,230,211,0) 70%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 18px 60px; }

header.top {
  background: linear-gradient(100deg, #b85c2e 0%, #cf7a45 60%, #dda06a 100%);
  color: #fff;
  padding: 14px 18px;
  box-shadow: 0 2px 10px rgba(184, 92, 46, .18);
}
header.top .inner { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
header.top h1 { font-size: 18px; margin: 0; font-weight: 600; }
header.top .who { font-size: 14px; opacity: .92; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(120, 80, 50, .05);
}

h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 18px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 15px; }
.big { font-size: 28px; font-weight: 700; letter-spacing: .5px; }

label { display: block; font-size: 15px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 12px 14px; font-size: 17px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit;
}

button {
  appearance: none; border: 0; border-radius: 10px; cursor: pointer;
  padding: 13px 20px; font-size: 17px; font-weight: 600;
  background: var(--brand); color: #fff;
  transition: background .12s ease;
}
button:hover { background: var(--brand-2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
button.ghost:hover { background: var(--brand-soft); }
button.danger { background: var(--err); }
button.danger:hover { background: #c8483a; }
button.small { padding: 8px 14px; font-size: 15px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }

/* 管理后台：顶部快速跳转（页面很长，没有导航要滚很久） */
.quicknav {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 14px; padding: 10px 12px;
  background: rgba(253, 247, 240, .96); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 12px;
}
.quicknav a {
  font-size: 14px; color: var(--brand); text-decoration: none;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.quicknav a:hover { background: var(--brand-soft); }

/* 完成情况：当前开放的行突出显示 */
tr.row-open td { background: #fdf1e8; font-weight: 600; }
.score-big {
  display: flex; align-items: baseline; gap: 10px;
  margin: 6px 0 2px;
}
.score-big .n { font-size: 40px; font-weight: 800; color: var(--brand); line-height: 1; }
.score-big .b { font-size: 17px; font-weight: 600; color: var(--ok); }
.score-parts { margin-top: 10px; padding-top: 4px; border-top: 1px dashed #eed9c4; }
.tag-open {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: #fff; background: var(--brand-2);
}

/* 学生端：完成小结 */
.summary-box { margin-top: 14px; }
.summary-box .srow {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.summary-box .srow:last-child { border-bottom: 0; }
.summary-box .sk { color: var(--muted); flex: 0 0 auto; white-space: nowrap; }
.summary-box .sv { font-weight: 600; text-align: right; }
.score-parts .sv { font-weight: 600; text-align: right; min-width: 0; }
.summary-box .snote { margin-top: 10px; font-size: 14px; color: var(--muted); }
.summary-box .spos { color: var(--ok); font-weight: 600; }

.eval-box {
  margin-top: 16px; padding: 14px 16px;
  background: #fff8f1; border: 1px solid #f0dcc8; border-radius: 12px;
}
.eval-title { font-weight: 700; margin-bottom: 6px; color: var(--brand); }
.eval-line { margin: 4px 0; font-size: 16px; line-height: 1.55; }

ul.tasks { list-style: none; padding: 0; margin: 0; }
ul.tasks li {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff;
}
ul.tasks li.done { background: #f2f8ee; border-color: #cfe3c2; }
ul.tasks li.locked { opacity: .6; }

/* 任务按钮不要换行（"未开放"三个字曾被挤成竖排） */
ul.tasks li button { white-space: nowrap; min-width: 92px; }

/* 还没开放的任务折叠在最后，不占主视野 */
ul.tasks li.locked-wrap {
  display: block; border: 0; background: none; padding: 0; margin-bottom: 10px;
}
ul.tasks li.locked-wrap > details > summary {
  cursor: pointer; color: var(--muted); font-size: 15px; padding: 10px 2px;
}
ul.tasks li.locked-wrap > details > ul.tasks { margin-top: 8px; }

.meter { height: 14px; background: var(--bg-2); border-radius: 8px; overflow: hidden; margin: 10px 0; }
.meter > i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s linear; }

.recording { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--rec); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--rec); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.promptbox {
  border-left: 4px solid var(--brand-2); background: #fdf5ee;
  padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 12px 0;
  white-space: pre-wrap;
}

.banner {
  border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-size: 15px;
  background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-ink);
}
.banner.err { background: #fdeeec; border-color: #f3cdc6; color: #96301f; }
.banner.ok { background: #f2f8ee; border-color: #cfe3c2; color: #3f6a2f; }

.hide { display: none !important; }

table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
th { background: var(--bg-2); font-weight: 600; }

/* 管理端编辑器 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
#svBlocks td, #blkItems td { vertical-align: top; }
#svBlocks textarea, #blkItems textarea { min-height: 44px; }
details summary { user-select: none; }
details[open] summary { margin-bottom: 6px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

progress { width: 100%; height: 16px; }

/* ---- 知情同意书 ---- */
.consent-link {
  display: inline-block; margin-top: 12px; font-size: 14px; color: var(--brand);
  text-decoration: underline; cursor: pointer; user-select: none;
}
.consent-panel {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); padding: 12px 14px;
}
.consent-panel .cap { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.consent-panel iframe { width: 100%; height: 62vh; border: 0; border-radius: 8px; background: #fff; }
.consent-panel img { max-width: 100%; border-radius: 8px; background: #fff; }
.consent-text {
  white-space: pre-wrap; max-height: 62vh; overflow: auto; font-size: 15px;
  background: #fff; border-radius: 8px; padding: 12px;
}
.consent-tip { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---- 问卷 ---- */
.qhead { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 10px 0 6px; }
.qbar { height: 8px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.qbar > i { display: block; height: 100%; width: 0; background: var(--brand-2); transition: width .15s ease; }
.qblock { margin: 20px 0 26px; }
.qblock > .qintro { color: var(--muted); font-size: 15px; margin: 4px 0 10px; }
.qbtitle { margin: 0 0 2px; }
.qbtitle .en { font-size: 15px; color: var(--muted); font-weight: 500; }
.qtopint { margin: 4px 0 14px; font-size: 15px; color: var(--ink); }

/* 中英对照 */
.bitext { display: block; }
.bitext .cn { display: block; }
.bitext .en { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.qtopint .en { font-size: 13.5px; }

.q { padding: 13px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q .qtext { font-weight: 600; margin-bottom: 9px; }
.q .qtext .num { color: var(--muted); font-weight: 400; margin-right: 7px; }
.q.missing { background: #fdf1ef; border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label {
  display: flex; align-items: flex-start; gap: 6px; margin: 0;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  font-size: 15px; background: #fff; cursor: pointer; color: var(--ink);
}
.opts label.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.opts input { margin: 0; }
.optlab { display: block; }
.optlab .en { font-size: 12px; color: var(--muted); display: block; }
.q .parts { display: flex; gap: 12px; flex-wrap: wrap; }
.q .parts > div { flex: 1 1 190px; }
.partlab { font-size: 14px; color: var(--muted); margin-bottom: 5px; }
.partlab .en { font-size: 12px; }
.inline-box { display: flex; align-items: center; gap: 8px; }
.q .inline-text { max-width: 280px; }

/* 量表矩阵：表头是量尺，每行一题 */
.matrix-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.matrix { min-width: 100%; }
.mrow { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.mhead { background: var(--bg-2); }
.mtext { flex: 1 1 auto; min-width: 0; padding: 11px 14px; display: flex; gap: 6px; align-items: flex-start; }
.mtext .num { color: var(--muted); flex: 0 0 auto; }
.mopts { display: flex; flex: 0 0 auto; }
.mopt {
  flex: 0 0 92px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 9px 4px; border-left: 1px solid var(--line); cursor: pointer;
}
.mhead .mopt { cursor: default; padding: 8px 4px 6px; justify-content: flex-start; }
.mlab { font-size: 13px; text-align: center; line-height: 1.25; }
.mlab-en { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; margin-top: 2px; }
.mnum { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.mopt input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.mopt.checked { background: var(--brand-soft); }
.mopt:hover { background: #fdf5ee; }
.mhead .mopt:hover { background: transparent; }
.mrow.missing { background: #fdf1ef; }

/* 窄屏下量尺改成"每题一块、选项平铺"，标签移到选项里面，
   避免 5 个选项被挤到屏幕外，学生只看得见前两个。 */
.mopt .opt-no,
.mopt .opt-cn,
.mopt .opt-en { display: none; }

@media (max-width: 560px) {
  .mhead { display: none; }
  .mrow { flex-direction: column; }
  .mrow:not(.mhead) { padding-bottom: 4px; }
  .mtext { min-width: 0; padding: 11px 12px 6px; }
  .mopts {
    flex-wrap: wrap; gap: 6px; padding: 0 10px 10px;
    border-top: 0;
  }
  .mopt {
    flex: 1 1 0; min-width: 0;
    border: 1px solid var(--line); border-radius: 10px;
    padding: 7px 4px 8px; gap: 3px;
  }
  .mopt:first-child { border-left: 1px solid var(--line); }
  .mopt .opt-no { display: block; font-size: 11px; color: var(--muted); }
  .mopt .opt-cn { display: block; font-size: 12.5px; text-align: center; line-height: 1.2; }
  .mopt .opt-en { display: block; font-size: 9.5px; color: var(--muted); text-align: center; line-height: 1.15; }
  .mopt.checked { border-color: var(--brand); }
  .scale-hint { display: block; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
}

.scale-hint { display: none; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .big { font-size: 24px; }
  .wrap { padding: 14px 12px 50px; }
  .consent-panel iframe { height: 50vh; }
}

@media (max-width: 720px) {
  .mtext { min-width: 200px; }
  .mopt { flex: 0 0 76px; }
  .mlab { font-size: 12px; }
  .mlab-en { font-size: 10px; }
}
