/* ================================================================
   自在邮局 MVP 样式 V3
   设计原则：
   1. 不破坏插画——所有交互元素不遮挡插画主体
   2. 一层信纸——插画本身已有的信纸不重复添加；读信页用信纸容器而非插画背景
   3. 写信排版——文字行距与信纸横线一致，文字在横线上方，不骑线
   4. 信纸不重叠——textarea透明覆盖插画信纸，无额外背景横线
   ================================================================ */

/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  background: #F7F3E9;
  color: #3A2A1A;
  -webkit-font-smoothing: antialiased;
}

/* ===== 页面基础 ===== */
.page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.page.active {
  display: flex;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== 背景图通用 ===== */
.splash-bg, .home-bg, .write-bg, .seal-bg, .zizai-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
}

/* 读信页不用插画背景，用纯色 */
.read-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #F7F3E9;
  z-index: 0;
}

/* ===== 叠加层 ===== */
.splash-overlay, .home-overlay, .write-overlay, .seal-overlay, .read-overlay, .zizai-overlay, .list-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== 通用返回按钮 ===== */
.back-btn {
  font-size: 14px;
  color: #8B6F47;
  cursor: pointer;
  letter-spacing: 2px;
}

.page-title {
  font-size: 16px;
  color: #3A2A1A;
  letter-spacing: 4px;
}

.placeholder {
  width: 40px;
}

/* ========== 导入页 ========== */
/*
 * 布局：
 *   上方天空（6%起）：splash-intro 左对齐介绍文字
 *   画面最下方（8%）：splash-slogan 加粗显示
 *   点击任意区域进入主页
 */
.splash-intro {
  position: absolute;
  top: max(6%, env(safe-area-inset-top));
  left: 10%;
  right: 10%;
  z-index: 2;
  font-size: 12px;
  line-height: 1.95;
  color: #3A2A1A;
  letter-spacing: 1px;
  opacity: 0.75;
  text-align: left;  /* 左对齐 */
}

.splash-intro .intro-line {
  display: block;
  margin-bottom: 4px;
}

.splash-intro .intro-line:last-child {
  margin-bottom: 0;
}

.splash-slogan {
  position: absolute;
  bottom: calc(8% - 32px);  /* 向下移动2个字高度(2×16px=32px) */
  left: 0;
  right: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 700;  /* 加粗 */
  color: #3A2A1A;
  letter-spacing: 8px;
  opacity: 0.85;
  z-index: 2;
  animation: breathe 3s ease-in-out infinite;
}

/* splash-hint 已移除，保留空定义避免报错 */
.splash-hint {
  display: none !important;
}

/* ========== 主页 ========== */
.home-logo-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-logo-btn {
  font-size: 14px;
  color: #8B6F47;
  cursor: pointer;
  letter-spacing: 3px;
}

.home-settings-btn {
  font-size: 14px;
  color: #8B6F47;
  cursor: pointer;
  letter-spacing: 3px;
  opacity: 0.7;
}

.home-overlay {
  justify-content: flex-end;
  padding: 0;
}

/* 信箱点击区域——覆盖整个信箱位置 */
.home-mailbox-clicks {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0 10px;
  margin-bottom: 14vh;
}

.mailbox-click-area {
  flex: 1;
  max-width: 48%;
  height: 30vh;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s;
}

.mailbox-click-area:active {
  background: rgba(255, 255, 255, 0.12);
}

/* ========== 写信页 ========== */
.write-overlay {
  justify-content: flex-start;
}

.write-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  flex-shrink: 0;
}

/*
 * V5写信页插画：信纸占上方75%（约8%-83%高度），无横线
 * 小自在缩到右下角约15%（约85%-95%高度）
 * textarea 透明覆盖信纸，位置参数匹配V5插画
 * 微调：上沿下移1字(约2vh)，下沿上移5字(约10vh)
 */
.write-textarea {
  position: absolute;
  top: 10.5vh;
  bottom: 18vh;
  left: 11%;
  right: 11%;
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 32px;
  color: #3A2A1A;
  font-family: inherit;
  outline: none;
  resize: none;
  padding: 8px 8px 0;
  z-index: 2;
  /* 无 background-image —— 插画信纸无横线，textarea 也保持空白 */
}

.write-textarea::placeholder {
  color: rgba(196, 180, 154, 0.4);
  font-size: 13px;
}

.write-footer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: max(10px, calc(env(safe-area-inset-bottom) + 8px));
  flex-shrink: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: linear-gradient(to top, rgba(247, 243, 233, 0.95) 60%, rgba(247, 243, 233, 0));
}

