/* ============================================================
   游戏的"外观"文件：大小、位置、动画都在这里
   ※ 颜色不在这里改！颜色都在根目录的"主题配色.css"里
   风格：柔和的皇室浪漫风 —— 肉粉 + 白金、圆角、细金边
============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: "Songti SC", "STSong", "SimSun", Georgia, serif; /* 典雅的宋体/衬线字体 */
  color: var(--深玫瑰);
  overflow: hidden;
}

/* 页面最底层：电脑上两侧的装饰背景
   （图片：素材/界面/侧边背景.jpg；没有图就显示浅粉色） */
body {
  background: var(--浅粉) url("../素材/界面/侧边背景.jpg") center / cover no-repeat fixed;
}

/* ---------- 手机画框：iPhone 竖屏比例 ----------
   电脑上：居中显示一个 9:19.5 的竖框；手机上自动占满全屏 */
#手机画框 {
  position: relative;
  height: 100dvh;
  aspect-ratio: 9 / 19.5;
  max-width: 100vw;
  margin: 0 auto;
  background: var(--奶白);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(138, 90, 94, 0.25); /* 画框四周柔柔的光晕 */
}

.隐藏 { display: none !important; }

/* ============================================================
   第一页：开门 loading 页（占位版）
============================================================ */
#开门页 {
  position: absolute;
  inset: 0;
  z-index: 10;
  background:
    radial-gradient(ellipse at 50% 30%, var(--浅粉) 0%, var(--奶白) 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}
#开门页.淡出 { opacity: 0; pointer-events: none; }

/* 占位的大门（以后换成你的开门视频） */
#大门 {
  position: absolute;
  width: 62%;
  height: 58%;
  top: 14%;
  left: 19%;
  border: 2px solid var(--金色);
  border-radius: 46% 46% 0 0 / 24% 24% 0 0; /* 顶部拱形，像宫殿大门 */
  overflow: hidden;
  box-shadow: var(--柔和阴影);
  perspective: 800px;
  background: var(--奶白);
}
.门扇 {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background: linear-gradient(90deg, var(--浅粉), #f0d3d6);
  border: 1px solid var(--金边);
  transition: transform 1.6s ease-in-out;
}
.左门 { left: 0;  transform-origin: left center; }
.右门 { right: 0; transform-origin: right center; }
.门把手 {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--金色);
  box-shadow: 0 0 8px var(--金色);
}
.左门 .门把手 { right: 8px; }
.右门 .门把手 { left: 8px; }
#大门.开门 .左门 { transform: rotateY(-100deg); }
#大门.开门 .右门 { transform: rotateY(100deg); }

#开门文字 {
  position: absolute;
  bottom: 10%;
  width: 100%;
  text-align: center;
  z-index: 11;
}
#开门文字 h1 {
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  color: var(--深玫瑰);
  text-shadow: 0 2px 12px rgba(232, 180, 184, 0.8);
  margin-bottom: 20px;
}
#推门按钮 {
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 12px 34px;
  cursor: pointer;
  box-shadow: var(--柔和阴影);
}
#推门按钮:active { transform: scale(0.96); }
.小字 {
  margin-top: 14px;
  font-size: 0.7rem;
  opacity: 0.45;
}

/* ============================================================
   第二页：游戏主体
============================================================ */
#游戏主体 {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部状态栏 ---------- */
#顶部栏 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
  padding-top: max(12px, env(safe-area-inset-top)); /* 避开 iPhone 刘海 */
  background: linear-gradient(180deg, var(--奶白半透明), rgba(253, 249, 245, 0));
  z-index: 5;
}
#当前时间 {
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--深玫瑰);
  flex: 1;
  text-align: center;
}
/* 左上角的菜单按钮（手机上打开侧栏抽屉用；电脑上自动隐藏） */
#菜单按钮 {
  font-family: inherit;
  font-size: 1rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: var(--柔和阴影);
}
#菜单按钮:active { background: var(--浅粉); }
/* 右上角的"返回来路"按钮 */
#返回按钮 {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
}
#返回按钮:active { background: var(--浅粉); }

/* ---------- 中间场景区 ---------- */
#场景区 {
  position: relative;
  flex: 1;
  overflow: hidden;
}
#场景视频,
#场景图片 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 没有素材时显示的占位画面 */
#占位画面 {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(ellipse at 50% 20%, var(--浅粉) 0%, var(--奶白) 78%);
}
#占位图案 { font-size: 4rem; filter: drop-shadow(0 4px 14px rgba(232, 180, 184, 0.8)); }
#占位标签 {
  font-size: 1.05rem;
  letter-spacing: 0.25em;
  color: var(--深玫瑰);
  border: 1px solid var(--金边);
  padding: 8px 22px;
  border-radius: 99px;
  background: var(--奶白半透明);
}

/* 场景下方的描述文字（像视觉小说的旁白框） */
#场景描述 {
  position: absolute;
  left: 12px; right: 12px;
  bottom: 14px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: center;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  box-shadow: var(--柔和阴影);
}
#场景描述:empty { display: none; }

/* 天气特效画布（雨丝等）：铺满场景区，不挡任何点击 */
#天气层 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 第二阶段预留的互动层 */
#互动层 { position: absolute; inset: 0; pointer-events: none; }

