:root, [data-theme="dark"] {
  --bg: #0f1115;
  --panel: #171a20;
  --panel-2: #1d2128;
  --ink: #e8eaed;
  --sub: #9aa1ad;
  --muted: #6b7280;
  --line: #262b33;
  --brand: #4F7CFF;
  --accent: #4F7CFF;
  --user-bubble: #232832;
  --good: #3fb950;
  --warn: #d29922;
  --shadow: rgba(0,0,0,.35);
  /* 状态三态（与 biorhythm-psi.html 统一）：蓝=连接中 / 绿=已同步 / 红=离线仅本机 */
  --green: #3fb950;
  --blue: #4c8dff;
  --red: #f2555a;
  /* 表单控件底色/文字（下拉框 + 填写框）随主题统一 */
  --field-bg: #000000;
  --field-ink: #ffffff;
  --field-ph: #b5b5b5;
  --field-hover: #333333;
}
[data-theme="light"] {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f1f3f5;
  --ink: #1f2329;
  --sub: #6b7280;
  --muted: #9ca3af;
  --line: #e5e7eb;
  --brand: #4F7CFF;
  --accent: #4F7CFF;
  --user-bubble: #f3f4f6;
  --good: #2da44e;
  --warn: #bf8700;
  --shadow: rgba(0,0,0,.06);
  --green: #16a34a;
  --blue: #2f6fd0;
  --red: #dc2626;
  /* 表单控件底色/文字（下拉框 + 填写框）随主题统一 */
  --field-bg: #ffffff;
  --field-ink: #000000;
  --field-ph: #555555;
  --field-hover: #e2e2e2;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

/* 全局细滚动条：让中间内容框的滚动条保持在最右、宽度纤细（WebKit + Firefox） */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sub); }
html { scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }

.chat {
  display: flex; flex-direction: column;
  min-height: 100dvh; max-width: 1080px; margin: 0 auto;
}

/* 顶部栏：电脑 / 手机模式下均固定在顶部（随 body 滚动时吸附视口顶边） */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px; flex: 0 0 auto;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--line);
  gap: 8px;
}
.brand-area { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 0; min-width: 0; }
.logo-lockup { display: none; height: 44px; width: auto; flex: 0 0 auto; margin-right: 6px; }
html[data-theme="dark"][lang="zh-CN"] .lo-zh-rev,
html[data-theme="dark"][lang="en"] .lo-en-rev,
html[data-theme="light"][lang="zh-CN"] .lo-zh-std,
html[data-theme="light"][lang="en"] .lo-en-std { display: block; }
/* 数字资产卫士：字号/字重/颜色/左对齐 与欢迎语「你好，欢迎使用电子馒头」(.welcome) 完全一致，作为对话流里的一条保留 */
.guardian-greeting {
  font-size: 15px; font-weight: 400; color: var(--sub);
  line-height: 1.6; text-align: left;
}
.brand-text { font-size: 17px; white-space: nowrap; }
.brand-text b { font-weight: 700; }
.brand-cn { color: var(--sub); font-weight: 400; margin-left: 6px; font-size: 14px; }
.ver { margin-left: 0; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .3px; align-self: center; flex: 0 0 auto; }
.welcome {
  margin: 0; max-width: 100%; text-align: left;
  font-size: 15px; font-weight: 400; color: var(--sub); line-height: 1.6;
}
.welcome .home-ver { margin-left: 8px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* 状态胶囊：与 biorhythm-psi.html 完全一致（sync 蓝 / on 绿 / off 红） */
.sync {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; font-size: 12px; color: var(--sub);
  border: 1px solid var(--line); padding: 6px 11px;
  border-radius: 20px; background: var(--panel-2);
  white-space: nowrap;
}
.sync u { text-decoration: none; opacity: .7; font-size: 11px; margin-left: 2px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.sync .dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.sync .dot.sync { background: var(--blue); }
.sync .dot.off { background: var(--red); }

/* 顶部「解锁 / 锁定」徽标：同设备切换的图标按钮配色（解锁=灰 / 锁定=蓝），无文字 */
.lock-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  background: transparent; color: var(--sub); border: 1px solid transparent;
  cursor: pointer; font-family: inherit; flex: 0 0 auto;
}
.lock-badge:hover { color: var(--ink); border-color: var(--line); }
.lock-badge .lb-ico { width: 18px; height: 18px; }
.lock-badge .lb-lock { display: none; }
.lock-badge.on { color: var(--blue); background: rgba(76,141,255,.14); border-color: transparent; }
.lock-badge.on:hover { color: var(--blue); background: rgba(76,141,255,.20); }
.lock-badge.on .lb-unlock { display: none; }
.lock-badge.on .lb-lock { display: block; }

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; background: transparent; color: var(--sub); border: 1px solid transparent;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.ghost-btn:hover { background: var(--panel); color: var(--ink); border-color: var(--line); }

/* 电脑/手机布局切换（参考截图：两个图标并排，高亮当前） */
.device-switch {
  display: inline-flex; align-items: center; gap: 2px;
  height: 32px; padding: 2px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
}
.device-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--sub); cursor: pointer; padding: 0;
}
.device-btn svg { width: 16px; height: 16px; }
.device-btn:hover { color: var(--ink); }
.device-btn.active { background: var(--panel); color: var(--brand); box-shadow: 0 1px 3px var(--shadow); }

/* 分享按钮：图标型 ghost-btn */
.ghost-btn.icon-only {
  width: 32px; padding: 0; border-radius: 50%;
}
.ghost-btn.icon-only svg { width: 18px; height: 18px; }

/* 轻提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 16px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 8px 28px var(--shadow); z-index: 999;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 对话区：电脑模式使用 body 级滚动，滚动条位于浏览器最右侧 */
.messages {
  flex: 1 1 auto; overflow-y: visible; overflow-x: hidden; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}

/* 消息：用户与助手均左对齐；用户前加「馒头」提示符 */
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.msg.user, .msg.assistant { justify-content: flex-start; }
.prompt-sym {
  flex: 0 0 auto; width: 26px; height: 26px;
  display: grid; place-items: center; margin-top: 2px;
}
.prompt-sym .mantou-icon { width: 22px; height: 22px; display: block; object-fit: contain; }
.bubble {
  padding: 11px 15px; border-radius: 14px; font-size: 15px;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
  max-width: 80%;
}
.msg.user .bubble { background: var(--user-bubble); border-top-left-radius: 4px; }
.msg.assistant .bubble { background: var(--panel); border: 1px solid var(--line); border-top-left-radius: 4px; }
.bubble.typing { color: var(--sub); padding: 11px 15px; }
.bubble.typing::after { content: "…"; animation: blink 1.2s steps(4) infinite; }
@keyframes blink { 0%,100%{opacity:.3} 50%{opacity:1} }

/* 内嵌网站内容卡片：标题栏带统一状态胶囊 */
.webcontent {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px; font-size: 14px; line-height: 1.7;
  width: 100%; max-width: 100%;
}
.wc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wc-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.wc-body { font-size: 14px; line-height: 1.7; }
.wc-body h3 { font-size: 15px; margin: 8px 0 6px; font-weight: 600; color: var(--brand); }
.wc-body p { margin: 8px 0; color: var(--sub); }
.wc-body ul { margin: 8px 0; padding-left: 20px; color: var(--sub); }
.wc-body li { margin: 4px 0; }
.wc-body b { color: var(--ink); }

/* 应用视图模式：输入 1/2 时，内容卡片填满中间整块；电脑模式随 body 滚动，滚动条在浏览器最右侧 */
.chat.app-mode .messages { padding: 0; gap: 0; overflow-y: visible; overflow-x: hidden; }
.chat.app-mode .webcontent {
  flex: 1 1 auto; min-height: 100dvh; width: 100%; max-width: 100%;
  border: 0; border-radius: 0; padding: 22px 24px;
  overflow-y: visible; overflow-x: hidden;
}
.chat.app-mode .webcontent .wc-head {
  background: var(--panel); padding: 2px 0 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* 手机模式：输入栏移到顶栏下方、内容栏融为一体；中间宽度对齐 TPL 固定宽度 560px */
.chat.mobile-mode { max-width: 560px; height: auto; min-height: 100dvh; }
.chat.mobile-mode .topbar { position: sticky; top: 0; z-index: 10; }
.chat.mobile-mode .composer {
  order: 1;
  padding: 8px 14px 14px;
  position: static; border-top: 0;
}
.chat.mobile-mode .composer .input-card,
.chat.mobile-mode .composer .attachments { max-width: none; }
.chat.mobile-mode .messages {
  order: 2;
  flex: none;
  overflow-y: visible;
  overflow-x: hidden;
  padding: 0 14px 20px;
  gap: 8px;
}
.chat.mobile-mode .msg .bubble { max-width: 92%; }

/* 手机模式下 app-mode（1/2 指令）也改为自然流，不再独立滚动 */
.chat.mobile-mode.app-mode .messages { overflow-y: visible; }
.chat.mobile-mode.app-mode .webcontent {
  height: auto; min-height: 0;
  border: 0; border-radius: 0;
  padding: 16px 0;
  overflow-y: visible; overflow-x: hidden;
}
.chat.mobile-mode.app-mode .webcontent .wc-head {
  position: static;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px; margin-bottom: 8px;
}

/* 手机模式（.chat.mobile-mode）下 PSI 当前数值三框一排：
   媒体查询只能按视口宽度判断，而用户可能在宽屏切手机模式，
   因此用类选择器强制三列，并压缩 label 与 value 之间的空隙。 */
.chat.mobile-mode .psi-overview { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chat.mobile-mode .psi-ov { padding: 7px 6px; }
.chat.mobile-mode .psi-ov .top {
  justify-content: flex-start;
  gap: 3px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}
.chat.mobile-mode .psi-ov .nm { font-size: 11px; white-space: nowrap; }
.chat.mobile-mode .psi-ov .nm em { font-size: 9px; margin-left: 1px; }
.chat.mobile-mode .psi-ov .vv { font-size: 13px; }
.chat.mobile-mode .psi-ov .st { font-size: 10px; margin-top: 4px; }
.chat.mobile-mode .psi-bar { height: 5px; margin-top: 4px; }
.chat.mobile-mode .psi-bar .mid { height: 9px; top: -2px; }

/* PSI 内联内容（由 psi-view.js 注入，跟随顶栏主题/语言，无独立状态条与切换） */
.psi-sub { color: var(--sub); font-size: 13px; margin: 0 0 14px; line-height: 1.65; }
.psi-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 8px; }
.psi-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.psi-fields-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; flex: 0 0 auto; min-width: 0; }
.psi-field { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 0 0 auto; min-width: 0; }
.psi-field label { width: 100%; font-size: 12px; color: var(--sub); white-space: nowrap; }
.psi-field-row { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; min-width: 0; }
/* PSI 日期输入框：沿用全站默认比例字体（font-family:inherit），与所有输入框统一；
   宽度按占位符 yyyy-mm-dd 在默认字体下的实际宽度 + 左右 8px padding 设定，保证完整显示且留白协调 */
