/* ══════════════════════════════════════
   📱 手机外壳
   ══════════════════════════════════════ */
.phone-desktop {
  position: relative !important;
  overflow: hidden !important;
  background: linear-gradient(160deg, #c8d4e8 0%, #d8e0ec 40%, #e8eef5 100%);
  border: 8px solid #1a1d26;
  border-radius: 36px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.25),
    0 8px 20px rgba(0,0,0,0.15),
    inset 0 0 0 1px rgba(255,255,255,0.2);
  max-width: 380px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  height: 760px;
  color: #1a1d26;
}
.phone-status-bar {
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  font-size: 11px;
  color: #1a1d26;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
}
.phone-status-bar:first-of-type { border-radius: 28px 28px 0 0; }
.phone-status-bar:nth-of-type(2) { border-radius: 0; }
.phone-status-bar .time { font-size: 13px; font-weight: 700; }
.phone-phase-badge {
  background: linear-gradient(135deg, #3060c0, #5b8dee);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
  box-shadow: 0 2px 6px rgba(48,96,192,0.3);
}
.phone-location-row {
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 11px; color: #2d3436;
  display: flex; justify-content: space-between;
  padding: 6px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}
.phone-bottom-nav {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.5);
  font-size: 11px; font-weight: 700; text-align: center;
  padding: 10px 0 14px;
  position: absolute; bottom: 0; left: 0; width: 100%;
  box-sizing: border-box; z-index: 5;
}
.phone-bottom-nav::before {
  content: ""; display: block;
  width: 110px; height: 4px;
  background: rgba(26,29,38,0.6);
  border-radius: 2px; margin: 0 auto 6px;
}

/* ══════════════════════════════════════
   📲 桌面九宫格
   ══════════════════════════════════════ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
  padding: 24px 14px 60px;
  background: transparent;
}
.app-item { position: static; text-align: center; }
.app-item > summary {
  list-style: none;
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
  cursor: pointer; user-select: none; padding: 0;
}
.app-item > summary::-webkit-details-marker { display: none; }
.app-item > summary .app-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #e8eef8 100%);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.12),
    0 1px 3px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.15s ease;
}
.app-item > summary:hover .app-icon,
.app-item > summary:active .app-icon { transform: scale(1.08); }
.app-item > summary > div:last-child {
  font-size: 11px; color: #1a1d26; font-weight: 600;
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}
.app-item:nth-child(1) .app-icon { background: linear-gradient(135deg, #ff7675, #fab1a0); }
.app-item:nth-child(2) .app-icon { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.app-item:nth-child(3) .app-icon { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.app-item:nth-child(4) .app-icon { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.app-item:nth-child(5) .app-icon { background: linear-gradient(135deg, #55efc4, #00b894); }
.app-item:nth-child(6) .app-icon { background: linear-gradient(135deg, #fd79a8, #e84393); }
.app-item:nth-child(7) .app-icon { background: linear-gradient(135deg, #81ecec, #00cec9); }
.app-item:nth-child(8) .app-icon { background: linear-gradient(135deg, #95ec69, #07c160); }
.app-item:nth-child(n+9) .app-icon { background: linear-gradient(135deg, #dfe6e9, #b2bec3); }

/* ══════════════════════════════════════
   📲 APP全屏覆盖
   ══════════════════════════════════════ */
.app-item[open] > summary {
  position: absolute;
  top: 0; left: 0; width: 100%;
  box-sizing: border-box; z-index: 30;
  height: 52px; padding: 0 18px;
  flex-direction: row !important;
  align-items: center !important; gap: 8px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border-radius: 28px 28px 0 0;
}
.app-item[open] > summary::before {
  content: "‹"; font-size: 26px; color: #3060c0;
  font-weight: 300; flex-shrink: 0; line-height: 1;
}
.app-item[open] > summary .app-icon {
  width: 30px !important; height: 30px !important;
  font-size: 16px !important; border-radius: 8px !important;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}
.app-item[open] > summary > div:not(.app-icon) {
  font-size: 15px !important; font-weight: 700;
  color: #1a1d26 !important; flex: 1;
  text-align: left; text-shadow: none;
}
.app-item[open] > summary::after {
  content: "关闭"; font-size: 12px; color: #3060c0;
  white-space: nowrap; font-weight: 500;
}
.app-item[open] .app-panel {
  position: absolute;
  top: 52px; left: 0; width: 100%;
  box-sizing: border-box;
  height: calc(100% - 52px - 44px);
  overflow-y: auto; z-index: 29;
  padding: 14px 14px 24px;
  background: #f2f4f8;
  border-radius: 0;
  animation: appPanelIn 0.22s cubic-bezier(.25,.8,.25,1) both;
}
@keyframes appPanelIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-item[open] .app-panel::-webkit-scrollbar { width: 3px; }
.app-item[open] .app-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.app-item:not([open]) .app-panel { display: none; }