/* ---------- 方向箭头（第一视角探索） ---------- */
#箭头层 {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.箭头 {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--深玫瑰);
  background: var(--主粉半透明);
  border: 1px solid var(--金边);
  border-radius: 14px;
  padding: 8px 11px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: var(--柔和阴影);
}
.箭头:active { background: var(--主粉); color: #fff; }
.箭头符号 { font-size: 1.05rem; line-height: 1; }

.向左 { left: 8px;  top: 50%; transform: translateY(-50%); }
.向右 { right: 8px; top: 50%; transform: translateY(-50%); }
.向上 { top: 8px;   left: 50%; transform: translateX(-50%); }
.向前 { top: 32%;   left: 50%; transform: translateX(-50%); }
.向下 { bottom: 100px; left: 50%; transform: translateX(-50%); }

/* ---------- 旧景层（叠化过渡） ----------
   切换房间时，旧画面的"快照"放在这层上慢慢变透明，
   新画面同时在下面显现——经典的交叉淡入淡出，
   全程不经过任何纯色画面。
   （过渡时长在"环境设定.js"的界面设定里调） */
#旧景层 {
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.4s linear;
}
#旧景层 > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- 点击伊夫的台词小气泡 ---------- */
#台词气泡 {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  max-width: 80%;
  padding: 12px 18px;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 18px;
  box-shadow: var(--柔和阴影);
  backdrop-filter: blur(6px);
  cursor: pointer; /* 点一下气泡可以提前关掉 */
}

/* ---------- "呼唤"按钮（找到他时出现在右下角） ---------- */
#呼唤按钮 {
  position: absolute;
  right: 12px;
  bottom: 110px; /* 描述框的上方 */
  z-index: 4;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: var(--柔和阴影);
}
#呼唤按钮:active { transform: scale(0.95); }

/* ---------- 呼唤模式（他来到屏幕前 + 对话框） ---------- */
#对话模式 {
  position: absolute;
  inset: 0;
  z-index: 7;
  background:
    radial-gradient(ellipse at 50% 25%, var(--浅粉) 0%, var(--奶白) 80%);
  opacity: 0;
  transition: opacity 0.4s ease; /* 淡入淡出（时长由程序按配置调） */
}
#对话模式.显现 { opacity: 1; }

#立绘视频 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#立绘占位 {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
#立绘占位图案 { font-size: 4.5rem; filter: drop-shadow(0 4px 14px rgba(232, 180, 184, 0.8)); }
#立绘占位字 {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--深玫瑰);
  border: 1px solid var(--金边);
  padding: 7px 20px;
  border-radius: 99px;
  background: var(--奶白半透明);
}

/* 视觉小说式对话框 */
#对话框 {
  position: absolute;
  left: 12px; right: 12px;
  bottom: 14px;
  padding: 26px 18px 16px;
  min-height: 96px;
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 18px;
  box-shadow: var(--柔和阴影);
  backdrop-filter: blur(8px);
  cursor: pointer; /* 打字时点一下＝直接显示整句 */
}
#对话名字 {
  position: absolute;
  top: -14px;
  left: 16px;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 4px 16px;
}
#对话文字 {
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--深玫瑰);
}
/* 对话框右下角的"还有下一页"小箭头 */
#对话续页 {
  position: absolute;
  right: 14px;
  bottom: 8px;
  font-size: 0.7rem;
  color: var(--金);
  animation: 续页跳 1.2s infinite;
}
@keyframes 续页跳 {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(3px); opacity: 1; }
}
/* 收起/展开对话框的小按钮（挂在对话框右上角） */
#收起对话框 {
  position: absolute;
  top: 6px;
  right: 10px;
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--金);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
}
/* 收起状态：缩成一条细边，不挡画面和按钮 */
#对话框.收起 { min-height: 0; padding: 6px 18px; }
#对话框.收起 #对话名字,
#对话框.收起 #对话文字,
#对话框.收起 #对话续页 { display: none; }

/* 逗他的小反应气泡（点立绘时冒出来） */
#逗他气泡 {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  max-width: 76%;
  padding: 10px 16px;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 16px;
  box-shadow: var(--柔和阴影);
  backdrop-filter: blur(6px);
}

/* 选项按钮（陪伴/闲聊/约会…），竖排靠右，悬在对话框上方 */
#选项区 {
  position: absolute;
  right: 12px;
  bottom: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.选项按钮 {
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 8px 20px;
  cursor: pointer;
  box-shadow: var(--柔和阴影);
  backdrop-filter: blur(4px);
}
.选项按钮:active { background: var(--主粉); color: #fff; }

/* 结束对话（右上角） */
#结束对话按钮 {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
}
#结束对话按钮:active { background: var(--浅粉); }

/* "敬请期待"这类小提示 */
#系统提示 {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.82rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 8px 20px;
  box-shadow: var(--柔和阴影);
  white-space: nowrap;
}

/* ---------- 立绘的绿幕抠像三件套 ---------- */
/* 背景：他所在房间的空景图 */
#立绘背景 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 抠好像的立绘（透明背景）叠在空景上 */
#立绘画布 {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 绿幕原视频在抠像时缩成隐形的小点，只当画面来源 */
/* 抠像失败时角落的小提示（点一下收起） */
#抠像提示 {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 55;
  max-width: 70%;
  padding: 6px 10px;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--深玫瑰);
  background: rgba(253, 249, 245, 0.92);
  border: 1px solid var(--金边);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(138, 90, 94, 0.2);
}

#立绘视频.抠像源 {
  opacity: 0;
  width: 2px;
  height: 2px;
  inset: auto;
  pointer-events: none;
}

