@charset "UTF-8";

/* 字体自托管：CDN 在部分网络下不可达，这里用本地子集化字体，离线也能正确显示 */
@font-face {
  font-family: "LXGW WenKai";
  src: url("assets/fonts/lxgw-wenkai-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/quicksand-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/quicksand-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/quicksand-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/quicksand-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("assets/fonts/caveat-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("assets/fonts/caveat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #faf4ea;
  --paper: #fffcf6;
  --surface: #ffffff;
  --ink: #3a3129;
  --ink-soft: #78695c;
  --ink-faint: #a99b8c;
  --line: rgba(58, 49, 41, 0.1);
  --line-strong: rgba(58, 49, 41, 0.16);

  --coral: #c8705f;
  --coral-soft: #f1d9d3;
  --sage: #7e957f;
  --sage-soft: #dee7dd;
  --honey: #cf9f49;
  --honey-soft: #f2e5c8;
  --mist: #6d8ba8;
  --mist-soft: #d9e3ec;
  --iris: #987fae;
  --iris-soft: #e7ddea;

  --module: var(--coral);
  --module-soft: var(--coral-soft);

  --font-ui: "Quicksand", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-hand: "LXGW WenKai", "LXGW WenKai Lite", "Kaiti SC", "KaiTi", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-note: "Caveat", "LXGW WenKai", cursive;

  --glass-bg: rgba(255, 252, 246, 0.66);
  --glass-edge: rgba(255, 255, 255, 0.66);
  --glass-shadow: 0 14px 34px rgba(69, 48, 34, 0.13);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
/* 关键补丁：作者样式里的 display 会压过浏览器默认的 [hidden]{display:none}，
   导致 hidden 的遮罩层依然铺满全屏、吃掉所有点击。这一条把它钉死。 */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; transition: transform 0.3s var(--ease-spring), background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
button:active { transform: scale(0.955); transition-duration: 0.08s; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--module); outline-offset: 3px; }
h1, h2, h3, p, blockquote, ul { margin: 0; }
h1, h2, h3 { font-family: var(--font-hand); font-weight: 600; }
p { text-wrap: pretty; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* 苹果液态玻璃质感 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}
.lens {
  display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.38));
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 16px rgba(69, 48, 34, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* 桌面预览舞台 */
.preview-stage {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 36px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(52% 42% at 18% 12%, rgba(240, 205, 196, 0.85), transparent 70%),
    radial-gradient(46% 40% at 84% 22%, rgba(199, 217, 231, 0.8), transparent 70%),
    radial-gradient(48% 44% at 72% 86%, rgba(226, 216, 236, 0.78), transparent 72%),
    radial-gradient(40% 36% at 26% 84%, rgba(240, 232, 203, 0.8), transparent 70%),
    var(--cream);
}
.desktop-caption { position: fixed; top: 26px; left: 32px; right: 32px; display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 10px; letter-spacing: 0.18em; }
.desktop-caption span:first-child { font-family: var(--font-hand); font-size: 16px; letter-spacing: 0.1em; }
.phone {
  width: 390px; height: min(844px, calc(100vh - 72px)); min-height: 660px;
  border: 11px solid #2e2823; border-radius: 50px; overflow: hidden; position: relative;
  background: var(--paper);
  box-shadow: 0 34px 74px rgba(62, 43, 31, 0.26), 0 6px 14px rgba(62, 43, 31, 0.14);
}
.status-bar { height: 44px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 6; font-size: 12px; font-weight: 600; }
.dynamic-island { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 106px; height: 27px; border-radius: 18px; background: #201d1b; color: #fffaf3; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: width 0.48s var(--ease-spring), height 0.48s var(--ease-spring), border-radius 0.35s ease; }
.dynamic-island span { max-width: 0; opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 500; transition: max-width 0.35s ease, opacity 0.2s ease; }
.dynamic-island.expanded { width: 240px; height: 34px; border-radius: 20px; }
.dynamic-island.expanded span { max-width: 210px; opacity: 1; transition-delay: 0.08s; }
.status-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.battery { width: 20px; height: 10px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; display: inline-block; }
.battery::before { content: ""; position: absolute; inset: 1.5px; width: 70%; background: currentColor; border-radius: 1px; }
.battery::after { content: ""; position: absolute; right: -3px; top: 2px; width: 2px; height: 4px; background: currentColor; border-radius: 0 2px 2px 0; }
.app-shell { height: calc(100% - 44px); position: relative; }

/* ---------- 真机适配：藏掉网页自绘的状态栏 ----------
 *
 * 网页里画的那条状态栏（时间 / 动态岛 / 5G / 电量）本来是"手机模型"的一部分，
 * 桌面预览看着完整。但真机上系统已经有一条状态栏了，两条叠在一起就是两层时间。
 *
 * 所以真机（App 或手机浏览器）下整条藏掉，内容顶到屏幕上沿；
 * 系统状态栏那半条由原生层负责，网页不再自己模拟。 */
html.native-shell .status-bar { display: none; }
html.native-shell .app-shell { height: 100%; }
html.native-shell .phone { height: 100dvh; min-height: 0; }
html.native-shell .error-banner { top: 8px; }
/* 系统状态栏是深色还是浅色由原生层决定，这里只保证内容不被压住 */
html.native-shell .chat-header { padding-top: max(10px, env(safe-area-inset-top)); }
html.native-shell .page-header { padding-top: max(14px, env(safe-area-inset-top)); }

/* 五个房间：同族不同色 */
.screen { position: absolute; inset: 0; padding-bottom: 96px; display: none; animation: screen-in 0.46s var(--ease-out); }
.screen.active { display: flex; flex-direction: column; }
.screen[data-module="chat"] { --module: var(--coral); --module-soft: var(--coral-soft); }
.screen[data-module="memory"] { --module: var(--mist); --module-soft: var(--mist-soft); }
.screen[data-module="journal"] { --module: var(--honey); --module-soft: var(--honey-soft); }
.screen[data-module="mind"] { --module: var(--iris); --module-soft: var(--iris-soft); }
.screen[data-module="profile"] { --module: var(--sage); --module-soft: var(--sage-soft); }
.screen::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(70% 38% at 12% 0%, var(--module-soft), transparent 68%);
  opacity: 0.85;
}
.screen > * { position: relative; z-index: 1; }
@keyframes screen-in { from { opacity: 0; transform: translateY(9px) scale(0.985); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }
.home-indicator { position: absolute; z-index: 20; bottom: 7px; left: 50%; transform: translateX(-50%); width: 120px; height: 4px; border-radius: 4px; background: var(--ink); opacity: 0.6; pointer-events: none; }

/* 环境自检条：出错就当场喊出来，而不是默默装死 */
.env-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 20px; background: rgba(255, 255, 255, 0.55); color: var(--ink-faint); font-size: 8px; font-weight: 600; white-space: nowrap; }
.env-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--sage); }
.env-pill.warn i { background: var(--honey); }
.env-pill.bad i { background: var(--coral); }
.error-banner { position: absolute; top: 44px; left: 12px; right: 12px; z-index: 30; padding: 10px 14px; border-radius: 14px; background: rgba(200, 112, 95, 0.94); color: #fffaf5; font-size: 11px; line-height: 1.6; box-shadow: 0 10px 24px rgba(120, 50, 40, 0.25); }

/* 聊天：Discord 式紧凑消息流 */
.chat-header { min-height: 70px; display: flex; align-items: center; gap: 11px; padding: 10px 16px 8px; }
.avatar { border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--module-soft); color: var(--module); font-family: var(--font-hand); overflow: hidden; padding: 0; border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 4px 10px rgba(69, 48, 34, 0.1); }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 9%; }
.avatar-small { width: 42px; height: 42px; }
.avatar-large { width: 64px; height: 64px; }
.avatar-message { width: 30px; height: 30px; }
.avatar-message img { object-position: 50% 7%; }
.companion-heading { min-width: 0; flex: 1; }
.name-line { display: flex; align-items: center; gap: 8px; }
.name-line h1 { font-size: 20px; line-height: 1.2; }
.companion-heading p { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.presence { color: var(--sage); background: rgba(126, 149, 127, 0.14); padding: 3px 8px; border-radius: 20px; font-size: 9px; font-weight: 600; }

/* 模型接入徽章 */
.model-badge { display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-faint); font-size: 8px; font-weight: 600; letter-spacing: .02em; }
.model-badge.live { border-color: color-mix(in srgb, var(--sage) 40%, transparent); background: color-mix(in srgb, var(--sage) 13%, transparent); color: color-mix(in srgb, var(--sage) 78%, #333); }
.model-badge.live::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--sage); vertical-align: middle; animation: model-pulse 2s ease-in-out infinite; }
@keyframes model-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 模型接入面板 */
.model-status { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 11px 13px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.model-status i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--ink-faint); }
.model-status.good { border-color: color-mix(in srgb, var(--sage) 42%, transparent); background: color-mix(in srgb, var(--sage) 10%, transparent); color: color-mix(in srgb, var(--sage) 80%, #333); }
.model-status.good i { background: var(--sage); }
.model-status.warn { border-color: color-mix(in srgb, var(--honey) 46%, transparent); background: color-mix(in srgb, var(--honey) 12%, transparent); color: #9a7128; }
.model-status.warn i { background: var(--honey); }
.model-status.bad { border-color: color-mix(in srgb, var(--coral) 46%, transparent); background: color-mix(in srgb, var(--coral) 11%, transparent); color: color-mix(in srgb, var(--coral) 82%, #333); }
.model-status.bad i { background: var(--coral); }

/* 空密钥时的自助引导：像手账便签，不像客服弹窗 */
.key-guide { margin-top: 2px; padding: 13px 14px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--honey) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--honey) 44%, transparent); }
.key-guide-lead { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 9px; color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.55; }
.key-guide-lead svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--honey); }
.key-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.key-steps li { display: flex; align-items: flex-start; gap: 8px; font-size: 10px; line-height: 1.65; color: var(--ink-soft); }
.key-steps li b:first-child { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--honey) 26%, transparent); color: #8a6420; font-family: var(--font-ui); font-size: 9px; font-weight: 700; }
.key-steps li b + b { font-weight: 700; color: var(--ink); }
.key-steps li em { font-style: normal; color: var(--coral); font-weight: 600; }
.key-steps a { color: var(--coral); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.key-steps code { padding: 1px 4px; border-radius: 4px; background: var(--paper-deep); color: var(--ink); font-family: var(--font-ui); font-size: 9px; }
.key-guide-foot { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed color-mix(in srgb, var(--ink-faint) 34%, transparent); color: var(--ink-faint); font-size: 9px; line-height: 1.6; }
.field select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: 11px; outline: none; }
.field select:focus { border-color: var(--module); }
.field input[type="password"] { font-family: var(--font-ui); letter-spacing: .04em; }

