/* ===========================================================================
 * 老板笔记（#sub-notebook）· 独立样式表
 * ---------------------------------------------------------------------------
 * 为什么单开文件：全站铁律 —— 不往 style.css 里加（80KB、多会话并发在改）。
 * 本文件在 index.html 里排在 style.css 与其它板块 css 之后加载。
 *
 * 🔴 两条硬约束（踩过的坑）
 *   ① 所有选择器必须带 `#sub-notebook` 作用域 —— `.hero-slogan` 那次裸类名
 *      连带把代理后台的 slogan 干掉过，本项目对"裸类名"零容忍。
 *   ② `.nb-compose` / `.nb-card` 里都有 absolute 装饰（折角、色条），
 *      容器必须 position:relative —— 否则装饰会按 right 撑宽 document，
 *      手机端整页缩成 77%（桌面看不出来）。
 *
 * 视觉基调：暖白"纸感" + 品牌橙点缀。老板板块整体是深琥珀，笔记是纸，
 * 辨识度靠质感而不是换主色（主色 #f95901 不许换）。
 * =========================================================================== */

#sub-notebook {
  --nb-paper: #fffdf9;
  --nb-paper2: #fdf6ec;
  --nb-ink: #2a2118;
  --nb-ink2: #8b7a68;
  --nb-ink3: #b3a394;
  --nb-line: rgba(150, 100, 50, .14);
  --nb-amber: #b45309;
  --nb-brand: #f95901;
  --nb-shadow: 0 2px 10px rgba(122, 58, 18, .07);
  --nb-shadow2: 0 6px 22px rgba(122, 58, 18, .12);
  /* 🔴 底部留白：fixed TabBar 实测高 74px，不留会被挡住按钮 */
  padding-bottom: 96px;
}

/* `hidden` 会被 display:flex/grid 盖掉，必须显式压掉（全站通病） */
#sub-notebook [hidden] { display: none !important; }

/* ===================== 顶部：本子脊背 ===================== */
#sub-notebook .nb-ridge {
  height: 4px;
  margin: 0 14px 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #7a3a12 0%, #c2701f 45%, #f0a95c 100%);
  opacity: .85;
}

/* ===================== 头部 ===================== */
#sub-notebook .nb-head { padding: 14px 16px 6px; }
#sub-notebook .nb-head-t {
  font-size: 23px; font-weight: 800; letter-spacing: .5px;
  color: var(--nb-ink);
}
#sub-notebook .nb-head-d {
  margin-top: 5px; font-size: 13px; line-height: 1.55; color: var(--nb-ink2);
}
#sub-notebook .nb-gains {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
#sub-notebook .nb-gain {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px;
  background: var(--nb-paper2); color: #8a5a24;
  border: 1px solid rgba(180, 83, 9, .14);
}

/* ===================== 速记区（便签纸） ===================== */
#sub-notebook .nb-compose {
  position: relative;                 /* 🔴 折角是 absolute，必须 relative */
  margin: 12px 14px 0;
  background: var(--nb-paper);
  border: 1px solid var(--nb-line);
  border-radius: 14px;
  box-shadow: var(--nb-shadow);
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
}
#sub-notebook .nb-compose:focus-within {
  border-color: rgba(249, 89, 1, .38);
  box-shadow: var(--nb-shadow2);
}
/* 左上折角：便签的隐喻，纯装饰 */
#sub-notebook .nb-compose::before {
  content: ''; position: absolute; left: 0; top: 0;
  border-width: 0 16px 16px 0; border-style: solid;
  border-color: transparent var(--nb-paper2) transparent transparent;
  transform: rotate(180deg);
  opacity: .9;
}
#sub-notebook .nb-input {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 84px; max-height: 40vh; resize: none;
  padding: 15px 15px 6px 17px;
  border: 0; outline: none; background: transparent;
  font-size: 15px; line-height: 1.62; color: var(--nb-ink);
  font-family: inherit;
}
#sub-notebook .nb-input::placeholder { color: #bcae9c; line-height: 1.62; }
#sub-notebook .nb-compose-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 12px 11px 15px;
  border-top: 1px dashed var(--nb-line);
}
#sub-notebook .nb-hint { font-size: 11.5px; color: var(--nb-ink2); }
#sub-notebook .nb-hint.warn { color: #c2410c; }
#sub-notebook .nb-save {
  flex: none; border: 0; cursor: pointer;
  padding: 9px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f95901, #d94804);
  box-shadow: 0 3px 10px rgba(249, 89, 1, .28);
  transition: transform .12s, box-shadow .18s, opacity .18s;
}
#sub-notebook .nb-save:active { transform: scale(.96); }
#sub-notebook .nb-save[disabled] { opacity: .5; cursor: default; box-shadow: none; }