/* ---------- 外出时卧室里的娃娃 ---------- */
#娃娃按钮 {
  position: absolute;
  left: 14px;
  bottom: 96px; /* 描述框上方 */
  z-index: 4;
  width: 84px;
  background: transparent;
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(138, 90, 94, 0.35));
}
#娃娃按钮:active { transform: scale(0.94); }
#娃娃图 { width: 100%; display: block; }
#娃娃占位 { font-size: 3rem; line-height: 1; }

/* ---------- 情书信纸 ---------- */
#情书层 {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: var(--深玫瑰蒙层); /* 信纸后面轻轻压暗 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}
#信纸 {
  width: 100%;
  max-height: 80%;
  overflow-y: auto;
  background:
    linear-gradient(180deg, var(--奶白) 0%, var(--浅粉) 130%);
  border: 1px solid var(--金色);
  border-radius: 14px;
  box-shadow: var(--柔和阴影);
  padding: 22px 20px 16px;
}
#信纸标题 {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--深玫瑰);
  text-align: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--金边); /* 标题下的金色细线 */
}
#信纸内容 {
  font-size: 0.88rem;
  line-height: 2;
  color: var(--深玫瑰);
  white-space: pre-line; /* 信里的换行原样显示 */
}
#合上信 {
  display: block;
  margin: 16px auto 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: #fff;
  background: var(--主粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 7px 22px;
  cursor: pointer;
}
#合上信:active { opacity: 0.8; }

/* ---------- 陪伴模式：道具层（背景/立绘之外的第三层） ---------- */
#道具层后, #道具层前 {
  position: absolute;
  inset: 0;
  z-index: 0; /* 建立独立的层级隔间：道具的"层级"数字只在层内比大小，不会窜到立绘上面 */
  pointer-events: none; /* 平时不挡点击；调试摆放时单个道具会打开 */
}
/* 道具的绿幕原视频：隐形，只当画面来源 */
#道具层后 video.抠像源, #道具层前 video.抠像源 {
  position: absolute;
  opacity: 0;
  width: 2px;
  height: 2px;
  pointer-events: none;
}
.道具 {
  position: absolute;
  transform: translate(-50%, -50%); /* 配置里的横纵是"中心点"位置 */
  height: auto;
  pointer-events: none;
}
/* 摆放调试模式下的道具：能拖、能滚轮缩放，带金色虚线框 */
.道具.可拖动 {
  pointer-events: auto;
  cursor: grab;
  outline: 1px dashed var(--金色);
}
.道具.可拖动:active { cursor: grabbing; }

/* 摆放调试板（左上角的小面板） */
#道具调试板 {
  position: absolute;
  top: 52px;
  left: 10px;
  z-index: 9;
  max-width: 78%;
  padding: 10px 12px;
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 12px;
  box-shadow: var(--柔和阴影);
  font-size: 0.7rem;
  color: var(--深玫瑰);
  text-align: left;
}
.调试说明 { line-height: 1.6; opacity: 0.85; }
#道具调试内容 {
  margin: 6px 0;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.66rem;
  font-family: inherit;
}
/* 陪睡时的调暗层 */
#睡觉调暗 {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 38, 0.55);
  opacity: 0;
  pointer-events: none;
}
/* 小事件：他变成娃娃形态 */
#陪伴娃娃 {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: 42%;
  text-align: center;
  font-size: 4.5rem;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(138, 90, 94, 0.4));
}
#陪伴娃娃图 { width: 100%; display: block; margin: 0 auto; }

/* 计时器：小巧地悬在画面上方 */
#计时器面板 {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 8px 22px;
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 18px;
  box-shadow: var(--柔和阴影);
  backdrop-filter: blur(6px);
}
#计时显示 { font-size: 1.25rem; letter-spacing: 0.12em; color: var(--深玫瑰); }
#计时阶段 { font-size: 0.68rem; opacity: 0.75; margin-top: 2px; color: var(--深玫瑰); }

/* ---------- 大号复古翻页时钟（侧栏，陪伴模式用） ----------
   --翻页倍 由"环境设定.js"的 翻页时钟大小 控制 */
#翻页时钟 {
  --翻页倍: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8px * var(--翻页倍));
  margin-bottom: 14px;
}
#翻页时钟牌 {
  display: flex;
  align-items: center;
  gap: calc(5px * var(--翻页倍));
}
.翻牌位 {
  position: relative;
  width: calc(42px * var(--翻页倍));
  height: calc(60px * var(--翻页倍));
  perspective: 300px;
}
.翻牌数 {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(40px * var(--翻页倍));
  font-weight: bold;
  color: var(--深玫瑰);
  /* 上下两半略有色差，配合中缝，像真的翻牌 */
  background: linear-gradient(180deg,
    var(--奶白) 0%, var(--奶白) 49.5%,
    var(--浅粉) 50.5%, var(--浅粉) 100%);
  border: 1px solid var(--金边);
  border-radius: calc(9px * var(--翻页倍));
  box-shadow: var(--柔和阴影);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
/* 中缝：一条横向的金色细线 */
.翻牌位::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--金边);
  transform: translateY(-0.5px);
  z-index: 2;
  pointer-events: none;
}
/* 翻页动画：旧数字向下翻走 → 新数字从上翻出（中点换字，见 翻页时钟.js） */
.翻牌位.翻转 .翻牌数 { animation: 翻牌一下 0.45s ease-in-out; }
@keyframes 翻牌一下 {
  0%      { transform: rotateX(0deg); }
  50%     { transform: rotateX(-90deg); }
  50.01%  { transform: rotateX(90deg); }
  100%    { transform: rotateX(0deg); }
}
.翻页冒号 {
  font-size: calc(34px * var(--翻页倍));
  font-weight: bold;
  color: var(--金色);
  padding: 0 calc(1px * var(--翻页倍));
}
#翻页时钟阶段 {
  font-size: calc(12px * var(--翻页倍));
  letter-spacing: 0.15em;
  color: var(--深玫瑰);
  opacity: 0.8;
}