#psiBirth, #psiCenter { width: 100px; max-width: 100%; box-sizing: border-box; padding: 0 8px; font-family: inherit; }
/* 性别下拉：按最宽中文选项“保密”紧凑显示，为下拉箭头按钮预留右侧空间（与左侧 padding 对称） */
#psiGender { min-width: 50px; padding-right: 26px; }
.psi-card input, .psi-card select {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 0 8px; border-radius: 7px; font-size: 13px; line-height: 31px;
  height: 31px; box-sizing: border-box; outline: none; font-family: inherit;
}
.psi-card input:focus, .psi-card select:focus { border-color: var(--accent); }
/* 收窄三框，使出生日期/性别/中心日期在大多宽度下保持一行 */
.psi-card input[type=text] { width: 92px; letter-spacing: .4px; }
.psi-card input[type=date] { width: 92px; }
.psi-card select {
  min-width: 54px; width: auto; max-width: 90px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 0 26px 0 8px;
}
.psi-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); height: 31px; padding-bottom: 0; flex: 0 0 auto; }
.psi-chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.psi-btn {
  background: var(--accent); color: #fff; border: 0; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.3; cursor: pointer; font-family: inherit;
}
.psi-btn:hover { filter: brightness(1.08); }
.psi-btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--sub); }
.psi-err { color: var(--red); font-size: 13px; margin-top: 8px; display: none; }
.psi-ov-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; flex-wrap: wrap; gap: 6px; }
.psi-ov-head b { font-size: 15px; }
.psi-ov-head span { color: var(--sub); font-size: 12px; }
.psi-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.psi-ov { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.psi-ov .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.psi-ov .nm { font-size: 13px; font-weight: 600; }
.psi-ov .nm em { font-style: normal; font-weight: 400; font-size: 11px; opacity: .7; margin-left: 4px; }
.psi-ov .vv { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.psi-bar { position: relative; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.psi-bar .mid { position: absolute; left: 50%; top: -2px; width: 1px; height: 10px; background: var(--sub); opacity: .6; }
.psi-bar .fill { position: absolute; top: 0; height: 6px; border-radius: 3px; }
.psi-ov .st { font-size: 12px; margin-top: 7px; color: var(--sub); }
.psi-chart-box { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.psi-chart-box svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.psi-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(23, 26, 32, 0.92); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; min-width: 180px; max-width: 86vw;
  box-shadow: 0 8px 24px var(--shadow); display: none; color: var(--ink);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
[data-theme="light"] .psi-tip { background: rgba(255, 255, 255, 0.94); }
.psi-tip .d { font-weight: 600; margin-bottom: 7px; font-size: 13px; }
.psi-tip .d em { font-style: normal; color: var(--sub); font-weight: 400; font-size: 12px; margin-left: 4px; }
.psi-tip .r { display: flex; align-items: center; gap: 7px; margin: 4px 0; }
.psi-tip .dotv { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.psi-tip .n { color: var(--sub); width: 34px; }
.psi-tip .v { font-variant-numeric: tabular-nums; font-weight: 600; width: 52px; text-align: right; }
.psi-tip .s { color: var(--sub); font-size: 12px; }
.psi-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--sub); }
.psi-legend span { display: flex; align-items: center; gap: 7px; }
.psi-legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.psi-details { margin-top: 8px; font-size: 13px; color: var(--sub); }
.psi-details summary { cursor: pointer; color: var(--ink); font-size: 13px; }
.psi-details p { margin: 8px 0; line-height: 1.75; white-space: pre-line; }
.psi-foot { color: var(--sub); font-size: 12px; line-height: 1.75; margin: 0; }

/* PSI 移动端全屏看图：点图表进入，横向铺满，顶部信息栏显示数值，右上角 X 关闭 */
.psi-fs { display: none; position: fixed; inset: 0; z-index: 60; background: var(--bg); flex-direction: column; overscroll-behavior: contain; }
.psi-fs.show { display: flex; }
.psi-fs-bar {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 13px 50px 13px 16px; font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.psi-fs-bar b { font-size: 14px; font-weight: 600; }
.psi-fs-bar .day { color: var(--sub); font-size: 12px; }
.psi-fs-bar .it { font-weight: 600; font-variant-numeric: tabular-nums; }
.psi-fs-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer;
}
.psi-fs-close:hover { border-color: var(--accent); }
.psi-fs-box { flex: 1 1 auto; position: relative; overflow: hidden; padding: 8px; touch-action: none; }
.psi-fs-box svg { display: block; width: 100%; height: 100%; }

/* 输入区：电脑模式下固定在底部（随 body 滚动时吸附视口底边），仅中间内容滚动；
   背景遮住其下方滚动过的内容，避免文字穿透 */
.composer { flex: 0 0 auto; padding: 12px 20px 18px; position: sticky; bottom: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--line); }
.attachments {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 auto 10px; max-width: 1040px;
}
.chip {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; color: var(--sub);
}
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; }
.chip button:hover { color: var(--ink); }
.input-card {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 10px 12px;
  box-shadow: 0 2px 12px var(--shadow);
  transition: box-shadow .15s, border-color .15s;
  max-width: 1040px; margin: 0 auto;
}
.input-card:focus-within { box-shadow: 0 4px 20px rgba(79,124,255,.18); border-color: var(--brand); }
.input-card.drag-over { border-color: var(--brand); box-shadow: 0 4px 20px rgba(79,124,255,.22); }
#input {
  flex: 1 1 auto; resize: none; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; line-height: 1.55;
  max-height: 160px; padding: 8px 4px;
}
#input::placeholder { color: var(--muted); }
.icon-btn {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 10px; color: var(--sub); cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { color: var(--ink); background: var(--panel-2); }
.icon-btn.active { color: var(--brand); background: rgba(79,124,255,.14); }
.icon-btn:disabled,
.icon-btn[aria-disabled="true"] { color: var(--muted); opacity: .55; cursor: not-allowed; }
.icon-btn[aria-disabled="true"]:hover { color: var(--muted); background: transparent; }
.send-btn {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--muted); border: 0; border-radius: 50%; color: #fff; cursor: pointer;
  transition: background .15s;
}
.send-btn svg { width: 22px; height: 22px; }
.send-btn:not(:disabled):hover { background: var(--sub); }
.send-btn:disabled { opacity: .45; cursor: default; }