/* 收信人昵称 */
.recipient-bar {
  flex: 1;
  min-width: 0;
}

.recipient-bar input {
  width: 100%;
  border: 1px solid rgba(138, 168, 196, 0.3);
  border-radius: 24px;
  padding: 10px 12px;
  font-size: 13px;
  background: rgba(255, 253, 247, 0.85);
  color: #3A2A1A;
  font-family: inherit;
  outline: none;
  letter-spacing: 0.5px;
  text-align: center;
}

.recipient-bar input::placeholder {
  color: #C4B49A;
}

.recipient-bar input:focus {
  border-color: rgba(200, 76, 60, 0.4);
}

.seal-btn {
  flex-shrink: 0;
  background: #C84C3C;
  color: #FFF;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  letter-spacing: 2px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(200, 76, 60, 0.25);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.seal-btn:active {
  transform: scale(0.95);
}

/* ========== 封缄页 ========== */
.seal-overlay {
  justify-content: space-between;
}

.seal-header {
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.seal-spacer {
  flex: 1;
}

.seal-bottom {
  padding: 0 20px 28px;
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
  text-align: center;
}

.seal-trigger-btn {
  background: #C84C3C;
  color: #FFF;
  border: none;
  border-radius: 28px;
  padding: 14px 48px;
  font-size: 15px;
  letter-spacing: 4px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 76, 60, 0.3);
  transition: all 0.3s ease;
}

.seal-trigger-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(200, 76, 60, 0.2);
}

.seal-message {
  animation: fadeIn 0.6s ease;
}

.seal-message-text {
  font-size: 22px;
  color: #3A2A1A;
  letter-spacing: 8px;
  margin-bottom: 14px;
}

.seal-message-sub {
  font-size: 13px;
  color: #8B6F47;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.seal-countdown {
  font-size: 32px;
  font-weight: 300;
  color: #C84C3C;
  letter-spacing: 4px;
  font-family: "SF Mono", "Menlo", monospace;
}

/* ========== 信箱列表页（通用） ========== */
.list-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #F7F3E9;
  z-index: 0;
}

.list-overlay {
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid rgba(58, 42, 26, 0.06);
}

.write-link {
  font-size: 14px;
  color: #C84C3C;
  letter-spacing: 2px;
  cursor: pointer;
}

/* 列表页顶部写信CTA按钮——强烈引导 */
.list-write-cta {
  padding: 16px 20px 8px;
  flex-shrink: 0;
}

/* 列表页写信CTA上方的启发文字——手写体信纸 */
.cta-letter-paper {
  background: #FFFDF7;
  background-image: linear-gradient(rgba(200,76,60,0.015) 1px, transparent 1px);
  background-size: 100% 28px;
  border-radius: 8px;
  padding: 14px 20px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(58, 42, 26, 0.06);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(200, 76, 60, 0.08);
  animation: fadeInUp 0.4s ease both;
}

/* 顶部装饰线 */
.cta-letter-paper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right,
    transparent 8%,
    rgba(200, 76, 60, 0.15) 25%,
    rgba(200, 76, 60, 0.3) 50%,
    rgba(200, 76, 60, 0.15) 75%,
    transparent 92%);
}

/* 内框 */
.cta-letter-paper::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border: 1px solid rgba(200, 76, 60, 0.05);
  border-radius: 5px;
  pointer-events: none;
}

.cta-letter-text {
  position: relative;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Noto Serif SC", serif;
  text-align: left;
}

.cta-letter-text .cta-line-1 {
  font-size: 13px;
  line-height: 28px;
  color: #5A4A3A;
  letter-spacing: 1px;
}

.cta-letter-text .cta-line-2 {
  font-size: 12px;
  line-height: 24px;
  color: #8B6F47;
  letter-spacing: 2px;
  text-align: left;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(200, 76, 60, 0.1);
}

.write-cta-btn {
  width: 100%;
  background: linear-gradient(135deg, #C84C3C, #D85A4A);
  color: #FFF;
  border: none;
  border-radius: 28px;
  padding: 14px 24px;
  font-size: 15px;
  letter-spacing: 4px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 76, 60, 0.3);
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.write-cta-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(200, 76, 60, 0.2);
}

/* 自在信箱列表的小自在叩问图片 */
/*
 * 06_zizai_question.png 裁剪后是横长方形（832x375，比例约 2.22:1）
 * 只保留小自在+对话泡泡"此刻，你心里最微小的那个声音在说什么？"
 * 飞哥要求：等比例放大，横向长度和下方"给小自在写一封信"按钮宽度一致
 * 图所在容器 .zizai-question-image 的左右边距是 20px（和 .list-write-cta 一致）
 * 所以图 width: 100% 就能和按钮宽度一致
 */
