/* 话说 — 全局样式补充。绝大部分样式走 Tailwind，这里只放原子类不方便覆盖的部分

   配色纪律（与 index.html 的 tailwind.config 一致）：
     底/面/字/线 = 中性灰阶：纸 #fff / 填充 #f4f4f5 / 描边 #e4e4e7 / 正文 #1a1a1a
     霁红 #9e2b2b 只出现在：logo、装订线、选中描边、标签、小徽记、主按钮
   一句话判断标准：如果去掉这处红色，用户还能认出这是「话说」吗？
   答案是「能」的地方，就不该用红。 */

* { -webkit-tap-highlight-color: transparent; }

/* 中文正文的可读性细节：
   1. optical sizing 和 kerning 让 PingFang 在小字号下不发虚；
   2. 标题统一 700，正文 400 —— 层级靠字重和字号一起拉开。 */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  letter-spacing: .01em;
}
/* 数字用等宽，时间戳对齐后才不会跳 */
.tabular-nums { font-variant-numeric: tabular-nums; }

html, body { margin:0; padding:0; height:100%; background:#ffffff; }

/* 隐藏滚动条但保留滚动 */
.scroll-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scroll-hide::-webkit-scrollbar { display: none; }

/* 顶栏图标按钮 */
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #5f5f68;
  transition: background .18s, color .18s;
}
.icon-btn:active { background: #f4f4f5; color: #1a1a1a; }

/* ---------- 标题字重 ---------- */
/* 所有层级的标题统一加粗。纯白底上标题若只靠颜色变深，扫视时会和正文糊在一起；
   加到 700 之后，版块边界一眼就能切出来。 */
h1, h2, h3, h4 { font-weight: 700; }
.sec-title { font-weight: 700; color: #1a1a1a; letter-spacing: .01em; }

/* 小节标题左侧的霁红短竖标。
   这是「小板块」的标识用色：一道 2px 的红，宽度不到标题的十分之一，
   却足够让每个版块的起点被认出来。比整条红色分割线安静得多。 */
.sec-mark {
  display: inline-block;
  width: 2px;
  height: 11px;
  border-radius: 1px;
  background: #9e2b2b;
  margin-right: 7px;
  vertical-align: -1px;
}

/* ---------- 底部导航 ---------- */
/* 四个文字 tab，选中加深、加粗，不用高饱和色跳出来 */
.tab-item {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  position: relative;
  color: #8e8e96; font-size: 13.5px; letter-spacing: .02em;
  transition: color .18s;
}
.tab-item[data-active="true"] { color: #1a1a1a; font-weight: 700; }
/* 选中态多给一个极小的红点。这是导航里唯一的红，
   点很小但位置固定，扫一眼就知道「我在哪一栏」。 */
.tab-item[data-active="true"]::after {
  content: ''; position: absolute; bottom: 7px;
  width: 3px; height: 3px; border-radius: 50%;
  background: #9e2b2b;
}

/* 中间的语音小方块：霁红实色，不用渐变（渐变是最典型的「生成感」）。
   圆角刻意不对称 —— 左上和右下比另外两角大 2px，
   像一枚手刻的印章而不是标准圆角矩形。 */
.mic-tab {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.mic-square {
  width: 40px; height: 40px;
  border-radius: 14px 11px 14px 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: #9e2b2b;
  transition: transform .16s, background .16s;
}
.mic-square:active {
  transform: scale(.92);
  background: #8a2424;
}

/* ---------- 侧边栏 ---------- */
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: none; } }
.drawer-in { animation: drawerIn .26s cubic-bezier(.2,.8,.25,1) both; }

/* ---------- 统计分拣条 ---------- */
/* 孵化页和归档页顶部的分组切换。
   它同时是「统计」和「筛选」：数字告诉你有多少，点一下就只看这一组。
   做成横向可滚动的胶囊而不是等宽分段控件 —— 归档有三组、孵化有五组，
   组数会变，等宽控件在组数多时字会挤。 */
.sortbar {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  scrollbar-width: none;
}
.sortbar::-webkit-scrollbar { display: none; }

/* 未选中：纯白底 + 中性描边，安静得像表格 */
.sort-chip {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 9px 13px 8px;
  border-radius: 11px 4px 11px 4px;
  background: #fff;
  border: 1px solid #e4e4e7;
  text-align: left;
  transition: border-color .16s, transform .12s, box-shadow .16s;
}
.sort-chip:active { transform: scale(.97); }
.sort-chip > .n {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}
.sort-chip > .t {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: #8e8e96;
}
/* 选中：霁红描边 + 红数字，底色仍是纯白。
   「边框和标签用红」正是这里 —— 不填色块，白底才守得住黑白分明。 */
.sort-chip[data-on="true"] {
  border-color: #9e2b2b;
  box-shadow: inset 0 0 0 1px #9e2b2b;
}
.sort-chip[data-on="true"] > .n { color: #9e2b2b; }
.sort-chip[data-on="true"] > .t { color: #3f3f46; font-weight: 700; }

/* ---------- 卡片 ---------- */
/* 极轻的卡片：纯白底 + 细中性描边，去掉重投影 */
.soft {
  background:#fff;
  border: 1px solid #e8e8eb;
  box-shadow: none;
}
.soft:active { background:#fafafa; }

/* 卡片正文的行数限制。
   用 line-clamp 而不是按字数截断：字数截断在中英混排、
   有换行的文本上完全不准—— 同样 60 字，可能占一行也可能占五行，
   卡片高度就跟着乱跳。按行裁剪才能保证列表里每张卡片高度一致。 */
.clamp-1, .clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }

/* 笔记卡片：像一张纸条。
   左边一道霁红装订线，圆角左小右大 ——
   手搓感来自这一点非对称，而不是加装饰。 */
.note-card {
  background: #fff;
  border: 1px solid #e8e8eb;
  border-radius: 2px 12px 13px 3px;
  box-shadow: none;
  transition: border-color .2s, transform .15s;
}
.note-card::before {
  content: '';
  position: absolute;
  left: -1px; top: 13px; bottom: 11px;
  width: 2px;
  border-radius: 2px;
  background: #d4a5a5;
}
.note-card:active {
  transform: scale(.994);
  border-color: #dcdce0;
}

/* 置顶：不加徽章、不换底色，只把装订线加深加宽。
   置顶是「这张纸被夹在最上面」，用同一个装订线语言表达最自然。 */
.note-card.is-pinned::before {
  width: 3px;
  background: #9e2b2b;
}

/* 子笔记（跟进）：比主卡片窄一截并左移缩进，
   靠缩进表达从属，而不是加「子笔记」标签。 */
.sub-card {
  background: #fafafa;
  border: 1px solid #e8e8eb;
  border-left: 2px solid #d4a5a5;
  border-radius: 2px 10px 10px 2px;
}

/* 三点菜单：默认压到很淡，触摸设备上一直可见但不吵；
   有指针的设备上悬停才浮起来。 */
.card-more { opacity: .34; }
.card-more:active { opacity: 1; }
@media (hover: hover) {
  .card-more { opacity: 0; }
  .note-card:hover .card-more { opacity: .5; }
  .card-more:hover { opacity: 1; background: #f4f4f5; }
}

/* ---------- 分段控件（回顾页周/月/年/自定义） ---------- */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #f4f4f5;
  border-radius: 11px;
}
.seg-item {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  font-size: 13px;
  color: #5f5f68;
  transition: background .18s, color .18s, box-shadow .18s;
}
/* 选中态用白片浮起 + 红字，红只落在字上，面积极小 */
.seg-item[data-on="true"] {
  background: #fff;
  color: #9e2b2b;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* ---------- 跟进（子笔记）时间线 ---------- */
/* 详情页里父笔记下方的追加记录。用左侧一道细线把它们串起来，
   表示「这些都挂在上面那条想法上」，而不是各自独立的卡片。
   节点用霁红小圆点 —— 属于「点缀」的正当用法。 */
.fu-item {
  position: relative;
  padding: 0 0 14px 16px;
}
.fu-item::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9e2b2b;
}
.fu-item::after {
  content: '';
  position: absolute;
  left: 3px; top: 15px; bottom: 0;
  width: 1px;
  background: #e4e4e7;
}
.fu-item:last-child { padding-bottom: 0; }
.fu-item:last-child::after { display: none; }

/* ---------- 动作菜单分组（上排横向图标 + 下方竖列） ---------- */
/* 上排：分享/编辑/复制，三个等宽的图标格，视觉上是「对这条内容做什么」 */
.menu-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.menu-quick > button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px;
  height: 82px;
  color: #3f3f46;
  font-size: 12.5px;
  transition: background .16s;
}
.menu-quick > button:active { background: #f4f4f5; }
/* 用极细分隔线切开三格，而不是给每格加卡片 */
.menu-quick > button + button { border-left: 1px solid #e8e8eb; }
.menu-quick > button > span:first-child {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: #f4f4f5;
  color: #5f5f68;
}

/* 下方竖列：整理/归档/置顶/删除，是「改变这条的状态」 */
.menu-list > button {
  width: 100%;
  height: 50px;
  display: flex; align-items: center; gap: 13px;
  padding: 0 18px;
  font-size: 14.5px;
  color: #1a1a1a;
  text-align: left;
  transition: background .16s;
}
.menu-list > button:active { background: #f4f4f5; }
.menu-list > button + button { border-top: 1px solid #efeff1; }
.menu-list > button > span:first-child {
  width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  color: #8e8e96;
  flex-shrink: 0;
}
.menu-list > button[data-danger="1"] { color: #8a2424; }
.menu-list > button[data-danger="1"] > span:first-child { color: #8a2424; }

/* 卡片入场动画 */
@keyframes cardIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
.card-in { animation: cardIn .3s cubic-bezier(.2,.7,.3,1) both; }

/* 弹层动画 */
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
.sheet-up { animation: sheetUp .3s cubic-bezier(.2,.8,.25,1) both; }
.fade-in  { animation: fadeIn .2s ease both; }

/* 录音时的呼吸光环 */
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(158,43,43,.35); }
  70%  { box-shadow: 0 0 0 22px rgba(158,43,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(158,43,43,0); }
}
.pulse-ring { animation: pulseRing 1.6s infinite; }

/* 声波条：录音时的霁红点缀，高度不齐才像真的在动 */
.wave-bar {
  width: 3px; border-radius: 2px; background: #9e2b2b;
  animation: waveMove .9s ease-in-out infinite;
}
@keyframes waveMove {
  0%,100% { height: 8px;  opacity:.4; }
  50%     { height: 30px; opacity:1;  }
}

/* Toast：白底上用近黑底白字，保持黑白分明 */
.toast {
  padding: 9px 16px; border-radius: 999px;
  background: rgba(26,26,26,.95); color:#fff;
  font-size: 13px;
  box-shadow: 0 8px 26px -8px rgba(0,0,0,.3);
  animation: fadeIn .2s ease both;
}

/* 长按选中态的轻微缩放反馈 */
.press-scale:active { transform: scale(.985); }

/* 生命周期时间轴竖线 */
.timeline-line::before {
  content:''; position:absolute; left:5px; top:16px; bottom:-6px;
  width:1px; background:#e4e4e7;
}
.timeline-item:last-child .timeline-line::before { display:none; }

/* 文本域自适应，去掉默认外观 */
textarea { resize: none; }
textarea:focus, input:focus, button:focus { outline: none; }
input, textarea { background:#f4f4f5; }

/* 详情页的可编辑正文：看起来是纸上的字，聚焦时才显出「这是输入框」。
   聚焦描边用霁红 —— 「边框用红」的典型场景，且只在交互瞬间出现。 */
.edit-body {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px;
  margin: -12px -12px 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: #1a1a1a;
  transition: background .18s, border-color .18s;
}
.edit-body:hover { background: #fafafa; }
.edit-body:focus {
  background: #fff;
  border-color: #9e2b2b;
}

/* 输入框聚焦：统一用霁红细描边，替掉浏览器默认蓝光圈 */
.field {
  background: #f4f4f5;
  border: 1px solid transparent;
  transition: border-color .16s, background .16s;
}
.field:focus {
  background: #fff;
  border-color: #9e2b2b;
}

/* ---------- 整理页：分类四格 / 归档原因三选 ---------- */
/* 选项一律「未选中=白底中性边，选中=白底霁红边 + 红字」。
   不填色块：一屏里若有四五个红底格子，红就不再是记号了。 */
.type-opt {
  padding: 12px 6px;
  border-radius: 11px 4px 11px 4px;
  background: #fff;
  border: 1px solid #e4e4e7;
  color: #5f5f68;
  text-align: center;
  transition: border-color .16s, color .16s, box-shadow .16s;
}
.type-opt:active { transform: scale(.98); }
.type-opt[data-on="true"] {
  border-color: #9e2b2b;
  box-shadow: inset 0 0 0 1px #9e2b2b;
  color: #9e2b2b;
  font-weight: 700;
}

/* 三栏横排：图标在上、词在下。一格只有两个字，横排左对齐会显得空荡。 */
.reason-opt {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 6px;
  border-radius: 12px 4px 12px 4px;
  background: #fff;
  border: 1px solid #e4e4e7;
  text-align: center;
  transition: border-color .16s, box-shadow .16s;
}
.reason-opt:active { transform: scale(.99); }
.reason-opt[data-on="true"] {
  border-color: #9e2b2b;
  box-shadow: inset 0 0 0 1px #9e2b2b;
}
.reason-opt[data-on="true"] > span:last-child { color: #9e2b2b; }

/* 类型色带：只有「想法」用霁红，其余走中性深浅。
   这样红仍然是特指，不会变成一套彩虹分类色。 */
.accent-idea    { background:#9e2b2b; }
.accent-observe { background:#5f5f68; }
.accent-question{ background:#8e8e96; }
.accent-quote   { background:#b4b4bb; }

/* ---------- 回顾：记录节奏热力图 ---------- */
/* 一天一格。方块用 flex:1 自适应宽度而不是写死尺寸 ——
   区间从一周到一年，列数差 50 倍，写死宽度必然要么留白要么横向溢出。
   aspect-ratio 保证它始终是正方形，不会被拉成长条。 */
.heat-cell {
  flex: 1 1 0;
  min-width: 0;
  max-width: 22px;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  transition: transform .12s, outline-color .12s;
  outline: 1px solid transparent;
  outline-offset: 0;
}
/* 图例里的方块不参与拉伸，给固定小尺寸 */
.heat-legend {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  aspect-ratio: auto;
  border-radius: 2px;
}
/* 区间外补位：留空不画色，避免误读成「这天没记」 */
.heat-void { background: transparent; }
/* 有记录的格子可点，按下时描红一圈 */
.heat-cell[data-action]:active {
  transform: scale(.86);
  outline-color: #9e2b2b;
}
.heat-cell[data-n="0"] { cursor: default; }

/* 五档深浅写成固定类，不用 Tailwind 的 /25 透明度修饰符 ——
   热力图是运行时注入的，CDN 版 JIT 不保证为动态 DOM 生成这些类。 */
.heat-0 { background: #ececef; }
.heat-1 { background: #f0d5d5; }
.heat-2 { background: #d99b9b; }
.heat-3 { background: #bd5f5f; }
.heat-4 { background: #9e2b2b; }

/* 行列标注：比方块还要轻，只作定位参考 */
/* 行标列：和方块列同构，让每个行标跟着对应那一行的高度走。
   写死高度会在方块尺寸变化时错位。 */
.heat-rows {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 16px;
}
.heat-row-label {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 9px;
  line-height: 1;
  color: #b4b4bb;
}
.heat-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  max-width: 22px;
}
.heat-col-label {
  flex: 1 1 0;
  min-width: 0;
  max-width: 22px;
  font-size: 9px;
  line-height: 1;
  color: #8e8e96;
  white-space: nowrap;
  overflow: visible;
}