/* 密钥输入框：带显示/隐藏按钮和一行提示 */
.key-input-wrap { position: relative; display: block; }
.key-input-wrap input { padding-right: 44px !important; }
.key-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); transition: background .2s ease, color .2s ease; }
.key-eye:hover { background: var(--paper-deep); color: var(--ink); }
.key-eye.active { color: var(--module); }
.key-eye svg { width: 17px; height: 17px; stroke: currentColor; }
.field-hint { display: block; margin-top: 6px; color: var(--ink-faint); font-size: 9px; line-height: 1.6; }
.sheet-actions-stack { flex-direction: column; }
.danger-button { color: color-mix(in srgb, var(--coral) 82%, #333); }
.icon-button { width: 42px; height: 42px; border-radius: 50%; }
.icon-button.accent-icon .ic { width: 19px; height: 19px; color: var(--module); }
.relationship-strip { margin: 0 18px; padding: 7px 12px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 9px; font-weight: 600; }
.affinity-track { height: 4px; background: var(--module-soft); flex: 1; border-radius: 4px; overflow: hidden; }
.affinity-track i { display: block; height: 100%; width: 58%; background: var(--module); border-radius: inherit; transition: width 0.6s var(--ease-out); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 10px 14px 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chat-scroll::-webkit-scrollbar, .page-scroll::-webkit-scrollbar { display: none; }
.day-divider { display: flex; justify-content: center; margin: 2px 0 18px; }
.day-divider span { padding: 4px 13px; border-radius: 14px; background: rgba(255, 255, 255, 0.72); border: 1px dashed var(--line-strong); color: var(--ink-faint); font-size: 9px; }
.message-row { display: flex; gap: 9px; margin-bottom: 6px; align-items: flex-start; padding: 2px 6px; border-radius: 10px; transition: background-color 0.2s ease; }
.message-row:hover { background: rgba(255, 255, 255, 0.55); }
.message-row.grouped { margin-top: -2px; }
.message-row.grouped .avatar { visibility: hidden; }
.message-row.grouped time { display: none; }
.message-row > div:not(.avatar) { max-width: 76%; min-width: 0; }
.message-bubble { padding: 9px 13px; border-radius: 6px 16px 16px 16px; background: rgba(255, 255, 255, 0.78); box-shadow: 0 2px 8px rgba(77, 54, 36, 0.05); font-size: 13px; line-height: 1.7; animation: bubble-in 0.4s var(--ease-spring); transform-origin: left bottom; }
.message-row time { display: block; margin-top: 3px; color: var(--ink-faint); font-size: 8px; }
.msg-author { display: block; margin-bottom: 4px; color: var(--module); font-family: var(--font-hand); font-size: 11px; font-weight: 600; }
.user-message { justify-content: flex-end; }
.user-message .message-bubble { background: var(--module); color: #fffaf5; border-radius: 16px 6px 16px 16px; box-shadow: 0 4px 12px rgba(69, 48, 34, 0.12); }
.user-message time { text-align: right; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(5px) scale(0.96); } to { opacity: 1; transform: none; } }
.thought-peek { width: calc(100% - 39px); min-height: 42px; margin: 10px 0 12px 39px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; text-align: left; border: 1px dashed color-mix(in srgb, var(--module) 35%, transparent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--module-soft) 45%, transparent); color: var(--ink); font-size: 10px; }
.thought-peek span:nth-child(2) { flex: 1; }
.thought-peek .ic { width: 14px; height: 14px; color: var(--module); }
.thought-mark { width: 7px; height: 7px; border: 1.5px solid var(--module); border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--module) 16%, transparent); }
.composer-wrap { padding: 4px 12px 12px; }
.quick-share { min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; margin: 0 0 6px 4px; border: 1px dashed color-mix(in srgb, var(--module) 34%, transparent); border-radius: 14px; background: rgba(255, 255, 255, 0.66); color: var(--module); font-size: 10px; font-weight: 600; }
.quick-share .ic { width: 13px; height: 13px; }
.composer { display: flex; align-items: center; gap: 5px; padding: 5px; border-radius: 24px; background: rgba(255, 255, 255, 0.74); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 10px 26px rgba(69, 48, 34, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85); }
.composer-tool { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.composer input { min-width: 0; flex: 1; height: 38px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.composer input::placeholder { color: var(--ink-faint); }
.send-button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, color-mix(in srgb, var(--module) 86%, white), var(--module)); color: #fffaf5; box-shadow: 0 6px 14px color-mix(in srgb, var(--module) 32%, transparent); }
.send-button .ic { width: 17px; height: 17px; stroke-width: 2.2; }

/* 页面通用 */
.page-header { min-height: 88px; padding: 18px 20px 10px; display: flex; justify-content: space-between; align-items: flex-end; }
.page-header h1 { font-size: 30px; letter-spacing: 0.04em; line-height: 1.1; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--module); font-size: 9px; letter-spacing: 0.14em; font-weight: 600; }
.text-button { min-width: 44px; min-height: 40px; display: inline-flex; align-items: center; gap: 5px; color: var(--module); font-size: 11px; font-weight: 600; }
.text-button .ic { width: 15px; height: 15px; }
.round-button { width: 42px; height: 42px; border-radius: 50%; color: var(--module); }
.round-button .ic { width: 17px; height: 17px; }
.page-scroll { flex: 1; overflow-y: auto; padding: 6px 18px 24px; scrollbar-width: none; }
.paper-texture { background-image: repeating-linear-gradient(0deg, transparent, transparent 25px, rgba(102, 81, 63, 0.028) 26px); }
.section-index { color: var(--module); font-size: 9px; letter-spacing: 0.12em; font-weight: 600; }
.section-heading { margin: 24px 2px 11px; display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { font-size: 17px; }
.section-heading > span { color: var(--ink-faint); font-size: 9px; }
.soft-button { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border-radius: 12px; background: color-mix(in srgb, var(--module-soft) 70%, white); color: var(--module); font-size: 11px; font-weight: 600; }
.soft-button .ic { width: 14px; height: 14px; }
.soft-button.compact { min-height: 36px; }
.primary-button { min-height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 24px; background: linear-gradient(160deg, color-mix(in srgb, var(--module) 86%, white), var(--module)); color: #fffaf5; font-size: 12px; font-weight: 600; box-shadow: 0 8px 18px color-mix(in srgb, var(--module) 26%, transparent); }
.primary-button .ic { width: 14px; height: 14px; }

/* 记忆 */
.memory-hero { position: relative; padding: 24px 22px; border-radius: 6px var(--radius-xl) var(--radius-xl) var(--radius-xl); background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 26px rgba(80, 56, 36, 0.07); }
.memory-hero blockquote { margin: 13px 0 10px; font-family: var(--font-hand); font-size: 23px; line-height: 1.5; }
.memory-hero p { color: var(--ink-soft); font-size: 11px; line-height: 1.85; }
.washi-tape { position: absolute; top: -9px; left: 26px; width: 84px; height: 20px; background: rgba(213, 192, 159, 0.5); border-left: 1px dashed rgba(160, 135, 100, 0.35); border-right: 1px dashed rgba(160, 135, 100, 0.35); transform: rotate(-3deg); }
.memory-list { display: grid; gap: 10px; }
.memory-item { padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.72); }
.memory-item:hover { background: #fff; box-shadow: 0 8px 20px rgba(80, 56, 36, 0.07); }
.memory-item strong { display: block; margin: 6px 0; font-size: 12px; font-weight: 600; line-height: 1.6; }
.memory-item p, .memory-date { color: var(--ink-faint); font-size: 9px; }
.memory-date { color: var(--module); font-weight: 600; }
.memory-level { display: inline-block; padding: 3px 8px; border-radius: 8px; background: var(--module-soft); color: var(--module); font-size: 8px; font-weight: 600; }

/* 日记 */
.journal-date { display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 2px 3px 16px; }
.journal-date strong { grid-row: span 2; font-family: var(--font-hand); font-size: 58px; font-weight: 500; line-height: 0.9; color: var(--module); }
.journal-date span { color: var(--ink-soft); font-size: 10px; }
.journal-date span:first-child { font-family: var(--font-hand); font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.journal-stickers { display: flex; gap: 8px; margin: 0 0 14px 4px; }
.journal-stickers span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px dashed color-mix(in srgb, var(--module) 32%, transparent); border-radius: 12px; background: rgba(255, 255, 255, 0.72); color: var(--ink-soft); font-size: 9px; transform: rotate(-1.2deg); }
.journal-stickers span:last-child { transform: rotate(1deg); }
.journal-stickers .ic { width: 12px; height: 12px; color: var(--module); }
.journal-paper { position: relative; padding: 30px 22px 18px; border-radius: 4px 4px 18px 4px; background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(253, 248, 240, 0.92)); box-shadow: 0 14px 32px rgba(80, 56, 36, 0.09); transform: rotate(-0.5deg); }
.tape { position: absolute; width: 70px; height: 20px; left: 50%; top: -8px; transform: translateX(-50%) rotate(2deg); background: rgba(213, 192, 159, 0.46); }
.journal-paper h2 { margin-bottom: 18px; font-size: 22px; }
.journal-paper p { margin-bottom: 14px; font-family: var(--font-hand); font-size: 14px; line-height: 2.05; }
.journal-paper footer { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 9px; }
.hand-note { margin-top: 14px !important; font-family: var(--font-note) !important; font-size: 15px !important; color: var(--module); letter-spacing: 0.04em; transform: rotate(-1.5deg); }
.demo-note { margin-top: 16px; text-align: center; color: var(--ink-faint); font-size: 9px; }

/* 内心 */
.version-chip { padding: 6px 11px; border-radius: 20px; background: var(--module-soft); color: var(--module); font-size: 9px; font-weight: 600; }
.consciousness-card { padding: 26px 22px 22px; text-align: center; border-radius: 48% 48% var(--radius-xl) var(--radius-xl) / 28% 28% var(--radius-xl) var(--radius-xl); background: linear-gradient(160deg, color-mix(in srgb, var(--module-soft) 85%, white), var(--module-soft)); box-shadow: 0 10px 26px rgba(80, 56, 36, 0.06); }
.mind-orbit { width: 88px; height: 88px; margin: 0 auto 18px; border: 1px solid color-mix(in srgb, var(--module) 26%, transparent); border-radius: 50%; display: grid; place-items: center; position: relative; }
.mind-orbit::before { content: ""; position: absolute; inset: 10px; border: 1px solid color-mix(in srgb, var(--module) 18%, transparent); border-radius: 50%; }
.mind-orbit span { font-family: var(--font-hand); font-size: 30px; color: var(--module); }
.mind-orbit i { position: absolute; width: 9px; height: 9px; top: 5px; left: 18px; border-radius: 50%; background: var(--module); box-shadow: 0 0 0 5px color-mix(in srgb, var(--module) 14%, transparent); animation: heart-beat 2.4s var(--ease-out) infinite; }
@keyframes heart-beat {
  0%, 62%, 100% { transform: scale(1); box-shadow: 0 0 0 5px color-mix(in srgb, var(--module) 14%, transparent); }
  12% { transform: scale(1.42); box-shadow: 0 0 0 11px color-mix(in srgb, var(--module) 6%, transparent); }
  26% { transform: scale(1.06); box-shadow: 0 0 0 7px color-mix(in srgb, var(--module) 10%, transparent); }
  38% { transform: scale(1.28); box-shadow: 0 0 0 9px color-mix(in srgb, var(--module) 8%, transparent); }
}
.consciousness-card h2 { font-size: 20px; line-height: 1.5; }
.consciousness-card p { margin: 11px 0 20px; color: var(--ink-soft); font-size: 11px; line-height: 1.85; }
.impulse-card { width: 100%; padding: 17px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.76); position: relative; }
.impulse-card::after { content: ""; position: absolute; top: -8px; right: 26px; width: 44px; height: 16px; background: rgba(213, 192, 159, 0.42); transform: rotate(4deg); }
.impulse-state { display: inline-block; padding: 3px 8px; border-radius: 8px; background: rgba(126, 149, 127, 0.14); color: var(--sage); font-size: 8px; font-weight: 600; }
.impulse-card strong { display: block; margin: 10px 0 8px; font-family: var(--font-hand); font-size: 14px; line-height: 1.65; }
.impulse-card p { color: var(--ink-soft); font-size: 10px; }
.impulse-list { display: grid; gap: 9px; }
.impulse-row { display: grid; gap: 7px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.7); }
.impulse-text { font-family: var(--font-hand); font-size: 12px; line-height: 1.7; }
.impulse-meta { color: var(--ink-faint); font-size: 9px; }
.verdict-chip { padding: 3px 8px; border-radius: 8px; font-size: 8px; font-weight: 600; justify-self: start; }
.verdict-采纳 { background: rgba(126, 149, 127, 0.16); color: var(--sage); }
.verdict-驳回 { background: color-mix(in srgb, var(--coral) 14%, white); color: var(--coral); }
.verdict-泄漏 { background: color-mix(in srgb, var(--honey) 22%, white); color: #a0762c; }
.energy-card { margin-top: 12px; padding: 17px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line); }
.energy-card > div:first-child { display: grid; gap: 5px; }
.energy-card span { color: var(--ink-soft); font-size: 9px; }
.energy-card strong { font-family: var(--font-hand); font-size: 30px; font-weight: 500; }
.energy-card small { color: var(--ink-faint); font-size: 9px; font-weight: 400; }
.energy-ring { width: 66px; height: 66px; border: 5px solid var(--module-soft); border-top-color: var(--module); border-radius: 50%; display: grid; place-content: center; text-align: center; transform: rotate(8deg); }
.energy-ring > * { transform: rotate(-8deg); }
.energy-ring span { color: var(--module); font-size: 11px; font-weight: 600; }
.mind-list { display: grid; gap: 10px; }
.mind-item { padding: 14px 15px; border-left: 3px solid var(--module); border-radius: 4px 14px 14px 4px; background: rgba(255, 255, 255, 0.74); }
.mind-item p { font-size: 11px; line-height: 1.8; }
.weight-bar { height: 4px; margin: 10px 0 7px; border-radius: 4px; background: color-mix(in srgb, var(--module) 14%, transparent); overflow: hidden; }
.weight-bar i { display: block; height: 100%; border-radius: inherit; background: var(--module); }
.mind-meta { color: var(--ink-faint); font-size: 9px; }
.empty-note { padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-faint); font-size: 10px; line-height: 1.75; text-align: center; }

