/* =========================================
   第一部分：AI风月 - 底层框架与正文排版 (已修复渲染丢失问题)
   ========================================= */
.ai-wrap {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    padding: 12px;
    border-radius: 24px;
    max-width: 100%;
    margin: 10px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}
/* 核心：思维链隐形术 */
.ai-wrap .think { display: none; }

/* 正文区域高可读性排版 (遵循平台规范使用text标签) */
.ai-wrap .ai-text {
    display: block;
    font-size: 16px;
    line-height: 1.75;
    color: #333336;
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    letter-spacing: 0.5px;
}
.ai-wrap .ai-text p { margin: 0 0 14px 0; text-indent: 2em; }
.ai-wrap .ai-text p:last-child { margin-bottom: 0; }

/* 顶部状态栏 */
.ai-wrap .ios-top-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 12px 16px; border-radius: 20px; margin-bottom: 16px;
    font-size: 13px; font-weight: 600; color: #1d1d1f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.ai-wrap .ios-top-bar p { margin: 0; display: inline-flex; align-items: center; }

/* iOS 风格状态卡片 */
.ai-wrap .ios-card {
    background: #ffffff; border-radius: 20px; margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03); overflow: hidden; transition: all 0.3s ease;
}
.ai-wrap .ios-card > summary {
    padding: 16px 20px; font-weight: 600; font-size: 16px; color: #1d1d1f;
    cursor: pointer; list-style: none; display: flex; align-items: center;
    background: #ffffff; border-bottom: 1px solid transparent; transition: background 0.2s;
}
.ai-wrap .ios-card > summary::-webkit-details-marker { display: none; }
.ai-wrap .ios-card > summary::after {
    content: '›'; margin-left: auto; font-size: 24px; line-height: 1; color: #c7c7cc; transition: transform 0.3s ease;
}
.ai-wrap .ios-card[open] > summary { border-bottom: 1px solid #f2f2f7; background: #fbfbfd; }
.ai-wrap .ios-card[open] > summary::after { transform: rotate(90deg); }

.ai-wrap .ios-content { padding: 16px 20px; font-size: 14px; color: #3a3a3c; }
.ai-wrap .ios-content p { margin: 10px 0; line-height: 1.6; display: flex; align-items: center; flex-wrap: wrap; }

/* 徽章与表格等通用件 */
.ai-wrap .ios-badge {
    background: #f2f2f7; color: #1d1d1f; padding: 3px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 600; margin-right: 8px; display: inline-block; border: 1px solid #e5e5ea;
}
.ai-wrap .ios-badge.blue { background: #e5f0ff; color: #007aff; border-color: #cce4ff; }
.ai-wrap .ios-badge.red { background: #ffe9e9; color: #ff3b30; border-color: #ffcccc; }
.ai-wrap .ios-highlight { color: #007aff; font-weight: 700; margin: 0 4px; }
.ai-wrap .inner-thought {
    color: #5856d6; font-style: italic; background: #f2f2f7; padding: 6px 12px;
    border-radius: 10px; display: block; margin-top: 8px; border-left: 3px solid #5856d6; width: 100%;
}
.ai-wrap .ios-table {
    width: 100%; border-collapse: separate; border-spacing: 0; margin: 12px 0;
    font-size: 13px; border-radius: 12px; overflow: hidden; border: 1px solid #e5e5ea;
}
.ai-wrap .ios-table th, .ai-wrap .ios-table td { border-bottom: 1px solid #e5e5ea; border-right: 1px solid #e5e5ea; padding: 10px; text-align: center; }
.ai-wrap .ios-table th:last-child, .ai-wrap .ios-table td:last-child { border-right: none; }
.ai-wrap .ios-table tr:last-child td { border-bottom: none; }
.ai-wrap .ios-table th { background: #f5f5f7; font-weight: 600; color: #1d1d1f; }

/* 嵌套卡与记忆区 */
.ai-wrap .ios-nested { background: #f5f5f7; border-radius: 16px; margin-top: 16px; border: 1px solid #e5e5ea; }
.ai-wrap .ios-nested > summary { padding: 12px 16px; font-size: 14px; font-weight: 600; color: #1d1d1f; cursor: pointer; list-style: none; display: flex; align-items: center; }
.ai-wrap .ios-nested > summary::-webkit-details-marker { display: none; }
.ai-wrap .ios-nested > summary::after { content: '+'; margin-left: auto; font-size: 18px; color: #007aff; font-weight: normal; }
.ai-wrap .ios-nested[open] > summary::after { content: '−'; }
.ai-wrap .stm, .ai-wrap .ltm { display: block; background: #ffffff; padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid #e5e5ea; border-left: 4px solid #34c759; }
.ai-wrap .ltm { border-left-color: #af52de; }
.ai-wrap .stm p, .ai-wrap .ltm p { margin: 6px 0; font-size: 13px; color: #48484a; }
.ai-wrap .stm b, .ai-wrap .ltm b { color: #1d1d1f; font-size: 14px; display: block; margin-bottom: 8px; border-bottom: 1px dashed #e5e5ea; padding-bottom: 4px; }


/* ==========================================
   第二部分：V7.0 究极完美版手机系统 (已修复防穿模与返回键)
   ========================================== */
/* 手机外壳：开启独立结界 */
.ph {
  width: 360px; height: 640px; 
  max-width: 100%; margin: 15px auto; background: #000;
  border-radius: 20px; border: 6px solid #222;
  position: relative; overflow: hidden; font-family: sans-serif;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translateZ(0); /* 绝对神级属性：将所有 fixed 锁定在手机壳内 */
}

/* 顶部状态栏 */
.ph-top {
  position: absolute; top: 0; left: 0; width: 100%; height: 25px;
  background: rgba(0,0,0,0.5); color: #fff; display: flex; justify-content: space-between;
  padding: 5px 15px; font-size: 11px; z-index: 500; box-sizing: border-box;
}

/* 桌面系统 */
.ph-desk {
  position: absolute; top: 0; left: 0; width: 100%; height: 640px;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); 
  padding: 40px 15px 20px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px 10px; align-content: start; overflow-y: auto; box-sizing: border-box;
}

/* 桌面图标基础 */
.ap { display: flex; flex-direction: column; align-items: center; }
.ap > summary { list-style: none; cursor: pointer; text-align: center; outline: none; display: block; }
.ap > summary::-webkit-details-marker { display: none; }
.ic-w { position: relative; display: inline-block; }
.ic { width: 50px; height: 50px; background: rgba(255,255,255,0.9); border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 28px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); color: #fff; }
.nm { font-size: 11px; color: #fff; margin-top: 5px; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.bd { position: absolute; top: -5px; right: -5px; background: #ff3b30; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; border: 2px solid rgba(255,255,255,0.8); }

/* ==========================================
   🔥🔥🔥 降维打击：物理图层覆盖返回系统 🔥🔥🔥
   ========================================== */
.wx-head {
  height: 44px; line-height: 44px; text-align: center; padding: 0;
  background: #ededed; font-weight: bold; font-size: 15px; color: #333;
  border-bottom: 1px solid #d9d9d9; position: sticky; top: 0; z-index: 10;
}

/* 1. 二级页面(APP)的返回键 */
.ap[open] > summary {
  position: fixed !important; top: 25px; left: 0; width: 60px; height: 44px;
  z-index: 101 !important; display: flex; align-items: center; justify-content: center;
  background: #ededed !important; /* 修复点1：实色背景，融入顶栏 */
}
.ap[open] > summary::before { content: "〈 返回"; color: #007aff; font-size: 14px; font-weight: 500; text-shadow: none; }
.ap[open] > summary * { display: none !important; }

/* 2. 三级页面(聊天/导师详情)的返回键 */
.wc[open] > summary, .t-dtl[open] > summary {
  position: fixed !important; top: 25px; left: 0; width: 60px; height: 44px;
  z-index: 201 !important; display: flex; align-items: center; justify-content: center;
  background: #ededed !important; /* 修复点2：用201层级的实色背景，物理覆盖掉101层级的二级返回键！完美平替:has() */
}
.wc[open] > summary::before, .t-dtl[open] > summary::before { content: "〈 返回"; color: #007aff; font-size: 14px; font-weight: 500; }
.wc[open] > summary *, .t-dtl[open] > summary * { display: none !important; }

/* ==========================================
   页面容器动画
   ========================================== */
.ap-ui {
  position: fixed; top: 25px; left: 0; width: 100%; height: 615px;
  background: #f0f0f0; z-index: 100; overflow-y: auto;
  animation: slideIn 0.2s ease-out;
}
.wc-ui, .t-dtl-ui {
  position: fixed; top: 25px; left: 0; width: 100%; height: 615px;
  background: #f5f5f5; z-index: 200; overflow-y: auto;
  animation: slideLeft 0.2s ease-out;
}
@keyframes slideIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ==========================================
   各APP深度美化
   ========================================== */
/* --- 微信 --- */
.wc > summary { list-style: none; outline: none; display: block; }
.wc > summary::-webkit-details-marker { display: none; }
.wc-item { display: flex; padding: 12px 15px; background: #fff; border-bottom: 1px solid #f0f0f0; align-items: center; }
.wc-ava { width: 45px; height: 45px; border-radius: 5px; background: #ddd; font-size: 28px; display: flex; justify-content: center; align-items: center; margin-right: 12px; }
.wc-info { flex: 1; overflow: hidden; }
.wc-nm { font-size: 15px; color: #333; margin-bottom: 4px; }
.wc-msg { font-size: 13px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-time { font-size: 11px; color: #b2b2b2; margin-bottom: 20px; }
.wc-body { padding: 15px; }

.m { display: flex; margin-bottom: 15px; align-items: flex-start; width: 100%; }
.m.t { flex-direction: row; justify-content: flex-start; }
.m.m { flex-direction: row; justify-content: flex-end; }
.m .ava { width: 35px; height: 35px; border-radius: 5px; background: #fff; font-size: 22px; text-align: center; line-height: 35px; margin: 0 10px; }
.m .bub { max-width: 65%; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.m.t .bub { background: #fff; color: #333; border: 1px solid #eee; }
.m.m .bub { background: #95ec69; color: #333; }

/* --- 朋友圈 --- */
.pyq-ui { background: #fff; }
.pyq-item { display: flex; padding: 15px; border-bottom: 1px solid #eee; }
.p-ava { width: 40px; height: 40px; border-radius: 5px; background: #ddd; font-size: 24px; text-align: center; line-height: 40px; margin-right: 10px; }
.p-main { flex: 1; }
.p-nm { font-size: 15px; color: #576b95; font-weight: bold; margin-bottom: 5px; }
.p-txt { font-size: 14px; color: #333; line-height: 1.5; margin-bottom: 10px; }
.p-bot { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.p-time { font-size: 12px; color: #999; }
.p-like { cursor: pointer; background: #f1f1f1; padding: 2px 8px; border-radius: 4px; }
.l-cb { display: none; }
.l-ic { font-size: 16px; color: #ccc; transition: all 0.3s; display: inline-block; }
.l-cb:checked + .l-ic { color: #ff3b30; animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes heartPop { 0% {transform: scale(1);} 50% {transform: scale(1.5);} 100% {transform: scale(1);} }
.p-cmt { background: #f7f7f7; padding: 8px; font-size: 13px; border-radius: 4px; color: #333; }

/* --- 天气 & 热搜 --- */
.wea-ui { background: linear-gradient(to bottom, #2b5876 0%, #4e4376 100%); color: #fff; }
.w-loc { font-size: 18px; text-align: center; margin-top: 20px; }
.w-now { font-size: 40px; text-align: center; margin: 20px 0 40px; font-weight: 300; }
.w-chart { display: flex; justify-content: space-between; align-items: flex-end; height: 150px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.3); }
.w-bar { width: 18%; background: rgba(255,255,255,0.2); border-radius: 8px 8px 0 0; text-align: center; font-size: 11px; padding-top: 5px; display: flex; flex-direction: column; justify-content: flex-start; }
.hot-ui { background: #f5f5f5; }
.h-list { background: #fff; margin-top: 10px; }
.h-item { padding: 15px; border-bottom: 1px solid #eee; font-size: 15px; color: #333; display: flex; align-items: center; }
.h-item:nth-child(-n+3)::after { content: "爆"; background: #c00; color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; margin-left: 8px; font-weight: bold; }

/* --- 名师汇 --- */
.tu-ui { background: #f4f6f8; }
.t-ban { background: linear-gradient(135deg, #ff6b6b, #ff8e8b); color: #fff; padding: 15px; font-size: 18px; font-weight: bold; margin-bottom: 15px; border-radius: 0 0 15px 15px; text-align: center; }
.t-wf { padding: 0 10px 20px; column-count: 2; column-gap: 10px; }

.t-dtl > summary { list-style: none; outline: none; display: block; }
.t-dtl > summary::-webkit-details-marker { display: none; }
.t-card { background: #fff; border-radius: 10px; margin-bottom: 10px; break-inside: avoid; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow: hidden; cursor: pointer; }
.t-pic { height: 80px; background: #e9ecef; display: flex; justify-content: center; align-items: center; font-size: 24px; }
.t-in { padding: 10px; }
.t-n { font-size: 13px; font-weight: bold; display: flex; justify-content: space-between; margin-bottom: 6px; }
.t-n span { font-size: 9px; background: #e3f2fd; color: #1e88e5; padding: 2px 4px; border-radius: 4px; font-weight: normal; }
.t-s { font-size: 10px; color: #666; margin-bottom: 4px; }
.t-exp { font-size: 10px; color: #ff6b6b; margin-bottom: 6px; font-weight: bold; }

.t-desc { font-size: 11px !important; color: #555 !important; line-height: 1.4 !important; word-wrap: break-word; font-weight: normal !important; display: block !important; margin-bottom: 10px; }
.t-desc * { font-size: 11px !important; font-weight: normal !important; margin: 0 !important; padding: 0 !important; display: inline !important; }

.t-p { text-align: right; margin-top: 8px; }
.t-p span {
  display: inline-block; background: linear-gradient(135deg, #ffd700, #daa520); 
  color: #5c3a00; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 12px;
  box-shadow: 0 2px 5px rgba(218,165,32,0.4);
}

.t-dtl-ui { background: #f9f9f9; }
.dtl-body { padding: 20px; }
.dtl-pic { height: 180px; background: #e9ecef; border-radius: 15px; display: flex; justify-content: center; align-items: center; font-size: 40px; margin-bottom: 15px; }
.dtl-n { font-size: 24px; font-weight: bold; color: #333; margin-bottom: 5px; text-align: center; }
.dtl-tag { font-size: 13px; color: #666; text-align: center; margin-bottom: 20px; }
.dtl-tit { font-size: 16px; font-weight: bold; color: #2c3e50; margin-bottom: 10px; border-left: 4px solid #ff6b6b; padding-left: 8px; }
.dtl-txt { font-size: 14px !important; color: #444 !important; line-height: 1.6 !important; background: #fff; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.dtl-txt * { font-size: 14px !important; line-height: 1.6 !important; margin: 0 !important; display: inline !important; }