.zizai-question-image {
  margin: 14px 20px 8px;
  text-align: left;
  animation: fadeInUp 0.4s ease both;
}

.zizai-question-image img {
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 8px;
  display: block;
}

.list-content {
  padding: 12px 20px;
}

.letter-item {
  background: rgba(255, 253, 247, 0.7);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(58, 42, 26, 0.04);
  transition: transform 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.letter-item:active {
  transform: scale(0.98);
}

/* 在路上的信件——不可点击，灰色样式 */
.letter-item-locked {
  background: rgba(247, 243, 233, 0.6);
  cursor: default;
  opacity: 0.6;
}

.letter-item-locked:active {
  transform: none;
}

.letter-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.letter-item-from {
  font-size: 15px;
  color: #3A2A1A;
  letter-spacing: 1px;
  font-weight: 500;
}

.letter-item-time {
  font-size: 12px;
  color: #B0A088;
  letter-spacing: 1px;
}

.letter-item-preview {
  font-size: 13px;
  color: #8B6F47;
  line-height: 1.6;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.letter-item-tag {
  display: inline-block;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  letter-spacing: 1px;
}

.tag-sending {
  color: #8B6F47;
  border: 1px solid rgba(139, 111, 71, 0.25);
  background: rgba(139, 111, 71, 0.05);
}

.tag-incoming {
  color: #8AA8C4;
  border: 1px solid rgba(138, 168, 196, 0.25);
  background: rgba(138, 168, 196, 0.05);
}

.tag-sent {
  color: #C84C3C;
  border: 1px solid rgba(200, 76, 60, 0.25);
}

.tag-received {
  color: #C84C3C;
  border: 1px solid rgba(200, 76, 60, 0.25);
}

.tag-zizai {
  color: #8AA8C4;
  border: 1px solid rgba(138, 168, 196, 0.25);
}

.list-empty {
  text-align: center;
  padding: 60px 20px;
  color: #B0A088;
  font-size: 14px;
  letter-spacing: 2px;
}

/* ========== 读信页 ========== */
/* 不用插画背景，避免两层信纸 */
.read-overlay {
  justify-content: flex-start;
}

.read-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  flex-shrink: 0;
}

.read-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 40px;
}

/* 信封 */
.read-envelope {
  margin: 40px 24px;
  background: rgba(255, 253, 247, 0.9);
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(58, 42, 26, 0.1);
  animation: scaleIn 0.6s ease;
}

.envelope-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #D85A4A, #C84C3C, #A83C2C);
  margin: 0 auto 24px;
  box-shadow: 0 4px 12px rgba(200, 76, 60, 0.3);
}

.envelope-from {
  font-size: 15px;
  color: #3A2A1A;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.envelope-time {
  font-size: 12px;
  color: #8B6F47;
  letter-spacing: 1px;
  margin-bottom: 28px;
}

.open-letter-btn {
  background: #C84C3C;
  color: #FFF;
  border: none;
  border-radius: 24px;
  padding: 12px 36px;
  font-size: 14px;
  letter-spacing: 3px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 76, 60, 0.3);
  transition: all 0.2s ease;
}

.open-letter-btn:active {
  transform: scale(0.95);
}

/* 拆信后的内容 */
.read-letter {
  animation: fadeInUp 0.6s ease;
}

/* 信纸容器——一层信纸，有横线背景 */
/* 关键：padding-top 必须是 line-height(30px) 的整数倍，否则手机端文字与横线错位重叠 */
.paper-letter {
  background: rgba(255, 253, 247, 0.95);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 29px,
    rgba(138, 168, 196, 0.12) 29px,
    rgba(138, 168, 196, 0.12) 30px
  );
  border-radius: 12px;
  padding: 30px 22px 24px;
  margin: 0 20px 20px;
  box-shadow: 0 2px 12px rgba(58, 42, 26, 0.06);
}