/* 她 */
.profile-identity { display: flex; align-items: center; gap: 14px; padding: 6px 2px 18px; }
.profile-identity > div { flex: 1; min-width: 0; }
.profile-identity h2 { font-size: 21px; }
.profile-identity p { margin-top: 5px; color: var(--ink-faint); font-size: 9px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-stats div { display: grid; gap: 5px; text-align: center; }
.profile-stats div + div { border-left: 1px solid var(--line); }
.profile-stats strong { font-family: var(--font-hand); font-size: 16px; font-weight: 500; }
.profile-stats span { color: var(--ink-faint); font-size: 8px; }
.persona-card { width: 100%; margin-top: 20px; padding: 22px; position: relative; text-align: left; border-radius: var(--radius-xl); background: rgba(255, 255, 255, 0.8); box-shadow: 0 10px 26px rgba(80, 56, 36, 0.07); }
.persona-card h2 { margin: 12px 0 9px; font-size: 19px; }
.persona-card p { color: var(--ink-soft); font-size: 11px; line-height: 1.85; }
.card-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 16px; color: var(--module); font-size: 11px; font-weight: 600; }
.card-link .ic { width: 13px; height: 13px; }
.settings-list { margin-top: 16px; }
.settings-list button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.settings-list button span:last-child { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-faint); font-size: 9px; }
.settings-list .ic { width: 13px; height: 13px; }

