/* ============================================================
   未央邮箱 · 解谜小游戏样式
   基线：Chrome 61（Android 8.1 WebView）
   规则：不用 flex gap / 逻辑属性 / inset 简写 / clamp / dvh 等，
        间距用 margin 基线，现代能力仅作增强层。
   ============================================================ */

/* ---------- 全局 ---------- */
html { touch-action: manipulation; }
body {
  background: #070b1c;
  color: #333;
  overflow: hidden;
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; }

/* ---------- 邮箱整体布局 ---------- */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部导航栏 ---------- */
.topbar {
  background: #3478f7;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  flex-shrink: 0;
}
.topbar-inner {
  height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
}
.logo-icon {
  position: relative;
  width: 22px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 2px;
  margin-right: 8px;
}
.logo-icon::before,
.logo-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: #fff;
}
.logo-icon::before { left: 4px; transform: rotate(28deg); }
.logo-icon::after { right: 4px; transform: rotate(-28deg); }
.logo-text {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}
.top-links {
  display: flex;
  align-items: center;
}
.top-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  margin-left: 14px;
  padding: 6px 2px;
}
.top-link:active { opacity: 0.6; }

/* ---------- 工具条：写信 + 搜索 ---------- */
.toolbar {
  background: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ececec;
  flex-shrink: 0;
}
.btn-compose {
  display: flex;
  align-items: center;
  background: #3478f7;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 18px;
  border-radius: 4px;
}
.btn-compose:active { opacity: 0.75; }
.compose-pen {
  width: 12px;
  height: 2px;
  background: #fff;
  position: relative;
  margin-right: 8px;
  transform: rotate(-40deg);
}
.compose-pen::before {
  content: "";
  position: absolute;
  left: -3px; top: -3px;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
}
.search-box {
  flex: 1;
  min-width: 0;
  margin-left: 12px;
  background: #f2f3f5;
  border-radius: 4px;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.search-icon {
  position: relative;
  width: 12px;
  height: 12px;
  border: 2px solid #b8bdc4;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: -5px; bottom: -4px;
  width: 7px;
  height: 2px;
  background: #b8bdc4;
  transform: rotate(45deg);
}
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #999;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- 文件夹标签 ---------- */
.folders {
  background: #fff;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid #ececec;
  flex-shrink: 0;
}
.folders::-webkit-scrollbar { display: none; }
.folder-item {
  position: relative;
  padding: 11px 12px;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
  border-bottom: 2px solid transparent;
}
.folder-item.active {
  color: #3478f7;
  font-weight: bold;
  border-bottom-color: #3478f7;
}
.folder-item:active { opacity: 0.6; }
.badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: #ff5722;
  color: #fff;
  font-size: 10px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 5px;
  font-weight: normal;
}