/* 信件内容文字 */
.letter-content-text {
  font-size: 15px;
  line-height: 30px;
  color: #3A2A1A;
  letter-spacing: 1px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 回信区域 */
.reply-section {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reply-label {
  font-size: 13px;
  color: #8B6F47;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

/* 回信信纸——和信件内容一样的信纸样式 */
.paper-reply {
  width: 100%;
  margin: 0 0 16px 0;
  padding: 0;
  overflow: hidden;
}

.reply-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 30px;
  color: #3A2A1A;
  font-family: inherit;
  outline: none;
  resize: none;
  padding: 30px 22px 20px;
  min-height: 240px;
  /* 信纸横线背景继承自 .paper-reply 的 background-image */
}

.reply-textarea::placeholder {
  color: #C4B49A;
}

.reply-btn {
  background: #3A2A1A;
  color: #F7F3E9;
  border: none;
  border-radius: 24px;
  padding: 12px 36px;
  font-size: 14px;
  letter-spacing: 3px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reply-btn:active {
  transform: scale(0.95);
}

/* ========== 自在信箱写信页 ========== */
/*
 * 02_otter_floating.png 扩图后是横长方形（1216x832，比例约1.46:1）
 * 第九轮布局（飞哥明确要求）：
 *   - 信纸容器：40vh → 60vh（拉长2倍）
 *   - 小自在图：保留 50vh 高度，但包在 30vh 容器中
 *     容器 overflow: hidden，让图上方 20vh 天空留白被裁掉
 *   - 寄给小自在按钮：fixed 在屏幕底部（absolute）
 *
 * 布局（自上而下）：
 *   zizai-header (~4vh) + zizai-paper-container (60vh) + zizai-otter-wrap (30vh)
 *   + 绝对定位的 zizai-footer（约8vh）
 *   总和约 102vh，footer 绝对定位始终在屏幕底部可见
 */
.zizai-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #F7F3E9;
  z-index: 0;
}

.zizai-overlay {
  justify-content: flex-start;
}

.zizai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top));
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

/*
 * 信纸容器——飞哥要求拉长为2倍（40vh → 60vh）
 * 紧贴header下方，居中显示
 */
.zizai-paper-container {
  position: relative;
  margin: 8px 6% 0 6%;
  background: rgba(255, 253, 247, 0.95);
  border-radius: 12px;
  padding: 14px 22px;
  box-shadow: 0 4px 16px rgba(58, 42, 26, 0.08);
  z-index: 2;
  height: 60vh;  /* 拉长2倍（原40vh） */
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.zizai-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 32px;
  color: #3A2A1A;
  font-family: inherit;
  outline: none;
  resize: none;
  padding: 0;
  flex: 1;
}

.zizai-textarea::placeholder {
  color: rgba(196, 180, 154, 0.5);
  font-size: 13px;
}

/*
 * 小自在插画——飞哥要求"裁掉头上20vh空间"
 * 原图 1216x832（横长方形，比例 1.462），水獭在图中央偏下
 * 上方约 27% 是天空留白，约等于 50vh * 27% = 13.5vh（但飞哥说约 20vh）
 * 实现：图片仍保持原始高度 50vh，但包在 height: 30vh 的容器中
 *       容器 overflow: hidden，图向上偏移露出 20vh 的天空留白
 *       最终容器可视区只显示图的下半部分（从图中y=20vh到y=50vh）
 *       水獭本体在图 y=27.7%-64.9%，裁后显示完整
 */
.zizai-otter-wrap {
  height: 30vh;  /* 容器高度：裁掉20vh后的可视高度 */
  position: relative;
  overflow: hidden;
  margin-top: 0;
  z-index: 1;
  flex-shrink: 0;
}

.zizai-otter-img {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 50vh;  /* 图片保持50vh高度（飞哥要求"放大到2倍"） */
  max-width: 100%;
  opacity: 0.95;
}

/*
 * footer——飞哥反馈"按钮显示不出来"，根因是总高度超出100vh
 * 修复：用 position: absolute 固定在屏幕底部，确保按钮始终可见
 *       上方加渐变背景，避免遮挡小自在形象太突然
 */
.zizai-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  padding-bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(to top, #F7F3E9 65%, rgba(247, 243, 233, 0));
}

.send-zizai-btn {
  background: #C84C3C;
  color: #FFF;
  border: none;
  border-radius: 28px;
  padding: 14px 48px;
  font-size: 15px;
  letter-spacing: 4px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 76, 60, 0.3);
  transition: all 0.2s ease;
}

.send-zizai-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(200, 76, 60, 0.2);
}

/* ========== 登录页 ========== */
.login-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #F7F3E9;
  z-index: 0;
}

.login-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
}

.login-title {
  font-size: 32px;
  color: #3A2A1A;
  letter-spacing: 12px;
  margin-bottom: 12px;
  font-weight: 600;
}

.login-subtitle {
  font-size: 13px;
  color: #8B6F47;
  letter-spacing: 6px;
  margin-bottom: 48px;
  opacity: 0.7;
}