/* 底部导航：液态玻璃悬浮条 */
.bottom-nav { position: absolute; z-index: 10; left: 12px; right: 12px; bottom: 13px; height: 64px; padding: 6px 8px; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 252, 246, 0.6); border: 1px solid rgba(255, 255, 255, 0.66); border-radius: 26px; backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8); box-shadow: 0 14px 32px rgba(69, 48, 34, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85); }
.nav-item { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-faint); font-size: 8px; font-weight: 600; }
.nav-glyph { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 11px; transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s var(--ease-spring); }
.nav-glyph .ic { width: 17px; height: 17px; }
.nav-item.active { color: var(--nav-color, var(--coral)); }
.nav-item.active .nav-glyph { background: var(--nav-soft, var(--coral-soft)); transform: translateY(-1px); }
/* 内心图标选中心跳语义：激活时跟着心跳轻轻搏动 */
.nav-item[data-screen-target="mind"].active .nav-glyph .ic { animation: nav-heart-beat 2.4s var(--ease-out) infinite; transform-origin: center; }
@keyframes nav-heart-beat {
  0%, 62%, 100% { transform: scale(1); }
  12% { transform: scale(1.18); }
  26% { transform: scale(1.03); }
  38% { transform: scale(1.1); }
}
.nav-item:hover .nav-glyph { background: rgba(255, 255, 255, 0.7); }