/* ---------- 邮件区包裹层（窄屏纵向 / 宽屏横向） ---------- */
.mail-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 邮件列表 ---------- */
.mail-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.list-head {
  background: #f4f6f9;
  padding: 8px 14px 4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-shrink: 0;
}
.lh-title { font-size: 12px; color: #888; font-weight: bold; }
.lh-count { font-size: 11px; color: #aab2bd; }

.mail-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  /* Chrome 61 不识别，新内核作为增强生效 */
  overscroll-behavior-y: contain;
}
.mail-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #f2f3f5;
}
.mail-item:active { background: #f7f9fc; }
.check {
  width: 16px;
  height: 16px;
  border: 1px solid #ccd2da;
  border-radius: 3px;
  margin-right: 10px;
  flex-shrink: 0;
}
.dot {
  width: 8px;
  height: 8px;
  background: #3478f7;
  border-radius: 50%;
  margin-right: 8px;
  margin-left: -4px;
  flex-shrink: 0;
}
.mail-main {
  flex: 1;
  min-width: 0;
}
.mail-row1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.mail-from {
  font-size: 14px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.mail-time {
  font-size: 11px;
  color: #aab2bd;
  margin-left: auto;
  padding-left: 6px;
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
  white-space: nowrap;
}
.mail-subject {
  font-size: 13px;
  color: #8a919b;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 未读邮件 */
.mail-item.unread .mail-from { font-weight: bold; }
.mail-item.unread .mail-subject {
  color: #3478f7;
  font-weight: bold;
}
.mail-item.unread .mail-time { color: #3478f7; }
/* 过期邮件（已删除系列） */
.mail-item.expired { opacity: 0.55; }
.mail-item.expired .mail-subject { color: #98a1ac; }
.mail-item.expired:active { background: #fff; }
/* 过期邮件行的「发件人 → 收件人」 */
.from-to {
  font-style: normal;
  font-weight: normal;
  color: #98a1ac;
  font-size: 12px;
}
/* 退回邮件主题行的红色「已退回」标签 */
.mail-flag {
  font-style: normal;
  font-size: 10px;
  line-height: 15px;
  color: #e02a2a;
  border: 1px solid rgba(224, 42, 42, 0.5);
  background: rgba(224, 42, 42, 0.06);
  border-radius: 3px;
  padding: 0 4px;
  margin-right: 6px;
  vertical-align: 1px;
  white-space: nowrap;
}

/* 星标 */
.star {
  font-size: 16px;
  color: #d8dde3;
  margin-left: 10px;
  flex-shrink: 0;
  padding: 4px;
}
.star.starred { color: #f7b500; }

/* ---------- 文件夹：私密邮箱锁 ---------- */
.folder-lock {
  position: relative;
  display: inline-block;
  width: 11px;
  height: 8px;
  background: #aab2bd;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: 0;
}
.folder-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 6px;
  height: 5px;
  margin-left: -3.5px;
  border: 2px solid #aab2bd;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}
.folder-item.unlocked .folder-lock,
.folder-item.unlocked .folder-lock::before { background: #f7b500; border-color: #f7b500; }

/* ---------- 密码弹窗 ---------- */
.pwd-lockbox {
  width: 58px;
  height: 58px;
  background: #fff7e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.pwd-lock {
  position: relative;
  width: 18px;
  height: 13px;
  background: #f7b500;
  border-radius: 2px;
}
.pwd-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 9px;
  height: 7px;
  margin-left: -5.5px;
  border: 2px solid #f7b500;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
}
.pwd-tip {
  font-size: 13px;
  color: #98a1ac;
  margin: 8px 0 16px;
}
.pwd-input {
  display: block;
  width: 100%;
  height: 42px;
  border: 1px solid #dce1e8;
  border-radius: 8px;
  background: #f7f9fc;
  font-size: 16px;
  color: #333;
  padding: 0 14px;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
  -webkit-user-select: text;
  user-select: text;
}
.pwd-input:focus { border-color: #3478f7; background: #fff; }
/* 退信密码输对后：输入框被“占据”，红字斜体（与退信末句同一视觉语言） */
.pwd-input.haunted {
  color: #d81f1f;
  font-style: italic;
  font-weight: bold;
  font-family: "SimSun", "宋体", "STSong", "Songti SC", serif;
  font-size: 18px;
  border-color: #d81f1f;
  background: #fff;
  cursor: default;
}
.pwd-error {
  display: none;
  font-size: 12px;
  color: #f4443a;
  margin-top: 8px;
}
.pwd-error.show { display: block; }
/* 软键盘弹出时上移，避免遮挡 */
#layer-password.kb {
  align-items: flex-start;
  padding-top: 12%;
}
.layer.show .pwd-card.error-shake { animation: shake 0.4s ease-out; }

/* ---------- 子长私密邮箱密码弹窗：两行"怨言" ----------
   顶行红字：玩家点进输入框后开始闪烁
   底行黑斜体：玩家点进输入框后马上变红 */
.pwd-haunt-top {
  display: none;
  color: #e02a2a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.pwd-haunt-bottom {
  display: none;
  color: #222;
  font-size: 13px;
  font-weight: bold;
  font-style: italic;
  letter-spacing: 1px;
  margin-top: 18px;
}
.pwd-haunt-top.blink { animation: pwdHauntBlink 0.7s steps(1, end) infinite; }
.pwd-haunt-bottom.turned-red { color: #e02a2a; }
@keyframes pwdHauntBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- 图片占位框（照片待添加） ---------- */
.img-placeholder {
  border: 2px dashed #d5dbe3;
  border-radius: 10px;
  background: #f7f9fc;
  padding: 46px 16px;
  text-align: center;
  color: #b8bdc4;
  font-size: 13px;
}
.img-placeholder::before {
  content: "";
  display: block;
  width: 44px;
  height: 34px;
  margin: 0 auto 12px;
  border: 2px solid #ccd2da;
  border-radius: 4px;
  position: relative;
  background:
    radial-gradient(4px 4px at 70% 32%, #ccd2da 47%, transparent 50%),
    linear-gradient(to top, #ccd2da 36%, transparent 38%);
}
.img-placeholder p { line-height: 1.6; }

/* ==================== 邮件列表（数据驱动渲染） ==================== */
.mail-item.deco { cursor: pointer; }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  background: #fff;
  flex-shrink: 0;
}
.pager-btn {
  color: #aab2bd;
  font-size: 16px;
  padding: 4px 14px;
}
.pager-btn:active { opacity: 0.5; }
.pager-cur {
  color: #3478f7;
  font-size: 13px;
  font-weight: bold;
}

/* ---------- 底栏 ---------- */
.footbar {
  background: #fff;
  border-top: 1px solid #ececec;
  color: #b8bdc4;
  font-size: 11px;
  text-align: center;
  padding: 7px 0;
  padding-bottom: calc(7px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  flex-shrink: 0;
}
.foot-logo { color: #98a1ac; }

/* ==================== 邮件详情视图 ==================== */
.detail-view {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #fff;
  z-index: 20;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateX(4%);
  transition: transform 0.25s ease-out, opacity 0.25s ease-out, visibility 0.25s;
}
.detail-view.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}
.detail-bar {
  background: #3478f7;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 50px;
}
.btn-back {
  color: #fff;
  font-size: 14px;
  padding: 8px 10px 8px 14px;
}
.btn-back:active { opacity: 0.6; }
.detail-bar-title {
  color: #fff;
  font-size: 15px;
}
.detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; /* 增强，61 忽略 */
  padding: 18px 16px 40px;
}
.detail-subject {
  font-size: 19px;
  line-height: 1.5;
  color: #222;
  font-weight: bold;
}
.detail-meta {
  display: flex;
  align-items: center;
  margin-top: 14px;
}
.detail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #3478f7;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-meta-text {
  margin-left: 10px;
  min-width: 0;
}
.detail-from { font-size: 14px; color: #333; font-weight: bold; }
.detail-time { font-size: 11px; color: #aab2bd; margin-top: 2px; }
.detail-to {
  display: none;
  font-size: 12px;
  color: #98a1ac;
  margin-top: 10px;
}
.detail-to.show { display: block; }
.detail-note {
  font-size: 12px;
  color: #98a1ac;
  margin-bottom: 10px;
}
.detail-divider {
  height: 1px;
  background: #ececec;
  margin: 16px 0;
}
.detail-content {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
}
.detail-content p { margin-bottom: 14px; }
.detail-content p:last-child { margin-bottom: 0; }

/* ---------- 退回邮件详情 ---------- */
/* 第一行红字系统警告条 */
.bounce-warn {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  background: rgba(224, 42, 42, 0.05);
  border: 1px solid rgba(224, 42, 42, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
.bounce-warn-icon {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  font-style: normal;
  font-weight: bold;
  text-align: center;
  width: 20px;
  height: 20px;
  line-height: 20px;
  font-size: 13px;
  color: #fff;
  background: #e02a2a;
  border-radius: 50%;
  margin: 2px 10px 0 0;
}
.detail-content .bounce-warn-main {
  color: #d81f1f;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 2px;
}
.detail-content .bounce-warn-sub {
  color: #b05555;
  font-size: 12px;
  margin-bottom: 0;
}
/* 末句：红字 · 斜体 · 加粗（呼应黑底红字信件） */
.detail-content .bounce-final {
  color: #ff0000;
  font-weight: bold;
  font-style: italic;
  font-family: "SimSun", "宋体", "STSong", "Songti SC", serif;
  font-size: 20px;
  line-height: 1.9;
  margin-top: 28px;
}

/* ==================== 弹窗层 ==================== */
.layer {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease-out, visibility 0.22s;
  z-index: 30;
}
.layer.show { visibility: visible; opacity: 1; }
.mask {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.5);
}
.card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 330px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transform: scale(0.92);
  transition: transform 0.22s ease-out;
}
.layer.show .card { transform: scale(1); }
.card-title {
  font-size: 18px;
  color: #222;
  font-weight: bold;
}

/* ---------- 顶栏用户名 ---------- */
.top-user {
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  margin-left: 14px;
  padding: 6px 2px;
}

/* ==================== 登录页 ==================== */
.view-login {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, #eef3fb 0%, #f7f9fc 55%, #ffffff 100%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 34px;
  padding-top: calc(30px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease-out, visibility 0.3s;
}
.view-login.hide-view {
  visibility: hidden;
  opacity: 0;
}
/* 登录页左上角「返回桌面」（从桌面打开邮箱时显示） */
.login-back-btn {
  position: absolute;
  top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  left: 6px;
  z-index: 5;
  border: none;
  background: none;
  color: #3478f7;
  font-size: 15px;
  padding: 8px 10px 8px 12px;
  white-space: nowrap;
}
.login-back-btn:active { opacity: 0.6; }
.login-box { width: 100%; max-width: 320px; }
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo-icon {
  width: 28px; height: 20px; border-width: 2.5px; margin-right: 10px;
  /* 登录页是浅色背景,覆盖顶栏默认白色,改用品牌蓝 */
  border-color: #3478f7;
}
.login-logo-icon::before,
.login-logo-icon::after { background: #3478f7; }
.login-brand {
  font-size: 26px;
  font-weight: bold;
  color: #3478f7;
  letter-spacing: 2px;
}
.login-sub {
  text-align: center;
  color: #98a1ac;
  font-size: 12px;
  margin: 10px 0 40px;
}
/* ---------- 登录表单 ---------- */
.login-form { margin-top: 6px; }
.login-field {
  position: relative;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  display: flex;
  align-items: center;
  height: 50px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(52, 120, 247, 0.05);
}
.login-field.error { border-color: #f4443a; }
.login-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  color: #333;
  padding: 0 48px 0 46px;
  -webkit-user-select: text;
  user-select: text;
  font-family: inherit;
}
/* 账号图标（人形） */
.field-user-icon {
  position: absolute;
  left: 15px;
  top: 16px;
  width: 17px;
  height: 18px;
}
.field-user-icon::before {
  content: "";
  position: absolute;
  left: 4.5px; top: 0;
  width: 8px; height: 8px;
  background: #98a1ac;
  border-radius: 50%;
}
.field-user-icon::after {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 17px; height: 8px;
  background: #98a1ac;
  border-radius: 8px 8px 0 0;
}
/* 密码图标（锁形） */
.field-lock-icon {
  position: absolute;
  left: 15px;
  top: 19px;
  width: 14px;
  height: 10px;
  background: #98a1ac;
  border-radius: 2px;
}
.field-lock-icon::before {
  content: "";
  position: absolute;
  left: 2px; top: -7px;
  width: 8px; height: 7px;
  border: 2px solid #98a1ac;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}
/* 小眼睛（显示/隐藏密码） */
.eye-btn {
  position: absolute;
  right: 4px;
  top: 7px;
  width: 40px;
  height: 36px;
}
.eye-btn:active { opacity: 0.5; }
.eye-icon {
  position: absolute;
  left: 11px;
  top: 12px;
  width: 18px;
  height: 11px;
  border: 2px solid #98a1ac;
  border-radius: 50%;
}
.eye-icon::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 4px; height: 4px;
  margin: -2px 0 0 -2px;
  background: #98a1ac;
  border-radius: 50%;
}
/* 隐藏状态：斜杠盖住眼睛 */
.eye-btn::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 17px;
  width: 25px;
  height: 2px;
  background: #f4443a;
  transform: rotate(-45deg);
  border-radius: 1px;
}
.eye-btn.showing::after { display: none; }
.login-error {
  display: none;
  font-size: 12px;
  color: #f4443a;
  text-align: left;
  margin: -4px 0 12px 4px;
}
.login-error.show { display: block; }
.login-box.error-shake { animation: shake 0.4s ease-out; }
.login-links {
  text-align: center;
  color: #b8bdc4;
  font-size: 12px;
  margin-top: 18px;
}
.login-links span { padding: 6px 4px; }
.login-links span:active { opacity: 0.5; }
.login-links i {
  font-style: normal;
  color: #e0e4ea;
  margin: 0 6px;
}
/* 登录页"返回主页"按钮：稍微加点视觉权重，让玩家意识到这是个出口 */
.login-links .login-back-home {
  color: #3478f7;
  font-weight: 600;
}
.login-links .login-back-home:active { opacity: 0.5; }
/* 登录按钮 loading */
.btn-spin {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}
.btn.loading .btn-spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  border-radius: 22px;
  padding: 11px 34px;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.7; }
.btn-block { display: block; width: 100%; }
.btn-primary {
  background: #3478f7;
  color: #fff;
}
.btn-ghost {
  background: #f2f3f5;
  color: #666;
}
.btn-danger {
  background: #f4443a;
  color: #fff;
}

/* ---------- 游玩须知 ---------- */
.notice-flag {
  width: 4px;
  height: 22px;
  background: #3478f7;
  border-radius: 2px;
  margin: 0 auto 12px;
}
.notice-body {
  margin: 14px 2px 22px;
  text-align: left;
}
.notice-body p {
  font-size: 13.5px;
  color: #666;
  line-height: 1.7;
  margin-bottom: 6px;
}
.notice-body p:last-child { margin-bottom: 0; }

/* ---------- 匿名邮件询问 ---------- */
.ask-icon {
  width: 58px;
  height: 58px;
  background: #eaf1ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.ask-envelope {
  position: relative;
  width: 26px;
  height: 18px;
  border: 2px solid #3478f7;
  border-radius: 2px;
}
.ask-envelope::before,
.ask-envelope::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 2px;
  height: 12px;
  background: #3478f7;
}
.ask-envelope::before { left: 4px; transform: rotate(30deg); }
.ask-envelope::after { right: 4px; transform: rotate(-30deg); }
.ask-text {
  font-size: 16px;
  color: #333;
  line-height: 1.7;
  margin-bottom: 22px;
}
.ask-actions {
  display: flex;
  justify-content: center;
}
.ask-actions .btn-ghost { margin-right: 16px; }

/* ---------- 系统出错 ---------- */
.error-icon {
  width: 56px;
  height: 56px;
  background: #fdecea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  position: relative;
}
.ex-line1,
.ex-line2 {
  position: absolute;
  width: 4px;
  height: 24px;
  background: #f4443a;
  border-radius: 2px;
}
.ex-line1 { transform: rotate(45deg); }
.ex-line2 { transform: rotate(-45deg); }
.error-text {
  font-size: 16px;
  color: #333;
  font-weight: bold;
  margin-bottom: 20px;
}
.layer.show .error-card { animation: shake 0.4s ease-out; }
@keyframes shake {
  0%, 100% { transform: scale(1) translateX(0); }
  20% { transform: scale(1) translateX(-7px); }
  40% { transform: scale(1) translateX(7px); }
  60% { transform: scale(1) translateX(-5px); }
  80% { transform: scale(1) translateX(5px); }
}

/* ---------- 黑底红字信件 ---------- */
.layer-letter {
  background: #000;
  z-index: 40;
  padding: 0;
}
.layer-letter .letter-inner {
  width: 100%;
  padding: 0 26px;
}
.letter-text {
  font-family: "SimSun", "宋体", "STSong", "Songti SC", serif;
  font-size: 26px;
  line-height: 2;
  text-align: center;
  color: #ff0000;
  font-weight: bold;
  font-style: italic;
  word-break: break-all;
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 4px rgba(255, 0, 0, 0.7),
    0 0 14px rgba(255, 0, 0, 0.35);
  /* 字本身不再有动画，只保留稳定的红字红影 */
}
/* 破碎马赛克叠层：更大、更密、更快地闪烁；覆盖在文字之上可"挡住"文字 */
.letter-mosaic {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.letter-mosaic i {
  position: absolute;
  background: #ff0000;
  opacity: 0;
  animation: mosaicBlink 0.55s steps(1, end) infinite;
  box-shadow: 0 0 3px rgba(255, 0, 0, 0.7);
}
@keyframes mosaicBlink {
  0%   { opacity: 0; }
  10%  { opacity: 0.95; }
  25%  { opacity: 0; }
  50%  { opacity: 0.85; }
  70%  { opacity: 0; }
  85%  { opacity: 0.6; }
  100% { opacity: 0; }
}
.letter-close {
  position: absolute;
  top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  left: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  z-index: 2;
}
.letter-close:active { background: rgba(255, 255, 255, 0.15); }
.x-line1,
.x-line2 {
  position: absolute;
  left: 50%; top: 50%;
  width: 14px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.9);
  margin: -0.75px 0 0 -7px;
}
.x-line1 { transform: rotate(45deg); }
.x-line2 { transform: rotate(-45deg); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(72px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 22, 28, 0.88);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 6px;
  padding: 9px 16px;
  max-width: 78%;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
  z-index: 80;
}
.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 宽屏增强（PC 模拟器） ---------- */
@media (min-width: 720px) {
  .mail-wrap {
    flex-direction: row;
  }
  .folders {
    flex-direction: column;
    border-bottom: none;
    border-right: 1px solid #ececec;
    width: 150px;
    flex-shrink: 0;
    overflow-y: auto;
  }
  .folder-item {
    border-bottom: none;
    border-left: 3px solid transparent;
    padding: 13px 16px;
  }
  .folder-item.active {
    border-left-color: #3478f7;
    background: #f0f6ff;
  }
}

/* ============================================================
   电脑桌面（汉武OS）· 退出邮箱后可见
   ============================================================ */
#app.app-hidden { display: none; }

.view-desktop {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 60;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease-out, visibility 0.3s;
  background-color: #070b1c;
  background-image:
    radial-gradient(1.5px 1.5px at 22px 34px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 96px 118px, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 168px 58px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 214px 176px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 126px 208px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 48px 232px, rgba(255, 255, 255, 0.6), transparent),
    linear-gradient(180deg, #0a1030 0%, #151d4a 48%, #070b1c 100%);
  background-size:
    260px 260px, 260px 260px, 260px 260px,
    260px 260px, 260px 260px, 260px 260px, 100% 100%;
}
.view-desktop.show {
  visibility: visible;
  opacity: 1;
}

/* ---------- 状态栏 ---------- */
.ds-statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40px;
  padding: 0 20px;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}
.ds-brand { letter-spacing: 1px; }
.ds-status-right {
  display: flex;
  align-items: center;
}
.ds-time { font-size: 13px; font-weight: bold; }
.ds-battery {
  display: inline-block;
  width: 23px;
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  position: relative;
  margin-left: 10px;
}
.ds-battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 2px;
  width: 2px;
  height: 5px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 1px 1px 0;
}
.ds-battery i {
  display: block;
  position: absolute;
  top: 1px;
  left: 1px;
  bottom: 1px;
  width: 68%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}

/* ---------- 图标网格 ---------- */
.ds-icons {
  position: absolute;
  top: 64px; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  padding: 6px 14px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ds-app {
  width: 23%;
  max-width: 104px;
  padding: 10px 4px;
  text-align: center;
}
.ds-app:active .ds-icon { opacity: 0.75; }
.ds-icon {
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  font-size: 26px;
  line-height: 54px;
  text-align: center;
}
.ds-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  border-radius: 9px;
  background: #e02a2a;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  text-align: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.ds-name {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   桌面应用通用窗口
   ============================================================ */
.app-view {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 70;
  background: #f4f5f7;
  visibility: hidden;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
  display: flex;
  flex-direction: column;
}
.app-view.show {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
}
.app-bar {
  position: relative;
  flex-shrink: 0;
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #ececec;
  display: flex;
  align-items: center;
  padding-left: 2px;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
}
.app-close {
  min-width: 46px;
  max-width: 130px;
  height: 46px;
  border: none;
  background: none;
  font-size: 15px;
  color: #333;
  line-height: 46px;
  padding: 0 10px 0 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.app-close:active { opacity: 0.5; }
.app-bar-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: #222;
  font-weight: bold;
}
.app-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(30px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}
/* 详情标题 / 元信息 / 正文（新闻 · 记事本共用） */
.record-title {
  font-size: 20px;
  line-height: 1.5;
  color: #1a1a1a;
  font-weight: bold;
  padding: 8px 16px 6px;
}
.news-meta {
  font-size: 12px;
  color: #98a1ac;
  padding: 0 16px;
}
.record-body {
  font-size: 15px;
  line-height: 1.9;
  color: #444;
  padding: 14px 16px 10px;
}
.record-body p { margin-bottom: 14px; }
.record-body p:last-child { margin-bottom: 0; }

/* ============================================================
   长安新闻
   ============================================================ */
.news-head {
  background: #fff;
  margin: 10px 12px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
}
.news-head:active { opacity: 0.85; }
.news-head-img {
  position: relative;
  height: 148px;
  background: linear-gradient(135deg, #232c54 0%, #101636 55%, #0a0f24 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-head-img .news-watermark {
  color: rgba(255, 255, 255, 0.16);
  font-size: 46px;
  font-weight: bold;
  letter-spacing: 10px;
  text-indent: 10px;   /* 抵消最后一个字的字距，视觉居中 */
}
.news-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  background: #e02a2a;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 3px;
}
.news-head-title {
  font-size: 17px;
  line-height: 1.55;
  color: #222;
  font-weight: bold;
  padding: 12px 14px 4px;
}
.news-row {
  background: #fff;
  margin: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  padding: 12px 14px;
}
.news-row:active { opacity: 0.85; }
.news-row-indent {
  margin-left: 24px;
  margin-right: 12px;
  background: #fafbfd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.news-section-head {
  background: linear-gradient(90deg, #3478f7, #4f8df7);
  color: #fff;
  margin: 14px 12px 0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(52, 120, 247, 0.18);
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 1px;
}
.news-section-head:active { opacity: 0.9; }
/* 板块标签（纯展示）：不可点开,原空"新闻汇总"页已删除 */
.news-section-head.news-section-label {
  pointer-events: none;
}
.news-section-flag { flex: 1; }
.news-section-arrow { font-size: 22px; font-weight: normal; opacity: 0.85; }
.news-row-text { flex: 1; min-width: 0; }
.news-row-text h3 {
  font-size: 15px;
  line-height: 1.5;
  color: #333;
  font-weight: bold;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   记事本
   ============================================================ */
.note-row {
  background: #fff;
  margin: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  padding: 13px 15px;
}
.note-row:active { opacity: 0.85; }
/* 伪装工作日志:点了无任何按压反馈 */
.note-row-locked:active { opacity: 1; }

/* 最近删除入口（列表底部） */
.note-trash-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 12px 24px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}
.note-trash-entry:active { opacity: 0.85; }
.note-trash-label {
  font-size: 15px;
  font-weight: bold;
  color: #333;
}
.note-trash-arrow {
  font-size: 18px;
  color: #b6bec9;
}
.note-row h3 {
  font-size: 15px;
  color: #333;
  font-weight: bold;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-row p {
  font-size: 13px;
  color: #98a1ac;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   精神科门诊病历（证明纸张样式）
   ============================================================ */
.diag-paper {
  background: #fffefb;
  border: 1px solid #e8e4da;
  border-radius: 4px;
  padding: 22px 16px 26px;
  margin: 6px 2px 18px;
  font-family: "SimSun", "宋体", "STSong", "Songti SC", serif;
  color: #2a2a2a;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.diag-hosp-name {
  text-align: center;
  font-size: 21px;
  font-weight: bold;
  color: #1c2b6b;
  letter-spacing: 5px;
  font-family: "SimHei", "黑体", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.diag-redline {
  height: 3px;
  background: #c9342e;
  margin: 10px 0 14px;
  border-radius: 1px;
}
.diag-info {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}
.diag-info td {
  width: 50%;
  padding: 3px 4px 3px 0;
  line-height: 1.7;
  vertical-align: top;
  word-break: break-all;
}
.diag-label {
  font-weight: bold;
  font-size: 13.5px;
  margin: 12px 0 2px;
}
.diag-text {
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 2px;
}
.diag-text.diag-strong { font-weight: bold; }
.diag-rx {
  border: 1px dashed #b8b2a6;
  border-radius: 4px;
  padding: 10px 12px;
  margin: 14px 0 4px;
}
.diag-sign {
  text-align: right;
  margin-top: 20px;
  padding-right: 44px;
  font-size: 14px;
}
.diag-doctor {
  font-family: "KaiTi", "楷体", "STKaiti", serif;
  font-size: 21px;
  font-style: italic;
  letter-spacing: 2px;
}
.diag-tips {
  font-size: 11px;
  color: #8a8478;
  line-height: 1.8;
  margin-top: 14px;
  border-top: 1px dashed #e0dbd0;
  padding-top: 10px;
}
/* 红色圆章：盖在签名区附近，微倾斜 */
.diag-seal {
  position: absolute;
  right: 12px;
  bottom: 70px;
  width: 128px;
  height: 128px;
  opacity: 0.82;
  transform: rotate(-12deg);
  pointer-events: none;
}

/* ============================================================
   汉武智通（企业通讯）
   ============================================================ */
.chat-row {
  background: #fff;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f1f3;
}
.chat-row:active { background: #f7f8fa; }
.chat-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5b8def, #3e6fd9);
  color: #fff;
  font-size: 17px;
  font-weight: bold;
  line-height: 44px;
  text-align: center;
  margin-right: 12px;
}
.chat-row-text { flex: 1; min-width: 0; }
.chat-row-name {
  font-size: 15px;
  color: #222;
  font-weight: bold;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-row-preview {
  font-size: 13px;
  color: #98a1ac;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-row-right {
  flex-shrink: 0;
  margin-left: 10px;
  text-align: right;
}
.chat-row-time {
  font-size: 11px;
  color: #b6bec9;
  display: block;
  margin-bottom: 4px;
}
.chat-dot {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  background: #e02a2a;
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 0 4px;
}
/* 聊天窗口（占位） */
.chat-window {
  background: #fff;
  margin: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  padding: 16px;
}
.chat-peer {
  font-size: 16px;
  font-weight: bold;
  color: #222;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f1f3;
}
.chat-empty {
  padding: 34px 10px 30px;
  text-align: center;
  color: #b6bec9;
  font-size: 13px;
}

/* ---- 智通会话列表：置顶标识 / 不可点会话 ---- */
.chat-pin {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e8f0fe;
  color: #5b8def;
  font-size: 10px;
  font-weight: normal;
  line-height: 15px;
  vertical-align: 1px;
}
.chat-row-locked:active { background: #fff; }   /* 点了无任何反应 */

/* ============================================================
   浏览器应用：装饰搜索栏 + 静态历史记录
   ============================================================ */
.browser-search {
  display: flex;
  align-items: center;
  margin: 14px 16px 6px;
  padding: 0 12px;
  height: 38px;
  border-radius: 19px;
  background: #f2f3f5;
}
.browser-search-icon {
  width: 13px;
  height: 13px;
  border: 2px solid #9aa3ae;
  border-radius: 50%;
  position: relative;
  margin-right: 10px;
  flex-shrink: 0;
}
.browser-search-icon::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 2px;
  background: #9aa3ae;
  border-radius: 1px;
  transform: rotate(45deg);
  bottom: -2px;
  right: -6px;
}
.browser-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #222;
  outline: none;
  -webkit-text-fill-color: #9aa3ae;   /* disabled 状态字色发灰 */
}
.browser-sec-title {
  padding: 10px 16px 8px;
  font-size: 13px;
  color: #98a1ac;
  font-weight: normal;
}
.browser-hist-row {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f1f3;
}
.browser-hist-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8f0fe;
  margin-right: 12px;
  position: relative;
  flex-shrink: 0;
}
.browser-hist-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #5b8def;
}
.browser-hist-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 0;
  border-left: 1px solid #5b8def;
}
.browser-hist-text { flex: 1; min-width: 0; }
.browser-hist-title {
  font-size: 14px;
  color: #333;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browser-hist-date {
  font-size: 11px;
  color: #b6bec9;
}

/* ============================================================
   桌面应用图标（CSS 矢量绘制，避免 emoji 字体缺失）
   ============================================================ */
.ds-icon i[class^="ico-"] {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}
/* 邮箱：信封 */
.ico-mail {
  width: 30px; height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 3px;
}
.ico-mail::before {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-bottom: 14px solid rgba(255, 255, 255, 0.9);
}
/* 记事本：三条线 */
.ico-notes {
  width: 28px; height: 22px;
}
.ico-notes::before, .ico-notes::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
}
.ico-notes::before { top: 3px; box-shadow: 0 7px 0 rgba(255,255,255,0.9), 0 14px 0 rgba(255,255,255,0.9); }
.ico-notes::after { top: 24px; }
/* 新闻：报纸 */
.ico-news {
  width: 26px; height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.85) 2px, transparent 2px) 4px 5px / 7px 2px no-repeat,
              linear-gradient(to bottom, rgba(255,255,255,0.6) 2px, transparent 2px) 14px 5px / 9px 2px no-repeat,
              linear-gradient(to bottom, rgba(255,255,255,0.6) 2px, transparent 2px) 4px 10px / 19px 2px no-repeat,
              linear-gradient(to bottom, rgba(255,255,255,0.6) 2px, transparent 2px) 4px 15px / 19px 2px no-repeat;
}
/* 智通：对话气泡 */
.ico-chat {
  width: 28px; height: 22px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 5px;
}
.ico-chat::before {
  content: "";
  position: absolute;
  left: 6px; bottom: -5px;
  border-left: 5px solid transparent;
  border-top: 7px solid rgba(255, 255, 255, 0.9);
}
.ico-chat::after {
  content: "";
  position: absolute;
  top: 5px; left: 5px;
  width: 18px; height: 2px;
  background: #3b4c8a;
  box-shadow: 0 5px 0 #3b4c8a;
}
/* 相机 */
.ico-camera {
  width: 28px; height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}
.ico-camera::before {
  content: "";
  position: absolute;
  top: 2px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 4px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px 2px 0 0;
}
.ico-camera::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 9px; height: 9px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
/* 电话 */
.ico-phone {
  width: 24px; height: 24px;
  transform: rotate(-30deg);
}
.ico-phone::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 16px;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
}
.ico-phone::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
}
/* 相册：风景 */
.ico-gallery {
  width: 30px; height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  overflow: hidden;
}
.ico-gallery::before {
  content: "";
  position: absolute;
  right: 4px; top: 4px;
  width: 5px; height: 5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
.ico-gallery::after {
  content: "";
  position: absolute;
  bottom: -5px; left: -2px;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-bottom: 16px solid rgba(255, 255, 255, 0.6);
}
/* 浏览器：地球 */
.ico-browser {
  width: 26px; height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
.ico-browser::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.9);
}
.ico-browser::after {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 2px;
  margin-top: -1px;
  background: rgba(255, 255, 255, 0.9);
}
/* 设置：齿轮 */
.ico-settings {
  width: 24px; height: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
.ico-settings::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}
/* 音乐：音符 */
.ico-music {
  width: 22px; height: 24px;
}
.ico-music::before {
  content: "";
  position: absolute;
  bottom: 2px; left: 2px;
  width: 8px; height: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 10px -5px 0 rgba(255, 255, 255, 0.9);
}
.ico-music::after {
  content: "";
  position: absolute;
  bottom: 9px; left: 10px;
  width: 2px; height: 13px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 10px -5px 0 rgba(255, 255, 255, 0.9);
}

/* ============================================================
   App 内登录卡片（记事本 / 汉武智通）
   ============================================================ */
.app-login-card {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 300px;
  margin: 56px auto 0;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.app-login-lock {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: #3478f7;
}
.app-login-lock::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 12px;
  border: 2.5px solid #fff;
  border-bottom: none;
  border-radius: 9px 9px 0 0;
}
.app-login-lock::after {
  content: "";
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 18px;
  background: #fff;
  border-radius: 4px;
}
.app-login-title {
  font-size: 18px;
  color: #222;
  font-weight: bold;
  margin-bottom: 6px;
}
.app-login-tip {
  font-size: 12px;
  color: #98a1ac;
  margin-bottom: 18px;
}
.app-login-input {
  width: 100%;
  height: 42px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  -webkit-appearance: none;
  background: #fafbfc;
}
.app-login-input:focus {
  border-color: #3478f7;
  background: #fff;
}
.app-login-error {
  color: #e02a2a;
  font-size: 12px;
  margin: -2px 0 10px;
  visibility: hidden;
  min-height: 14px;
}
.app-login-error.show {
  visibility: visible;
}
/* 记事本连错3次的特殊提示:红色斜体 */
.app-login-error.hint-italic-red {
  color: #e02a2a;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 1px;
}
/* App 顶栏右侧动作按钮（退出登录） */
.app-bar-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #3478f7;
  font-size: 13px;
  padding: 8px 10px;
}
.app-bar-action:active {
  opacity: 0.5;
}

/* ============================================================
   聊天记录气泡
   ============================================================ */
.chat-msgs {
  padding-top: 4px;
}
.chat-line {
  display: flex;
  margin: 8px 0;
}
.chat-line.me {
  justify-content: flex-end;
}
.chat-line.peer {
  justify-content: flex-start;
}
.chat-bubble {
  max-width: 76%;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-all;
}
.chat-bubble.me {
  background: #3478f7;
  color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-bubble.peer {
  background: #fff;
  color: #333;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.chat-divider {
  text-align: center;
  color: #b0b8c4;
  font-size: 11px;
  margin: 16px 0 10px;
}
.chat-divider.chat-sys {
  color: #98a1ac;
}

/* 「我恨您」消息旁的复制按钮 */
.chat-line.me {
  align-items: center;
}
.chat-line.peer {
  align-items: center;
}
.chat-copy-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d0d6df;
  border-radius: 50%;
  background: #fff;
  margin: 0 8px;
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.chat-copy-btn:active { background: #eef3fb; }
.chat-copy-btn::before,
.chat-copy-btn::after {
  content: '';
  position: absolute;
  background: #5b6573;
}
.chat-copy-btn::before {
  /* 左侧方块 */
  width: 10px; height: 10px;
  left: 5px; top: 5px;
  border: 1.5px solid #5b6573;
  background: transparent;
  border-radius: 1px;
}
.chat-copy-btn::after {
  /* 右侧方块（叠在左方块右下角） */
  width: 10px; height: 10px;
  right: 5px; bottom: 5px;
  border: 1.5px solid #5b6573;
  background: #fff;
  border-radius: 1px;
}

/* 屏幕中央大字「已复制」反馈 */
#center-tip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 26px;
  font-weight: bold;
  padding: 18px 30px;
  border-radius: 14px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  letter-spacing: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}
#center-tip.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- 彩蛋：连续点"否"后的满屏系统错误 ---------- */
.layer-easter-error {
  background: #000;
  z-index: 45;
  padding: 0;
  display: block;
}
.easter-error-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 4px;
}
.easter-row {
  font-family: "SimSun", "宋体", "STSong", "Songti SC", serif;
  font-size: 28px;
  line-height: 1.4;
  font-weight: bold;
  font-style: italic;
  color: #ff0000;
  letter-spacing: 4px;
  white-space: nowrap;
  animation: easterShake 0.45s steps(2, end) infinite;
  text-align: center;
}
.easter-row:nth-child(3n) { font-size: 22px; opacity: 0.7; padding-left: 12px; }
.easter-row:nth-child(5n) { font-size: 32px; color: #c00000; padding-left: -10px; }
.easter-row:nth-child(7n) { color: #ff4040; padding-left: 22px; }
@keyframes easterShake {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-1px, 1px); }
}

/* ============================================================
   红色雪花噪点：老电视机无信号频道效果（全红深浅条状）
   第3次起回桌面时整屏爆闪一帧：不透明、挡视线、挡操作
   ============================================================ */
#tv-static {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 94;            /* 桌面(60)/应用(70)/toast(80)/提示(90)之上,结局层(95+)之下 */
  display: none;
  background: #160000;
}
#tv-static.on { display: block; }

/* ============================================================
   结局：结束了吗 → 快闪截图 → 黑屏红字 → 结语白页
   ============================================================ */
/* 最后一封退信底部的结局入口：带下划线的小红字 */
.detail-content .ending-hook {
  margin-top: 36px;
  text-align: center;
  color: #e02a2a;
  font-size: 13px;
  text-decoration: underline;
  letter-spacing: 1px;
  cursor: pointer;
}
.detail-content .ending-hook:active { opacity: 0.55; }

/* —— E1. 快闪层：游戏内"截图"（克隆的真实界面）+ 红色马赛克 —— */
#ending-flash {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #000;
  z-index: 95;
  display: none;
}
#ending-flash.on { display: block; }
#ending-shot {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  pointer-events: none;
}
#ending-shot > * { pointer-events: none; }
#ending-mosaic {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 999;
}
#ending-mosaic i {
  position: absolute;
  background: #ff0000;
  opacity: 0;
  animation: mosaicBlink 0.55s steps(1, end) infinite;
  box-shadow: 0 0 3px rgba(255, 0, 0, 0.7);
}

