:root {
  --brand: #185fa5;
  --brand-soft: #e6f1fb;
  --ink: #1f2329;
  --ink-2: #5f5e5a;
  --ink-3: #8a8f99;
  --line: rgba(0, 0, 0, 0.1);
  --page: #f4f6f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

#app { min-height: 100vh; }

.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.muted { color: var(--ink-3); font-size: 12px; }

/* ---------- 学生端 ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 28px 16px 48px; }

.hero { text-align: center; padding: 12px 0 24px; }
.hero-title { font-size: 20px; font-weight: 500; }
.hero-sub { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 10px;
}
.topbar-title { font-size: 15px; font-weight: 500; }
.topbar-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.survey-list {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.survey-card { cursor: pointer; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.type-tag { font-size: 12px; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 2px 8px; }
.status-tag { font-size: 12px; border-radius: 6px; padding: 2px 8px; background: #f1efe8; color: #5f5e5a; }
.status-tag.todo { background: #faeeda; color: #854f0b; }
.status-tag.done { background: #eaf3de; color: #3b6d11; }
.survey-title { font-size: 16px; font-weight: 500; margin: 10px 0 4px; }
.survey-desc { font-size: 13px; color: var(--ink-2); }
.survey-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 14px; }
.cta { color: var(--brand); }

.question { max-width: 560px; margin: 0 auto; padding: 6px 16px 48px; }
.question-title { font-size: 18px; font-weight: 500; line-height: 1.5; }
.question-desc { font-size: 13px; color: var(--ink-2); margin: 10px 0 18px; white-space: pre-wrap; }

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
  cursor: pointer;
}
.option.active { border-color: var(--brand); background: #f2f7fd; }
.option input[type="radio"], .option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.option-label { flex: 1; font-size: 15px; word-break: break-word; }
.option-badge { font-size: 11px; color: #854f0b; background: #faeeda; border-radius: 4px; padding: 1px 6px; flex: none; }
.other-input { flex: 1; border: 0; outline: none; font-size: 14px; background: transparent; min-width: 0; }
.other-hint { font-size: 12px; color: var(--ink-3); margin: -2px 0 12px; }

.submit-bar { position: sticky; bottom: 0; padding: 12px 0 8px; background: linear-gradient(to top, var(--page) 70%, rgba(244, 246, 249, 0)); }

/* 多题问卷：一页内每题一块 */
.q-block {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.q-block:first-of-type { border-top: 0; margin-top: 12px; padding-top: 0; }
.q-head { display: flex; align-items: baseline; gap: 8px; }
.q-index {
  flex: none;
  width: 22px; height: 22px; line-height: 22px;
  text-align: center; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 500;
}
.q-title { font-size: 16px; font-weight: 500; line-height: 1.5; word-break: break-word; }
.q-type { font-size: 12px; color: var(--ink-3); margin: 6px 0 12px 30px; }

/* ---------- 教师端 ---------- */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 20px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.admin-title { font-size: 18px; font-weight: 500; }
.admin-tabs { margin-bottom: 16px; }
.login-wrap { max-width: 380px; margin: 12vh auto; padding: 0 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat-num { font-size: 26px; font-weight: 500; line-height: 1.2; }
.stat-lbl { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.bar-row { margin-bottom: 14px; }
.bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.bar-val { color: var(--ink-3); flex: none; }
.bar-track { height: 10px; background: #eceff3; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 6px; transition: width .3s ease; }
.bar-fill.alt { background: #97c459; }

.answer-wall { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.answer-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.answer-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }

.section-title { font-size: 14px; font-weight: 500; margin: 20px 0 10px; }
.qr-box { text-align: center; padding: 8px 0; }
.qr-box img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 8px; }
.option-editor-row { display: flex; gap: 8px; margin-bottom: 8px; }
.name-cell { font-weight: 500; }

/* 多题问卷：编辑弹窗里每题的卡片 */
.q-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 16px 2px;
  margin-bottom: 14px;
  background: #fbfcfd;
}
.q-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 2px;
}
.q-editor-idx {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 2px 10px;
}

/* 统计弹窗里每题的区块 */
.stat-part {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 2px;
}
.stat-part:first-of-type { border-top: 0; margin-top: 4px; }