/* ===================== 工具行 ===================== */
#sub-notebook .nb-tools {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 8px;
}
#sub-notebook .nb-search-wrap {
  position: relative; flex: 1 1 auto; min-width: 0;
}
#sub-notebook .nb-search-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: 13px; opacity: .55; pointer-events: none;
}
#sub-notebook .nb-search {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px 9px 31px; border-radius: 10px;
  border: 1px solid var(--nb-line); background: var(--nb-paper);
  font-size: 13.5px; color: var(--nb-ink); outline: none;
  -webkit-appearance: none; appearance: none;
}
#sub-notebook .nb-search:focus { border-color: rgba(249, 89, 1, .38); }
#sub-notebook .nb-review-btn {
  flex: none; cursor: pointer; border: 1px solid rgba(180, 83, 9, .22);
  background: var(--nb-paper2); color: #8a5a24;
  padding: 9px 12px; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
#sub-notebook .nb-review-btn:active { transform: scale(.97); }

/* ===================== 列表 ===================== */
#sub-notebook .nb-list { padding: 4px 14px 0; }
#sub-notebook .nb-card {
  position: relative;                       /* 🔴 左侧色条是 absolute */
  background: var(--nb-paper);
  border: 1px solid var(--nb-line);
  border-radius: 13px;
  padding: 12px 14px 11px 18px;
  margin-bottom: 9px;
  box-shadow: var(--nb-shadow);
  cursor: pointer;
  transition: transform .13s, box-shadow .18s, border-color .18s;
}
#sub-notebook .nb-card:active { transform: scale(.985); }
#sub-notebook .nb-card:hover { box-shadow: var(--nb-shadow2); }
/* 索引色条：像笔记本侧面的标记 */
#sub-notebook .nb-card::before {
  content: ''; position: absolute; left: 7px; top: 13px; bottom: 13px;
  width: 3px; border-radius: 3px;
  background: rgba(180, 83, 9, .18);
}
#sub-notebook .nb-card.on::before {
  background: linear-gradient(180deg, #f95901, #f0a95c);
}
#sub-notebook .nb-card-top {
  display: flex; align-items: baseline; gap: 6px;
}
#sub-notebook .nb-card-t {
  flex: 1 1 auto; min-width: 0;
  font-size: 14.5px; font-weight: 700; color: var(--nb-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#sub-notebook .nb-pin-flag { flex: none; font-size: 12px; }
#sub-notebook .nb-card-d {
  margin-top: 4px; font-size: 12.5px; line-height: 1.55; color: var(--nb-ink2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
#sub-notebook .nb-card-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 7px;
}
#sub-notebook .nb-time { font-size: 11px; color: #b3a394; }
#sub-notebook .nb-tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(249, 89, 1, .08); color: #b45309;
  border: 1px solid rgba(249, 89, 1, .14);
}
#sub-notebook .nb-tag.ai { background: rgba(16, 122, 87, .08); color: #0f766e; border-color: rgba(16, 122, 87, .16); }

/* ===================== 空态 ===================== */
#sub-notebook .nb-empty {
  margin: 6px 14px 0; padding: 18px 16px 16px;
  border: 1px dashed rgba(180, 83, 9, .28);
  border-radius: 14px; background: rgba(253, 246, 236, .6);
  text-align: center;
}
#sub-notebook .nb-empty-t { font-size: 14px; font-weight: 700; color: #8a5a24; }
#sub-notebook .nb-empty-d { margin-top: 6px; font-size: 12.5px; color: var(--nb-ink2); line-height: 1.6; }
#sub-notebook .nb-samples { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
#sub-notebook .nb-sample {
  cursor: pointer; text-align: left;
  padding: 9px 12px; border-radius: 10px;
  background: var(--nb-paper); border: 1px solid var(--nb-line);
  font-size: 12.5px; color: var(--nb-ink); line-height: 1.5;
}
#sub-notebook .nb-sample:active { transform: scale(.98); }
#sub-notebook .nb-sample b { color: var(--nb-amber); }

/* ===================== 详情视图 ===================== */
#sub-notebook .nb-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 4px;
}
#sub-notebook .nb-bar-btn {
  cursor: pointer; border: 1px solid var(--nb-line);
  background: var(--nb-paper); color: var(--nb-ink2);
  padding: 7px 12px; border-radius: 9px; font-size: 12.5px;
}
#sub-notebook .nb-bar-btn:active { transform: scale(.97); }
#sub-notebook .nb-bar-btn.danger { color: #b91c1c; border-color: rgba(185, 28, 28, .22); }
#sub-notebook .nb-bar-sp { flex: 1 1 auto; }
#sub-notebook .nb-meta {
  padding: 2px 16px 0; font-size: 11.5px; color: #b3a394;
}
#sub-notebook .nb-edit {
  display: block; width: calc(100% - 28px); box-sizing: border-box;
  margin: 10px 14px 0;
  /* 高度自适应：内容多高就多高（JS 按 scrollHeight 给值）。
     原先写死 40vh，一条短笔记也会占掉大半屏，把「整理结果」压到屏幕外。 */
  min-height: 118px; max-height: 46vh; resize: none;
  padding: 14px 15px; border-radius: 13px;
  border: 1px solid var(--nb-line); background: var(--nb-paper);
  font-size: 15px; line-height: 1.68; color: var(--nb-ink);
  font-family: inherit; outline: none;
  box-shadow: var(--nb-shadow);
}
#sub-notebook .nb-edit:focus { border-color: rgba(249, 89, 1, .35); }
#sub-notebook .nb-detail-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 0;
}
#sub-notebook .nb-savestate { flex: 1 1 auto; font-size: 11.5px; color: var(--nb-ink2); }
#sub-notebook .nb-primary {
  flex: none; cursor: pointer; border: 0;
  padding: 11px 18px; border-radius: 11px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #b45309, #7a3a12);
  box-shadow: 0 4px 12px rgba(122, 58, 18, .25);
  transition: transform .12s, opacity .18s;
}
#sub-notebook .nb-primary:active { transform: scale(.96); }
#sub-notebook .nb-primary[disabled] { opacity: .5; box-shadow: none; cursor: default; }
#sub-notebook .nb-ghost {
  flex: none; cursor: pointer; border: 1px solid var(--nb-line);
  background: var(--nb-paper); color: var(--nb-ink2);
  padding: 10px 14px; border-radius: 11px; font-size: 13px;
}

