/* ╔══════════════════════════════════════════════════════╗
   ║  美屄App · Neo-Brutalism Pop Art + Phone Frame v5   ║
   ║  story   → 漫画叙事框（无手机壳）                     ║
   ║  appui   → 手机壳内App界面                           ║
   ║  chat    → 手机壳内聊天界面                           ║
   ║  app     → 手机壳内状态面板                           ║
   ╚══════════════════════════════════════════════════════╝ */


/* ═══════════════════════════════════════════
   📖 场景一：story · 叙事正文（无手机壳）
   ═══════════════════════════════════════════ */

story {
  display: block;
  margin: 20px auto;
  padding: 32px 24px 28px;
  background: #fdf6e3;
  border: 3px solid #0a0a0a;
  border-radius: 4px;
  box-shadow: 6px 6px 0 #0a0a0a;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}

story::before {
  content: "STORY";
  position: absolute;
  top: -14px;
  left: 18px;
  padding: 4px 14px;
  background: #ff3b7a;
  color: #fdf6e3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  border: 2px solid #0a0a0a;
  box-shadow: 2px 2px 0 #0a0a0a;
  transform: rotate(-2deg);
  z-index: 2;
  font-family: "Impact", "Arial Black", sans-serif;
}

story::after {
  content: "18+";
  position: absolute;
  top: -12px;
  right: 16px;
  padding: 3px 10px;
  background: #0a0a0a;
  color: #ffe14d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  border: 2px solid #0a0a0a;
  transform: rotate(3deg);
  z-index: 2;
  font-family: "Impact", "Arial Black", sans-serif;
}

story p {
  margin: 0 0 16px;
  padding: 0;
  text-indent: 2em;
  font-size: 15.5px;
  line-height: 1.9;
  color: #1a1a1a;
  font-family: "Noto Serif SC", "Source Han Serif CN", "STSong", Georgia, serif;
  font-weight: 500;
  box-sizing: border-box;
}

story p:last-child {
  margin-bottom: 0;
}

story p::selection {
  background: #ff3b7a;
  color: #fff;
}


/* ═══════════════════════════════════════════
   📱 手机外壳基础框架
   ═══════════════════════════════════════════ */

appui,
chat,
app {
  display: block;
  margin: 24px auto;
  padding: 0;
  background: #fdf6e3;
  border: 4px solid #0a0a0a;
  border-radius: 28px;
  box-shadow: 7px 7px 0 #0a0a0a;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  position: relative;
  box-sizing: border-box;
}

/* 手机顶部状态栏 */
appui::before,
chat::before,
app::before {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 24px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #0a0a0a;
  background: #ffe14d;
  border-bottom: 3px solid #0a0a0a;
  box-sizing: border-box;
  letter-spacing: 0.5px;
  font-family: "SF Pro Text", -apple-system, sans-serif;
}

appui::before {
  content: "⦿ MeiBi     ☰ 美屄App     ■ 82%";
}

chat::before {
  content: "⦿ MeiBi     💬 聊天     ■ 82%";
}

app::before {
  content: "⦿ MeiBi     📊 状态面板     ■ 82%";
}

/* Home Indicator */
appui::after,
chat::after {
  content: "";
  display: block;
  width: 130px;
  height: 5px;
  margin: 12px auto 10px;
  background: #0a0a0a;
  border-radius: 100px;
}


/* ═══════════════════════════════════════════
   📱 场景二：appui · App界面
   ═══════════════════════════════════════════ */

appui apptitle {
  display: block;
  padding: 16px 22px 12px;
  font-size: 18px;
  font-weight: 900;
  color: #0a0a0a;
  letter-spacing: -0.3px;
  border-bottom: 3px solid #0a0a0a;
  background: #fff;
  position: relative;
  text-transform: uppercase;
  box-sizing: border-box;
}

appui apptitle::after {
  content: "★";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #ff3b7a;
}

appui card {
  display: block;
  margin: 12px 16px;
  padding: 16px 18px;
  background: #fff;
  border: 3px solid #0a0a0a;
  border-radius: 4px;
  box-shadow: 4px 4px 0 #0a0a0a;
  position: relative;
  overflow: visible;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  box-sizing: border-box;
}

appui card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #0a0a0a;
}

appui card:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #0a0a0a;
}

appui card::before {
  position: absolute;
  top: -10px;
  right: -6px;
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  border: 2px solid #0a0a0a;
  box-shadow: 2px 2px 0 #0a0a0a;
  z-index: 2;
  font-family: "Impact", "Arial Black", sans-serif;
}

appui card:nth-of-type(1)::before {
  content: "HOT";
  background: #ff3b7a;
  color: #fff;
  transform: rotate(5deg);
}

appui card:nth-of-type(2)::before {
  content: "NEW";
  background: #3bc7ff;
  color: #0a0a0a;
  transform: rotate(-3deg);
}