/* 电脑宽屏：用侧栏大翻页时钟，画面里的小计时器藏起来 */
@media (min-width: 1000px) {
  #计时器面板 { display: none !important; }
}
/* 手机端：维持画面里的小巧计时器，大翻页时钟不出现 */
@media (max-width: 999px) {
  #翻页时钟 { display: none !important; }
}

/* 陪伴设置 / 结算：居中的小卡片 */
#陪伴设置, #结算面板 {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 84%;
  padding: 18px 16px;
  background: linear-gradient(180deg, var(--奶白) 0%, var(--浅粉) 140%);
  border: 1px solid var(--金色);
  border-radius: 18px;
  box-shadow: var(--柔和阴影);
  text-align: center;
}
.面板标题 {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--深玫瑰);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--金边);
}
.方式行 { display: flex; gap: 8px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.方式钮 {
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--深玫瑰);
  background: var(--奶白);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 7px 16px;
  cursor: pointer;
}
.方式钮.选中 { background: var(--主粉); color: #fff; }
.时长行 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  margin: 8px 0;
}
.时长行 input {
  width: 64px;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: center;
  color: var(--深玫瑰);
  background: var(--奶白);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 5px 4px;
}
.设置按钮行 { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.结算行 { font-size: 0.86rem; line-height: 2.1; color: var(--深玫瑰); }
#结算面板 .选项按钮 { margin-top: 12px; }

/* ---------- 侧栏的陪伴卡片（状态说明 + 待办清单） ---------- */
#陪伴状态说明 {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--深玫瑰);
  opacity: 0.85;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--金边);
}
#待办输入行 { display: flex; gap: 6px; margin-bottom: 8px; }
#待办输入 {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 6px 10px;
}
#待办添加 {
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  background: var(--主粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 4px 12px;
  cursor: pointer;
}
#待办列表 { list-style: none; max-height: 240px; overflow-y: auto; }
.待办项 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  padding: 5px 2px;
}
.待办项 input[type="checkbox"] { accent-color: var(--主粉); }
.待办文字 { flex: 1; cursor: pointer; word-break: break-all; }
.待办项.完成 .待办文字 { text-decoration: line-through; opacity: 0.5; }
.待办项.刚完成 { animation: 待办弹一下 0.5s ease; }
@keyframes 待办弹一下 {
  0% { transform: scale(1); }
  40% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.待办删 {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  opacity: 0.45;
  background: transparent;
  border: none;
  cursor: pointer;
}
.待办删:hover { opacity: 1; }
.待办改 {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--深玫瑰);
  background: var(--奶白);
  border: 1px solid var(--金边);
  border-radius: 8px;
  padding: 3px 8px;
}

/* ============================================================
   小手机（和伊夫的聊天）
   手机窄屏：默认藏起来，菜单里点"和他聊天"全屏打开
   电脑宽屏：见上面媒体查询——固定立在画框右侧
============================================================ */
#小手机 {
  display: none; /* 窄屏默认不显示 */
  position: fixed;
  inset: 0;
  z-index: 70;
}
#小手机.打开 { display: block; } /* 窄屏打开 = 全屏浮层 */

/* 手机机身：粉白描金的小手机造型 */
#手机机身 {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--奶白);
  border: 2px solid var(--金色);
  border-radius: 26px;
  box-shadow: var(--柔和阴影);
  overflow: hidden;
}
/* 顶部小刘海，装饰用 */
#手机刘海 {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 8px;
  border-radius: 99px;
  background: var(--浅粉);
  border: 1px solid var(--金边);
  pointer-events: none;
}

#手机顶栏 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 14px 8px;
  border-bottom: 1px solid var(--金边);
  background: linear-gradient(180deg, var(--浅粉), var(--奶白));
}
#手机联系人 {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--深玫瑰);
  font-weight: bold;
}
#手机状态 {
  flex: 1;
  font-size: 0.7rem;
  color: var(--主粉);
}
#清空聊天, #关闭手机 {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 4px 9px;
  cursor: pointer;
}
/* 关闭按钮在哪都有用：窄屏关全屏浮层，电脑收起悬浮窗口 */

#聊天记录 {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--浅粉) 0%, var(--奶白) 60%);
}

/* 气泡 */
.气泡行 { display: flex; flex-direction: column; max-width: 82%; }
.气泡行.我的 { align-self: flex-end; align-items: flex-end; }
.气泡行.他的 { align-self: flex-start; align-items: flex-start; }
.气泡 {
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.7;
  border-radius: 16px;
  word-break: break-word;
  box-shadow: var(--柔和阴影);
}
.我的 .气泡 {
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.他的 .气泡 {
  background: #fff;
  color: var(--深玫瑰);
  border: 1px solid var(--金边);
  border-bottom-left-radius: 5px;
}
.气泡图片 {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 4px;
}
.气泡时间 { font-size: 0.62rem; opacity: 0.45; margin-top: 2px; color: var(--深玫瑰); }
.气泡费用 { font-size: 0.6rem; opacity: 0.4; margin-top: 1px; color: var(--深玫瑰); }
/* 他消息旁的小喇叭：点一下听他用日语念这条 */
.气泡喇叭 {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0 4px;
  font-size: 0.7rem;
  line-height: 1.4;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.55;
}
.气泡喇叭:hover { opacity: 1; }
.手机系统注 {
  align-self: center;
  font-size: 0.7rem;
  color: var(--深玫瑰);
  opacity: 0.6;
  text-align: center;
  padding: 4px 12px;
}

/* "对方正在输入…"的三个小点 */
.气泡.打字中 { display: flex; gap: 4px; padding: 12px 14px; }
.气泡.打字中 span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--主粉);
  animation: 打字点 1.2s infinite;
}
.气泡.打字中 span:nth-child(2) { animation-delay: 0.2s; }
.气泡.打字中 span:nth-child(3) { animation-delay: 0.4s; }
@keyframes 打字点 {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* 待发送的图片预览条 */
#待发图片预览 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px dashed var(--金边);
  background: var(--浅粉);
}
#待发图片预览 img { height: 44px; border-radius: 8px; }
#待发图片预览 button {
  font-family: inherit;
  color: var(--深玫瑰);
  background: var(--奶白);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 2px 8px;
  cursor: pointer;
}

