/* skeleton-v2.css —— 骨架层：心电图状态条 / 睡眠模式 / 思考链微光
 * 只加不改：原有 styles.css 一个字不动，这一层独立覆盖。
 * 2026-10-23 小d · 骨架第一批
 */

/* ---------- 1. 心电图：底部极细状态条 ---------- */
.vitals {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 22px;
  padding: 0 14px calc(env(safe-area-inset-bottom, 0px));
  font: 500 10.5px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
  color: #8d8377;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.96), rgba(10, 10, 12, 0.55));
  border-top: 1px solid rgba(242, 181, 68, 0.12);
  backdrop-filter: blur(6px);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
.vitals .vt-model { color: #c9bfae; }
.vitals .vt-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #7fae8a; box-shadow: 0 0 6px rgba(127, 174, 138, 0.7);
  flex: none;
}
.vitals .vt-dot.is-warn { background: #f2b544; box-shadow: 0 0 6px rgba(242, 181, 68, 0.8); }
.vitals .vt-dot.is-bad  { background: #c25b4e; box-shadow: 0 0 6px rgba(194, 91, 78, 0.8); }
.vitals .vt-spacer { flex: 1 1 auto; }
.vitals .vt-sleep {
  border: 0; background: transparent; color: #8d8377;
  font: inherit; cursor: pointer; padding: 2px 4px;
  flex: none;
}
.vitals .vt-model { flex: 0 1 auto; min-width: 0; }
.vitals .vt-sleep:hover { color: #f2b544; }

/* 主内容别被状态条压住 */
.app { padding-bottom: 22px; }
.chat-footer { bottom: 22px; }

/* ---------- 2. 睡眠模式（低功耗守护） ---------- */
body.sleep { --sleep-dim: 0.22; }
body.sleep .ambient,
body.sleep .presence-dot,
body.sleep .music-frame,
body.sleep video { display: none !important; }
body.sleep * {
  animation: none !important;
  transition: none !important;
}
body.sleep .core-zone,
body.sleep .chat-log,
body.sleep .msg-bubble { filter: brightness(var(--sleep-dim)) saturate(0.5); }
body.sleep .vitals { opacity: 0.55; }
body.sleep::after {
  content: "";
  position: fixed; inset: 0; z-index: 55; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 100%, rgba(242, 181, 68, 0.05), transparent 65%);
}

/* ---------- 3. 思考链：折叠时留一道微光 ---------- */
.think > summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding-left: 14px;
  color: #8d8377;
}
.think > summary::-webkit-details-marker { display: none; }
.think > summary::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: #f2b544;
  opacity: 0.55;
  animation: thinkBreath 2.4s ease-in-out infinite;
}
.think[open] > summary::before { animation: none; opacity: 0.25; }
@keyframes thinkBreath {
  0%, 100% { opacity: 0.28; box-shadow: 0 0 0 rgba(242, 181, 68, 0); }
  50%      { opacity: 0.7;  box-shadow: 0 0 8px rgba(242, 181, 68, 0.55); }
}
body.sleep .think > summary::before { animation: none; }

/* ---------- 4. 抽屉：一屏对话，入口不抢主屏 ---------- */
.drawer-btn {
  position: fixed;
  left: 14px;
  top: 12px;
  z-index: 70;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(242, 181, 68, 0.18);
  background: rgba(18, 17, 20, 0.72);
  color: #c9bfae;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.drawer-btn:hover { color: #f2b544; border-color: rgba(242, 181, 68, 0.45); }

/* 抽屉按钮固定左上，把各视图的返回键让开 */
.view-header .back { margin-left: 40px; }

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 68;
  background: rgba(6, 6, 8, 0.55);
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  z-index: 72;
  left: 0;
  top: 0;
  bottom: 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 16px;
  background: linear-gradient(160deg, rgba(24, 22, 26, 0.98), rgba(14, 13, 16, 0.98));
  border-right: 1px solid rgba(242, 181, 68, 0.14);
  box-shadow: 22px 0 48px rgba(0, 0, 0, 0.55);
  animation: drawerIn 160ms ease-out;
}
@keyframes drawerIn { from { transform: translateX(-12px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.drawer-head {
  font: 600 15px/1.2 "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0.14em;
  color: #ece6da;
}
.drawer-head .drawer-sub {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8d8377;
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-item {
  text-align: left;
  padding: 10px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b7ae9f;
  font: 500 13.5px/1.2 "Noto Sans SC", system-ui, sans-serif;
  cursor: pointer;
}
.drawer-item:hover, .drawer-item:focus-visible {
  background: rgba(242, 181, 68, 0.09);
  color: #f2b544;
  outline: none;
}
.drawer-close {
  margin-top: 0;
  padding: 9px;
  border: 1px solid rgba(242, 181, 68, 0.16);
  border-radius: 8px;
  background: transparent;
  color: #8d8377;
  font: 500 12px/1 "Noto Sans SC", system-ui, sans-serif;
  cursor: pointer;
}
#drawerClose { margin-top: auto; }
.drawer-close:hover { color: #f2b544; }

/* 窄屏抽屉占 78% 宽，别顶到边 */
@media (max-width: 480px) {
  .drawer { width: 78vw; }
}

/* ---------- 5. 窄屏兜底 ---------- */
@media (max-width: 480px) {
  /* 手机只留三样：状态灯、首字耗时、睡眠按钮 —— 其余收起，别把 22px 挤成两行 */
  .vitals { gap: 8px; padding: 0 10px; }
  .vitals #vtTok,
  .vitals #vtCache { display: none; }
  .vitals .vt-model { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .vitals .vt-sleep { margin-left: auto; }
}

@media (max-width: 420px) {
  .vitals { gap: 6px; padding: 0 8px; font-size: 10px; }
  .vitals .vt-model { max-width: 76px; }
}