appui card:nth-of-type(3)::before {
  content: "TOP";
  background: #ffe14d;
  color: #0a0a0a;
  transform: rotate(4deg);
}

appui card:nth-of-type(4)::before {
  content: "VIP";
  background: #b44dff;
  color: #fff;
  transform: rotate(-5deg);
}

appui card:nth-of-type(n+5)::before {
  content: "♥";
  background: #ff3b7a;
  color: #fff;
  transform: rotate(3deg);
}

appui card.profile {
  background: #ffe14d;
  border-width: 3px;
  padding: 20px;
  margin: 14px 16px;
}

appui card.profile::before {
  content: "PROFILE";
  background: #0a0a0a;
  color: #ffe14d;
  transform: rotate(-3deg);
  top: -11px;
  left: 14px;
  right: auto;
}

appui card p {
  margin: 0;
  box-sizing: border-box;
}

appui card .name {
  font-size: 17px;
  font-weight: 900;
  color: #0a0a0a;
  padding-bottom: 5px;
  letter-spacing: -0.3px;
}

appui card .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #ff3b7a;
  padding: 3px 0;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ff3b7a;
}

appui card .info {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  padding: 4px 0;
}

appui card .price {
  display: inline-block;
  font-size: 15px;
  font-weight: 900;
  color: #0a0a0a;
  padding: 6px 12px;
  margin-top: 8px;
  background: #ffe14d;
  border: 2px solid #0a0a0a;
  box-shadow: 2px 2px 0 #0a0a0a;
}

appui card .status {
  font-size: 13px;
  font-weight: 800;
  color: #0a0a0a;
  padding-top: 5px;
}

appui .bio {
  margin: 0 16px 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.75;
  color: #333;
  font-weight: 600;
  background: #fff;
  border: 2px solid #0a0a0a;
  border-left: 6px solid #ff3b7a;
  box-shadow: 3px 3px 0 #0a0a0a;
  font-style: italic;
  box-sizing: border-box;
}

appui item {
  display: block;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  border-bottom: 2px solid #0a0a0a;
  background: #fff;
  transition: all 0.12s ease;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}

appui item:hover {
  background: #ffe14d;
  padding-left: 28px;
}

appui item:hover::before {
  content: "→";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  color: #0a0a0a;
  font-size: 14px;
}

appui item:last-of-type {
  border-bottom: none;
}

appui item.no {
  color: #999;
  font-weight: 600;
  text-decoration: line-through;
  background: #f5f0e0;
  cursor: default;
}

appui item.no:hover {
  background: #f5f0e0;
  padding-left: 20px;
}

appui item.no:hover::before {
  content: none;
}

appui review {
  display: block;
  margin: 10px 16px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid #0a0a0a;
  box-shadow: 3px 3px 0 #0a0a0a;
  position: relative;
  box-sizing: border-box;
}

appui review::before {
  content: "REVIEW";
  position: absolute;
  top: -9px;
  left: 10px;
  padding: 2px 8px;
  background: #3bc7ff;
  color: #0a0a0a;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 2px;
  border: 2px solid #0a0a0a;
  font-family: "Impact", "Arial Black", sans-serif;
}

appui review .star {
  font-size: 14px;
  color: #0a0a0a;
  padding-bottom: 4px;
  margin: 0;
  font-weight: 900;
}

appui review .rev {
  font-size: 12px;
  color: #555;
  line-height: 1.65;
  font-style: italic;
  font-weight: 600;
  margin: 0;
}

appui sys {
  display: block;
  text-align: center;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 800;
  color: #0a0a0a;
  letter-spacing: 1px;
  background: #e8e2d0;
  border-top: 3px solid #0a0a0a;
  text-transform: uppercase;
  box-sizing: border-box;
}

appui .narr {
  margin: 10px 16px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.75;
  color: #555;
  font-style: italic;
  font-weight: 600;
  border-left: 4px solid #b44dff;
  background: #f8f4e8;
  font-family: "Noto Serif SC", Georgia, serif;
  box-sizing: border-box;
}

appui hr {
  border: none;
  height: 3px;
  background: #0a0a0a;
  margin: 0 16px;
}


/* ═══════════════════════════════════════════
   💬 场景三：chat · 聊天界面
   ═══════════════════════════════════════════ */

chat chathead {
  display: block;
  background: #fff;
  border-bottom: 3px solid #0a0a0a;
  box-sizing: border-box;
}