/* 输入栏 */
#手机输入栏 {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--金边);
  background: var(--奶白);
}
#选图按钮, #发送按钮 {
  font-family: inherit;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 12px;
  padding: 6px 11px;
  cursor: pointer;
  flex-shrink: 0;
}
#选图按钮 { background: var(--浅粉); color: var(--深玫瑰); }
#聊天输入 {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 14px;
  padding: 8px 12px;
}

/* 抽屉里的"和他聊天"入口 */
#打开聊天 {
  font-family: inherit;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 6px 16px;
  cursor: pointer;
  margin-bottom: 12px;
  margin-left: 8px;
}

/* 角落的手机图标（窄屏藏起来，走菜单入口） */
#手机图标 {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 64;
  width: 54px;
  height: 54px;
  font-size: 1.5rem;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 2px solid var(--金色);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--柔和阴影);
}
#手机图标:active { transform: scale(0.92); }

/* ---------- 心情面板（图标 + 进度条 + 一句软话） ---------- */
#心情面板 { display: flex; flex-direction: column; gap: 9px; }
.心情行 { display: flex; align-items: center; gap: 8px; }
.心情图标 { font-size: 1rem; flex-shrink: 0; }
.心情条 {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: var(--浅粉);
  border: 1px solid var(--金边);
  overflow: hidden;
}
.心情条芯 {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--主粉), var(--金色));
  transition: width 0.8s ease; /* 数值变化时条条柔柔地动 */
}
.心情词 {
  font-size: 0.68rem;
  color: var(--深玫瑰);
  opacity: 0.75;
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}

/* 呼唤时"闲聊"的打字输入行（AI 模式） */
.闲聊输入行 {
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
}
.闲聊输入行 input {
  width: 180px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 14px;
  padding: 8px 12px;
  backdrop-filter: blur(4px);
}

/* ============================================================
   交换日记：一本摊开的日记本
============================================================ */
#日记本 {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--深玫瑰蒙层);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
}
#日记册 {
  width: min(94vw, 480px);
  height: min(90dvh, 760px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--奶白) 0%, #fdf6ef 100%);
  border: 2px solid var(--金色);
  border-left-width: 8px; /* 厚厚的书脊 */
  border-radius: 8px 16px 16px 8px;
  box-shadow: var(--柔和阴影);
  overflow: hidden;
}
#日记头 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--金边);
  background: var(--浅粉);
}
#日记日期 {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--深玫瑰);
}
#关闭日记 {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 4px 10px;
  cursor: pointer;
}
#日记页区 {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.日记页 {
  border: 1px solid var(--金边);
  border-radius: 12px;
  padding: 12px 14px;
  /* 纸的横线质感 */
  background:
    repeating-linear-gradient(180deg,
      transparent 0px, transparent 27px,
      rgba(201, 169, 106, 0.22) 27px, rgba(201, 169, 106, 0.22) 28px),
    var(--奶白);
}
.日记页标题 {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--深玫瑰);
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--金边);
}
#他的日记文 {
  font-size: 0.88rem;
  line-height: 28px; /* 跟着纸的横线走 */
  color: var(--深玫瑰);
  white-space: pre-line;
  min-height: 84px;
}
#他的日记文.日记空白 { opacity: 0.5; font-style: italic; }
/* 他一天里分几段写的日记：每段带一个淡淡的时段小标 */
.日记段 { margin-bottom: 12px; }
.日记段:last-child { margin-bottom: 0; }
.日记段标 {
  font-size: 0.66rem;
  letter-spacing: 1px;
  color: var(--金);
  opacity: 0.85;
  margin-bottom: 2px;
}
.日记段文 { white-space: pre-line; }
.日记空白 { opacity: 0.5; font-style: italic; }
#我的日记输入 {
  width: 100%;
  min-height: 140px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 28px;
  color: var(--深玫瑰);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
}
.日记按钮行 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.日记按钮行 button {
  font-family: inherit;
  font-size: 0.8rem;
  color: #fff;
  background: var(--主粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 5px 18px;
  cursor: pointer;
}
#我的日记状态 { font-size: 0.7rem; color: var(--深玫瑰); opacity: 0.6; }

/* 页边留言 */
.留言题 {
  font-size: 0.72rem;
  color: var(--深玫瑰);
  opacity: 0.6;
  margin: 10px 0 4px;
}
.留言条 {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--深玫瑰);
  padding: 4px 10px;
  margin: 3px 0;
  border-radius: 10px;
}
.留言条.留言我 { background: rgba(232, 180, 184, 0.28); }
.留言条.留言他 { background: rgba(201, 169, 106, 0.16); }
.留言输入行 {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.留言输入行 input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 6px 10px;
}
.留言输入行 button {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--深玫瑰);
  background: var(--奶白);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 5px 12px;
  cursor: pointer;
}