/* —— E2. 黑屏 + 两行红字（与黑底红字信件同一视觉语言） —— */
#ending-black {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #000;
  z-index: 96;
  display: none;
  opacity: 0;
  transition: opacity 1.1s ease-out;
}
#ending-black.on { display: block; }
#ending-black.faded { opacity: 1; }
#ending-lines {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 26px;
  text-align: center;
}
.ending-line {
  font-family: "SimSun", "宋体", "STSong", "Songti SC", serif;
  font-size: 24px;
  line-height: 2;
  color: #ff0000;
  font-weight: bold;
  font-style: italic;
  text-shadow:
    0 0 4px rgba(255, 0, 0, 0.7),
    0 0 14px rgba(255, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.9s ease-out;
  margin: 12px 0;
  word-break: break-all;
}
.ending-line.show { opacity: 1; }

/* —— E3. 结语白页（终幕） —— */
#ending-final {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #fff;
  z-index: 97;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#ending-final.on { display: block; }
.ending-final-title {
  font-size: 22px;
  font-weight: bold;
  color: #1a1a1a;
  text-align: center;
  letter-spacing: 12px;
  text-indent: 12px;   /* 抵消末字字距，视觉居中 */
  padding: 58px 0 10px;
}
.ending-final-body {
  padding: 20px 24px 90px;
  font-size: 15px;
  line-height: 2.1;
  color: #444;
}
.ending-final-body p { margin-bottom: 14px; }
.ending-final-body p:last-child { margin-bottom: 0; }
/* 分隔线 + 密码卡片 + 彩蛋行 */
.ending-divider {
  height: 1px;
  background: #e3e6ea;
  margin: 26px 0 22px;
}
.ending-code-card {
  background: #f7f8fa;
  border: 1px solid #eceef1;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}
.ending-code-card p {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.9;
}
.ending-code-card p:last-child { margin-bottom: 0; }
.ending-code-name {
  font-weight: bold;
  color: #222;
  letter-spacing: 1px;
}
.ending-egg { color: #666; }