/* ===================== 报告（整理 / 回顾共用） ===================== */
#sub-notebook .nb-report {
  margin: 14px 14px 0; padding: 16px 16px 18px;
  background: var(--nb-paper); border: 1px solid var(--nb-line);
  border-radius: 14px; box-shadow: var(--nb-shadow);
  font-size: 14px; line-height: 1.72; color: var(--nb-ink);
}
#sub-notebook .nb-report h4 {
  margin: 16px 0 7px; font-size: 14.5px; font-weight: 800; color: #8a5a24;
  padding-left: 9px; border-left: 3px solid var(--nb-brand);
  line-height: 1.35;
}
#sub-notebook .nb-report h4:first-child { margin-top: 0; }
#sub-notebook .nb-report ul, #sub-notebook .nb-report ol { margin: 6px 0; padding-left: 20px; }
#sub-notebook .nb-report li { margin: 5px 0; }
#sub-notebook .nb-report p { margin: 7px 0; }
#sub-notebook .nb-report strong { color: #7a3a12; font-weight: 700; }
#sub-notebook .nb-report code {
  background: var(--nb-paper2); padding: 1px 5px; border-radius: 5px;
  font-size: 12.5px; color: #9a3412;
}
#sub-notebook .nb-report blockquote {
  margin: 8px 0; padding: 7px 12px; border-left: 3px solid rgba(180, 83, 9, .3);
  background: rgba(253, 246, 236, .7); border-radius: 0 8px 8px 0;
  color: #6b5642; font-size: 13px;
}
#sub-notebook .nb-report hr { border: 0; border-top: 1px dashed var(--nb-line); margin: 14px 0; }
#sub-notebook .nb-report table {
  width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px;
}
#sub-notebook .nb-report th, #sub-notebook .nb-report td {
  border: 1px solid var(--nb-line); padding: 7px 9px; text-align: left;
}
#sub-notebook .nb-report th { background: var(--nb-paper2); font-weight: 700; color: #8a5a24; }
/* 可打勾清单：整理出来的待办要能直接勾 */
#sub-notebook .nb-report li.nb-task { list-style: none; margin-left: -20px; padding-left: 20px; position: relative; }
#sub-notebook .nb-report li.nb-task::before {
  content: '☐'; position: absolute; left: 2px; top: 0;
  color: var(--nb-amber); font-size: 13px;
}
#sub-notebook .nb-report li.nb-task.done { color: #b3a394; text-decoration: line-through; }
#sub-notebook .nb-report li.nb-task.done::before { content: '☑'; }

/* 报告头（谁生成的 + 操作） */
#sub-notebook .nb-report-head {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 14px 0;
}
#sub-notebook .nb-report-head .nb-savestate { flex: 1 1 auto; }

/* 整理中的等待态（不造假百分比，只给节奏感） */
#sub-notebook .nb-loading {
  display: flex; align-items: center; gap: 9px;
  margin: 14px 14px 0; padding: 14px 15px;
  background: var(--nb-paper); border: 1px solid var(--nb-line);
  border-radius: 13px; font-size: 13px; color: var(--nb-ink2);
}
#sub-notebook .nb-spin {
  width: 15px; height: 15px; flex: none; border-radius: 50%;
  border: 2px solid rgba(180, 83, 9, .2); border-top-color: var(--nb-brand);
  animation: nbSpin .8s linear infinite;
}
@keyframes nbSpin { to { transform: rotate(360deg); } }

/* 搜索无结果 */
#sub-notebook .nb-nohit {
  margin: 10px 4px; padding: 16px; text-align: center;
  font-size: 13px; color: var(--nb-ink2);
}

/* 轻提示（保存成功 / 已复制） */
#sub-notebook .nb-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(42, 33, 24, .92); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 13px;
  z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none;
}
#sub-notebook .nb-toast.on { opacity: 1; }
