/* 职业探索教练：孩子端 / 家长端 / 管理端共用样式。 */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #2b2a28;
  --ink-soft: #5f5c56;
  --line: #e3ded4;
  --accent: #2f6f5e;
  --accent-soft: #e7f1ec;
  --warn-bg: #fdf3e3;
  --warn-ink: #8a5a12;
  --danger: #a5442f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 42, 40, 0.06), 0 6px 18px rgba(43, 42, 40, 0.05);
}

* { box-sizing: border-box; }

/* 作者样式里的 display 会盖过 hidden 属性自带的 display:none，必须显式压回去。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

a { color: var(--accent); }
/* 像链接的按钮（反馈入口用），不抢正文的视觉重量 */
.linklike { background:none; border:0; padding:0; color:var(--accent); font:inherit; cursor:pointer; text-decoration:underline; }

.app { max-width: 880px; margin: 0 auto; padding: 0 16px 96px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  background: linear-gradient(var(--bg) 80%, rgba(246, 244, 239, 0));
}

.topbar h1 { font-size: 17px; margin: 0; letter-spacing: 0.02em; }
.topbar .spacer { flex: 1; }

.demo-banner {
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid #eedcbb; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; margin: 8px 0;
}
.demo-banner[hidden] { display: none; }
.demo-banner strong { display: block; }
/* 细节收在"详情"里：首屏只留一行，孩子先看到的是"从哪儿开始" */
.banner-detail { margin: 4px 0 0; }
.banner-detail summary { cursor: pointer; font-size: 12px; opacity: 0.85; }
.banner-detail p { margin: 4px 0 0; font-size: 12px; line-height: 1.55; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin: 12px 0;
}

.card h2 { font-size: 15px; margin: 0 0 8px; }
.card h3 { font-size: 14px; margin: 12px 0 4px; }

.muted { color: var(--ink-soft); font-size: 13px; }
.small { font-size: 13px; }

button, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer;
  font-family: inherit;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { color: var(--danger); border-color: #e5c9c1; }

input[type="text"], input[type="password"], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; color: inherit; background: var(--surface);
}
textarea { min-height: 72px; resize: vertical; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* 对话区 */

.chat { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }

.msg { max-width: 86%; padding: 12px 15px; border-radius: 16px; white-space: pre-wrap; }
.msg.coach { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: var(--shadow); }
.msg.child { background: var(--accent-soft); border: 1px solid #cfe3da; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.system { align-self: center; background: transparent; border: 1px dashed var(--line); color: var(--ink-soft); font-size: 13px; }

.question { font-weight: 600; margin-top: 8px; }
/* 检索状态行（"正在找相关资料"）：只在联网检索发生时出现，放在对话流里而不是覆盖内容。 */
.retrieval-status { align-self: flex-start; font-size: 13px; color: var(--ink-soft); font-style: italic; }

.composer { position: sticky; bottom: 0; background: linear-gradient(rgba(246, 244, 239, 0), var(--bg) 40%); padding: 10px 0 14px; }
/* 输入区里嵌的 .app 是为了跟正文同宽，但它不该继承外层的 96px 底部留白——
   那段留白是给"滚动内容不被 sticky 输入区盖住"用的，嵌进来就变成一片死空间
   （实测 900px 视口里白白占掉约 100px，手机上比例更高）。 */
.composer .app { padding-bottom: 0; }
.composer .inner { display: flex; gap: 8px; }
.composer textarea { flex: 1; min-height: 48px; max-height: 140px; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.quick-row button { font-size: 13px; padding: 9px 14px; border-radius: 999px; background: var(--surface); min-height: 38px; }

/* 事实卡 */

.fact { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: #fcfbf8; }
.fact summary { cursor: pointer; padding: 10px 14px; font-size: 14px; }
.fact[open] summary { border-bottom: 1px dashed var(--line); }
.fact .body { padding: 10px 14px 14px; font-size: 14px; }
.fact table { border-collapse: collapse; font-size: 13px; margin: 6px 0; width: 100%; }
.fact th, .fact td { text-align: left; padding: 4px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.fact th { color: var(--ink-soft); font-weight: 500; width: 34%; }
.fact .src { font-size: 12px; color: var(--ink-soft); word-break: break-all; }
.badge { display: inline-block; font-size: 12px; border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.badge.demo { background: var(--warn-bg); color: var(--warn-ink); }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
/* 来源参考（通用库概览 / 联网片段）：与"已审核资料"用不同颜色区分，避免孩子误当成已专业审核。 */
.badge.reference { background: #eef1f6; color: #43536b; border: 1px solid #dde3ec; }

/* 草稿卡（待确认） */

.draft-card { border: 1px dashed #c8b98f; background: #fffdf6; border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.draft-card .kind { font-size: 12px; color: var(--warn-ink); }
.draft-card input, .draft-card textarea { margin-top: 6px; background: #fff; }

/* 已保存的卡：实线、绿色系，跟"等你确认"的虚线草稿一眼分开。
   刚保存和刷新后回放用同一个样式，同一种东西不长两种样子。 */
.saved-card { border: 1px solid #cfe3da; background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.saved-card .kind { font-size: 12px; color: var(--accent); }

/* 资料架：翻出来的资料自成一块，不跟对话里的卡混在一起 */
.shelf { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.shelf-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }

/* 记录抽屉 */

.drawer { position: fixed; inset: 0; background: rgba(43, 42, 40, 0.4); display: flex; justify-content: flex-end; z-index: 30; }
.drawer[hidden] { display: none; }
.drawer .panel { width: min(560px, 100%); background: var(--bg); height: 100%; overflow-y: auto; padding: 18px; }
.drawer h2 { margin-top: 0; }
.record-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.record-item .meta { font-size: 12px; color: var(--ink-soft); }

/* 弹窗 */

.modal { position: fixed; inset: 0; background: rgba(43, 42, 40, 0.45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal[hidden] { display: none; }
.modal .box { background: var(--surface); border-radius: 16px; max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 20px; box-shadow: var(--shadow); }
.share-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.share-item input { width: auto; margin-top: 5px; }

/* 任务 */

.task-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); margin: 8px 0; }
.steps { margin: 6px 0; padding-left: 20px; font-size: 14px; }
.steps li { margin: 3px 0; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; align-items: center; }

/* 判断选择 */

.judge { display: flex; gap: 8px; flex-wrap: wrap; }
.judge button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 提示条 */

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #33322f; color: #fff; border-radius: 10px; padding: 10px 18px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }
.toast[hidden] { display: none; }

.empty { text-align: center; color: var(--ink-soft); padding: 32px 12px; font-size: 14px; }

.gate { max-width: 480px; margin: 8vh auto; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

code { background: #efece6; border-radius: 6px; padding: 1px 6px; font-size: 13px; word-break: break-all; }

@media (max-width: 640px) {
  .msg { max-width: 96%; }
  .app { padding: 0 10px 110px; }
  .drawer .panel { width: 100%; }
  /* 手机上快捷行收成一行横滑，省出竖向空间 */
  .quick-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .quick-row button { flex: 0 0 auto; }
  /* 横滑行的滚动条在窄屏上只是一条压在按钮下方的杂线，触屏本来就是滑动手势——
     照样能滑，只是不画那条线。 */
  .quick-row::-webkit-scrollbar { height: 0; }
  .quick-row { scrollbar-width: none; }
  /* 顶部现在有三个固定入口（看看资料 / 我的记录 / 先到这里），
     手机上不缩一点标题就会折成两行、把内容顶下去。触摸目标仍保持 ≥36px。 */
  .topbar { gap: 8px; }
  .topbar h1 { font-size: 15px; white-space: nowrap; }
  .topbar button { font-size: 12px; padding: 8px 10px; min-height: 36px; }
}

@media print {
  .topbar, .composer, .quick-row, button, .drawer, .modal { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