chat chathead p {
  margin: 0;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 900;
  color: #0a0a0a;
  text-align: center;
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

chat time {
  display: block;
  text-align: center;
  padding: 14px 0 6px;
  font-size: 11px;
  font-weight: 800;
  color: #aaa;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-sizing: border-box;
}

chat msg {
  display: block;
  padding: 4px 16px;
  margin: 0;
  clear: both;
  overflow: hidden;
  box-sizing: border-box;
}

chat msg p {
  display: inline-block;
  max-width: 72%;
  padding: 10px 16px;
  margin: 4px 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
  word-break: break-word;
  position: relative;
  border: 2px solid #0a0a0a;
  box-sizing: border-box;
}

chat .npc p {
  float: left;
  background: #fff;
  color: #1a1a1a;
  border-radius: 0 14px 14px 14px;
  box-shadow: 3px 3px 0 #0a0a0a;
}

chat .npc p::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -8px;
  width: 0;
  height: 0;
  border-top: 8px solid #0a0a0a;
  border-left: 8px solid transparent;
}

chat .npc p::after {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  width: 0;
  height: 0;
  border-top: 6px solid #fff;
  border-left: 6px solid transparent;
}

chat .user p {
  float: right;
  background: #3bc7ff;
  color: #0a0a0a;
  border-radius: 14px 0 14px 14px;
  box-shadow: 3px 3px 0 #0a0a0a;
}

chat .user p::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -8px;
  width: 0;
  height: 0;
  border-top: 8px solid #0a0a0a;
  border-right: 8px solid transparent;
}

chat .user p::after {
  content: "";
  position: absolute;
  top: 0;
  right: -5px;
  width: 0;
  height: 0;
  border-top: 6px solid #3bc7ff;
  border-right: 6px solid transparent;
}

chat sys {
  display: block;
  text-align: center;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 800;
  color: #aaa;
  font-style: italic;
  clear: both;
  letter-spacing: 1px;
  box-sizing: border-box;
}

chat .narr {
  display: block;
  clear: both;
  margin: 10px 14px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.75;
  color: #666;
  font-style: italic;
  font-weight: 600;
  border-left: 4px solid #b44dff;
  background: #f8f4e8;
  border-top: 2px solid #0a0a0a;
  border-bottom: 2px solid #0a0a0a;
  font-family: "Noto Serif SC", Georgia, serif;
  box-sizing: border-box;
}


/* ═══════════════════════════════════════════
   📊 状态栏：app
   ═══════════════════════════════════════════ */

app header {
  display: block;
  text-align: center;
  padding: 18px 16px 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #0a0a0a;
  background: #ffe14d;
  border-bottom: 3px solid #0a0a0a;
  text-transform: uppercase;
  box-sizing: border-box;
}