/* ══════════════════════════════════════
   🎨 信息面板：标题 + 行卡片 (减耗版)
   ══════════════════════════════════════ */
.app-panel t,
.chat-tab-panel t {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #3060c0;
  letter-spacing: 0.05em;
  margin: 16px 2px 7px;
  padding-left: 8px;
  border-left: 3px solid #5b8dee;
  border-bottom: none;
}
.app-panel t:first-child,
.chat-tab-panel t:first-child { margin-top: 2px; }

.app-panel r,
.chat-tab-panel r {
  display: block;
  margin: 5px 0;
  padding: 9px 12px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.045);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s ease;
}
.app-panel r:hover,
.chat-tab-panel r:hover {
  box-shadow: 0 2px 8px rgba(48,96,192,0.08);
}

.app-panel v,
.chat-tab-panel v {
  font-size: 12px;
  line-height: 1.95;
  color: #2d3436;
  word-break: break-word;
}

/* NPC卡片内行去重，避免卡中卡 */
.npc-card r {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 3px 0;
  margin: 2px 0;
}
.npc-card r:hover { box-shadow: none; }

/* ══════════════════════════════════════
   📊 数值颜色标签（保留原版）
   ══════════════════════════════════════ */
.app-panel g, .chat-tab-panel g { 
  color: #00b894; font-weight: 700;
  background: rgba(0,184,148,0.1);
  padding: 1px 6px; border-radius: 4px;
}
.app-panel y, .chat-tab-panel y { 
  color: #e8941a; font-weight: 700;
  background: rgba(253,203,110,0.15);
  padding: 1px 6px; border-radius: 4px;
}
.app-panel o, .chat-tab-panel o { 
  color: #d63031; font-weight: 700;
  background: rgba(225,112,85,0.12);
  padding: 1px 6px; border-radius: 4px;
}
.app-panel c, .chat-tab-panel c { 
  color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #d63031, #c0392b);
  padding: 1px 6px; border-radius: 4px;
  animation: pulse-crit 1.5s ease-in-out infinite;
  box-shadow: 0 2px 4px rgba(214,48,49,0.3);
}
@keyframes pulse-crit { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

/* 隐藏内部标签 */
think, shade, md { display: none !important; }

/* ══════════════════════════════════════
   👤 NPC关系标签 & 卡片（完整保留）
   ══════════════════════════════════════ */
.rel-tag, rt {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 8px;
  letter-spacing: 0.03em; margin-left: 4px;
  display: inline-block;
}
.rel-tag.kin, rt.kin { background: rgba(116,185,255,0.18); color: #0984e3; }
.rel-tag.lover, rt.lover { background: rgba(255,118,117,0.18); color: #d63031; }
.rel-tag.friend, rt.friend { background: rgba(85,239,196,0.18); color: #00b894; }
.rel-tag.acquaint, rt.acquaint { background: rgba(178,190,195,0.18); color: #636e72; }
.rel-tag.colleague, rt.colleague { background: rgba(253,203,110,0.18); color: #e67e22; }
.rel-tag.stranger, rt.stranger { background: rgba(178,190,195,0.12); color: #999; }
.rel-tag.hostile, rt.hostile { background: rgba(214,48,49,0.12); color: #d63031; }
.rel-tag.interest, rt.interest { background: rgba(253,121,168,0.18); color: #e84393; }
.rel-tag.power, rt.power { background: rgba(108,92,231,0.15); color: #6c5ce7; }

.npc-card {
  border-radius: 12px;
  padding: 10px 12px;
  border-left: 3px solid #dfe6e9;
  background: #ffffff;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.npc-card.lover { border-left-color: #d63031; }
.npc-card.friend { border-left-color: #00b894; }
.npc-card.kin { border-left-color: #0984e3; }
.npc-card.hostile { border-left-color: #d63031; }
.npc-card.interest { border-left-color: #e84393; }
.npc-card.power { border-left-color: #6c5ce7; }
.npc-card.colleague { border-left-color: #e67e22; }
.npc-card.acquaint { border-left-color: #636e72; }
.npc-card.stranger { border-left-color: #b2bec3; }

.npc-card r {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  border-radius: 0 !important;
}
.npc-card r + r { border-top: 1px solid rgba(0,0,0,0.04) !important; }

.npc-inner-theater {
  font-size: 10px; color: #636e72; font-style: italic;
  line-height: 1.8;
  background: rgba(108,92,231,0.04);
  border-radius: 6px;
  padding: 7px 10px;
  border-left: 2px solid rgba(108,92,231,0.3);
  margin-top: 6px;
}

/* ══════════════════════════════════════
   💬 沉浸式聊天模式（完整保留）
   ══════════════════════════════════════ */
.chat-app {
  position: relative;
  overflow: hidden;
  background: #ededed;
  border: 8px solid #1a1d26;
  border-radius: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 8px 20px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.2);
  max-width: 380px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  height: 760px;
  color: #1a1d26;
  display: flex;
  flex-direction: column;
}
.chat-app p { margin: 0; padding: 0; }

.chat-status-bar {
  background: #ededed;
  font-size: 11px; color: #1a1d26;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 18px; flex-shrink: 0;
  border-radius: 28px 28px 0 0;
}
.chat-status-bar .time { font-size: 13px; font-weight: 700; }

.chat-header {
  background: #ededed;
  border-bottom: 1px solid #d9d9d9;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 18px; flex-shrink: 0;
}
.chat-header-title { font-size: 16px; font-weight: 700; color: #1a1d26; }

.chat-list {
  flex: 1; overflow-y: auto;
  background: #fff; padding: 0;
}
.chat-list::-webkit-scrollbar { width: 3px; }
.chat-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }

.chat-item { position: static; border-bottom: 1px solid #f0f0f0; }
.chat-item > summary {
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  cursor: pointer; background: #fff;
}
.chat-item > summary::-webkit-details-marker { display: none; }
.chat-item > summary:hover { background: #f7f7f7; }

.chat-list-avatar {
  width: 48px; height: 48px;
  border-radius: 6px;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  font-size: 16px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-list-avatar.group { background: linear-gradient(135deg, #dfe6e9, #b2bec3); font-size: 14px; }

.chat-list-content { flex: 1; min-width: 0; }
.chat-list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.chat-list-name { font-size: 15px; font-weight: 600; color: #1a1d26; }
.chat-list-time { font-size: 11px; color: #999; flex-shrink: 0; margin-left: 8px; }
.chat-list-preview {
  font-size: 13px; color: #999;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.chat-list-badge {
  width: 18px; height: 18px;
  border-radius: 9px;
  background: #d63031; color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: 8px;
}
.chat-list-badge:empty { display: none; }

/* 聊天对象展开：全屏 */
.chat-item[open] > summary {
  position: absolute;
  top: 0; left: 0; width: 100%;
  box-sizing: border-box; z-index: 30;
  height: 52px; padding: 0 18px;
  flex-direction: row; gap: 8px;
  background: #ededed;
  border-bottom: 1px solid #d9d9d9;
  border-radius: 28px 28px 0 0;
}
.chat-item[open] > summary::before {
  content: "‹"; font-size: 26px; color: #07c160;
  font-weight: 300; flex-shrink: 0; line-height: 1;
}
.chat-item[open] > summary .chat-list-avatar {
  width: 32px; height: 32px; font-size: 13px;
}
.chat-item[open] > summary .chat-list-content { flex: 1; }
.chat-item[open] > summary .chat-list-name { font-size: 15px; }
.chat-item[open] > summary .chat-list-time,
.chat-item[open] > summary .chat-list-preview,
.chat-item[open] > summary .chat-list-badge { display: none; }
.chat-item[open] > summary::after {
  content: "⋮"; font-size: 20px; color: #1a1d26; flex-shrink: 0;
}
.chat-item[open] .chat-panel {
  position: absolute;
  top: 52px; left: 0; width: 100%;
  box-sizing: border-box;
  height: calc(100% - 52px);
  overflow-y: auto; z-index: 29;
  padding: 8px 12px;
  background: #ededed;
  animation: appPanelIn 0.22s cubic-bezier(.25,.8,.25,1) both;
  display: flex; flex-direction: column; gap: 4px;
}
.chat-item:not([open]) .chat-panel { display: none; }

.chat-time-divider {
  text-align: center; font-size: 10px; color: #999;
  background: rgba(0,0,0,0.04);
  border-radius: 4px; padding: 2px 10px;
  margin: 10px auto; width: fit-content;
}

.chat-row {
  display: flex; align-items: flex-start;
  gap: 8px; max-width: 82%; margin: 2px 0;
}
.chat-row-other { align-self: flex-start; flex-direction: row; }
.chat-row-self { align-self: flex-end; flex-direction: row-reverse; }

.chat-avatar-other, .chat-avatar-self {
  width: 38px; height: 38px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.chat-avatar-other { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.chat-avatar-self { background: linear-gradient(135deg, #95ec69, #07c160); }
.chat-avatar-other[data-c="1"] { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.chat-avatar-other[data-c="2"] { background: linear-gradient(135deg, #fd79a8, #e84393); }
.chat-avatar-other[data-c="3"] { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.chat-avatar-other[data-c="4"] { background: linear-gradient(135deg, #ffeaa7, #e67e22); }
.chat-avatar-other[data-c="5"] { background: linear-gradient(135deg, #55efc4, #00b894); }
.chat-avatar-other[data-c="6"] { background: linear-gradient(135deg, #81ecec, #00cec9); }

.chat-row-other + .chat-row-other .chat-avatar-other,
.chat-row-self + .chat-row-self .chat-avatar-self { visibility: hidden; }
.chat-row-other + .chat-row-other,
.chat-row-self + .chat-row-self { margin-top: -1px; }

.chat-bubble {
  border-radius: 8px;
  font-size: 14px; line-height: 1.6;
  word-break: break-word; max-width: 100%;
}
.chat-bubble p { margin: 0; padding: 9px 12px; }
.chat-bubble-other {
  background: #fff;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  color: #1a1d26;
}
.chat-bubble-self {
  background: #95ec69;
  border-top-right-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  color: #1a1d26;
}
.chat-row-other + .chat-row-other .chat-bubble-other { border-top-left-radius: 8px; }
.chat-row-self + .chat-row-self .chat-bubble-self { border-top-right-radius: 8px; }

.chat-sender {
  display: block;
  font-size: 10px; color: #576574;
  padding: 0 4px 3px;
  line-height: 1.3; font-weight: 500;
}

.chat-typing {
  font-size: 11px; color: #999; font-style: italic;
  padding: 4px 54px;
  animation: typingPulse 1.5s ease-in-out infinite;
}
@keyframes typingPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.chat-sys-msg {
  align-self: center;
  font-size: 10px; color: #999;
  background: rgba(0,0,0,0.06);
  border-radius: 4px; padding: 3px 12px;
  margin: 6px 0;
}

/* ══════════════════════════════════════
   特殊消息类型（保留原版）
   ══════════════════════════════════════ */
.chat-bubble .voice-msg {
  display: flex; align-items: center; gap: 6px;
  min-width: 100px; padding: 9px 12px;
  font-size: 13px; color: #333;
}
.chat-bubble .voice-msg::before {
  content: "🔊"; font-size: 18px; flex-shrink: 0;
}
.chat-bubble .voice-msg::after {
  content: ""; flex: 1; height: 2px;
  background: repeating-linear-gradient(90deg, #999 0 2px, transparent 2px 5px);
  border-radius: 1px;
}

.chat-bubble .img-msg {
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 24px 20px 12px;
  font-size: 11px; color: #999;
  text-align: center; margin: 4px 8px;
  min-width: 120px;
}
.chat-bubble .img-msg::before {
  content: "🖼️"; display: block;
  font-size: 32px; margin-bottom: 6px;
}

.chat-bubble .red-packet {
  background: linear-gradient(135deg, #e8725c, #d4543e);
  color: #fff;
  border-radius: 10px; padding: 0;
  min-width: 200px; max-width: 240px;
  box-shadow: 0 2px 8px rgba(200,60,40,0.25);
  overflow: hidden;
}
.red-packet-body {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.red-packet-icon {
  width: 40px; height: 48px;
  background: linear-gradient(180deg, #c0392b 0%, #c0392b 55%, #a93226 55%, #a93226 100%);
  border-radius: 6px;
  position: relative; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.red-packet-icon::after {
  content: "¥";
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  background: #e6a817;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #c0392b;
  line-height: 20px;
}
.red-packet-text {
  flex: 1;
  font-size: 15px; font-weight: 500; line-height: 1.4;
  color: #fff;
}
.red-packet-footer {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 6px 16px;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
}

.chat-bubble .transfer-msg {
  background: linear-gradient(135deg, #f5a623, #e8941a);
  color: #fff;
  border-radius: 10px; padding: 0;
  min-width: 200px; max-width: 240px;
  box-shadow: 0 2px 8px rgba(230,150,20,0.25);
  overflow: hidden;
}
.transfer-body {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.transfer-icon {
  width: 40px; height: 40px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.transfer-icon::after {
  content: "⇄";
  font-size: 18px;
  color: rgba(255,255,255,0.9);
  font-weight: 700;
}
.transfer-info { flex: 1; }
.transfer-amount {
  font-size: 18px; font-weight: 700;
  color: #fff; line-height: 1.3;
}
.transfer-label {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.transfer-footer {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 6px 16px;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
}

/* ══════════════════════════════════════
   底部Tab栏 (保留原版)
   ══════════════════════════════════════ */
.chat-bottom-tabs {
  background: #f7f7f7;
  border-top: 1px solid #e0e0e0;
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 12px; flex-shrink: 0;
}

.chat-tab { position: static; text-align: center; flex: 1; }
.chat-tab > summary {
  list-style: none;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; padding: 4px 0;
}
.chat-tab > summary::-webkit-details-marker { display: none; }

.chat-tab-icon { font-size: 22px; color: #666; transition: color 0.2s; }
.chat-tab-label { font-size: 10px; color: #666; transition: color 0.2s; }
.chat-tab.active .chat-tab-icon,
.chat-tab.active .chat-tab-label { color: #07c160; }

.chat-tab[open] > summary {
  position: absolute;
  top: 0; left: 0; width: 100%;
  box-sizing: border-box; z-index: 50;
  height: 52px; padding: 0 18px;
  flex-direction: row; gap: 8px;
  background: #ededed;
  border-bottom: 1px solid #d9d9d9;
  border-radius: 28px 28px 0 0;
}
.chat-tab[open] > summary::before {
  content: "‹"; font-size: 26px; color: #07c160;
  font-weight: 300; flex-shrink: 0; line-height: 1;
}
.chat-tab[open] > summary .chat-tab-icon { display: none; }
.chat-tab[open] > summary .chat-tab-label {
  font-size: 15px; font-weight: 700; color: #1a1d26;
  flex: 1; text-align: left;
}
.chat-tab[open] .chat-tab-panel {
  position: absolute;
  top: 52px; left: 0; width: 100%;
  box-sizing: border-box;
  height: calc(100% - 52px);
  overflow-y: auto; z-index: 49;
  padding: 14px 14px 24px;
  background: #f2f4f8;
  animation: appPanelIn 0.22s cubic-bezier(.25,.8,.25,1) both;
}
.chat-tab[open] .chat-tab-panel::-webkit-scrollbar { width: 3px; }
.chat-tab[open] .chat-tab-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.chat-tab:not([open]) .chat-tab-panel { display: none; }

/* ══════════════════════════════════════
   📷 朋友圈卡片 (减耗版独立作用)
   ══════════════════════════════════════ */
.chat-tab-panel m {
  display: block;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.chat-tab-panel m b {
  font-size: 13px;
  font-weight: 700;
  color: #576b95;
}
.chat-tab-panel m i {
  font-size: 10px;
  color: #b2bec3;
  font-style: normal;
  margin-left: 8px;
}
.chat-tab-panel m p {
  font-size: 13px;
  color: #1a1d26;
  line-height: 1.75;
  margin: 7px 0 9px;
}
.chat-tab-panel m u {
  display: block;
  font-size: 11px;
  color: #8a9aa9;
  text-decoration: none;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 7px;
}
.chat-tab-panel m u::before {
  content: "";
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #576b95;
  margin: 0 6px 2px 0;
  vertical-align: middle;
}

/* ══════════════════════════════════════
   ⚖️ 抉择卡片 (保留原版)
   ══════════════════════════════════════ */
.choice-bar {
  background: linear-gradient(135deg, #fff8e1, #ffe9b3);
  border-bottom: 1px solid #ffd54f;
  padding: 10px 16px;
  flex-shrink: 0;
}
.choice-title {
  font-size: 11px; font-weight: 700;
  color: #e67e22;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.choice-opt {
  font-size: 12px; color: #5c5c5c;
  padding: 6px 12px; margin-bottom: 5px;
  background: #fff;
  border-radius: 8px;
  border-left: 3px solid #ffd54f;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  line-height: 1.5;
}
.choice-opt:last-child { margin-bottom: 0; }

/* 响应式 */
@media (max-width: 600px) {
  .chat-app, .phone-desktop { 
    max-width: 100%; border-radius: 28px; 
    border-width: 6px; height: 720px; 
  }
  .phone-status-bar:first-of-type,
  .chat-status-bar,
  .app-item[open] > summary,
  .chat-item[open] > summary,
  .chat-tab[open] > summary {
    border-radius: 22px 22px 0 0;
  }
}


/* ===== 统一聊天气泡：全宽自适应 + 清新毛玻璃 ===== */
.group.is-user > div:first-child,
.group.is-assistant > div:first-child {
  width: 100% !important;
  max-width: 100% !important;
  border: none !important;
  border-radius: 16px !important;
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  box-shadow: 0 6px 22px rgba(120,170,255,0.18) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  transition: transform .25s ease, box-shadow .25s ease !important;
}

.group.is-user > div:first-child {
  background: linear-gradient(135deg, rgba(224,247,250,0.92), rgba(209,236,241,0.92)) !important;
}

.group.is-assistant > div:first-child {
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(238,247,255,0.94)) !important;
}

.group.is-user > div:first-child::before,
.group.is-assistant > div:first-child::before {
  content: "" !important;
  position: absolute !important;
  top: -40%; left: -20%;
  width: 140%; height: 80%;
  background: radial-gradient(circle at 30% 20%, rgba(126,200,227,0.35), transparent 60%) !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

.group.is-user > div:first-child:hover,
.group.is-assistant > div:first-child:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(120,170,255,0.30) !important;
}

/* ===== 正文：宋体 + 深色高可读 ===== */
.rili-markdown-renderer,
.rili-markdown-renderer * {
  font-family: "宋体","SimSun","STSong",serif !important;
  color: #222222 !important;
  line-height: 1.85 !important;
  letter-spacing: 0.3px !important;
}

/* ===== 底部 Token/模型信息 ===== */
.text-xs.font-mono.text-muted-foreground {
  color: rgba(60,90,120,0.75) !important;
}

/* ===== 操作按钮图标 ===== */
.bg-muted.rounded.flex button svg.lucide {
  stroke: rgba(60,90,120,0.85) !important;
}

/* ===== 加载动画：自转地球 ===== */
.flex.gap-2.w-full.h-full.items-center.justify-center > span {
  display: none !important;
}
.flex.gap-2.w-full.h-full.items-center.justify-center {
  flex-direction: column !important;
  gap: 14px !important;
}
.flex.gap-2.w-full.h-full.items-center.justify-center::before {
  content: "" !important;
  display: block !important;
  width: 84px !important;
  height: 84px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cdefs%3E%3CradialGradient id='o' cx='35%25' cy='30%25'%3E%3Cstop offset='0%25' stop-color='%239fdcf0'/%3E%3Cstop offset='70%25' stop-color='%232a86c4'/%3E%3Cstop offset='100%25' stop-color='%230d4d80'/%3E%3C/radialGradient%3E%3CclipPath id='c'%3E%3Ccircle cx='40' cy='40' r='34'/%3E%3C/clipPath%3E%3C/defs%3E%3Ccircle cx='40' cy='40' r='34' fill='url(%23o)'/%3E%3Cg clip-path='url(%23c)'%3E%3Cg fill='%235cb85c'%3E%3Cpath d='M22 22 q10 -6 16 2 q6 8 -2 14 q-8 4 -16 -2 q-6 -8 2 -14z'/%3E%3Cpath d='M48 44 q10 -2 12 8 q0 10 -10 10 q-10 -2 -8 -12 q2 -6 6 -6z'/%3E%3Cpath d='M30 52 q6 -2 8 4 q0 6 -6 6 q-6 0 -6 -6 q0 -3 4 -4z'/%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 40 40' to='360 40 40' dur='8s' repeatCount='indefinite'/%3E%3C/g%3E%3Ccircle cx='40' cy='40' r='34' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'/%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  filter: drop-shadow(0 0 12px rgba(80,180,255,0.55)) !important;
}
.flex.gap-2.w-full.h-full.items-center.justify-center::after {
  content: "世界正在为你展开" !important;
  font-family: "宋体","SimSun",serif !important;
  font-size: 15px !important;
  letter-spacing: 3px !important;
  color: #2a6fa8 !important;
  text-shadow: 0 0 8px rgba(126,200,227,0.4) !important;
}
