/* ============ 盛和塾学习日问卷 · 共享设计令牌与组件 ============
   与旧版问卷包同一视觉体系（米色纸感 + 朱红强调），填写页与后台共用本文件。
   页面自身只写各自独有的布局，不改这里的令牌。 */

:root {
  --bg: #f6f2ec;
  --card: #fffdfa;
  --ink: #2b2622;
  --sub: #8a8279;
  --line: #e6ded2;
  --accent: #9c2f22;
  --accent-soft: #f8ece8;
  --danger: #b3261e;
  --ok: #1f7a52;
  --radius-card: 14px;
  --radius-opt: 11px;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* ---------- 版心 ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 140px; }

/* ---------- 头部 ---------- */
.hero { padding: 26px 2px 6px; }
.brand { font-size: 12px; letter-spacing: .3em; color: var(--accent); font-weight: 700; }
h1 { font-size: 22px; line-height: 1.45; margin: 10px 0 8px; font-weight: 700; letter-spacing: .01em; }
.lede { color: var(--sub); font-size: 14px; margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.meta span { font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 5px; }
.meta span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55; }

/* ---------- 进度条 ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; background: rgba(246, 242, 236, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 10px 2px 9px; border-bottom: 1px solid var(--line); margin-top: 16px;
}
.pcount { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin-bottom: 7px; }
.pcount b { color: var(--accent); font-weight: 700; }
.track { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .28s ease; }

/* ---------- 分组标题 ---------- */
.secTitle { font-size: 13px; letter-spacing: .18em; color: var(--sub); margin: 26px 0 -4px 4px; font-weight: 600; }
.secHint { font-size: 12.5px; color: var(--sub); margin: 6px 0 0 4px; line-height: 1.6; }

/* ---------- 题卡 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 17px 15px; margin: 13px 0; box-shadow: 0 1px 2px rgba(43, 38, 34, .03);
}
.qhead { display: flex; gap: 9px; align-items: flex-start; }
.qno {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; margin-top: 2px;
}
.qtitle { font-size: 16px; font-weight: 600; line-height: 1.55; margin: 0; }
.qtitle em { font-style: normal; color: var(--sub); font-weight: 400; font-size: 14px; margin-left: 4px; }
.req { color: var(--accent); font-size: 12px; margin-left: 4px; }
.qhint { font-size: 13px; color: var(--sub); margin: 9px 0 0; line-height: 1.6; }

/* ---------- 选项 ---------- */
.opts { display: grid; gap: 9px; margin-top: 14px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line);
  border-radius: var(--radius-opt); padding: 12px 13px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s; -webkit-tap-highlight-color: transparent; min-height: 46px;
}
.opt:hover { border-color: #d4c9ba; }
.opt input {
  -webkit-appearance: none; appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0;
  border: 1.5px solid #bdb3a6; background: #fff; border-radius: 50%; position: relative;
  transition: .15s; cursor: pointer;
}
.opt input[type=checkbox] { border-radius: 6px; }
.opt input:checked { border-color: var(--accent); background: var(--accent); }
.opt input[type=radio]:checked::after {
  content: ""; position: absolute; left: 5.5px; top: 5.5px; width: 7px; height: 7px; border-radius: 50%; background: #fff;
}
.opt input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.opt span { font-size: 15px; line-height: 1.5; }
.opt span i { display: block; font-style: normal; font-size: 12.5px; color: var(--sub); margin-top: 3px; line-height: 1.55; }
.opt:has(input:checked), .opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.opt.disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 输入 ---------- */
.txt {
  width: 100%; font: inherit; font-size: 15px; color: inherit; padding: 11px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.txt::placeholder { color: #b3aaa0; }
.txt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(156, 47, 34, .09); }
textarea.txt { min-height: 110px; resize: vertical; line-height: 1.7; margin-top: 12px; }
.otherWrap { margin-top: 10px; }
.otherWrap .txt { font-size: 14.5px; }
.counter { font-size: 12px; color: var(--sub); text-align: right; margin-top: 6px; }
.counter.warn { color: var(--danger); }

/* ---------- 校验 ---------- */
.errMsg { display: none; color: var(--danger); font-size: 13px; margin-top: 10px; line-height: 1.5; }
.q.invalid { border-color: #e2a49d; box-shadow: 0 0 0 3px rgba(179, 38, 30, .06); }
.q.invalid .errMsg { display: block; }

/* ---------- 按钮 ---------- */
.btn {
  font: inherit; font-size: 16.5px; font-weight: 600; border: 0; border-radius: 12px; cursor: pointer;
  padding: 15px 20px; letter-spacing: .05em; width: 100%; transition: opacity .15s, transform .08s;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sm { width: auto; font-size: 14.5px; padding: 10px 16px; letter-spacing: 0; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120; max-width: 86vw;
  transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none;
  background: #2b2622; color: #fff; font-size: 14px; line-height: 1.5; padding: 11px 18px;
  border-radius: 10px; transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 页脚 ---------- */
.foot { font-size: 12px; color: var(--sub); text-align: center; margin-top: 14px; line-height: 1.7; }