app details {
  border-bottom: 3px solid #0a0a0a;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

app details:last-child {
  border-bottom: none;
}

app details[open] {
  background: #f8f2dc;
}

app summary {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 900;
  color: #0a0a0a;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: all 0.12s ease;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

app summary::-webkit-details-marker {
  display: none;
}

app summary::after {
  content: "▶";
  position: absolute;
  right: 18px;
  font-size: 10px;
  color: #0a0a0a;
  transition: transform 0.2s ease;
}

app details[open] > summary::after {
  transform: rotate(90deg);
}

app summary:hover {
  background: #ffe14d;
}

app summary:active {
  background: #ffd200;
}

/* ── details 左边框色彩序列（合并后6个details） ── */
/*  1 = 👤 用户信息   */
app details:nth-of-type(1) summary {
  border-left: 6px solid #3bc7ff;
}
/*  2 = 📇 配对档案   */
app details:nth-of-type(2) summary {
  border-left: 6px solid #ff3b7a;
}
/*  3 = 💬 微信消息   */
app details:nth-of-type(3) summary {
  border-left: 6px solid #b44dff;
}
/*  4 = 🎭 当前交互NPC（合并后）  */
app details:nth-of-type(4) summary {
  border-left: 6px solid #ff3b7a;
}
/*  5 = 📋 记忆区     */
app details:nth-of-type(5) summary {
  border-left: 6px solid #b44dff;
}
/*  6 = 🎯 推荐选项   */
app details:nth-of-type(6) summary {
  border-left: 6px solid #ffe14d;
}

app p {
  margin: 0;
  padding: 8px 22px 8px 30px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  color: #333;
  border-bottom: 1px dashed #ccc;
  position: relative;
  transition: background 0.12s ease;
  box-sizing: border-box;
}

app p:last-child {
  border-bottom: none;
}

app p:hover {
  background: #ffe14d33;
}

app p.body {
  border-left: 4px solid #ff3b7a;
  padding-left: 26px;
  margin-left: 4px;
  background: #fff5f8;
}

app p.body:hover {
  background: #ffe0ea;
}

/* ── 🎭 NPC合并档案 · 分区标题 <sec> ── */

app sec {
  display: block;
  padding: 8px 22px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "Impact", "Arial Black", sans-serif;
  color: #fdf6e3;
  border-bottom: 2px solid #0a0a0a;
  position: relative;
  box-sizing: border-box;
}

app sec:nth-of-type(1) {
  background: #ff3b7a;
}

app sec:nth-of-type(2) {
  background: #b44dff;
  margin-top: 4px;
}

app sec:nth-of-type(3) {
  background: #3bc7ff;
  color: #0a0a0a;
  margin-top: 4px;
}

/* 推荐选项按钮样式（最后一个details） */
app details:last-of-type p {
  padding: 12px 20px;
  color: #0a0a0a;
  margin: 6px 14px;
  border: 2px solid #0a0a0a;
  box-shadow: 3px 3px 0 #0a0a0a;
  background: #fff;
  cursor: pointer;
  transition: all 0.12s ease;
  border-bottom: 2px solid #0a0a0a;
  font-weight: 800;
}

app details:last-of-type p:hover {
  background: #ffe14d;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #0a0a0a;
}

app details:last-of-type p:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #0a0a0a;
}

app details:last-of-type p:last-child {
  background: #f5f0e0;
  border: 2px dashed #aaa;
  box-shadow: none;
  font-style: italic;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-align: center;
  cursor: default;
}

app details:last-of-type p:last-child:hover {
  background: #f5f0e0;
  transform: none;
  box-shadow: none;
  color: #ff3b7a;
}

app ltm,
app stm {
  display: block;
  padding: 10px 22px 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: "Impact", "Arial Black", sans-serif;
  box-sizing: border-box;
}

app ltm {
  color: #0a0a0a;
  background: #b44dff;
  padding: 8px 22px;
}

app ltm::before {
  content: "💎 ";
}

app stm {
  color: #0a0a0a;
  background: #3bc7ff;
  margin-top: 6px;
  padding: 8px 22px;
}

app stm::before {
  content: "⚡ ";
}

app::after {
  content: "";
  display: block;
  width: 130px;
  height: 5px;
  margin: 14px auto 10px;
  background: #0a0a0a;
  border-radius: 100px;
}


/* ═══════════════════════════════════════════
   📐 移动端响应式
   ═══════════════════════════════════════════ */

@media (max-width: 480px) {
  story {
    margin: 14px 4px;
    padding: 26px 16px 22px;
    box-shadow: 4px 4px 0 #0a0a0a;
  }
  story p {
    font-size: 15px;
    line-height: 1.85;
  }
  story::before {
    top: -12px;
    left: 12px;
    font-size: 10px;
    padding: 3px 10px;
  }
  story::after {
    top: -10px;
    right: 12px;
    font-size: 9px;
    padding: 2px 8px;
  }
  appui,
  chat,
  app {
    margin: 16px 2px;
    border-radius: 22px;
    box-shadow: 5px 5px 0 #0a0a0a;
    border-width: 3px;
  }
  appui::before,
  chat::before,
  app::before {
    padding: 10px 18px 8px;
    font-size: 12px;
  }
  appui::after,
  chat::after,
  app::after {
    width: 110px;
    height: 4px;
    margin: 10px auto 8px;
  }
}


/* ═══════════════════════════════════════════
   🎬 动画
   ═══════════════════════════════════════════ */

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.85) rotate(-2deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.03) rotate(0.5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

appui card {
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

appui card:nth-of-type(2) {
  animation-delay: 0.08s;
}

appui card:nth-of-type(3) {
  animation-delay: 0.16s;
}

appui card:nth-of-type(4) {
  animation-delay: 0.24s;
}

chat .npc p {
  animation: slideRight 0.2s ease forwards;
}

chat .user p {
  animation: slideLeft 0.2s ease forwards;
}

app details[open] > p,
app details[open] > ltm,
app details[open] > stm,
app details[open] > sec {
  animation: slideRight 0.2s ease forwards;
}


/* ═══════════════════════════════════════════
   🛡️ 防掉美化兜底补丁
   ═══════════════════════════════════════════ */

story,
appui,
chat,
app {
  display: block;
  box-sizing: border-box;
}

story *,
appui *,
chat *,
app * {
  box-sizing: border-box;
}

appui p,
appui sys,
appui item,
appui card,
appui review,
appui apptitle,
chat p,
chat sys,
chat msg,
chat time,
chat chathead,
app p,
app ltm,
app stm,
app sec {
  box-sizing: border-box;
}

appui > p:not(.bio),
chat > p,
app > p {
  margin: 10px 16px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #0a0a0a;
  box-shadow: 3px 3px 0 #0a0a0a;
  color: #0a0a0a;
  font-weight: 700;
  line-height: 1.65;
}

app p.free {
  background: #f5f0e0;
  border: 2px dashed #aaa;
  box-shadow: none;
  font-style: italic;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-align: center;
  cursor: default;
}

app p.free:hover {
  background: #f5f0e0;
  transform: none;
  box-shadow: none;
  color: #ff3b7a;
}

app p.trigger {
  display: none;
}