/* 手机顶栏里的日记按钮，跟旁边按钮一个样式 */
#打开日记 {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--深玫瑰);
  background: var(--奶白半透明);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 4px 9px;
  cursor: pointer;
}
/* 抽屉里的日记入口，跟"和他聊天"一个样式 */
#抽屉日记 {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 6px 16px;
  cursor: pointer;
  margin-bottom: 12px;
  margin-left: 8px;
}

/* ---------- 未读小红点（挂在手机图标和聊天入口上） ---------- */
.有未读 { position: relative; }
.有未读::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e4586a;
  border: 2px solid var(--奶白);
  box-shadow: 0 0 6px rgba(228, 88, 106, 0.6);
}

/* ---------- 电脑两侧的雨层（雨天装饰区飘雨丝） ---------- */
#侧边雨层 {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0; /* 在最底下，画框和卡片都盖在它上面 */
}

/* ---------- 侧栏的天气面板 ---------- */
#当前天气行 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  padding: 8px 0 10px;
}
#当前天气行 .天气大图 { font-size: 1.8rem; }
.预报行 {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 4px 6px;
  border-top: 1px dashed var(--金边);
}
#雨幕开关行 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  margin-top: 10px;
  cursor: pointer;
}
#雨幕开关行 input { accent-color: var(--主粉); }

/* 存档卡片：备份/恢复浏览器里的记录 */
#存档说明 {
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--深玫瑰);
  opacity: 0.75;
  margin-bottom: 8px;
}
#存档按钮行 { display: flex; gap: 8px; }
#存档按钮行 button {
  flex: 1;
  font-family: inherit;
  font-size: 0.76rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 6px 4px;
  cursor: pointer;
}
#存档按钮行 button:hover { background: var(--主粉); color: #fff; }

/* ============================================================
   记忆面板（🧠 他的大脑）
============================================================ */
#记忆面板 {
  position: fixed;
  inset: 0;
  z-index: 82; /* 比日记本(80)还高一层 */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(138, 90, 94, 0.45);
}
#记忆面板.隐藏 { display: none; }
#记忆册 {
  width: min(94vw, 500px);
  height: min(90dvh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--奶白);
  border: 1px solid var(--金);
  border-left: 8px solid var(--主粉); /* 书脊 */
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(138, 90, 94, 0.35);
  overflow: hidden;
}
#记忆头 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--金边);
  color: var(--深玫瑰);
  font-weight: bold;
}
#关闭记忆 {
  font-family: inherit;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 4px 10px;
  cursor: pointer;
}
#记忆滚动区 { flex: 1; overflow-y: auto; padding: 12px 16px; }
.记忆节 { margin-bottom: 18px; }
.记忆节标题 { margin: 0 0 4px; font-size: 0.92rem; color: var(--深玫瑰); }
.记忆节说明 { font-size: 0.72rem; opacity: 0.7; color: var(--深玫瑰); line-height: 1.6; margin-bottom: 8px; }
.记忆条 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 6px;
  line-height: 1.6;
}
.记忆删 {
  background: none;
  border: none;
  color: var(--深玫瑰);
  opacity: 0.5;
  cursor: pointer;
  font-size: 0.8rem;
}
.记忆删:hover { opacity: 1; }
.记忆空 { font-size: 0.78rem; opacity: 0.5; color: var(--深玫瑰); font-style: italic; }
#叮嘱输入行 { display: flex; gap: 8px; margin-top: 8px; }
#叮嘱输入 {
  flex: 1;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--深玫瑰);
  background: #fff;
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 7px 10px;
}
#叮嘱添加 {
  font-family: inherit;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
}
/* 人格成长：可编辑的"他长成的样子" */
#人格拓展输入 {
  width: 100%;
  min-height: 90px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--深玫瑰);
  background: #fff;
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 8px 10px;
  resize: vertical;
}
#人格拓展按钮行 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--深玫瑰);
}
#人格拓展按钮行 span { opacity: 0.7; }
#保存人格拓展 {
  font-family: inherit;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 5px 14px;
  cursor: pointer;
}

#记忆备份节 {
  background: var(--浅粉);
  border: 1px dashed var(--金);
  border-radius: 12px;
  padding: 10px 12px;
}
#记忆备份按钮行 { display: flex; gap: 8px; }
#记忆备份按钮行 button {
  flex: 1;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--深玫瑰);
  background: var(--奶白);
  border: 1px solid var(--金);
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
}
#记忆备份按钮行 button:hover { background: var(--主粉); color: #fff; }
.独白条 {
  border-left: 3px solid var(--金);
  background: rgba(201, 169, 106, 0.06);
  padding: 5px 10px;
  margin-bottom: 10px;
  border-radius: 0 8px 8px 0;
}
.独白时间 { font-size: 0.72rem; color: var(--金); margin-bottom: 2px; }
.独白文 { font-size: 0.84rem; color: var(--深玫瑰); line-height: 1.7; white-space: pre-line; font-style: italic; }
.年表条 {
  border-left: 3px solid var(--主粉);
  padding: 4px 10px;
  margin-bottom: 10px;
}
.年表日期 { font-size: 0.74rem; color: var(--金); margin-bottom: 2px; }
.年表文 { font-size: 0.82rem; color: var(--深玫瑰); line-height: 1.7; white-space: pre-line; }
#打开记忆 {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
#抽屉记忆 {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
}