.login-form {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-input-group {
  width: 100%;
  margin-bottom: 16px;
}

.login-input {
  width: 100%;
  border: 1px solid rgba(138, 168, 196, 0.3);
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 15px;
  background: rgba(255, 253, 247, 0.85);
  color: #3A2A1A;
  font-family: inherit;
  outline: none;
  letter-spacing: 2px;
  text-align: center;
}

.login-input::placeholder {
  color: #C4B49A;
  letter-spacing: 2px;
}

.login-input:focus {
  border-color: rgba(200, 76, 60, 0.4);
}

.login-code-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.login-code-input {
  flex: 1;
}

.send-code-btn {
  flex-shrink: 0;
  background: rgba(255, 253, 247, 0.85);
  color: #8B6F47;
  border: 1px solid rgba(138, 168, 196, 0.3);
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 13px;
  letter-spacing: 1px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.send-code-btn:active {
  transform: scale(0.95);
}

.send-code-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.dev-code-hint {
  font-size: 16px;
  font-weight: 700;
  color: #C84C3C;
  letter-spacing: 4px;
  margin-bottom: 16px;
  text-align: center;
  background: rgba(200, 76, 60, 0.1);
  border: 1px solid rgba(200, 76, 60, 0.3);
  border-radius: 8px;
  padding: 10px 16px;
}

.login-btn {
  width: 100%;
  background: #C84C3C;
  color: #FFF;
  border: none;
  border-radius: 28px;
  padding: 14px 24px;
  font-size: 15px;
  letter-spacing: 4px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 76, 60, 0.3);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.login-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(200, 76, 60, 0.2);
}

/* ========== 专属链接看信页 ========== */
.token-loading, .token-error {
  text-align: center;
  padding: 80px 24px;
  color: #8B6F47;
  font-size: 15px;
  line-height: 2;
  letter-spacing: 2px;
}

.token-letter-section {
  padding: 24px 20px 0;
}

.token-from {
  font-size: 15px;
  color: #3A2A1A;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.token-time {
  font-size: 12px;
  color: #B0A088;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.token-register {
  width: 100%;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.token-register-title {
  font-size: 14px;
  color: #8B6F47;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.token-input {
  width: 100%;
  border: 1px solid rgba(138, 168, 196, 0.3);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  background: rgba(255, 253, 247, 0.85);
  color: #3A2A1A;
  font-family: inherit;
  outline: none;
  letter-spacing: 2px;
  text-align: center;
}

.token-input::placeholder {
  color: #C4B49A;
}

.token-input:focus {
  border-color: rgba(200, 76, 60, 0.4);
}

.token-goto-mailbox {
  margin-top: 16px;
  font-size: 14px;
  color: #8B6F47;
  letter-spacing: 2px;
  cursor: pointer;
  text-decoration: underline;
}

/* ========== 设置面板 ========== */
.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.settings-panel {
  background: #F7F3E9;
  border-radius: 20px;
  width: 85%;
  max-width: 340px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(58, 42, 26, 0.1);
}

.settings-title {
  font-size: 18px;
  color: #3A2A1A;
  letter-spacing: 3px;
}

.settings-close {
  font-size: 24px;
  color: #8B6F47;
  cursor: pointer;
  line-height: 1;
}

.settings-body {
  padding: 20px 24px 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-label {
  font-size: 15px;
  color: #3A2A1A;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.settings-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(58, 42, 26, 0.2);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: #3A2A1A;
  background: rgba(255, 255, 255, 0.6);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.settings-input:focus {
  border-color: #8B6F47;
}

.settings-action-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #8B6F47, #6B5436);
  color: #F7F3E9;
  font-size: 16px;
  letter-spacing: 3px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  transition: opacity 0.2s;
}

.settings-action-btn:active {
  opacity: 0.8;
}

.settings-divider {
  height: 1px;
  background: rgba(58, 42, 26, 0.1);
  margin: 20px 0;
}

.settings-logout-btn {
  background: transparent;
  color: #C84C3C;
  border: 1px solid rgba(200, 76, 60, 0.3);
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
}

.toast-inner {
  background: rgba(58, 42, 26, 0.88);
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #C84C3C;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon::after {
  content: "";
  width: 14px;
  height: 8px;
  border-left: 2px solid #FFF;
  border-bottom: 2px solid #FFF;
  transform: rotate(-45deg) translate(1px, -2px);
}

.toast-text {
  font-size: 15px;
  color: #F7F3E9;
  letter-spacing: 3px;
  line-height: 1.6;
}

/* ========== 大屏适配 ========== */
@media (min-width: 600px) {
  .page {
    max-width: 420px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid rgba(58, 42, 26, 0.06);
    border-right: 1px solid rgba(58, 42, 26, 0.06);
  }
  .page.active {
    transform: translateX(-50%);
  }
  body {
    background: #EDE7DA;
  }
}
