/* 6周信念重塑训练营 · 心理疗愈风格·清新简洁 */
:root {
  --bg: #F5F8F4;
  --bg-warm: #FAF7F0;
  --surface: #FFFFFF;
  --primary: #2E5A4C;
  --primary-soft: #E7F0E9;
  --sage: #DCE9E0;
  --accent: #C6875C;
  --accent-soft: #FBF1E8;
  --ink: #2B3A34;
  --ink-2: #5C6F66;
  --ink-3: #8A9A91;
  --line: #E2EAE2;
  --line-2: #EEF3ED;
  --danger: #B4564B;
  --ok: #3F7C5E;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 2px 18px rgba(46, 90, 76, .05);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }

/* ---------- 通用 ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 18px 72px; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 0 24px 72px; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 760px; margin: 0 auto; padding: 13px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.wrap-wide .topbar-inner, .topbar-inner.wide { max-width: 1240px; padding-left: 24px; padding-right: 24px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 14px;
}
.brand-text { font-family: var(--serif); font-size: 15px; letter-spacing: .02em; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; }

.btn {
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
  font-size: 14px; line-height: 1.4; transition: .18s ease; background: var(--primary); color: #fff;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 14px; font-size: 15.5px; letter-spacing: .04em; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.hint { font-size: 12.5px; color: var(--ink-3); }
.muted { color: var(--ink-2); }

/* ---------- 学员端 Hero ---------- */
.hero { padding: 30px 2px 20px; }
.eyebrow { font-size: 11.5px; letter-spacing: .2em; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.hero h1 { font-family: var(--serif); font-size: clamp(23px, 5vw, 31px); line-height: 1.45; margin: 0 0 8px; font-weight: 600; color: var(--primary); }
.hero p { margin: 0; color: var(--ink-2); font-size: 14px; }
.notice {
  margin-top: 18px; padding: 13px 16px; border-left: 3px solid var(--sage);
  background: var(--bg-warm); border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 13.5px; color: var(--ink-2);
}

/* ---------- 天数导航 ---------- */
.progress-line { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; }
.progress-track { flex: 1; height: 6px; background: var(--sage); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s ease; }
.progress-text { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

.daynav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.daynav::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 1 0 auto; min-width: 92px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 11px 12px; text-align: left; transition: .18s ease; position: relative;
}
.day-chip:hover { border-color: var(--primary); }
.day-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.day-chip .d-label { font-size: 11px; opacity: .72; display: block; line-height: 1.3; letter-spacing: .06em; }
.day-chip .d-title { font-size: 13px; font-weight: 600; display: block; margin-top: 4px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.day-chip .d-dot { position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.day-chip.active .d-dot { background: #fff; }

/* ---------- 表单 ---------- */
.day-head { padding: 20px 22px 4px; }
.day-head .kicker { font-size: 11.5px; letter-spacing: .14em; color: var(--accent); }
.day-head h2 { font-family: var(--serif); font-size: 21px; margin: 4px 0 6px; color: var(--primary); font-weight: 600; }
.day-head p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.section { border-top: 1px solid var(--line-2); margin-top: 18px; padding: 20px 22px 4px; }
.section:first-of-type { border-top: none; margin-top: 10px; }
.section-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.section-num { font-family: var(--serif); font-size: 12px; color: #fff; background: var(--primary); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.section.side .section-num { background: var(--accent); }
.section-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.section-head .tag { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

.field { margin-bottom: 19px; }
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 7px; line-height: 1.6; }
.field-hint { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 7px; }
.field-note {
  padding: 12px 15px; background: var(--primary-soft); border-radius: var(--radius-s);
  font-family: var(--serif); font-size: 14.5px; color: var(--primary); line-height: 1.7;
}
.input, .textarea {
  width: 100%; border: 1px solid var(--line); background: #FBFCFA; border-radius: var(--radius-s);
  padding: 11px 13px; font-size: 16px; color: var(--ink); outline: none; transition: .18s ease;
}
.input:focus, .textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(46,90,76,.09); }
.input::placeholder, .textarea::placeholder { color: #AEBDB4; font-size: 14px; }
.textarea { resize: vertical; min-height: 76px; line-height: 1.7; }
.affix { display: flex; align-items: center; gap: 8px; }
.affix span { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.affix .input { flex: 1; }
.affix .suffix { font-size: 13px; color: var(--ink-3); }

.opts { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line);
  background: #FBFCFA; border-radius: var(--radius-s); padding: 10px 13px; cursor: pointer;
  transition: .16s ease; font-size: 14px; line-height: 1.5; min-width: 0;
}
.opt:hover { border-color: var(--primary); }
.opt.checked { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.opt input { display: none; }
.opt .box { width: 16px; height: 16px; border: 1.5px solid #B9C8BE; border-radius: 4px; flex: none; margin-top: 2px; display: grid; place-items: center; transition: .16s ease; }
.opt.checked .box { background: var(--primary); border-color: var(--primary); color: #fff; font-size: 11px; }
.opt .box::after { content: "✓"; opacity: 0; }
.opt.checked .box::after { opacity: 1; }
.opt-desc { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.opt.checked .opt-desc { color: #6A8879; }
.opt-main { font-weight: 500; }

.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale button {
  min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: #FBFCFA; color: var(--ink-2); font-size: 14px; transition: .16s ease;
}
.scale button:hover { border-color: var(--primary); }
.scale button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.scale-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; max-width: 460px; }

details.example { margin: 6px 22px 0; border: 1px dashed #E4D8C4; background: var(--bg-warm); border-radius: var(--radius-s); }
details.example summary { padding: 11px 15px; cursor: pointer; font-size: 13px; color: var(--accent); list-style: none; user-select: none; }
details.example summary::-webkit-details-marker { display: none; }
details.example summary::before { content: "＋"; margin-right: 8px; }
details.example[open] summary::before { content: "－"; }
.example-body { padding: 0 15px 14px; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; line-height: 1.85; border-top: 1px dashed #E4D8C4; padding-top: 12px; }

/* ---------- 身份 & 提交 ---------- */
.identity { margin-top: 24px; padding: 20px 22px; }
.identity h3 { margin: 0 0 4px; font-size: 15px; font-family: var(--serif); color: var(--primary); }
.identity .hint { margin-bottom: 16px; }
.id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.id-grid label { font-size: 12.5px; color: var(--ink-2); display: block; margin-bottom: 5px; }
.submit-area { margin-top: 18px; }
.form-msg { min-height: 22px; font-size: 13px; margin-top: 10px; text-align: center; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--danger); }
/* 留下你的记号：必填校验 */
.req { color: var(--danger); font-size: 11px; font-weight: 500; margin-left: 5px; }
.input.invalid { border-color: var(--danger); background: #FFF9F8; }
.input.invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(176,74,64,.10); }
.field-err { min-height: 15px; font-size: 11.5px; color: var(--danger); margin-top: 4px; }
#admin-msg { text-align: left; }
.foot-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 26px; line-height: 1.8; }

/* ---------- 我的记录 Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(28, 48, 40, .42); z-index: 50;
  display: none; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto;
}
.overlay.show { display: flex; }
.modal { width: 100%; max-width: 680px; background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: 0 18px 60px rgba(20,45,35,.18); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-family: var(--serif); font-size: 20px; margin: 0; color: var(--primary); }
.icon-btn { border: 1px solid var(--line); background: #fff; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-2); font-size: 16px; line-height: 1; flex: none; }
.lookup { display: flex; gap: 8px; flex-wrap: wrap; }
.lookup .input { flex: 1; min-width: 120px; }
.mine-summary { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.mine-summary .pill { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; }
.hist-day { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.hist-head { padding: 12px 15px; display: flex; align-items: center; gap: 10px; background: #FBFCFA; }
.hist-head .h-label { font-size: 13px; font-weight: 600; }
.hist-head .h-title { font-size: 12.5px; color: var(--ink-3); }
.badge { margin-left: auto; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.b-done { background: var(--primary-soft); color: var(--ok); }
.b-part { background: var(--accent-soft); color: var(--accent); }
.b-none { background: #F0F2EF; color: var(--ink-3); }
.hist-body { padding: 4px 15px 12px; }
.hist-item { padding: 9px 0; border-bottom: 1px dashed var(--line-2); font-size: 13.5px; }
.hist-item:last-child { border-bottom: none; }
.hist-item .k { color: var(--ink-3); font-size: 12px; display: block; }
.hist-item .v { white-space: pre-wrap; line-height: 1.7; }
.hist-time { font-size: 11.5px; color: var(--ink-3); padding: 0 15px 12px; }

/* ---------- 教务端 ---------- */
.login-wrap { max-width: 400px; margin: 12vh auto 0; padding: 28px; }
.login-wrap h1 { font-family: var(--serif); font-size: 22px; color: var(--primary); margin: 0 0 6px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 28px 2px 18px; flex-wrap: wrap; }
.admin-head h1 { font-family: var(--serif); font-size: 25px; color: var(--primary); margin: 0; }
.admin-head .sub { font-size: 13px; color: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { padding: 18px 20px; }
.stat .n { font-family: var(--serif); font-size: 30px; color: var(--primary); line-height: 1.2; }
.stat .t { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.panel { padding: 20px 22px; margin-bottom: 20px; }
.panel h2 { font-family: var(--serif); font-size: 17px; color: var(--primary); margin: 0 0 16px; }
.day-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.day-bar .lbl { font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; }
.day-bar .track { height: 9px; background: var(--sage); border-radius: 99px; overflow: hidden; }
.day-bar .fill { height: 100%; background: var(--primary); border-radius: 99px; }
.day-bar .num { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.table-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.table-tools .input { max-width: 240px; font-size: 14px; padding: 8px 12px; }
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
table.grid th, table.grid td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line-2); }
table.grid th { font-size: 12px; color: var(--ink-2); font-weight: 600; background: #FBFCFA; }
table.grid th:first-child, table.grid td:first-child { text-align: left; padding-left: 12px; }
table.grid tbody tr:hover { background: #FAFCFA; }
.cell { display: inline-block; min-width: 78px; padding: 4px 8px; border-radius: 8px; font-size: 12px; border: 1px solid transparent; }
.c-done { background: var(--primary-soft); color: var(--ok); border-color: #CDE2D3; }
.c-part { background: var(--accent-soft); color: var(--accent); border-color: #F0DCC8; }
.c-none { background: #F4F6F3; color: var(--ink-3); border-color: var(--line); }
.linklike { background: none; border: none; color: var(--primary); font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 14px; }
.detail-day { border-top: 1px solid var(--line-2); padding: 14px 0; }
.detail-day h4 { margin: 0 0 8px; font-size: 14px; color: var(--primary); }
.detail-item { font-size: 13px; margin: 7px 0; }
.detail-item .k { color: var(--ink-3); font-size: 12px; }
.detail-item .v { white-space: pre-wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .wrap, .wrap-wide { padding-left: 14px; padding-right: 14px; }
  .topbar-inner, .topbar-inner.wide { padding-left: 14px; padding-right: 14px; }
  .hero { padding-top: 22px; }
  .day-head, .section, .identity { padding-left: 16px; padding-right: 16px; }
  details.example { margin-left: 16px; margin-right: 16px; }
  .id-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .day-bars { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 18px; }
  .brand-sub { display: none; }
  .opt { flex: 1 1 100%; }
}