/* ============================================================
   情书抽屉（💌）
============================================================ */
#情书抽屉面板 {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(138, 90, 94, 0.45);
}
#情书抽屉面板.隐藏 { display: none; }
#情书抽屉册 {
  width: min(94vw, 500px);
  height: min(90dvh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--奶白);
  border: 1px solid var(--金);
  border-left: 8px solid var(--金); /* 抽屉边 */
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(138, 90, 94, 0.35);
  overflow: hidden;
}
#情书抽屉头 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--金边);
  color: var(--深玫瑰);
  font-weight: bold;
}
#关闭抽屉信 {
  font-family: inherit;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 4px 10px;
  cursor: pointer;
}
#情书抽屉滚动区 { flex: 1; overflow-y: auto; padding: 12px 16px; }
.信卡 {
  background: #fffdf8;
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(138, 90, 94, 0.08);
}
.信卡.已收藏 { border-color: var(--金); background: rgba(201, 169, 106, 0.08); }
.信卡.我的信 { background: var(--浅粉); }
.信卡头 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--金);
  margin-bottom: 6px;
}
.信收藏钮 {
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--金);
  background: none;
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 2px 10px;
  cursor: pointer;
}
.信卡文 {
  font-size: 0.86rem;
  color: var(--深玫瑰);
  line-height: 1.8;
  white-space: pre-line;
}
#回信输入 {
  width: 100%;
  min-height: 110px;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--深玫瑰);
  background: #fff;
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
}
#回信按钮行 { margin: 8px 0 12px; text-align: right; }
#寄出回信 {
  font-family: inherit;
  font-size: 0.84rem;
  color: #fff;
  background: linear-gradient(180deg, var(--主粉), #dfa0a6);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 8px 18px;
  cursor: pointer;
}
#打开抽屉信 {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
#抽屉情书 {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
}

/* ============================================================
   iPhone PWA 安全区补充（底部横条/刘海不挡任何按钮）
   （顶部栏和手机输入栏原本就避让了，这里补齐其余底部元素）
============================================================ */
#对话框 { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
#选项区 { bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }
#呼唤按钮 { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
#结束对话按钮 { top: calc(10px + env(safe-area-inset-top, 0px)); }

/* 立绘微调（大小/位置）：数值在 环境设定.js 的 界面设定 里改 */
#立绘画布,
#立绘视频:not(.抠像源),
#立绘占位 {
  transform: translate(var(--立绘横移, 0%), var(--立绘纵移, 0%)) scale(var(--立绘缩放, 1));
  transform-origin: center bottom; /* 以脚底为中心缩放，人不会飘起来 */
}

/* 日历：经期与预测的温和标示 */
.日历日.经期日 {
  background: rgba(232, 180, 184, 0.35);
  border-radius: 50%;
}
.日历日.预测期 {
  outline: 1px dashed var(--主粉);
  outline-offset: -2px;
  border-radius: 50%;
}
/* 日历详情里的小节（身体 / 这一天） */
.详情小题 {
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--深玫瑰);
  margin: 12px 0 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--金边);
}
.详情说明 {
  font-size: 0.72rem;
  color: var(--深玫瑰);
  opacity: 0.7;
  line-height: 1.6;
  margin-bottom: 6px;
}
.身体备注输入 {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.76rem;
  color: var(--深玫瑰);
  background: #fff;
  border: 1px solid var(--金边);
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 6px;
}
.统计行 {
  font-size: 0.76rem;
  color: var(--深玫瑰);
  line-height: 1.8;
}

/* 我的歌单：他听完某首歌写的小感想（垫在歌名下面） */
.歌单感想 {
  list-style: none;
  font-size: 0.7rem;
  color: var(--金);
  line-height: 1.6;
  padding: 2px 8px 6px 18px;
  font-style: italic;
  cursor: default;
}

/* 音乐卡片里的"他的语音"总开关 */
.语音开关行 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  margin-top: 6px;
  cursor: pointer;
  color: var(--深玫瑰);
}
.语音开关行 input { accent-color: var(--主粉); }

/* ============================================================
   侧栏（心情 / 音乐 / 日历 三张卡片）
   手机上：左上角菜单按钮 → 抽屉滑出
   电脑上：常驻显示在画框左右两侧
============================================================ */

/* 手机抽屉打开时，四周的暗化蒙层 */
#侧栏遮罩 {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: var(--深玫瑰蒙层);
}

/* 抽屉本体（手机默认藏在屏幕左边外面） */
#侧栏抽屉 {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: min(84vw, 340px);
  z-index: 60;
  background: var(--奶白);
  border-right: 1px solid var(--金边);
  box-shadow: var(--柔和阴影);
  padding: 16px 14px;
  padding-top: max(16px, env(safe-area-inset-top));
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform 0.3s ease;
}
#侧栏抽屉.打开 { transform: none; }

#关闭抽屉 {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 5px 14px;
  cursor: pointer;
  margin-bottom: 12px;
}

.侧栏组 {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

/* 卡片的统一样子 */
.卡片 {
  background: var(--奶白);
  border: 1px solid var(--金边);
  border-radius: 18px;
  box-shadow: var(--柔和阴影);
  padding: 14px 16px;
}
.卡片标题 {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--深玫瑰);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--金边); /* 标题下的细金线 */
}
.占位内容 {
  font-size: 0.85rem;
  line-height: 1.8;
  text-align: center;
  color: var(--深玫瑰);
  opacity: 0.75;
  padding: 10px 0;
}
.小注 { font-size: 0.72rem; opacity: 0.7; }