/* 弹层 */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(45, 34, 26, 0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); box-shadow: 0 -18px 48px rgba(48, 34, 24, 0.26); transform: translateY(102%); transition: transform 0.44s var(--ease-out); }
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-grabber { display: block; width: 42px; height: 5px; margin: 0 auto 14px; border-radius: 4px; background: rgba(83, 66, 52, 0.2); }
.sheet-head { margin-bottom: 16px; }
.sheet-head h2 { margin: 6px 0 8px; font-size: 21px; line-height: 1.45; }
.sheet-head p { color: var(--ink-soft); font-size: 11px; line-height: 1.85; }
.sheet-textarea { width: 100%; min-height: 190px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-family: var(--font-hand); font-size: 13px; line-height: 1.95; resize: vertical; outline: none; }
.sheet-textarea:focus { border-color: var(--module); }
.sheet-textarea.short { min-height: 110px; }
.counter-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--ink-faint); font-size: 9px; }
.lock-note { color: var(--module); }
.locked-note { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; padding: 11px 13px; border-radius: var(--radius-md); background: var(--module-soft); color: var(--module); font-size: 10px; }
.locked-note .ic { width: 14px; height: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions > * { flex: 1; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button[disabled] { background: color-mix(in srgb, var(--module) 32%, white); box-shadow: none; cursor: not-allowed; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 10px; }
.field input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: 12px; outline: none; }
.field input:focus { border-color: var(--module); }
.question-form { display: grid; gap: 16px; }
.question-block { margin: 0; padding: 0; border: 0; }
.question-block legend, .legend-like { display: block; margin-bottom: 10px; font-family: var(--font-hand); font-size: 14px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span { display: inline-block; min-height: 38px; padding: 0 13px; border: 1px dashed color-mix(in srgb, var(--module) 32%, transparent); border-radius: 12px; background: rgba(255, 255, 255, 0.72); color: var(--ink-soft); font-size: 11px; line-height: 36px; cursor: pointer; transition: all 0.24s var(--ease-spring); }
.choice-chip input:checked + span { border-style: solid; border-color: var(--module); background: var(--module-soft); color: var(--module); transform: translateY(-1px); }
.log-timeline { display: grid; gap: 12px; }
.log-entry { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.log-entry.expanded { box-shadow: 0 8px 22px rgba(80, 56, 36, 0.08); }
.log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.log-head time { color: var(--ink-faint); font-size: 9px; }
.log-raw { font-family: var(--font-hand); font-size: 13px; line-height: 1.8; }
.log-reason { margin-top: 8px; color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.log-meta { display: inline-block; margin-top: 10px; color: var(--ink-faint); font-size: 9px; }
.search-field { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.search-field .ic { width: 15px; height: 15px; color: var(--ink-faint); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-results { display: grid; gap: 10px; margin-top: 14px; }
.search-result { padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.search-result strong { display: block; margin: 7px 0 6px; font-size: 12px; }
.search-result p { color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.diary-list { display: grid; gap: 11px; }
.diary-entry { padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.diary-entry strong { display: block; margin: 8px 0 7px; font-family: var(--font-hand); font-size: 14px; }
.diary-entry p { color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.diary-date-chip { color: var(--module); font-size: 9px; letter-spacing: 0.08em; font-weight: 600; }
.diary-mood { display: inline-block; margin-top: 10px; color: var(--ink-faint); font-size: 9px; }
.sheet-diary { padding: 18px; border-radius: 4px 16px 16px 4px; background: var(--surface); font-family: var(--font-hand); font-size: 13px; line-height: 2.05; box-shadow: inset 0 0 0 1px rgba(102, 81, 63, 0.05); }
.core-list { margin: 0; padding: 0 0 0 18px; }
.core-list li { margin-bottom: 11px; font-size: 11px; line-height: 1.9; }
/* 可删除的底片：每条右侧一个 ×，点一下就真的忘掉 */
.core-list.core-editable { padding: 0; list-style: none; }
.core-list.core-editable li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.core-list.core-editable .core-body { flex: 1; min-width: 0; font-size: 11px; line-height: 1.85; word-break: break-word; }
.core-remove { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-faint); transition: color 0.2s, background 0.2s; }
.core-remove .ic { width: 14px; height: 14px; }
.core-remove:hover { color: var(--coral); background: var(--coral-soft); }
/* 删除归档：手滑删了还能还原 */
.core-archive { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.core-archive .section-heading { margin-bottom: 8px; }
.archive-list { margin: 0; padding: 0; list-style: none; }
.archive-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.archive-list li:last-child { border-bottom: none; }
.archive-list li > span { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; word-break: break-word; }
.archive-restore { flex: none; min-height: 30px; padding: 0 11px; border-radius: 15px; display: inline-flex; align-items: center; gap: 5px; color: var(--module); font-size: 10px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--module) 26%, transparent); }
.archive-restore .ic { width: 12px; height: 12px; }
/* 记忆管理面板：每一层一行，右侧一个清空按钮 */
.memory-admin-list { margin: 0; padding: 0; list-style: none; }
.memory-admin-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.memory-admin-info { flex: 1; min-width: 0; }
.memory-admin-info strong { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.memory-admin-info strong em { color: var(--ink-faint); font-style: normal; font-size: 9px; font-weight: 500; }
.memory-admin-info p { margin: 4px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.memory-admin-clear { flex: none; min-width: 62px; min-height: 34px; padding: 0 11px; border-radius: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: color-mix(in srgb, var(--coral) 82%, #333); font-size: 10px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--coral) 26%, transparent); }
.memory-admin-clear .ic { width: 13px; height: 13px; }
.memory-admin-clear[disabled] { opacity: 0.32; pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 4px; }
/* 测试模式开关：回归测试时打开，免得污染她的记忆 */
.test-mode-toggle { width: 100%; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.test-mode-toggle .test-mode-copy { flex: 1; min-width: 0; }
.test-mode-toggle strong { font-size: 12px; }
.test-mode-toggle em { margin-left: 7px; color: var(--ink-faint); font-style: normal; font-size: 9px; }
.test-mode-toggle p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.test-mode-toggle .ic { width: 17px; height: 17px; color: var(--ink-faint); flex: none; margin-top: 2px; }
.test-mode-toggle.on { border-color: color-mix(in srgb, var(--coral) 40%, transparent); background: var(--coral-soft); }
.test-mode-toggle.on .ic { color: var(--coral); }
.test-mode-toggle.on strong { color: color-mix(in srgb, var(--coral) 78%, #333); }
.fact-list { margin: 0; padding: 0; list-style: none; }
.fact-list li { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact-list strong { font-size: 11px; }
.fact-list span { color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.typing { display: flex; gap: 4px; padding: 13px 15px; border-radius: 6px 16px 16px 16px; background: rgba(255, 255, 255, 0.8); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: typing-bounce 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.16s; }
.typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Tweaks */
.tweaks { position: fixed; right: 22px; bottom: 22px; z-index: 50; }
.tweaks-toggle { min-height: 42px; padding: 0 16px; border-radius: 22px; background: #403631; color: #f8f3eb; box-shadow: 0 6px 20px rgba(50, 35, 28, 0.18); font-size: 11px; font-weight: 600; }
.tweaks-panel { position: absolute; right: 0; bottom: 52px; width: 210px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 15px 40px rgba(80, 56, 36, 0.16); }
.tweaks-panel strong { display: block; margin-bottom: 14px; font-family: var(--font-hand); font-size: 16px; }
.tweaks-panel label { min-height: 40px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 11px; }
.tweaks-panel select { max-width: 92px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 4px; }
.tweaks-panel small { display: block; margin-top: 10px; color: var(--ink-faint); font-size: 9px; line-height: 1.65; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 100; transform: translate(-50%, 15px); max-width: min(330px, calc(100vw - 40px)); padding: 11px 17px; border-radius: 20px; background: rgba(48, 38, 31, 0.94); color: #fffaf3; box-shadow: 0 10px 28px rgba(50, 35, 28, 0.24); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body[data-theme="night"] { --cream: #d8cec3; --paper: #f2e9dc; --ink: #332b24; --ink-soft: #6d6055; }
body[data-theme="paper"] { --cream: #e7e4dd; --paper: #faf9f5; --coral: #b8736a; --mist: #6b8299; --honey: #bb9145; --iris: #8d75a0; --sage: #71886f; }
body.frameless .phone { border-width: 0; border-radius: 28px; }
body.frameless .dynamic-island { display: none; }

@media (max-width: 600px) {
  .preview-stage { padding: 0; display: block; }
  .desktop-caption, .tweaks { display: none; }
  .phone { width: 100%; height: 100dvh; min-height: 560px; border: 0; border-radius: 0; box-shadow: none; }
  .status-bar { padding-top: env(safe-area-inset-top); height: calc(38px + env(safe-area-inset-top)); }
  .dynamic-island { display: none; }
  .app-shell { height: calc(100% - 38px - env(safe-area-inset-top)); }
  .bottom-nav { bottom: calc(10px + env(safe-area-inset-bottom)); height: 64px; padding: 6px 8px; }
  .screen { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .home-indicator { bottom: calc(5px + env(safe-area-inset-bottom)); }
  .env-pill { padding: 0; background: none; }
  .env-pill span { display: none; }
}

@media (max-height: 740px) and (min-width: 601px) {
  .phone { min-height: 620px; }
  .desktop-caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   记忆页 · 三层结构（真实数据驱动）
   ============================================================ */
.memory-layer-chips { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.memory-layer-chips span {
  padding: 4px 10px; border-radius: 9px;
  background: var(--mist-soft); color: var(--mist);
  font-size: 8px; font-weight: 600; letter-spacing: 0.04em;
}
.memory-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 20px; }
.memory-level-card {
  display: grid; gap: 5px; justify-items: start;
  padding: 13px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 0.24s var(--ease-spring), box-shadow 0.24s var(--ease-out);
}
.memory-level-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(80, 56, 36, 0.08); }
.memory-level-card strong { font-size: 10px; font-weight: 600; }
.memory-level-card .memory-date { font-family: var(--font-hand); font-size: 17px; color: var(--ink); }

.memory-item.level-l3 { border-left: 3px solid var(--coral); }
.memory-item.level-l2 { border-left: 3px solid var(--mist); }
.memory-item.level-diary { border-left: 3px solid var(--honey); }
.memory-item.level-l3 .memory-date { color: var(--coral); }
.memory-item.level-l2 .memory-date { color: var(--mist); }
.memory-item.level-diary .memory-date { color: var(--honey); }

/* ============================================================
   性格画像 · 极慢变化
   ============================================================ */
.personality-teaser {
  width: 100%; padding: 19px; position: relative; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  transition: transform 0.24s var(--ease-spring);
}
.personality-teaser:hover { transform: translateY(-2px); }
.personality-teaser::after {
  content: ""; position: absolute; top: -8px; right: 30px;
  width: 42px; height: 16px; background: rgba(152, 127, 174, 0.24); transform: rotate(5deg);
}
.personality-teaser .teaser-mark {
  display: block; width: 22px; height: 22px; margin-bottom: 10px;
  border-radius: 50%; border: 2px solid var(--iris);
  box-shadow: inset 0 0 0 4px rgba(152, 127, 174, 0.12);
}
.personality-teaser strong {
  display: block; margin-bottom: 8px;
  font-family: var(--font-hand); font-size: 14px; line-height: 1.7; color: var(--ink);
}
.personality-teaser p { color: var(--ink-soft); font-size: 10px; line-height: 1.8; }

.trait-list { display: grid; gap: 17px; margin-top: 4px; }
.trait-row { position: relative; }
.trait-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; font-weight: 600; margin-bottom: 7px;
}
.trait-num { font-family: var(--font-hand); font-size: 15px; font-weight: 500; }
.trait-num small { font-family: var(--font-ui); font-size: 8px; color: var(--ink-faint); }
.trait-track {
  position: relative; height: 6px; border-radius: 3px;
  background: rgba(58, 49, 41, 0.08); overflow: visible;
}
.trait-track i {
  position: absolute; left: 0; top: 0; height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--iris-soft), var(--iris));
}
.trait-base {
  position: absolute; top: -3px; width: 2px; height: 12px;
  background: var(--ink-faint); border-radius: 1px;
}
.trait-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 7px; color: var(--ink-faint); font-size: 8px;
}
.drift-chip {
  padding: 2px 8px; border-radius: 8px;
  background: rgba(58, 49, 41, 0.06); color: var(--ink-faint);
  font-size: 8px; font-variant-numeric: tabular-nums;
}
.drift-chip.moved { background: var(--iris-soft); color: var(--iris); font-weight: 600; }
.trait-spark {
  display: block; width: 100%; height: 22px; margin-top: 6px;
  color: var(--iris); opacity: 0.65;
}

.habit-row { margin-top: 18px; }
.habit-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.habit-tag {
  padding: 4px 10px; border-radius: 10px;
  background: var(--honey-soft); color: #8a6a2c;
  font-size: 9px; font-weight: 600;
}

.drift-status {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  margin-top: 20px; padding: 15px;
  border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line);
}
.drift-status > div { display: grid; gap: 5px; }
.drift-status span { color: var(--ink-faint); font-size: 8px; }
.drift-status strong { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.drift-note {
  margin-top: 14px; color: var(--ink-faint); font-size: 9px;
  font-style: italic; line-height: 1.8; text-align: center;
}

.core-kind {
  display: inline-block; margin-right: 8px; padding: 2px 7px;
  border-radius: 7px; background: var(--coral-soft); color: var(--coral);
  font-size: 8px; font-weight: 600; vertical-align: middle;
}

/* ============================================================
   云端登录门 · 只在云端模式出现
   ============================================================ */
#cloud-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, #fdf6ec 0%, #f6ece0 48%, #efe4da 100%);
  transition: opacity 0.42s var(--ease-out), transform 0.42s var(--ease-out);
}
#cloud-gate.gate-leave { opacity: 0; transform: scale(1.04); pointer-events: none; }

.gate-card {
  width: 100%;
  max-width: 320px;
  padding: 34px 26px 26px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 48px rgba(80, 56, 36, 0.13);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: gate-in 0.5s var(--ease-spring) both;
}
@keyframes gate-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.gate-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--coral-soft), var(--honey-soft));
  box-shadow: inset 0 0 0 1px rgba(200, 112, 95, 0.22);
  position: relative;
}
.gate-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 3px;
  background: var(--coral);
  animation: gate-pulse 2.6s ease-in-out infinite;
}
@keyframes gate-pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) rotate(45deg) scale(0.86); }
  50% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1.06); }
}

.gate-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.gate-card h1 {
  margin: 0 0 8px;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.gate-card > p {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.gate-field { display: block; margin-bottom: 12px; }
.gate-field input {
  width: 100%;
  padding: 12px 15px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  transition: border-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}
.gate-field input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(200, 112, 95, 0.13);
}
.gate-field input.shake { animation: gate-shake 0.36s ease; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.gate-error {
  min-height: 16px;
  margin-bottom: 4px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 600;
}

.gate-btn {
  width: 100%;
  padding: 13px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: #fffaf3;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--coral), #d97f63);
  box-shadow: 0 8px 18px rgba(200, 112, 95, 0.28);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), opacity 0.2s;
}
.gate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(200, 112, 95, 0.34); }
.gate-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.gate-btn:disabled { opacity: 0.62; cursor: default; }

.gate-foot {
  display: block;
  margin-top: 14px;
  color: var(--ink-faint);
  font-size: 9px;
}

/* ============================================================
   朋友圈
   新增页面，风格沿用手帐体系：纸纹、胶带、暖色系。
   底部导航保持 5 项不变——朋友圈从聊天页右上角进入，
   这样不破坏哥已经看惯了的排版。
   ============================================================ */

.screen[data-module="moments"] { --module: var(--coral); --module-soft: var(--coral-soft); }

.moments-scroll { padding-bottom: 30px; }

/* 顶部那张小结卡 */
.moment-cover { position: relative; margin: 4px 0 16px; padding: 16px 18px; border-radius: 18px; background: rgba(255, 255, 255, 0.58); border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 8px 20px rgba(69, 48, 34, 0.07); }
.moment-cover .section-index { display: block; margin-bottom: 7px; }
.moment-cover p { color: var(--ink-soft); font-size: 11px; line-height: 1.85; font-family: var(--font-hand); }

/* 动态列表 */
.moment-list { display: flex; flex-direction: column; gap: 13px; }

/* 一条动态 */
.moment-card { position: relative; padding: 15px 16px 11px; border-radius: 18px; background: rgba(255, 255, 255, 0.62); border: 1px solid rgba(255, 255, 255, 0.72); box-shadow: 0 6px 18px rgba(69, 48, 34, 0.07); animation: moment-in 0.4s var(--ease-out) both; }
@keyframes moment-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 她的动态贴一张胶带，呼应日记页的手帐感 */
.moment-card.from-her::before { content: ''; position: absolute; top: -7px; left: 22px; width: 52px; height: 15px; background: rgba(207, 159, 73, 0.28); border-left: 1px dashed rgba(207, 159, 73, 0.42); border-right: 1px dashed rgba(207, 159, 73, 0.42); transform: rotate(-2.2deg); }

.moment-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.moment-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 9%; border: 1px solid rgba(255, 255, 255, 0.75); box-shadow: 0 3px 8px rgba(69, 48, 34, 0.1); }
.moment-who { flex: 1; min-width: 0; }
.moment-who strong { display: block; font-size: 12px; }
.moment-who span { color: var(--ink-faint); font-size: 9px; }
.moment-mood { padding: 3px 8px; border-radius: 20px; background: var(--module-soft); color: color-mix(in srgb, var(--module) 82%, #333); font-size: 9px; font-weight: 600; }

.moment-text { color: var(--ink); font-size: 12.5px; line-height: 1.92; word-break: break-word; white-space: pre-wrap; }
.moment-text.is-me { font-family: var(--font-hand); }

/* 配图 */
.moment-images { margin-top: 9px; display: grid; gap: 5px; }
.moment-images.one { grid-template-columns: 1fr; }
.moment-images.two { grid-template-columns: 1fr 1fr; }
.moment-images.three { grid-template-columns: repeat(3, 1fr); }
.moment-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 3px 9px rgba(69, 48, 34, 0.09); cursor: zoom-in; }
.moment-images.one img { aspect-ratio: 4 / 3; }

/* 底部互动条 */
.moment-actions { margin-top: 10px; padding-top: 9px; border-top: 1px dashed rgba(102, 81, 63, 0.16); display: flex; align-items: center; gap: 7px; }
.moment-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 20px; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(102, 81, 63, 0.12); color: var(--ink-soft); font-size: 10px; font-weight: 600; transition: transform 0.24s var(--ease-spring), background-color 0.2s ease, color 0.2s ease; }
.moment-btn .ic { width: 13px; height: 13px; }
.moment-btn:active { transform: scale(0.9); }
.moment-btn.liked { background: rgba(126, 149, 127, 0.16); border-color: rgba(126, 149, 127, 0.34); color: #5f7a61; }
.moment-btn.disliked { background: rgba(200, 112, 95, 0.14); border-color: rgba(200, 112, 95, 0.32); color: #a85a4a; }
.moment-btn.count { margin-left: auto; color: var(--ink-faint); background: none; border: none; cursor: default; }

/* 评论区 */
.moment-comments { margin-top: 9px; padding: 9px 11px; border-radius: 12px; background: rgba(102, 81, 63, 0.045); }
.moment-comment { display: flex; gap: 6px; font-size: 11px; line-height: 1.75; }
.moment-comment + .moment-comment { margin-top: 5px; }
.moment-comment b { color: var(--module); font-weight: 600; }
.moment-comment.her b { color: #a85a4a; }

/* 回复按钮：挂在她的评论旁边，点了就能接着回她 */
.moment-reply-btn {
  flex: 0 0 auto; align-self: flex-start; margin-left: auto;
  padding: 1px 8px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(102, 81, 63, 0.14);
  color: var(--ink-faint); font-size: 9px; font-weight: 600;
  transition: transform 0.22s var(--ease-spring), color 0.2s ease, border-color 0.2s ease;
}
.moment-reply-btn:active { transform: scale(0.9); }
.moment-reply-btn:hover { color: #a85a4a; border-color: rgba(168, 90, 74, 0.34); }

/* 评论输入 */
.moment-comment-form { margin-top: 8px; display: flex; gap: 6px; }
.moment-comment-form input { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 20px; border: 1px solid rgba(102, 81, 63, 0.16); background: rgba(255, 255, 255, 0.72); font-size: 11px; color: var(--ink); }
.moment-comment-form input:focus { outline: none; border-color: color-mix(in srgb, var(--module) 45%, transparent); }
.moment-comment-form button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--module); color: #fffaf5; }
.moment-comment-form button .ic { width: 14px; height: 14px; }

/* 空的动态列表 */
.moment-empty { padding: 40px 20px; text-align: center; color: var(--ink-faint); font-size: 11px; line-height: 2; font-family: var(--font-hand); }

/* 发一条的弹层 */
.moment-compose textarea { width: 100%; min-height: 96px; padding: 13px 15px; border-radius: 14px; border: 1px solid rgba(102, 81, 63, 0.16); background: rgba(255, 255, 255, 0.76); font-family: var(--font-hand); font-size: 13px; line-height: 1.9; color: var(--ink); resize: vertical; }
.moment-compose textarea:focus { outline: none; border-color: color-mix(in srgb, var(--module) 45%, transparent); }
.moment-compose-picker { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 7px; }
.moment-pick { position: relative; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(102, 81, 63, 0.14); }
.moment-pick img { width: 100%; height: 100%; object-fit: cover; }
.moment-pick button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(45, 34, 26, 0.62); color: #fff; display: grid; place-items: center; }
.moment-pick button .ic { width: 11px; height: 11px; }
.moment-compose-tools { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.moment-compose-tools .soft-button { flex: 0 0 auto; }

/* 图片查看器 */
.moment-viewer { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 26px; background: rgba(32, 24, 18, 0.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.moment-viewer.open { display: flex; animation: moment-fade 0.26s ease both; }
@keyframes moment-fade { from { opacity: 0; } to { opacity: 1; } }
.moment-viewer img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; }

/* ============================================================
   聊天附件：图片与表情包
   ============================================================ */

/* 聊天里的图片消息 */
.message-images { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.message-images img { width: 132px; height: 132px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 3px 9px rgba(69, 48, 34, 0.1); cursor: zoom-in; }
.user-message .message-images { justify-content: flex-end; }

/* 附件面板的 Tab */
.attach-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.attach-tab { padding: 6px 14px; border-radius: 20px; background: rgba(102, 81, 63, 0.06); color: var(--ink-soft); font-size: 11px; font-weight: 600; transition: background-color 0.2s ease, color 0.2s ease; }
.attach-tab.active { background: var(--module-soft); color: color-mix(in srgb, var(--module) 82%, #333); }

/* 表情分组 */
.emoji-group { margin-bottom: 14px; }
.emoji-group-name { display: block; margin-bottom: 6px; color: var(--ink-faint); font-size: 9px; letter-spacing: 0.1em; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.emoji-cell { height: 38px; border-radius: 10px; font-size: 21px; line-height: 1; transition: transform 0.22s var(--ease-spring), background-color 0.18s ease; }
.emoji-cell:active { transform: scale(1.28); background: rgba(102, 81, 63, 0.07); }

/* 表情包与图片网格 */
.attach-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.attach-cell { aspect-ratio: 1; border-radius: 13px; overflow: hidden; border: 1px solid rgba(102, 81, 63, 0.12); background: rgba(255, 255, 255, 0.5); transition: transform 0.22s var(--ease-spring); }
.attach-cell:active { transform: scale(0.92); }
.attach-cell img { width: 100%; height: 100%; object-fit: cover; }
.attach-empty { padding: 26px 10px; text-align: center; color: var(--ink-faint); font-size: 11px; line-height: 1.9; }