/* 移动端 */
@media (max-width: 640px) {
  .topbar, .messages, .composer { padding-left: 14px; padding-right: 14px; }
  .brand-cn { display: none; }
  .bubble { max-width: 86%; }

  /* 顶栏：单行优先——放得下就绝不换行，只有真的放不下才折行。
     关键：操作区不能用 flex-basis:100%（那会强制占满整行、必然折行），
     改成 flex:0 1 auto + margin-left:auto：既能自然留在同行，折行时也能靠右。
     此区间保持原有间距不变，只改「换行策略」。 */
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .brand-area { flex: 0 1 auto; min-width: 0; }
  .brand-text { white-space: normal; overflow: hidden; text-overflow: ellipsis; }
  .top-actions { flex: 0 1 auto; margin-left: auto; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; min-width: 0; }
  #shareBtn { display: none; }
  .sync { padding: 6px 9px; }
  .sync #statusText, .sync u { display: none; }
  .lock-badge { width: 30px; height: 30px; }
  .lock-badge .lb-ico { width: 17px; height: 17px; }

  /* 应用标题行：标题可换行、不与状态胶囊重叠 */
  .chat.app-mode .webcontent .wc-head,
  .wc-head { flex-wrap: wrap; align-items: flex-start; }
  .wc-head h2 { min-width: 0; flex: 1 1 auto; word-break: break-word; }

  /* PSI 表单：窄屏按内容宽度紧凑排列，尽量让三框一行 */
  .psi-form { gap: 8px; }
  .psi-fields-row { width: 100%; gap: 8px; }
  .psi-field { flex: 0 0 auto; }
  .psi-card input, .psi-card select { font-size: 12px; padding: 0 8px; }
  .psi-card input[type=text] { width: 116px; }
  .psi-card input[type=date] { width: 110px; }
  .psi-card select { min-width: 40px; width: auto; max-width: 90px; }
  #psiGender { min-width: 40px; padding-right: 26px; }
  .psi-chk { flex: 1 1 100%; padding-bottom: 0; }
  .psi-btn, .psi-btn-ghost { flex: 1 1 auto; }

  /* PSI 概览：手机模式三卡等分一排，压缩内边距避免溢出 */
  .psi-overview { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* 移动端 tooltip：移到图表底部、半透明、紧凑两列，尽量不遮挡曲线 */
  .psi-tip {
    min-width: 0; width: calc(100% - 12px); max-width: none;
    left: 50%; top: auto; bottom: 4px; transform: translateX(-50%);
    font-size: 11px; padding: 6px 8px; border-radius: 8px;
  }
  .psi-tip .d { font-size: 11px; margin-bottom: 4px; }
  .psi-tip .d em { font-size: 10px; }
  .psi-tip .r { display: inline-flex; width: calc(50% - 3px); margin: 2px 0; gap: 4px; }
  .psi-tip .n { width: auto; font-size: 10px; }
  .psi-tip .v { width: auto; font-size: 11px; }
  .psi-tip .s { font-size: 10px; }

  /* PSI 概览卡片：手机模式三卡一排，进一步压缩 */
  .psi-ov { padding: 8px 7px; }
  .psi-ov .top { gap: 3px; margin-bottom: 4px; flex-wrap: nowrap; }
  .psi-ov .nm { font-size: 11px; white-space: nowrap; }
  .psi-ov .nm em { font-size: 9px; margin-left: 1px; }
  .psi-ov .vv { font-size: 14px; }
  .psi-ov .st { font-size: 10px; margin-top: 4px; }
  .psi-bar { height: 5px; margin-top: 4px; }
  .psi-bar .mid { height: 9px; top: -2px; }

  /* 兜底：防止任何子元素撑出横向滚动 */
  .chat, .webcontent, .psi-card, .psi-chart-box { max-width: 100%; overflow-x: hidden; }
}

/* 单行优先（≤440）：空间开始紧张——先压间距，再缩 LOGO，尽量不折行。
   观感上「LOGO 小一点点」远好于「整条顶栏折成两行」。 */
@media (max-width: 440px) {
  .topbar { column-gap: 8px; }
  .brand { gap: 8px; }
  .ver { margin-left: 6px; }
  .top-actions { gap: 4px; }
  .ghost-btn { padding: 6px 9px; }
  .device-btn { width: 26px; }
  .sync { padding: 6px 7px; }
  .logo-lockup { height: 36px; }
}

/* 更窄（≤390）：先只压「非触控尺寸」——内边距/间距/版本字号，LOGO 不动。
   英文界面下语言键是「中文」（比 EN 宽约 8px），这一步是给英文模式留的余量。
   按钮可点面积（ghost 高 32、设备键 26）保持不变。 */
@media (max-width: 390px) {
  .topbar { column-gap: 6px; }
  .top-actions { gap: 2px; }
  .ghost-btn { padding: 6px 8px; }
  .ver { font-size: 10px; letter-spacing: 0; }
}

/* 再窄（≤380）：LOGO 再缩一档，仍然优先单行 */
@media (max-width: 380px) {
  .logo-lockup { height: 32px; }
}

/* 隐藏态：textarea 与密码输入框互斥显示 */
.hidden { display: none !important; }

/* ===== 数字资产卫士 (Asset Guardian / DAG) 模块（本地版，借鉴账户保险箱 app.html 结构） ===== */

/* ===== 时光事务手账 (Time & Task Journal / TTJ) 模块 ===== */
.ttj-bar { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 2px 0 12px; flex-wrap: wrap; }
.ttj-new {
  border: 1px solid transparent; border-radius: 7px;
  background: var(--brand, #4F7CFF); color: #fff;
  font-size: 13px; font-weight: 600; padding: 6px 14px; line-height: 1.3; cursor: pointer;
  transition: filter .15s ease;
}
.ttj-new:hover { filter: brightness(1.08); }
.ttj-new:active { filter: brightness(.95); }

.ttj-search, .ttj-filter {
  background: var(--bg, #0f1115); border: 1px solid var(--line, #262b33);
  color: var(--ink, #e8eaed); border-radius: 7px; font-size: 13px;
  height: 31px; padding: 0 12px; box-sizing: border-box; font-family: inherit;
  outline: none;
}
.ttj-search:focus, .ttj-filter:focus { border-color: var(--brand, #4F7CFF); }
.ttj-search { flex: 1 1 180px; min-width: 140px; max-width: 260px; }
.ttj-filter { flex: 0 0 auto; min-width: 90px; padding: 0 26px 0 8px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
}
.ttj-filter option { background: var(--bg, #0f1115); color: var(--ink, #e8eaed); }

/* DAG「新增」按钮单独缩小高度，与 TTJ 新增按钮风格一致且更精致 */
#gdNew {
  padding: 6px 14px; font-size: 13px; border-radius: 7px; line-height: 1.3;
  align-self: center;
}

.ttj-list { display: flex; flex-direction: column; gap: 8px; }
.ttj-empty { color: var(--sub, #9aa1ad); font-size: 13px; padding: 18px 4px; text-align: center; }

.ttj-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 2px 6px; }
.ttj-sec-title { font-size: 13px; font-weight: 700; color: var(--sub, #9aa1ad); letter-spacing: .4px; }
.ttj-sec-hint { font-size: 12px; color: var(--muted, #6b7280); }
.ttj-clear-done {
  border: 1px solid var(--line, #262b33); border-radius: 999px; background: transparent;
  color: var(--sub, #9aa1ad); font-size: 13px; line-height: 1.3; padding: 6px 12px; cursor: pointer;
}
.ttj-clear-done:hover { color: var(--ink, #e8eaed); border-color: var(--sub, #9aa1ad); }

.ttj-rec {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  background: var(--panel-2, #1d2128); border: 1px solid var(--line, #262b33);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ttj-rec:hover { border-color: var(--sub, #9aa1ad); }
.ttj-rec.done { opacity: .55; }
.ttj-rec.done .ttj-rec-nm { text-decoration: line-through; }
.ttj-rec-main {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
}
.ttj-rec-sub {
  display: flex; align-items: center; gap: 8px; flex: 0 1 auto; margin-left: auto;
}
.ttj-rec-cat {
  flex: 0 0 auto; font-size: 12px; padding: 3px 8px; border-radius: 7px;
  background: var(--panel, #171a20); border: 1px solid var(--line, #262b33); white-space: nowrap;
}
.ttj-rec-nm { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink, #e8eaed); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttj-rec-meta { flex: 0 0 auto; font-size: 12px; color: var(--sub, #9aa1ad); white-space: nowrap; }
.ttj-rec-note { display: none; }
.ttj-rec-next { display: none; }
.ttj-rec-acts { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.ttj-mini {
  border: 1px solid var(--line, #262b33); border-radius: 7px; background: transparent;
  color: var(--sub, #9aa1ad); font-size: 12px; padding: 4px 9px; cursor: pointer; white-space: nowrap;
}
.ttj-mini:hover { color: var(--ink, #e8eaed); border-color: var(--sub, #9aa1ad); }
.ttj-mini.danger:hover { color: var(--red, #f2555a); border-color: var(--red, #f2555a); }
.ttj-check {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  border: 1px solid var(--sub, #9aa1ad); background: transparent; color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ttj-check.on { background: var(--good, #3fb950); border-color: var(--good, #3fb950); }

/* —— 录入 / 编辑 —— */
.ttj-entry { display: block; }
.ttj-form { display: flex; flex-direction: column; gap: 8px; }
.ttj-sec { border: 1px solid var(--line, #262b33); border-radius: 12px; padding: 12px 14px; background: var(--panel, #171a20); }
.ttj-sec-h { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink, #e8eaed); }
.ttj-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.ttj-field label, .ttj-muted { font-size: 12px; color: var(--sub, #9aa1ad); }
.ttj-input, .ttj-form textarea, .ttj-form input[type="text"] {
  width: 100%; box-sizing: border-box; background: var(--bg, #0f1115); color: var(--ink, #e8eaed);
  border: 1px solid var(--line, #262b33); border-radius: 8px; padding: 9px 11px; font-size: 14px;
  font-family: inherit;
}
.ttj-form textarea { resize: vertical; }
/* 时光手账下拉框：内容自适应宽度，统一下拉箭头，左 8 右 26 与全站一致 */
.ttj-select {
  width: auto; min-width: 54px; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 9px 26px 9px 8px;
}
.ttj-input:focus, .ttj-select:focus, .ttj-form textarea:focus, .ttj-form input[type="text"]:focus {
  outline: none; border-color: var(--brand, #4F7CFF);
}
.ttj-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ttj-cat {
  font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line, #262b33); background: var(--panel-2, #1d2128); color: var(--sub, #9aa1ad);
}
.ttj-cat.active { border-color: var(--brand, #4F7CFF); color: var(--ink, #e8eaed); background: rgba(79,124,255,.12); }

.ttj-sec-h-row { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.ttj-sec-h-row .ttj-sec-h { margin: 0; }
.ttj-switch-label, .ttr-label { font-size: 13px; color: var(--sub, #9aa1ad); margin: 0 0 8px; }
.ttj-switch {
  position: relative; width: 46px; height: 26px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--line, #262b33); transition: background .18s ease; flex: 0 0 auto;
}
.ttj-switch.on { background: var(--brand, #4F7CFF); }
.ttj-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .18s ease;
}
.ttj-switch.on .ttj-knob { transform: translateX(20px); }
.ttj-cond { margin-top: 8px; }
.ttj-cond-sub { margin-top: 8px; }
.ttj-freqs { display: flex; flex-wrap: wrap; gap: 8px; }
.ttj-freq {
  font-size: 13px; padding: 6px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line, #262b33); background: var(--panel-2, #1d2128); color: var(--sub, #9aa1ad);
}
.ttj-freq.active { border-color: var(--brand, #4F7CFF); color: var(--ink, #e8eaed); background: rgba(79,124,255,.12); }
.ttj-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ttj-pill {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border: 1px solid var(--line, #262b33); background: var(--panel-2, #1d2128); color: var(--sub, #9aa1ad);
}
.ttj-pill.on { border-color: var(--brand, #4F7CFF); color: var(--ink, #e8eaed); background: rgba(79,124,255,.12); }

.ttj-form-actions { display: flex; gap: 8px; margin-top: 2px; }
.ttj-btn {
  flex: 1 1 0; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.3; padding: 6px 0; cursor: pointer; border: 1px solid transparent;
}
.ttj-form-actions .ttj-btn { flex: 0 0 auto; min-width: 72px; padding: 6px 22px; }
.ttj-primary { background: var(--brand, #4F7CFF); color: #fff; }
.ttj-primary:hover { filter: brightness(1.08); }
.ttj-ghost { background: transparent; color: var(--sub, #9aa1ad); border-color: var(--line, #262b33); }
.ttj-ghost:hover { color: var(--ink, #e8eaed); border-color: var(--sub, #9aa1ad); }
.ttj-form-msg { font-size: 12px; min-height: 16px; margin-top: 2px; }
.ttj-form-msg.err { color: var(--red, #f2555a); }
.ttj-form-msg.ok { color: var(--good, #3fb950); }

/* TTJ 移动端：类别+事务内容一行，执行日期+按钮另一行 */
@media (max-width: 640px) {
  .ttj-rec {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
  }
  .ttj-rec-main {
    flex: 1 1 100%;
    min-width: 0;
  }
  .ttj-rec-sub {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: space-between;
    min-width: 0;
  }
  .ttj-rec-nm {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
  }
  .ttj-rec-meta {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
  }
  .ttj-rec-cat {
    font-size: 12px;
  }
  .ttj-rec-acts {
    flex: 0 0 auto;
  }
}

/* ===== 清除 (Wipe) 交互视图 ===== */
.clear-warn {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink, #e8eaed);
  background: rgba(242, 85, 90, 0.10);
  border: 1px solid rgba(242, 85, 90, 0.45);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.clear-row { display: flex; gap: 8px; margin-top: 8px; }
.clear-row.clear-actions { justify-content: flex-end; }
.clear-input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg, #0f1115);
  border: 1px solid var(--line, #262b33);
  border-radius: 8px;
  color: var(--ink, #e8eaed);
  padding: 10px 12px;
  font-size: 14px;
}
.clear-input::placeholder { color: var(--muted, #6b7280); }
.clear-btn {
  border: 1px solid var(--line, #262b33);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  background: var(--panel, #171a20);
  color: var(--ink, #e8eaed);
  transition: filter .15s ease;
}
.clear-btn:hover { filter: brightness(1.18); }
.clear-confirm {
  background: rgba(242, 85, 90, 0.16);
  border-color: rgba(242, 85, 90, 0.55);
  color: #f2555a;
}
.clear-confirm:hover { color: #ff7a7f; }

/* ===== 链上 (On-chain) 本机密码门禁（输入框/按钮复用 clear-view 的 .clear-input/.clear-btn） ===== */
.oc-gate { max-width: 460px; margin: 4px 0 0; padding: 8px 2px; text-align: left; }
.oc-gate-h { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.oc-gate-sub { font-size: 13px; color: var(--sub); line-height: 1.7; margin: 0 0 16px; }
.oc-gate .clear-row { margin-top: 8px; }
.oc-gate .clear-actions { justify-content: flex-end; margin-top: 8px; }
.oc-gate .clear-input { font-size: 15px; }

.gd-row1 { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gd-btn {
  background: var(--accent); color: #fff; border: 0; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.3; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.gd-btn:hover { filter: brightness(1.08); }
.gd-btn.gd-primary { background: var(--accent); }
.gd-btn.gd-ghost { background: transparent; border: 1px solid var(--line); color: var(--sub); }
.gd-btn.gd-disabled {
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  cursor: not-allowed; opacity: .85;
}
.gd-btn.gd-disabled:hover { filter: none; }
.gd-form-actions .gd-btn { flex: 0 0 auto; min-width: 72px; padding: 6px 22px; }
.gd-tools { margin-bottom: 8px; }
.gd-search {
  width: 100%; box-sizing: border-box;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 13px; border-radius: 10px; font-size: 14px; outline: none; font-family: inherit;
}
.gd-search:focus { border-color: var(--accent); }
.gd-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gd-chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--sub);
  padding: 6px 13px; border-radius: 999px; font-size: 13px; line-height: 1.3; cursor: pointer; font-family: inherit; user-select: none;
}
.gd-chip:hover { color: var(--ink); border-color: var(--accent); }
.gd-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.gd-list { display: flex; flex-direction: column; gap: 8px; }
.gd-empty { color: var(--sub); font-size: 13px; text-align: center; padding: 28px 10px; }
.gd-entry { margin-top: 4px; }

/* 录入表单 */
.gd-form { display: flex; flex-direction: column; gap: 8px; }
.gd-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.gd-sec:first-child { border-top: 0; padding-top: 0; }
.gd-sec-h { font-size: 15px; font-weight: 600; color: var(--brand); margin: 0 0 12px; }
.gd-field { display: flex; flex-direction: column; gap: 8px; }
.gd-field label { font-size: 12px; color: var(--sub); }
.gd-form input:not(.gd-cell):not(.gd-num), .gd-form select, .gd-form textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 12px; border-radius: 9px; font-size: 14px; outline: none; font-family: inherit;
  width: 100%; box-sizing: border-box; resize: vertical;
}
/* 数字资产卫士下拉框：内容自适应宽度（flex 列中需 align-self 防拉伸），统一箭头，左 8 右 26 */
.gd-form select {
  width: auto; min-width: 54px; max-width: 100%; align-self: flex-start;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 10px 26px 10px 8px;
}
.gd-form input:focus, .gd-form select:focus, .gd-form textarea:focus { border-color: var(--accent); }
.gd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gd-muted { color: var(--sub); font-size: 13px; }
.gd-num { width: 84px; flex: 0 0 auto; }
.gd-len-opts { display: flex; gap: 6px; }
.gd-lenopt {
  padding: 6px 13px; border-radius: 8px; font-size: 13px; line-height: 1.3; cursor: pointer; font-family: inherit; user-select: none;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--sub);
}
.gd-lenopt:hover { color: var(--ink); border-color: var(--accent); }
.gd-lenopt.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.gd-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gd-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--sub);
  font-size: 13px; line-height: 1.3; cursor: pointer; user-select: none; opacity: .55; transition: .15s;
}
.gd-pill.on { opacity: 1; border-color: var(--good); color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.gd-grid { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.gd-cell {
  width: 22px; height: 34px; text-align: center; font-size: 15px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); padding: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.gd-cell:focus { outline: none; border-color: var(--accent); }
.gd-cell--gap { margin-left: 12px; }
.gd-form-actions { display: flex; gap: 8px; margin-top: 4px; }
.gd-form-msg { font-size: 13px; min-height: 16px; }
.gd-form-msg.err { color: var(--red); }
.gd-form-msg.ok { color: var(--good); }

/* 类别选择网格（录入时） */
.gd-catgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-cat {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--sub);
  padding: 8px 13px; border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none;
}
.gd-cat:hover { color: var(--ink); border-color: var(--accent); }
.gd-cat.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 列表条目（借鉴账户保险箱 app.html 的 .rec 卡片） */
.gd-rec {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.gd-rec:hover { border-color: var(--accent); }
.gd-rec-cat {
  flex: 0 0 auto; font-size: 12px; color: var(--brand); background: rgba(79,124,255,.12);
  border: 1px solid rgba(79,124,255,.3); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.gd-rec-info { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink); }
.gd-rec-nm { font-weight: 600; word-break: break-word; }
.gd-rec-idx { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 5px; padding: 1px 6px; }
.gd-rec-ac { color: var(--sub); word-break: break-word; }
.gd-sep { color: var(--muted); }
.gd-rec-meta { color: var(--muted); font-size: 12px; }
.gd-rec-actions-row { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gd-rec-pwrow { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.gd-pwmask { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; font-size: 16px; color: var(--good); user-select: none; white-space: nowrap; }
/* 继承内容掩码：与 ④ 原有内容区分（左侧虚线 + 强调色） */
.gd-pwmask--inh { color: var(--accent); border-left: 1px dashed var(--line); padding-left: 7px; margin-left: 2px; }
.gd-holdbtn { margin: 0; padding: 6px 12px; font-size: 13px; line-height: 1.3; border-radius: 8px; cursor: pointer; font-family: inherit; background: var(--panel); border: 1px solid var(--line); color: var(--sub); }
.gd-holdbtn:hover { color: var(--ink); border-color: var(--accent); }
.gd-rec-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.gd-rec-acts .gd-mini {
  background: transparent; border: 1px solid var(--line); color: var(--sub);
  font-size: 12px; padding: 3px 9px; border-radius: 7px; cursor: pointer; font-family: inherit;
}
.gd-rec-acts .gd-mini:hover { color: var(--ink); border-color: var(--accent); }
.gd-rec-acts .gd-mini-danger:hover { color: var(--red); border-color: var(--red); }

/* 继承设置：顶部次级按钮（激活态高亮） */
.gd-btn.gd-secondary { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.gd-btn.gd-secondary:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gd-btn.gd-secondary.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 列表「继承」标识 */
.gd-rec-inherit { flex: 0 0 auto; font-size: 12px; padding: 2px 8px; border-radius: 7px; background: color-mix(in srgb, var(--good, #3fb950) 18%, transparent); color: var(--good, #3fb950); border: 1px solid color-mix(in srgb, var(--good, #3fb950) 40%, transparent); white-space: nowrap; }
.gd-mini-inh { color: var(--accent); border-color: var(--accent); }
.gd-mini-inh:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
/* 单条「继承设置」内联编辑器 */
.gd-inherit-panel { flex: 0 0 100%; margin-top: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2, #1d2128); }
.gd-inh-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.gd-inh-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); cursor: pointer; }
.gd-inh-check input { width: 18px; height: 18px; accent-color: var(--good, #3fb950); }

/* 移动端：按钮与列表项操作占满整行 */
@media (max-width: 640px) {
  .gd-row1 { gap: 8px; }
  .gd-btn { flex: 1 1 auto; padding: 8px 12px; }
  .gd-rec-acts { flex: 0 0 auto; }
}

/* 代码输入框：视觉与 #input 对齐 */
#codeInput {
  flex: 1 1 auto; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; line-height: 1.55;
  padding: 8px 4px; letter-spacing: 2px;
}
#codeInput::placeholder { color: var(--muted); }

/* 首页三大部分 */
.home-page .home-sec { margin-bottom: 18px; }
.home-page .home-sec:last-child { margin-bottom: 0; }
.home-page .home-sec > h3 {
  font-size: 15px; margin: 0 0 8px; font-weight: 600; color: var(--brand);
}
.home-page .home-bio { font-size: 14px; line-height: 1.7; }
.home-page .home-bio p { margin: 6px 0; color: var(--sub); }
.home-page .home-bio h3 { font-size: 14px; margin: 8px 0 6px; color: var(--ink); }
.home-page .home-bio ul { margin: 6px 0; padding-left: 20px; color: var(--sub); }
.home-page .home-bio li { margin: 3px 0; }
.home-page .home-bio b { color: var(--ink); }
.home-page .home-greet-text, .home-page .home-ver { font-size: 15px; line-height: 1.65; color: var(--ink); }
.home-page .home-greet { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.home-page .home-ver { color: var(--sub); font-size: 13px; }
.cmd-table {
  margin: 0; padding: 10px 14px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; font-family: inherit; font-size: 14px; line-height: 1.8; color: var(--ink); white-space: pre-wrap;
}
.fn-list { display: flex; flex-direction: column; gap: 6px; }
.fn-row {
  font-size: 14px; line-height: 1.6; color: var(--ink);
  padding: 8px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
}
/* 命令表 / 功能列表 行可点击进入对应模块 */
.cmd-table div.clickable,
.fn-row.clickable { cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.cmd-table div.clickable:hover,
.fn-row.clickable:hover { color: var(--accent); border-color: var(--accent); }
.fn-row.clickable:hover { background: var(--panel); }

/* ===== 链上：密码强度实时提示 ===== */
.oc-strength { margin-top: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.oc-str-title { font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.oc-bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 4px 0 8px; }
.oc-bar-fill { height: 100%; border-radius: 999px; transition: width .2s ease, background .2s ease; }
.oc-weak { background: var(--red); }
.oc-medium { background: #f59e0b; }
.oc-strong { background: #3b82f6; }
.oc-very { background: var(--good); }
.oc-str-info { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--sub); }
.oc-str-info b { color: var(--ink); }
.oc-badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.oc-warn { font-size: 12px; color: var(--red); margin-top: 8px; line-height: 1.6; }
.oc-tip { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ===== 链上：生成/导入保险箱 ===== */
.oc-create { max-width: 520px; }
.oc-langrow { margin-top: 6px; }
.oc-langsel { display: inline-flex; gap: 8px; margin: 8px 0; }
.oc-lang-opt { padding: 6px 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--sub); border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .15s; }
.oc-lang-opt.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.oc-session { font-size: 12px; color: var(--muted); margin: 8px 0; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
.oc-mn-box { margin-top: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.oc-mn-warn { color: var(--red); background: rgba(242,85,90,.10); border: 1px solid rgba(242,85,90,.30); border-radius: 9px; padding: 8px; font-size: 13px; line-height: 1.7; margin-bottom: 8px; }
.oc-mnemonic { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; line-height: 1.9; color: #ffccc7; word-break: break-word; letter-spacing: .4px; user-select: text; margin-bottom: 8px; background: #2a1215; border: 1px solid #ff4d4f; border-radius: 10px; padding: 8px; box-shadow: inset 0 0 0 1px rgba(255,77,79,.15); }
.oc-pub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.oc-pub .oc-fld-label { font-size: 12px; color: var(--sub); }
.oc-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--brand); word-break: break-all; }
.oc-pub-tip { font-size: 12px; color: var(--sub); line-height: 1.6; margin: 8px 0; padding: 8px; background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.oc-check { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; margin-top: 8px; font-size: 13px; color: var(--ink); line-height: 1.6; }
.oc-check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 1px; cursor: pointer; }
.oc-check label { cursor: pointer; word-break: break-word; white-space: normal; overflow-wrap: anywhere; }
.oc-lang-display { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.oc-lang-display .oc-lang-val { font-size: 13px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.oc-tools .gd-search { width: 100%; }
.oc-create .clear-row.clear-actions { justify-content: flex-end; margin-top: 8px; }

/* 移动端：创建/导入的按钮占满整行 */
@media (max-width: 640px) {
  .oc-create .clear-actions .clear-btn { flex: 1 1 auto; }
  .oc-mnemonic { font-size: 15px; }
}

/* 解锁页：重置入口（低调文字按钮） */
.oc-reset-row { margin-top: 8px; text-align: center; }
.oc-link-btn { background: none; border: none; color: var(--sub); font-size: 12.5px; cursor: pointer; padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; }
.oc-link-btn:hover { color: var(--brand); }

/* 链上门禁：锁定 / 禁用态 */
.oc-gate .clear-input:disabled { opacity: .55; cursor: not-allowed; }
.oc-gate .clear-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* 危险操作按钮（重置二次确认中的最终清除） */
.clear-btn.clear-danger { background: var(--red); color: #fff; border-color: var(--red); }
.clear-btn.clear-danger:hover { filter: brightness(1.12); }

/* 二次确认弹窗（通用遮罩） */
.oc-modal-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.oc-modal {
  width: 100%; max-width: 420px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 20px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.40);
}
.oc-modal-h { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.oc-modal-body { font-size: 13.5px; line-height: 1.8; color: var(--sub); margin-bottom: 8px; }
.oc-modal-acts { display: flex; gap: 8px; justify-content: flex-end; }
.oc-modal-acts .clear-btn { flex: 0 0 auto; }

/* ===== 链上工作台：三层分区 tab ===== */
.oc-section-tabs { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.oc-stab {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  background: var(--panel-2, rgba(255,255,255,.05)); color: var(--sub);
  border: 1px solid var(--line); transition: all .15s;
}
.oc-stab.on { background: var(--brand, #ff7a45); color: #fff; border-color: transparent; font-weight: 600; }
.oc-stab:hover { color: var(--ink); }
/* PSI 顶部版块切换（周期曲线 / 生物调节 / 记忆和意识），与链上 oc-section-tabs 一致 */
.psi-tabs { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.psi-tab {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  background: var(--panel-2, rgba(255,255,255,.05)); color: var(--sub);
  border: 1px solid var(--line); transition: all .15s;
}
.psi-tab.on { background: var(--brand, #4F7CFF); color: #fff; border-color: transparent; font-weight: 600; }
.psi-tab:hover { color: var(--ink); }
.oc-ext-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.oc-ext-link {
  display: inline-flex; align-items: center; font-size: 13px; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; color: var(--accent, #4f8cff);
  background: var(--panel-2, rgba(255,255,255,.05)); border: 1px solid var(--line);
  transition: all .15s;
}
.oc-ext-link:hover { color: #fff; background: var(--accent, #4f8cff); border-color: transparent; }

/* ===== 积分面板 ===== */
.pts-wrap { padding: 2px 0; }
.pts-h { font-size: 17px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.pts-addr-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pts-addr-line select.pts-input.pts-addr-sel { flex: 0 1 auto; width: auto; max-width: 360px; }
.pts-addr-line .oc-mono { font-size: 12px; color: var(--brand); word-break: break-all; }
.pts-note { color: var(--sub); font-size: 13px; line-height: 1.8; margin-bottom: 8px; }
.pts-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.pts-card { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.pts-card-l { font-size: 11px; color: var(--sub); margin-bottom: 2px; }
.pts-card-v { font-size: 16px; font-weight: 700; color: var(--ink); }
.pts-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.pts-sec-h { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.pts-hint { font-size: 12.5px; color: var(--sub); line-height: 1.7; margin: 0 0 8px; }
.pts-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pts-input, .pts-sec select.pts-input {
  flex: 1 1 200px; min-width: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--input, rgba(0,0,0,.25)); color: var(--ink); border: 1px solid var(--line);
  font-size: 13.5px;
}
.pts-issuer { background: rgba(255,122,69,.06); border: 1px solid rgba(255,122,69,.25); border-radius: 12px; padding: 8px; }

/* ===== 数据存储面板 ===== */
/* 充值 / 发行方记录列表 */
.pts-rec-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pts-rec-item { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; }
.pts-rec-item b { color: var(--ink); }
.pts-rec-sub { font-size: 12px; color: var(--sub); margin-top: 3px; }
.pts-rec-item .pts-row { margin-top: 8px; }

/* ===== 第 8 条：积分四区新增样式 ===== */
.pts-header .pts-addr-l { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.pts-input.narrow { max-width: 460px; }
.pts-quick .gd-btn { min-width: 92px; }
.pts-methods { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pts-method { font-size: 13px; color: var(--sub); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pts-method input { accent-color: var(--brand, #ff7a45); }
.pts-net { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.pts-stake-fixed { color: var(--brand, #ff7a45); }
.pts-rec-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.pts-rec-table th, .pts-rec-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); color: var(--sub); }
.pts-rec-table th { color: var(--ink); font-weight: 600; }
.pts-rec-row { cursor: pointer; transition: background .12s; }
.pts-rec-row:hover td { background: var(--panel-2, rgba(255,255,255,.04)); color: var(--ink); }
/* 充值：金额小输入框与快捷按钮同行 */
.pts-quick { align-items: center; }
.pts-input-sm { flex: 0 0 auto; width: 120px; }
/* 划转备注在记录表中的展示 */
.pts-rec-note-row td { padding-top: 0; }
.pts-rec-note { font-size: 12px; color: var(--sub); font-style: italic; }

/* 「我的地址」地址簿下拉 */
.pts-addr-line .pts-addr-l { font-size: 12px; color: var(--sub); white-space: nowrap; margin-bottom: 0; }
.pts-cards { align-items: stretch; }

/* 地址簿 */
.pts-ab-add { margin-bottom: 8px; }
.pts-ab-addrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pts-ab-addrow .pts-input { flex: 1 1 240px; min-width: 160px; }
.pts-ab-addrow #abPaste { flex: 0 0 auto; width: 360px; max-width: 100%; }
.pts-ab-addrow .pts-ab-label { flex: 0 1 160px; }
.pts-ab-addrow .gd-btn { flex: 0 0 auto; }
.pts-ab-list { display: flex; flex-direction: column; gap: 8px; }
.pts-ab-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  background: var(--panel-2, rgba(255,255,255,.03));
}
.pts-ab-name { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.pts-ab-name b { color: var(--ink); font-size: 14px; }
.pts-ab-pub { color: var(--sub); font-size: 12px; }
.pts-ab-meta { color: var(--sub); font-size: 12px; flex: 0 1 auto; min-width: 0; word-break: break-all; }
.pts-ab-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 消息模块（链上加密消息） */
.msg-wrap { max-width: 920px; margin: 0 auto; }
.msg-hint { font-size: 12px; color: var(--sub); margin: 8px 0; line-height: 1.5; }
.msg-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.msg-tab { opacity: .65; }
.msg-tab.active { opacity: 1; outline: 2px solid var(--brand); }
.msg-note { color: var(--sub); font-size: 13px; padding: 8px 2px; }
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-row {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  background: var(--panel-2, rgba(255,255,255,.03));
}
.msg-row:hover { border-color: var(--brand); }
.msg-row.open { border-color: var(--brand); }
.msg-peer { font-weight: 600; color: var(--ink); font-size: 14px; }
.msg-time { color: var(--sub); font-size: 12px; margin-left: auto; }
.msg-unread { background: var(--brand); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.msg-thread { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; background: rgba(255,255,255,.02); }
.msg-thread-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.msg-bubble { max-width: 80%; align-self: flex-start; }
.msg-bubble-text { background: var(--panel-2, rgba(255,255,255,.06)); border: 1px solid var(--line); border-radius: 10px; padding: 8px; color: var(--ink); font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.msg-bubble-time { font-size: 11px; color: var(--sub); margin: 2px 2px 0; }
.msg-reply { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.msg-reply-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-lbl { font-size: 12px; color: var(--sub); white-space: nowrap; }
.msg-byte { font-size: 12px; color: var(--sub); }
.msg-send { display: flex; flex-direction: column; gap: 8px; }
.msg-send-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-send-row .pts-input.narrow { flex: 0 1 360px; }


/* 独立查询 / 支付页 */
.pr-wrap, .pp-wrap { max-width: 920px; margin: 6vh auto; padding: 0 20px; }
.pp-wrap { max-width: 520px; text-align: center; }
.pr-h { font-size: 20px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.pr-sub { color: var(--sub); font-size: 13px; margin: 0 0 8px; word-break: break-all; }
.pr-addr { color: var(--brand, #ff7a45); }
.pr-back, .pp-back { margin-top: 8px; }
.pr-back a, .pp-back a { color: var(--accent, #4f8cff); text-decoration: none; }
.pp-card { background: var(--panel, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.pp-amt { font-size: 34px; font-weight: 800; margin: 8px 0; color: var(--ink); }
.pp-meta { color: var(--sub); font-size: 14px; line-height: 1.9; }
.pp-note { color: var(--brand, #ff7a45); font-size: 12.5px; margin-top: 8px; }

/* 独立「解锁」弹窗：固定遮罩 modal，覆盖在页面之上，内容框不残留任何内容 */
.ub-modal-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ub-modal {
  width: 100%; max-width: 420px;
  background: var(--panel, #1c1f26); color: var(--ink, #e8eaed);
  border: 1px solid var(--line, #2a2e37); border-radius: 14px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.40);
  text-align: left;
}
.ub-modal-h { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.ub-modal-title { font-size: 16px; font-weight: 600; color: var(--ink, #e8eaed); }
.ub-close {
  flex: 0 0 auto; width: 30px; height: 30px; line-height: 1;
  border: 1px solid var(--line, #2a2e37); background: transparent; color: var(--sub, #9aa3af);
  border-radius: 8px; font-size: 18px; cursor: pointer;
}
.ub-close:hover { color: var(--ink, #e8eaed); border-color: var(--brand, #3d8bff); }
.ub-modal .ub-sub { font-size: 13px; color: var(--sub, #9aa3af); line-height: 1.6; margin: 0 0 8px; }
.ub-modal .ub-form { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.ub-modal .ub-input {
  flex: 1 1 auto; max-width: 260px; height: 36px; border: 1px solid var(--line, #2a2e37);
  border-radius: 9px; background: var(--bg, #12141a); color: var(--ink, #e8eaed); padding: 0 12px;
  font-family: inherit; font-size: 14px;
}
.ub-modal .ub-input:focus { outline: none; border-color: var(--brand, #3d8bff); }
.ub-modal .ub-msg { margin-top: 8px; font-size: 13px; min-height: 18px; }
.ub-modal .ub-msg.ok { color: var(--green, #34c759); }
.ub-modal .ub-msg.err { color: var(--red, #ff4d4f); }

/* ===== 链上 · On-chain：根账户 Hub / 详情 / 备份 ===== */
.oc-roothub { margin-bottom: 8px; }
.oc-rh-card {
  background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px;
}
.oc-rh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oc-rh-title { font-weight: 600; color: var(--ink); }
.oc-rh-count { font-size: 12px; color: var(--sub); }
.oc-rh-sub { font-size: 12px; color: var(--sub); margin: 8px 0; line-height: 1.55; }
.oc-rh-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.oc-rh-chip { font-size: 12px; color: var(--sub); background: rgba(127,127,127,.12);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; }
.oc-rh-chip .oc-mono { color: var(--ink); }
.oc-rh-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.oc-rh-empty { font-size: 13px; color: var(--muted); padding: 8px 0; }
.oc-mne-hidden { filter: blur(7px); user-select: none; transition: filter .15s ease; }
/* 详情面板 */
.oc-detail { display: flex; flex-direction: column; gap: 8px; }
.oc-detail-head { display: flex; align-items: center; gap: 8px; }
.oc-detail-title { font-weight: 600; color: var(--ink); }
.oc-sec { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; }
.oc-sec-h { font-size: 13px; font-weight: 600; color: var(--sub); margin: 0 0 8px; }
.oc-fullpub { display: block; width: 100%; font-size: 12px; word-break: break-all;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; margin: 0 0 8px; color: var(--ink); }
textarea.oc-fullpub { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.oc-detail-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.oc-import-backup-link { margin-top: 8px; text-align: center; }
.oc-link-btn { background: none; border: none; color: var(--brand); cursor: pointer;
  font-size: 13px; text-decoration: underline; font-family: inherit; }
.oc-bk-text { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; resize: vertical; }
.oc-modal-body { font-size: 13px; color: var(--sub); line-height: 1.6; margin: 4px 0; }
.oc-mn-box { margin: 8px 0; }
.oc-mnemonic { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
  line-height: 1.7; color: var(--warn); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; word-break: break-word; }

/* ===== 链上模块补充样式（v0.7.0 重写版）===== */
.gd-mini { font-family: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--sub); cursor: pointer;
  transition: color .15s ease, border-color .15s ease; }
.gd-mini:hover { color: var(--ink); border-color: var(--accent); }
.gd-mini-danger { color: var(--red); }
.gd-mini-danger:hover { color: var(--red); border-color: var(--red); }
.clear-ghost { background: transparent; border: 1px solid var(--line); color: var(--sub); }
.clear-ghost:hover { color: var(--ink); border-color: var(--accent); }
.oc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.oc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.oc-empty { font-size: 13px; color: var(--muted); padding: 8px 4px; line-height: 1.7; }
.oc-meta-row { font-size: 12px; color: var(--muted); margin-top: 8px; }
.oc-tools { margin: 8px 0; }

/* ===== 账本（链上账本操作） ===== */
.oc-ledger { padding: 4px 2px; }
.oc-ledger-head { margin-bottom: 8px; }
.oc-sec-h { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.oc-sec-sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0; }
.oc-ledger-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.oc-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.oc-stat-v { font-size: 18px; font-weight: 700; color: var(--accent); word-break: break-all; }
.oc-stat-v.oc-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; color: var(--ink); }
.oc-you { color: var(--accent); font-size: 12px; font-weight: 700; }
.oc-stat-l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.oc-ledger-id { margin: 8px 0; }
.oc-field-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.oc-select, .oc-input { width: 100%; box-sizing: border-box; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 13px; font-family: inherit; }
/* 链上下拉框：内容自适应宽度，统一箭头，左 8 右 26 与全站一致 */
.oc-select {
  width: auto; min-width: 54px; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 9px 26px 9px 8px;
}
.oc-select:focus, .oc-input:focus { outline: none; border-color: var(--accent); }
.oc-row { margin-bottom: 8px; }
.oc-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 8px; }
.oc-panel-h { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.oc-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; padding: 8px 2px; }
.oc-hint.oc-warn { color: var(--warn, #ffa940); }
.oc-dis { opacity: .45; cursor: not-allowed; }
.oc-danger { color: var(--red); border-color: var(--red); }
.oc-danger:hover { background: rgba(255,77,79,.12); }
.oc-hist { margin-top: 8px; max-height: 320px; overflow: auto; }
.oc-tx { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.oc-tx:last-child { border-bottom: none; }
.oc-tx-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.oc-badge-mint { background: rgba(82,196,26,.18); color: #52c41a; }
.oc-badge-xfer { background: rgba(24,144,255,.18); color: #40a9ff; }
.oc-tx-route { color: var(--ink); }
.oc-tx-amt { font-weight: 700; color: var(--accent); }
.oc-tx-fee { color: var(--muted); }
.oc-tx-note { color: var(--muted); font-style: italic; }
.oc-tx-time { color: var(--muted); margin-left: auto; }
.oc-tx-sig { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); font-size: 11px; }

/* ===== 移动端适配 ===== */
@media (max-width: 640px) {
  .pts-cards { grid-template-columns: repeat(2, 1fr); }
  .pts-row .gd-btn { flex: 1 1 100%; }
}

/* ===== 出行准备清单 Travel Packing List · TPL（packing-view.js 注入） =====
   全部颜色走 site.css 主题变量，深/浅色自动跟随，无独立色板。 */
.pk-wrap { display: flex; flex-direction: column; gap: 8px; max-width: 1080px; margin: 0 auto; width: 100%; }
.pk-sec {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.pk-sec-h {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; color: var(--brand);
  margin: 0 0 8px;
}
.pk-sec-h small { font-weight: 400; font-size: 12px; color: var(--sub); }
.pk-sec-h .ic { width: 18px; height: 18px; flex: none; color: var(--brand); }
.pk-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.pk-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 0 0 auto; }
.pk-field > span { font-size: 12px; color: var(--sub); }
.pk-field input, .pk-field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--ink);
  font-family: inherit;
}
/* 出行清单下拉框：内容自适应宽度（flex 列中需 align-self 防拉伸），统一箭头，左 8 右 26 */
.pk-field select {
  width: auto; min-width: 54px; max-width: 100%; align-self: flex-start;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 8px 26px 8px 8px;
}
.pk-field input:focus, .pk-field select:focus { outline: none; border-color: var(--accent); }
/* 出行信息：日期/select 固定宽度，尽量一行排布，排不下再自然换行 */
.pk-field-date input { width: 130px; }
.pk-date-row { display: flex; align-items: center; gap: 6px; }
.pk-grid .pk-field select { width: auto; min-width: 54px; max-width: 100%; align-self: flex-start; }
.pk-grid .pk-field .pk-chips { flex-wrap: nowrap; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-chip { position: relative; }
.pk-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.pk-chip span {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 12.5px; color: var(--sub);
  background: var(--bg); cursor: pointer; user-select: none;
}
.pk-chip:hover span { color: var(--ink); border-color: var(--accent); }
.pk-chip input:checked + span {
  background: var(--accent); color: #fff; border-color: transparent; font-weight: 600;
}
.pk-chip input:focus-visible + span { box-shadow: 0 0 0 2px var(--accent); }
.pk-hint { font-size: 12px; color: var(--sub); margin: -2px 0 8px; }
.pk-climate {
  border: 1px dashed var(--accent); border-radius: 12px;
  padding: 12px 14px; background: var(--bg); margin: 0 0 8px;
}
.pk-climate .cl-h {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px; color: var(--accent); margin-bottom: 6px;
}
.pk-climate .cl-h .ic { width: 18px; height: 18px; flex: none; }
.pk-climate .cl-text { font-size: 13px; line-height: 1.6; color: var(--ink); margin-bottom: 8px; }
.pk-custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-custom input[type=text] {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; min-width: 120px;
}
/* 出行清单自定义项下拉框：内容自适应，统一箭头，左 8 右 26 */
.pk-custom select {
  width: auto; min-width: 54px; max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 8px 26px 8px 8px;
}
.pk-custom input[type=text] { flex: 1 1 160px; max-width: 320px; }
.pk-custom select:focus, .pk-custom input[type=text]:focus { outline: none; border-color: var(--accent); }
.pk-custom-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.pk-citem { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; }
.pk-citem i { font-style: normal; font-size: 11px; color: var(--sub); margin-left: 6px; }
.pk-citem .pk-nn { padding: 3px 9px; font-size: 12px; }
.pk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 8px; padding: 8px 14px; font-size: 13px;
  cursor: pointer; font-family: inherit; min-height: 36px;
  width: auto; min-width: 88px; flex: none;
}
.pk-btn:hover { border-color: var(--accent); color: var(--accent); }
.pk-btn.pri { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.pk-btn.pri:hover { filter: brightness(1.08); color: #fff; }
.pk-btn.sec { flex: 0 1 auto; }
.pk-row { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.pk-btn:active { transform: scale(.98); }

/* 进度环 + 统计 */
.pk-prog { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pk-prog .ring { flex: none; }
.pk-prog .pt { font-size: 13px; color: var(--sub); }
.pk-prog .pt b { display: block; font-size: 22px; color: var(--ink); line-height: 1.2; }

/* 天气 */
.pk-wx {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; background: var(--bg); margin-bottom: 8px;
}
.pk-wx .w-h {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-weight: 600; font-size: 13px; color: var(--brand); margin-bottom: 8px;
}
.pk-wx .w-sub { font-weight: 400; font-size: 12px; color: var(--sub); margin-left: 6px; }
.pk-wx .w-day {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.pk-wx .w-day:first-of-type { border-top: 0; }
.pk-wx .wd { font-weight: 600; min-width: 52px; color: var(--ink); }
.pk-wx .we { width: 24px; text-align: center; }
.pk-wx .wt { flex: 1; color: var(--sub); }
.pk-wx .wt b { color: var(--ink); }
.pk-wx .wp { min-width: 50px; text-align: right; font-size: 12px; color: var(--accent); }
.pk-wx .w-tip {
  font-size: 12px; color: var(--sub); margin-top: 8px; line-height: 1.55;
  background: var(--panel-2); padding: 8px 10px; border-radius: 10px;
}
.pk-wx .w-note { font-size: 13px; color: var(--sub); display: flex; align-items: center; gap: 8px; padding: 4px 0; }

/* 分类 + 条目 */
.pk-cat { margin-bottom: 8px; }
.pk-cat-h {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13.5px; color: var(--ink); margin-bottom: 8px;
}
.pk-cat-h .ic { width: 18px; height: 18px; flex: none; color: var(--accent); }
.pk-cat-h .cnt { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--sub); }
.pk-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 9px; cursor: pointer;
}
.pk-item:nth-child(odd) { background: var(--bg); }
.pk-item input { width: 17px; height: 17px; flex: none; accent-color: var(--accent); }
.pk-item label { flex: 1; cursor: pointer; font-size: 13px; word-break: break-word; }
.pk-item.done label { text-decoration: line-through; color: var(--sub); }
.pk-nn {
  flex: none; border: 0; background: transparent; cursor: pointer;
  font-size: 12px; color: var(--sub); padding: 4px 8px; border-radius: 8px;
  font-family: inherit; line-height: 1.2;
}
.pk-nn:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.pk-item.nn { opacity: .62; }
.pk-item.nn label { text-decoration: line-through; color: var(--sub); }
.pk-item.nn .pk-nn { color: var(--red); font-weight: 600; }

/* 近期提醒 */
.pk-up {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); margin-bottom: 8px;
  cursor: pointer;
}
.pk-up.over { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--bg)); }
.pk-up .dd { font-weight: 700; font-size: 13.5px; }
.pk-up .meta { font-size: 12px; color: var(--sub); }
.pk-up .bar { flex: 1; height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 40px; }
.pk-up .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #9b6cff); }
.pk-up .pc { font-size: 12px; color: var(--sub); min-width: 34px; text-align: right; }
.pk-sh {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--sub);
  font-size: 12px; padding: 4px 10px; border-radius: 8px; cursor: pointer; font-family: inherit; line-height: 1.3;
}
.pk-sh:hover { color: var(--accent); border-color: var(--accent); }

/* 历史 */
.pk-hist {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 8px; background: var(--bg);
}
.pk-hist .h-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pk-hist .h-name { font-weight: 700; font-size: 14px; }
.pk-hist .h-meta { font-size: 12px; color: var(--sub); margin: 6px 0; }
.pk-hist .h-act { display: flex; gap: 8px; margin-top: 8px; }
.pk-hist .h-act .pk-btn { flex: 0 1 auto; min-width: 76px; min-height: 34px; font-size: 12.5px; padding: 6px 10px; }
.pk-tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent); font-weight: 600;
}
.pk-tag.g { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pk-empty { color: var(--sub); font-size: 13px; text-align: center; padding: 18px 0; }
.pk-foot { text-align: center; color: var(--sub); font-size: 12px; padding: 6px 0 2px; }
@media (max-width: 640px) {
  .pk-grid { grid-template-columns: 1fr; }
  .pk-field input, .pk-field select { max-width: none; }
  .pk-sec { padding: 12px 13px; }
  .pk-row { flex-direction: column; }
  .pk-row .pk-btn { width: 100%; }
}

/* ===== PSI 子版块：生物调节 / 记忆和意识 ===== */
.psi-subview { margin-top: 8px; }
.psi-sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.psi-sub-head h3 { margin: 0; font-size: 17px; color: var(--ink); font-weight: 600; }
.psi-btn-sm { font-size: 12px; padding: 4px 10px; border-radius: 7px; }

/* 生物调节 · 个人医疗健康卡 */
.br-card { margin-top: 8px; }
.br-sec-h { font-weight: 600; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.br-sec-h .psi-btn-sm { margin-left: auto; }
.br-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.br-field { display: flex; flex-direction: column; gap: 5px; }
.br-field-full { grid-column: 1 / -1; }
.br-field label { font-size: 12px; color: var(--muted); }
.br-field input, .br-field textarea, .br-field select { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 13px; font-family: inherit; }
.br-field input:focus, .br-field textarea:focus, .br-field select:focus { border-color: var(--accent); outline: none; }
.br-field textarea { resize: vertical; }
.br-actions { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.br-saved { font-size: 12px; color: var(--good); }
.br-cond-list { display: flex; flex-direction: column; gap: 8px; }
.br-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.br-empty-sm { padding: 4px 0; }
.br-cond { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); }
.br-cond-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.br-cond-name, .br-cond-date, .br-cond-st, .br-cond-note { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
.br-cond-name { flex: 1 1 160px; min-width: 120px; }
.br-cond-date { width: 130px; }
.br-cond-note { width: 100%; box-sizing: border-box; margin-top: 8px; resize: vertical; }
.br-cond-note:focus, .br-cond-name:focus, .br-cond-date:focus, .br-cond-st:focus { border-color: var(--accent); outline: none; }
.br-x { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 7px; width: 28px; height: 28px; cursor: pointer; flex: none; }
.br-x:hover { border-color: var(--red); color: var(--red); }
.br-checks-h { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.br-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.br-check { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.br-check input { flex: 1 1 120px; min-width: 90px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12px; font-family: inherit; }
.br-check input:focus { border-color: var(--accent); outline: none; }
.br-check .br-x { width: 24px; height: 24px; }

/* 记忆和意识 · 上传状况看板 */
.mc-card { margin-top: 8px; }
.mc-intro { color: var(--sub); font-size: 13px; margin: 0 0 8px; line-height: 1.6; }
.mc-list { display: flex; flex-direction: column; gap: 8px; }
.mc-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mc-row-main { flex: 1 1 240px; min-width: 200px; }
.mc-name { font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.mc-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.mc-row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.mc-size { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-state { font-size: 12px; color: var(--warn); }
.mc-row-side .psi-btn[disabled] { opacity: .5; cursor: not-allowed; }
.mc-up-list { flex-basis: 100%; }
.mc-empty { font-size: 12px; color: var(--muted); }
.mc-foot { margin-top: 8px; }
.mc-foot .psi-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* PSI 子板块面包屑（点击根返回主页面） */
.psi-crumb-head { flex-wrap: wrap; }
.psi-crumb { color: var(--accent); cursor: pointer; font-weight: 600; }
.psi-crumb:hover { text-decoration: underline; }
.psi-crumb-sep { color: var(--muted); }
.psi-crumb-cur { color: var(--ink); font-weight: 600; }
/* 记忆看板：上传按钮保持原宽，不随内容缩短 */
.mc-up-one { min-width: 76px; }

@media (max-width: 640px) {
  .mc-row-side { width: 100%; justify-content: space-between; }
}

/* 生物调节：窄输入框 + 单位 + 查找/列表/详情 */
.br-field { display: inline-flex; flex-direction: column; gap: 6px; }
.br-field label { width: 100%; font-size: 12px; color: var(--muted); }
.br-field-row { display: flex; align-items: center; gap: 6px; }
.br-field input[type=text], .br-field input[type=number] { width: 104px; flex: 0 0 auto; }
.br-field select {
  width: auto; min-width: 54px; flex: 0 0 auto;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0b8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  padding: 0 26px 0 8px;
}
.br-field textarea { width: 100%; }
.br-unit { display: none; }
.br-search { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.br-search input { flex: 1 1 160px; min-width: 120px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 13px; font-family: inherit; }
.br-search input:focus { border-color: var(--accent); outline: none; }
.br-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.br-item { display: flex; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--bg); cursor: pointer; }
.br-item:hover { border-color: var(--accent); }
.br-item-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; flex: 1; }
.br-item-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.br-item-date { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.br-badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.br-b-ongoing { color: var(--warn); border-color: var(--warn); }
.br-b-better { color: var(--good); border-color: var(--good); }
.br-b-cured { color: var(--accent); border-color: var(--accent); }
.br-b-follow { color: var(--muted); }
.br-detail { margin-top: 6px; }
.br-detail-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.br-detail-h { font-weight: 600; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; }
.br-detail-h .br-x { margin-left: auto; }
.br-add .br-detail-h { margin-left: 0; }

/* 生物调节：日期选择器 / 排布 / 列表元信息 / 检查记录行 */
.br-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.br-grid > .br-field { flex: 0 0 auto; min-width: 0; }
.br-grid > .br-field-full { flex: 1 1 100%; }
.br-field.br-dn .br-field-row input[type=text] { width: 96px; }
.br-cal { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--sub); border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.br-cal:hover { color: var(--ink); border-color: var(--accent); }
.br-cal-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.br-allergy-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.br-allergy-row .br-allergy { flex: 1 1 320px; min-width: 220px; }
.br-allergy-row .br-allergy textarea { width: 100%; box-sizing: border-box; }
.br-allergy-row #bioSave { flex: 0 0 auto; align-self: flex-end; }
.br-item { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.br-item-main { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.br-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.br-item-meta .br-next { color: var(--muted); }
.br-item-meta .br-overdue { color: var(--red); font-weight: 600; }
.br-check { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.br-check-new { border-style: dashed; border-color: var(--accent); }
.br-check .br-chk-date { flex: 0 0 auto; width: 96px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; font-size: 12px; font-family: inherit; }
.br-check .br-chk-res, .br-check .br-chk-note { flex: 1 1 0; min-width: 0; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; font-size: 12px; font-family: inherit; }
.br-chk-date:focus, .br-chk-res:focus, .br-chk-note:focus { border-color: var(--accent); outline: none; }
.br-check .br-cal { width: 28px; height: 28px; font-size: 13px; }
.br-check .gd-rec-acts { margin-left: auto; }

/* ===== 市场预测投票（MPV）用户板块 ===== */
.mpv-wrap { padding: 4px 2px; }
.mpv-disc { font-size: 12px; color: var(--sub); background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 8px; line-height: 1.6; }
.mpv-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.mpv-bar .pts-input { flex: 0 1 auto; }
.mpv-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.mpv-cat.active { background: var(--accent, #3d8bff); color: #fff; border-color: var(--accent, #3d8bff); }
.mpv-list { display: flex; flex-direction: column; gap: 8px; }
.mpv-note, .msg-note { color: var(--sub); font-size: 13px; }
.mpv-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel-2, rgba(255,255,255,.03)); }
.mpv-card-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.mpv-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.mpv-badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.mpv-badge.open { background: #13314f; color: #7cc3ff; }
.mpv-badge.resolved { background: #1f3a2c; color: var(--ok, #34d399); }
.mpv-desc { color: var(--sub); font-size: 13px; margin: 6px 0; line-height: 1.5; }
.mpv-meta { color: var(--sub); font-size: 12px; margin: 2px 0; }
.mpv-opts { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.mpv-opt { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel, rgba(255,255,255,.02)); }
.mpv-opt.winner { border-color: var(--ok, #34d399); background: rgba(52,211,153,.08); }
.mpv-opt.mine { border-color: var(--accent, #3d8bff); }
.mpv-opt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mpv-opt-name { font-size: 14px; color: var(--ink); }
.mpv-bar-bg { height: 7px; border-radius: 5px; background: var(--panel); overflow: hidden; margin: 6px 0 4px; }
.mpv-bar-fg { height: 100%; background: var(--accent, #3d8bff); }
.mpv-opt-sub { font-size: 12px; color: var(--sub); }
.mpv-tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.mpv-tag.voted { background: #13314f; color: #7cc3ff; }
.mpv-tag.winner { background: #1f3a2c; color: var(--ok, #34d399); }
.mpv-tag.claimed { background: #2a2a1a; color: #e0c060; }
.mpv-votehint { font-size: 12px; color: var(--sub); margin-top: 8px; }
.mpv-formula { font-size: 12px; color: var(--sub); margin-top: 8px; background: var(--panel); border: 1px dashed var(--line); border-radius: 8px; padding: 7px 9px; line-height: 1.5; }
.mpv-myreward { font-size: 12px; color: var(--ok, #34d399); }
.mpv-confirm { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.mpv-modal { background: var(--panel, #141b2e); border: 1px solid var(--line); border-radius: 12px; padding: 18px; max-width: 320px; }
.mpv-modal-txt { font-size: 14px; color: var(--ink); margin-bottom: 8px; line-height: 1.5; }
.mpv-modal-acts { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== 全局表单控件：下拉框 + 填写框 底色 / 文字 / 提示词 / 选项悬浮（随主题切换） =====
   覆盖各模块自身的底色/文字，确保全站一致：
   深色 → 黑底白字，悬浮选项深灰；浅色 → 白底黑字，悬浮选项浅灰。 */
select,
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
textarea {
  background-color: var(--field-bg) !important;
  color: var(--field-ink) !important;
}
input::placeholder,
textarea::placeholder {
  color: var(--field-ph) !important;
  opacity: 1 !important;
}
select option {
  background-color: var(--field-bg) !important;
  color: var(--field-ink) !important;
}
select option:hover,
select option:checked,
select option:focus {
  background-color: var(--field-hover) !important;
  color: var(--field-ink) !important;
}

/* 全站表单控件默认比例字体：与正文一致。
   说明：仅作用于真正的表单元素；密钥/地址类展示用的是 div（.oc-mnemonic/.gd-pwmask 等），不受影响；
   2FA 验证码格 .gd-cell 用更高优先级的等宽规则，保持对齐。 */
input, select, textarea { font-family: inherit; }