/* ---------- 日历 ---------- */
.日历头 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.日历标题 { font-size: 0.9rem; letter-spacing: 0.1em; }
.日历导航 {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 10px;
  padding: 3px 10px;
  cursor: pointer;
}
.日历导航:active { background: var(--主粉); color: #fff; }

.星期行 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  opacity: 0.65;
  margin-bottom: 4px;
}
.日历格 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.日历日 {
  position: relative;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--深玫瑰);
  background: transparent;
  border: none;
  border-radius: 50%;
  aspect-ratio: 1;
  cursor: pointer;
}
.日历日:hover { background: var(--浅粉); }
.日历日.今天 { background: var(--主粉); color: #fff; font-weight: bold; }
.日历日.选中 { outline: 2px solid var(--金色); }
/* 有固定事件的日子：右上角一个小金点 */
.日历日.有事件::before {
  content: "";
  position: absolute;
  top: 3px; right: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--金色);
}
/* 有自己记事的日子：下方一个小粉点 */
.日历日.有记事::after {
  content: "";
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--主粉);
}

.日历详情 {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--金边);
  font-size: 0.8rem;
  line-height: 1.7;
}
.日历详情 .详情日期 { letter-spacing: 0.1em; margin-bottom: 6px; }
.日历详情 .事件行 { color: var(--深玫瑰); margin-bottom: 4px; }
.记事输入 {
  width: 100%;
  min-height: 58px;
  margin: 6px 0;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--深玫瑰);
  background: var(--浅粉);
  border: 1px solid var(--金边);
  border-radius: 12px;
  resize: vertical;
}
.记事按钮行 { display: flex; gap: 8px; }
.记事按钮 {
  font-family: inherit;
  font-size: 0.78rem;
  color: #fff;
  background: var(--主粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 5px 16px;
  cursor: pointer;
}
.记事按钮.次要 { background: var(--浅粉); color: var(--深玫瑰); }
.记事按钮:active { opacity: 0.8; }

/* ---------- 音乐卡片 ---------- */
.正在播放 {
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 8px 10px;
  background: var(--浅粉);
  border-radius: 12px;
  margin-bottom: 8px;
  text-align: center;
}
.音乐按钮行 { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.音乐按钮 {
  font-family: inherit;
  font-size: 0.8rem;
  color: #fff;
  background: var(--主粉);
  border: 1px solid var(--金边);
  border-radius: 99px;
  padding: 5px 16px;
  cursor: pointer;
}
.音乐按钮:active { opacity: 0.8; }
.曲目清单 {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.曲目行 {
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.曲目行:hover { background: var(--浅粉); }
.曲目行.当前曲 { background: var(--主粉); color: #fff; }
.音量行 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  margin-top: 6px;
}
.音量行 input[type="range"] {
  flex: 1;
  accent-color: var(--主粉); /* 滑杆用主粉色 */
}

/* ============================================================
   电脑宽屏布局（窗口宽度 ≥ 1000px 时自动生效）
   画框居中，三张卡片分列左右两侧，菜单按钮隐藏
============================================================ */
@media (min-width: 1000px) {
  #菜单按钮 { display: none; }
  #侧栏遮罩 { display: none !important; }
  #关闭抽屉 { display: none; }

  /* 宽屏主画面：不再锁手机窄比例，宽度由 环境设定.js 的"电脑画面宽"决定 */
  #手机画框 {
    aspect-ratio: auto;
    width: var(--画面宽, 62vw);
    max-width: calc(100vw - 440px); /* 至少给两侧面板留点位置 */
    height: 100dvh;
  }
  /* 立绘不再随宽画面拉伸/裁切：完整站在正中，两侧露出房间空景 */
  #立绘画布, #立绘视频:not(.抠像源), #陪伴娃娃图 { object-fit: contain; }

  /* 抽屉"解体"：让里面的左右两组直接各自定位 */
  #侧栏抽屉 {
    display: contents;
  }
  .侧栏组 {
    position: fixed;
    top: 0; bottom: 0;
    width: calc((100vw - min(var(--画面宽, 62vw), 100vw - 440px)) / 2 - 12px);
    padding: 22px 10px;
    overflow-y: auto;
    margin: 0;
  }
  /* 左边一组（陪伴+心情+音乐）贴着画框左侧 */
  #左组 { left: 4px; align-items: flex-end; }
  /* 右边一组（日历+天气）贴着画框右侧 */
  #右组 { right: 4px; align-items: flex-start; }
  .侧栏组 .卡片 { width: 100%; max-width: 340px; }

  /* 手机窄屏专用的按钮，电脑上藏起来 */
  #打开聊天 { display: none; }
  #抽屉日记 { display: none; } /* 电脑上从手机顶栏的 📔 打开日记 */
  #抽屉记忆 { display: none; } /* 电脑上从手机顶栏的 🧠 打开记忆 */
  #抽屉情书 { display: none; } /* 电脑上从手机顶栏的 💌 打开情书抽屉 */

  /* 小手机：悬浮窗口模式——点角落的 📱 图标弹出，可拖动 */
  #小手机 {
    display: none;
    position: fixed;
    inset: auto;
    right: 84px;
    bottom: 20px;
    width: 340px;
    height: min(80dvh, 660px);
    z-index: 65;
  }
  #小手机.打开 { display: block; }
  #手机顶栏 { cursor: grab; }        /* 按住顶栏拖动窗口 */
  #手机顶栏:active { cursor: grabbing; }

  /* 角落的手机图标按钮 */
  #手机图标 { display: block; }
}
