﻿/*
浠ょ墝鎷嗗垎鍘熷垯锛?1. 鍏ㄥ眬璇箟鑹诧細鎵€鏈夋ā鍧楀叡鐢紝鎹㈣偆棣栭€夈€?2. 妯″潡涓撳睘鑹诧細浠呭綋鏈夌嫭绔嬭涔夋椂寤虹珛锛涜兘鍩轰簬鍏ㄥ眬鑹叉淳鐢熺殑浼樺厛娲剧敓锛涘繀椤诲湪 :root 鍜?[data-theme="dark"] 閮芥湁鍊笺€?3. 鐢ㄦ埛鏁版嵁鑹诧細涓嶈繘浠ょ墝琛紝鐣欏湪涓氬姟 JS 骞舵敞閲娿€?*/
/* =========================================================
   Design Tokens 琛屼笟鏍囧噯绯荤粺璁捐浠ょ墝 (v2.0)
   1. :root 鏀俱€愭祬鑹查粯璁ゅ€笺€?   2. [data-theme="dark"] 鏀俱€愭繁鑹茶鐩栭」銆?   3. 鍏煎灞傚崟鍚戞槧灏?   4. 璇箟鍖栧伐鍏风被
   ========================================================= */

:root {
  /* 鍩虹璁捐浠ょ墝 (Design Tokens - Light 榛樿鍊? */
  --bg-base: #f2f2f7;           /* iOS 绯荤粺搴曠伆锛岀粷闈炲埡鐪兼鐧?*/
  --bg-surface: #ffffff;        /* 鍐呭鍗＄墖琛ㄩ潰绾櫧 */
  --bg-elevated: rgba(247, 247, 247, 0.94); /* 椤舵爮/搴曟爮姣涚幓鐠冩诞灞?*/
  --bg-elevated-solid: #f7f7f7; /* 姣涚幓鐠冧笉鏀寔鏃剁殑瀹炰綋闄嶇骇搴曡壊 */

  --text-primary: #1c1c1e;      /* 涓€绾ф鏂?涓绘爣棰?(娣辩偔鐏帮紝娓╂鼎鎶ょ溂) */
  --text-secondary: #6e6e73;    /* 浜岀骇璇存槑鏂囨/鏃堕棿鎴?*/
  --text-muted: #8e8e93;        /* 鍗犱綅鏂囧瓧/寮辨彁绀?*/

  --danger-primary: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --success-primary: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --info-primary: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.12);
  --accent-primary: #e06d64;
  --accent-soft: rgba(224, 109, 100, 0.2);
  --palace-highlight: #9333ea;
  --palace-highlight-soft: rgba(147, 51, 234, 0.12);
  --palace-highlight-text: #7e22ce;
  /* 妯″潡涓撳睘璇箟浠ょ墝 (Light) */
  --stickers-accent: var(--info-primary);
  --stickers-accent-soft: var(--info-soft);
  --stickers-accent-border: rgba(2, 132, 199, 0.35);
  --days-accent: var(--info-primary);
  --days-accent-soft: var(--info-soft);
  --days-accent-border: rgba(2, 132, 199, 0.35);
  --days-past-color: var(--info-primary);
  --romantic-pink: #db2777;
  --days-future-color: var(--romantic-pink);
  --days-tag-love: var(--danger-primary);
  --days-tag-promise: var(--palace-highlight);
  --days-tag-holiday: #d97706;
  --days-tag-other: var(--info-primary);
  --reader-accent: #db2777;
  --reader-accent-soft: rgba(219, 39, 119, 0.12);
  --border-default: rgba(0, 0, 0, 0.06); /* 缁嗚吇鍒嗙晫绾?*/
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04); /* 绔嬩綋婕弽灏勫井娴洉 */

  /* 寰俊娴呰壊涓撳睘浠ょ墝 */
  --bubble-user: #bde7a4;
  --bubble-user-text: #000000;
  --bubble-bot: #ffffff;
  --bubble-bot-text: #1c1c1e;
  --wechat-bg-chat: #f4f1ea;
  --wechat-bg-bar: rgba(237, 237, 237, 0.96);
  --chat-dim: rgba(10, 10, 14, 0.16); /* 聊天壁纸压暗层：浅色下要轻 */
  --wechat-bg-input: #ffffff;
  /* 聊天页四块浮层（＋抽屉 / 表情抽屉 / 引用条 / 多选栏）共用的面板底 */
  --chat-drawer-bg: #ffffff;

  /* 一起看（影视放映室）专属：浅色保持暖杏桃 */
  --watch-bg: #ede5e0;
  --watch-glow: rgba(255, 255, 255, 0.4);
  --watch-text: #2e2622;
  --watch-text-sub: #63534d;
  --watch-text-mute: #9e8e87;
  --watch-card: #fbf8f5;
  --watch-card-2: #f5efe9;
  --watch-card-3: #ede4de;
  --watch-border: #e5d8d1;
  --watch-bubble: #cfb9b2;
  --watch-accent: #90766e;
  --watch-accent-strong: #624b45;
  --watch-accent-soft: #e9dbd5;
  --watch-glass-soft: rgba(255, 255, 255, 0.45);
  --watch-glass: rgba(255, 255, 255, 0.6);
  --watch-glass-strong: rgba(255, 255, 255, 0.78);
  --watch-glass-border: rgba(255, 255, 255, 0.7);
  --watch-glass-border-soft: rgba(255, 255, 255, 0.45);
  /* 音乐页专属（网易云黑胶风）：浅色保持原样 */
  --mus-bar: rgba(255, 255, 255, 0.85);
  --mus-card: #ffffff;
  --mus-text: #222222;
  --mus-text-2: #555555;
  --mus-text-3: #888888;
  --mus-text-4: #aaaaaa;
  --mus-strong: #111111;
  --mus-play: #181818;
  --mus-on-strong: #ffffff;
  --mus-line: rgba(0, 0, 0, 0.06);
  --mus-line-2: rgba(0, 0, 0, 0.1);
  --mus-veil: rgba(0, 0, 0, 0.04);
  --mus-hover: rgba(0, 0, 0, 0.05);
  --mus-grid: rgba(0, 0, 0, 0.03);
  --mus-ring: #ffffff;

  /* 阅读页专属（鲜果机粉色系）：浅色保持原样 */
  --rd-card: #ffffff;
  --rd-card-2: #faf8f5;
  --rd-card-3: #f4f3f0;
  --rd-text: #222222;
  --rd-text-sub: #666666;
  --rd-text-mute: #999999;
  --rd-border: #ece8e1;
  --rd-cta: #f0e2d4;
  --rd-plane: #f0e2d4;
  --rd-cta-text: #6a463c;
  --rd-cta-border: rgba(140, 100, 74, 0.18);
  --rd-cta-shadow: rgba(150, 116, 92, 0.14);
  --rd-cta-press: #e3d0bd;
  --glass-faint: rgba(0, 0, 0, 0.04);
  --glass-soft: rgba(0, 0, 0, 0.05);
  --glass: rgba(0, 0, 0, 0.07);
  --glass-strong: rgba(0, 0, 0, 0.10);

  /* TODO(v2.0): 鏃у彉閲忓吋瀹瑰眰锛屼笟鍔′唬鐮佹竻闆跺悗绉婚櫎 */
  --theme-global-bg: var(--bg-base);
  --theme-accent: var(--accent-primary);
  --text-main: var(--text-primary);

  --color-bg-page: var(--bg-base);
  --color-bg-card: var(--bg-surface);
  --color-bg-card-hover: var(--bg-base);
  --color-bg-bar: var(--bg-elevated);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-border: var(--border-default);
  --color-border-subtle: rgba(0, 0, 0, 0.04);
  --color-card-shadow: var(--shadow-card);

  --sys-bg-primary: var(--bg-base);
  --sys-bg-secondary: var(--bg-surface);
  --sys-bg-bar: var(--bg-elevated);
  --sys-label-primary: var(--text-primary);
  --sys-separator: var(--border-default);
}

/* 娣辫壊瑕嗙洊椤?(浠呭湪 data-theme="dark" 鏃剁敓鏁? */
[data-theme="dark"],
body[data-theme="dark"],
.phone-screen[data-theme="dark"] {
  --bg-base: #121212;           /* 琛屼笟鏍囧噯鏆楀搴曟澘锛屼弗绂佹榛?#000 */
  --bg-surface: #1e1e1e;        /* 鍗＄墖/鎵胯浇琛ㄩ潰 */
  --bg-elevated: rgba(23, 23, 27, 0.94); /* 姣涚幓鐠冮《搴曟爮 */
  --bg-elevated-solid: #17171b; /* 瀹炰綋闄嶇骇搴曡壊 */

  --text-primary: #f5f5f7;      /* 楂樺姣旀竻鏅颁富鐧藉瓧 */
  --text-secondary: #94a3b8;    /* 鑸掗€傛绾х伆瀛?*/
  --text-muted: #64748b;        /* 鍗犱綅鏂囧瓧/寮辨彁绀?*/

  --danger-primary: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.18);
  --success-primary: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.18);
  --info-primary: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.18);
  --accent-primary: #f28b82;
  --accent-soft: rgba(242, 139, 130, 0.2);
  --palace-highlight: #c084fc;
  --palace-highlight-soft: rgba(192, 132, 252, 0.22);
  --palace-highlight-text: #f3e8ff;
  /* 妯″潡涓撳睘璇箟浠ょ墝瑕嗙洊 (Dark) */
  --stickers-accent: var(--info-primary);
  --stickers-accent-soft: var(--info-soft);
  --stickers-accent-border: rgba(56, 189, 248, 0.4);
  --days-accent: var(--info-primary);
  --days-accent-soft: var(--info-soft);
  --days-accent-border: rgba(56, 189, 248, 0.4);
  --days-past-color: var(--info-primary);
  --romantic-pink: #f472b6;
  --days-future-color: var(--romantic-pink);
  --days-tag-love: var(--danger-primary);
  --days-tag-promise: var(--palace-highlight);
  --days-tag-holiday: #f59e0b;
  --days-tag-other: var(--info-primary);
  --reader-accent: #ea8d95;
  --reader-accent-soft: rgba(254, 238, 242, 0.15);
  --border-default: rgba(255, 255, 255, 0.08);
  --shadow-card: none;

  /* 寰俊娣辫壊涓撳睘浠ょ墝瑕嗙洊 */
  --bubble-user: #28c445;
  --bubble-user-text: #000000;
  --bubble-bot: #2b2a33;
  --bubble-bot-text: #f5f5f7;
  --wechat-bg-chat: #111114;
  --wechat-bg-bar: rgba(23, 23, 27, 0.94);
  --chat-dim: rgba(10, 10, 14, 0.58); /* 聊天壁纸压暗层 */
  --wechat-bg-input: #2c2c2e;
  --chat-drawer-bg: #1e1e1e;

  /* 一起看（影视放映室）深色覆盖 */
  --watch-bg: #17120f;
  --watch-glow: rgba(255, 255, 255, 0.05);
  --watch-text: #f0e9e4;
  --watch-text-sub: #bda99f;
  --watch-text-mute: #8f7d75;
  --watch-card: #2a221e;
  --watch-card-2: #241d19;
  --watch-card-3: #332821;
  --watch-border: rgba(255, 255, 255, 0.12);
  --watch-bubble: #43302a;
  --watch-accent: #a8796a;
  --watch-accent-strong: #8a5c4f;
  --watch-accent-soft: #35271f;
  --watch-glass-soft: rgba(255, 255, 255, 0.05);
  --watch-glass: rgba(255, 255, 255, 0.07);
  --watch-glass-strong: rgba(255, 255, 255, 0.1);
  --watch-glass-border: rgba(255, 255, 255, 0.12);
  --watch-glass-border-soft: rgba(255, 255, 255, 0.08);
  --mus-bar: rgba(23, 23, 27, 0.94);
  --mus-card: #1e1e1e;
  --mus-text: #f5f5f7;
  --mus-text-2: #c3cad6;
  --mus-text-3: #a4adbb;
  --mus-text-4: #8a94a2;
  --mus-strong: #2c2b34;
  --mus-play: #35343f;
  --mus-on-strong: #ffffff;
  --mus-line: rgba(255, 255, 255, 0.08);
  --mus-line-2: rgba(255, 255, 255, 0.12);
  --mus-veil: rgba(255, 255, 255, 0.05);
  --mus-hover: rgba(255, 255, 255, 0.09);
  --mus-grid: rgba(255, 255, 255, 0.05);
  --mus-ring: rgba(255, 255, 255, 0.35);

  /* 阅读页专属（深色：暖紫夜读） */
  --rd-card: #211f27;
  --rd-card-2: #1a1720;
  --rd-card-3: #171420;
  --rd-text: #f2eff6;
  --rd-text-sub: #a9a5b8;
  --rd-text-mute: #7c7888;
  --rd-border: rgba(255, 255, 255, 0.10);
  --rd-cta: #2b2b36;
  --rd-plane: #232328;
  --rd-cta-text: #ffffff;
  --rd-cta-border: transparent;
  --rd-cta-shadow: rgba(43, 43, 54, 0.20);
  --rd-cta-press: #22222c;
  --glass-faint: rgba(255, 255, 255, 0.04);
  --glass-soft: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);

  /* 鏃у彉閲忓吋瀹瑰眰娣辫壊鑱斿姩 */
  --color-border-subtle: rgba(255, 255, 255, 0.05);
  --color-bg-card-hover: rgba(255, 255, 255, 0.08);
}

/* 璇箟鍖栧伐鍏风被 (Utility Classes - 渚涚粍浠朵笌 JS 瀹夊叏寮曠敤锛屼笉渚濊禆 !important) */
.bg-base { background-color: var(--bg-base); }
.bg-surface { background-color: var(--bg-surface); }
.bg-elevated { background-color: var(--bg-elevated); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger-primary); }
.text-success { color: var(--success-primary); }
.text-info { color: var(--info-primary); }
.bg-palace-soft { background-color: var(--palace-highlight-soft); }
.text-palace { color: var(--palace-highlight); }
.border-palace { border-color: var(--palace-highlight); }
.border-default { border-color: var(--border-default); }
.shadow-card { box-shadow: var(--shadow-card); }

/* 姣涚幓鐠冪壒鎬ч檷绾ф敮鎸?(淇濊瘉鏃?backdrop-filter 鏃堕《鏍忓簳鏍忓疄浣撲笉绌垮府) */
@supports not (backdrop-filter: blur(1px)) {
  .wechat-header,
  .wechat-main-header,
  .glass-header {
    background-color: var(--bg-elevated-solid);
  }
}

/* 鍘熺敓琛ㄥ崟涓庡叏灞€鎺т欢鐨勬棤鎰熻涔夌户鎵?(鏉滅粷瑁稿锛屼笉渚濊禆 !important) */
input, select, textarea, button {
  font-family: inherit;
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    body {
      background: var(--bg-base);
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-main);
      overflow-x: hidden;
      -webkit-touch-callout: none;
    }

    .device-wrapper {
      position: relative;
      width: 100%;
      max-width: 430px;
      height: 860px;
      max-height: 96vh;
      background: #0a0a0c;
      border-radius: 50px;
      padding: 10px;
      box-shadow: 0 30px 80px rgba(0,0,0,0.85), 0 0 0 2px rgba(255,255,255,0.1);
      display: flex;
      flex-direction: column;
    }

    .phone-screen {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 40px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      background-color: var(--theme-global-bg);
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
    }

    .dynamic-island {
      position: absolute;
      top: 10px;
      left: 50%;
      transform: translateX(-50%);
      width: 110px;
      height: 24px;
      background: #000;
      border-radius: 20px;
      z-index: 999;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 12px;
    }
    .island-lens {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: #111a2e;
      border: 1px solid #1e293b;
    }

    .status-bar {
      height: 44px;
      padding: 10px 22px 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13.5px;
      font-weight: 600;
      color: var(--color-text-primary);
      text-shadow: 0 1px 4px rgba(0,0,0,0.7);
      z-index: 100;
      user-select: none;
    }

    .view-container {
      position: relative;
      flex: 1;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    
    /* iPhone 14 鐏靛姩宀涘畨鍏ㄥ尯閬胯涓庨〉闈㈠眰绾ц鑼?*/
    .view-page {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: none;
      flex-direction: column;
      overflow: hidden;
      background: var(--color-bg-page, #111116);
      color: var(--text-primary);
      z-index: 10;
    }
    .view-page.active {
      display: flex;
      z-index: 20;
    }

    /* 鎵€鏈夐《鏍忚嚜鍔ㄩ伩寮€ iPhone 14 鐏靛姩宀涗笌鍒樻捣 */
    .wechat-header, .glass-header, .ios-setting-nav {
      padding-top: max(env(safe-area-inset-top, 44px), 24px) !important;
      height: auto !important;
      min-height: 84px !important;
      padding-bottom: 10px !important;
      display: flex;
      align-items: flex-end !important;
      background: var(--wechat-bg-bar) !important;
      border-bottom: 0.5px solid var(--border-default) !important;
      z-index: 100 !important;
    }

    .wechat-back-btn, .glass-btn, .ios-nav-action {
      padding: 8px 12px !important;
      font-size: 17px !important;
      touch-action: manipulation;
      cursor: pointer;
    }

    /* 妗岄潰椤堕儴澧炲姞瀹夊叏杈硅窛 */
    #page-home {
      padding-top: max(env(safe-area-inset-top, 44px), 20px);
      background: transparent !important; /* 褰诲簳閫忓嚭鍏ㄥ眬妗岄潰澹佺焊锛屽憡鍒函榛戦伄鎸?*/
    }

    .old-view-page {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: none;
      flex-direction: column;
      overflow: hidden;
    }
    .view-page.active {
      display: flex;
      animation: pageFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes pageFade {
      from { opacity: 0; transform: scale(0.98); }
      to { opacity: 1; transform: scale(1); }
    }

    
    /* iOS 鍘熺敓纭欢鍔犻€熸í鍚戞粦椤典綋绯?(绾墿鐞嗕笣婊戜綋楠? */
    .ios-pages-viewport {
      flex: 1;
      width: 100%;
      height: 100%;
      position: relative;
      overflow-x: scroll;
      overflow-y: hidden;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      display: flex;
    }
    .ios-pages-viewport::-webkit-scrollbar {
      display: none;
    }

    .ios-page-slide {
      flex: 0 0 100%;
      width: 100%;
      height: 100%;
      scroll-snap-align: start;
      scroll-snap-stop: always;
      padding: 10px 18px 8px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
      box-sizing: border-box;
    }

    /* 浼樺寲闀挎寜浣撻獙涓庨槻绯荤粺鑿滃崟寮瑰嚭 */
    .ios-app-card, .art-photo-square {
      -webkit-touch-callout: none !important;
      user-select: none !important;
      -webkit-user-select: none !important;
    }

    /* iOS 椤堕儴妗ｆ澶х粍浠?*/
    .hero-profile-card {
      width: 100%;
      height: 290px;
      border-radius: 32px;
      position: relative;
      overflow: hidden;
      box-shadow: 0 12px 36px rgba(0,0,0,0.5);
      border: 1px solid rgba(255,255,255,0.12);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      flex-shrink: 0;
    }

    .hero-card-banner {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(180deg, rgba(150,140,200,0.18) 0%, rgba(120,108,170,0.34) 100%), #b3b0d2;
      background-size: cover;
      background-position: center;
      cursor: pointer;
    }

    .hero-avatar-wrap {
      position: absolute;
      top: 36px;
      left: 50%;
      transform: translateX(-50%);
      width: 90px;
      height: 90px;
      border-radius: 50%;
      border: 3.5px solid #ffffff;
      box-shadow: 0 8px 24px rgba(0,0,0,0.45);
      overflow: hidden;
      cursor: pointer;
      z-index: 10;
      background: #e2c0b8;
    }
    .hero-avatar-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .hero-info-plate {
      position: relative;
      width: 100%;
      height: 185px; padding-top: 48px;
      background: var(--bg-elevated);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-radius: 28px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      padding-bottom: 16px;
      gap: 4px;
      color: var(--text-primary);
      z-index: 5;
    }

    /* 棣栭〉椤堕儴淇℃伅闈㈡澘涓庣偣鍑讳氦浜掑弽棣?*/
    .editable-text-name {
      font-size: 19px;
      font-weight: 800;
      color: var(--text-primary);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 8px;
      transition: all 0.15s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .hero-edit-pen-tag {
      font-size: 11px;
      opacity: 0.45;
      font-weight: normal;
    }
    .editable-text-name:active {
      transform: scale(0.95);
      background: rgba(0, 0, 0, 0.06);
    }
    .editable-text-sub {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
      cursor: pointer;
      padding: 2px 8px;
      border-radius: 8px;
      transition: all 0.15s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .editable-text-sub:active {
      transform: scale(0.95);
      background: rgba(0, 0, 0, 0.06);
    }
    .editable-text-tag {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-primary);
      cursor: pointer;
      padding: 2px 8px;
      border-radius: 8px;
      transition: all 0.15s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .editable-text-tag:active {
      transform: scale(0.95);
      background: rgba(0, 0, 0, 0.06);
    }
    .location-bubble {
      margin-top: 4px;
      background: var(--glass);
      border: 1px solid var(--border-default);
      padding: 4px 14px;
      border-radius: 20px;
      font-size: 12px;
      color: var(--text-primary);
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(0,0,0,0.06);
      transition: all 0.15s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .location-bubble:active {
      transform: scale(0.95);
      background: var(--glass);
    }

    /* 浼樺寲绗竴灞忓瀭鐩磋妭濂忥紝瑙ｅ喅闂磋窛杩囧瘑涓庡簳閮ㄥぇ鐣欑櫧闂 */
    #slide-page-1 {
      padding: 12px 18px 8px;
      gap: 18px;
      justify-content: flex-start;
    }

    /* 棣栭〉搴曢儴路缁█闄即蹇冪缁勪欢 (瀹岀編骞宠　鍥?瑙嗚鐣欑櫧) */
    .hero-companion-widget {
      background: rgba(255, 255, 255, 0.12);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 22px;
      padding: 11px 15px;
      display: flex;
      align-items: center;
      gap: 12px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
      cursor: pointer;
      transition: transform 0.15s, background 0.2s;
      user-select: none;
      -webkit-user-select: none;
      flex-shrink: 0;
      -webkit-tap-highlight-color: transparent;
    }
    .hero-companion-widget:active {
      transform: scale(0.97);
      background: rgba(255, 255, 255, 0.18);
    }
    .companion-avatar-dot {
      position: relative;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.18);
      border: 1px solid rgba(255, 255, 255, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
      flex-shrink: 0;
    }
    .companion-avatar-dot .pulse-ring {
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      border: 1.5px solid rgba(255, 255, 255, 0.55);
      animation: companionPulse 2.4s infinite ease-out;
    }
    @keyframes companionPulse {
      0% { transform: scale(0.9); opacity: 0.85; }
      70% { transform: scale(1.35); opacity: 0; }
      100% { transform: scale(1.35); opacity: 0; }
    }
    .companion-widget-center {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .companion-quote-text {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--color-text-primary);
      line-height: 1.4;
      text-shadow: 0 1px 3px rgba(0,0,0,0.4);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: opacity 0.15s ease;
    }
    .companion-status-row {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      color: rgba(255, 255, 255, 0.7);
    }
    .companion-tag {
      background: rgba(255, 255, 255, 0.2);
      color: var(--color-text-primary);
      padding: 1px 6px;
      border-radius: 8px;
      font-weight: 700;
      font-size: 10px;
    }
    .companion-widget-right {
      font-size: 15px;
      color: rgba(255, 255, 255, 0.6);
      flex-shrink: 0;
    }

    /* 寰俊姘旀场闀挎寜鑿滃崟 (澶嶅埢鏈湯鎴浘浜や簰) */
    .bubble-menu-mask {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 500;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      box-sizing: border-box;
    }
    .bubble-menu-mask.open {
      display: flex;
      animation: modalFadeIn 0.18s ease forwards;
    }
    .bubble-menu-card {
      width: 220px;
      background: rgba(36, 36, 44, 0.96);
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 20px;
      overflow: hidden;
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
      display: flex;
      flex-direction: column;
      animation: scaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .bubble-menu-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 13px 18px;
      font-size: 15px;
      font-weight: 500;
      color: #f2f2f7;
      cursor: pointer;
      border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
      transition: background 0.15s;
      -webkit-tap-highlight-color: transparent;
    }
    .bubble-menu-item:last-child {
      border-bottom: none;
    }
    .bubble-menu-item:active {
      background: rgba(255, 255, 255, 0.1);
    }
    .bubble-menu-item.danger {
      color: #ff453a;
    }
    .bubble-menu-icon {
      font-size: 16px;
      width: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* 姘旀场缂栬緫鎶藉眽寮圭獥 */
    .bubble-edit-modal-mask {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      z-index: 600;
      display: none;
      align-items: flex-end;
      justify-content: center;
    }
    .bubble-edit-modal-mask.open {
      display: flex;
      animation: modalFadeIn 0.2s ease forwards;
    }
    .bubble-edit-card {
      width: 100%;
      background: #1e1e26;
      border-top: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 24px 24px 0 0;
      padding: 16px 20px 24px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      box-sizing: border-box;
      animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .bubble-edit-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--color-text-primary);
    }
    .bubble-edit-input {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 12px;
      padding: 12px;
      font-size: 15px;
      color: var(--color-text-primary);
      outline: none;
      resize: vertical;
      font-family: inherit;
      line-height: 1.5;
    }
    .bubble-edit-actions {
      display: flex;
      gap: 12px;
    }

    /* 寮曠敤鍥炲鎻愮ず鏉?*/
    .chat-quote-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 7px 14px;
      background: var(--chat-drawer-bg, var(--bg-elevated));
      border-top: 0.5px solid var(--border-default);
      font-size: 12px;
      color: var(--text-secondary);
      z-index: 25;
    }
    .quote-bar-text {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-right: 8px;
    }
    .quote-bar-tag {
      color: #07c160;
      font-weight: 700;
      margin-right: 4px;
    }
    .quote-bar-close {
      background: none;
      border: none;
      color: var(--color-text-secondary);
      font-size: 15px;
      padding: 2px 6px;
      cursor: pointer;
    }

    /* 澶氶€夋ā寮忓簳閮ㄦ搷浣滄爮 */
    .chat-multi-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 10px));
      background: var(--chat-drawer-bg, var(--bg-surface));
      border-top: 0.5px solid var(--border-default);
      z-index: 30;
    }
    .multi-bar-btn {
      padding: 6px 14px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      border: none;
    }
    .multi-bar-btn.cancel {
      background: var(--glass);
      color: var(--text-primary);
    }
    .multi-bar-btn.delete {
      background: #ff453a;
      color: #ffffff;
    }
    .multi-bar-count {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text-primary);
    }

    /* 澶氶€夌姸鎬佷笅鐨勬皵娉″嬀閫夊湀 */
    .msg-select-check {
      display: none;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.4);
      margin-right: 8px;
      align-self: center;
      flex-shrink: 0;
      box-sizing: border-box;
      transition: all 0.15s;
    }
    body.chat-multi-mode .msg-select-check {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    body.chat-multi-mode .msg-group {
      cursor: pointer;
    }
    .msg-group.selected .msg-select-check {
      background: #07c160;
      border-color: #07c160;
    }
    .msg-group.selected .msg-select-check::after {
      content: '鉁?;
      color: var(--color-text-primary);
      font-size: 13px;
      font-weight: 700;
    }

    /* iOS 鍘熺敓妗ｆ缂栬緫鎶藉眽娴眰 (閫傞厤 iOS PWA锛屾棤缂濇浛浠?prompt) */
    .hero-modal-mask {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      z-index: 600;
      display: none;
      align-items: flex-end;
      justify-content: center;
    }
    .hero-modal-mask.open {
      display: flex;
      animation: modalFadeIn 0.2s ease forwards;
    }
    .hero-modal-sheet {
      width: 100%;
      background: var(--bg-surface);
      border-top: 1px solid var(--border-default);
      border-radius: 28px 28px 0 0;
      padding: 12px 20px 28px;
      box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
      display: flex;
      flex-direction: column;
      gap: 14px;
      box-sizing: border-box;
      animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .modal-sheet-handle {
      width: 40px;
      height: 4.5px;
      background: rgba(255, 255, 255, 0.28);
      border-radius: 4px;
      margin: 2px auto 8px;
    }
    .hero-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .hero-modal-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--color-text-primary);
    }
    .hero-modal-close-btn {
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: #b0a8b9;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      font-size: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    .hero-modal-body {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .hero-modal-input-group {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
    .hero-modal-input-group label {
      font-size: 12px;
      font-weight: 600;
      color: #a89eb0;
    }
    .hero-modal-input-group input {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 12px;
      padding: 10px 14px;
      font-size: 14px;
      color: var(--color-text-primary);
      outline: none;
      transition: border-color 0.2s;
    }
    .hero-modal-input-group input:focus {
      border-color: #f28b82;
      background: rgba(255, 255, 255, 0.12);
    }
    .hero-modal-footer {
      display: flex;
      gap: 12px;
      margin-top: 6px;
    }
    .hero-modal-btn {
      flex: 1;
      padding: 12px;
      border-radius: 14px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      border: none;
      transition: transform 0.15s, opacity 0.15s;
    }
    .hero-modal-btn:active {
      transform: scale(0.97);
    }
    .hero-modal-btn.cancel {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-primary);
    }
    .hero-modal-btn.save {
      background: #ffffff;
      color: #16151a;
      box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
    }

    .home-mid-section {
      display: flex;
      gap: 14px;
      align-items: stretch;
      flex-shrink: 0;
    }

    .art-photo-square {
      width: 155px;
      height: 185px; padding-top: 48px;
      border-radius: 28px;
      background: rgba(255, 255, 255, 0.9);
      border: 1px solid rgba(255,255,255,0.15);
      box-shadow: 0 8px 24px rgba(0,0,0,0.35);
      overflow: hidden;
      cursor: pointer;
      position: relative;
      flex-shrink: 0;
    }
    .art-photo-square img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .art-badge {
      position: absolute;
      bottom: 8px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0,0,0,0.55);
      color: var(--color-text-primary);
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 12px;
      white-space: nowrap;
      backdrop-filter: blur(4px);
    }

    /* iOS 椋庢牸鍙噸鎺掑浘鏍囩綉鏍?*/
    .ios-icon-grid {
      flex: 1;
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px 10px;
      align-content: center;
    }

    
    .ios-app-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      position: relative;
      touch-action: manipulation;
      -webkit-tap-highlight-color: rgba(255,255,255,0.2);
      padding: 4px;
      z-index: 10;
    }
    .ios-app-card:active {
      transform: scale(0.9);
      opacity: 0.8;
    }
    .ios-app-icon {
      pointer-events: none; /* 璁╀簨浠剁洿鎺ョ┛閫忓埌鐖跺崱鐗?*/
    }
    .ios-app-name {
      pointer-events: none;
    }

    /* 鎵╁ぇ iOS 鍒嗛〉鍦嗙偣鐨勮Е鎽哥儹鍖猴紝淇濊瘉鎵嬫寚蹇呬腑 */
    .ios-page-dots {
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-top: 2px;
      z-index: 50;
    }
    .ios-dot-hitbox {
      padding: 10px 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .ios-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.35);
      transition: all 0.25s ease;
      pointer-events: none;
    }
    .ios-dot-hitbox.active .ios-dot {
      width: 22px;
      border-radius: 6px;
      background: #ffffff;
      box-shadow: 0 0 10px rgba(255,255,255,0.8);
    }

    .old-ios-app-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      position: relative;
      transition: transform 0.15s;
    }
    .ios-app-card:active { transform: scale(0.92); }

    .ios-app-icon {
      width: 56px;
      height: 56px;
      border-radius: 19px;
      background: var(--desk-tile);
      backdrop-filter: blur(14px) saturate(150%);
      -webkit-backdrop-filter: blur(14px) saturate(150%);
      border: 1px solid var(--desk-tile-line);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      overflow: hidden;
      box-shadow: 0 8px 18px rgba(18,12,36,0.18), inset 0 1px 0 rgba(255,255,255,0.55);
    }
    .ios-app-icon .ios-line-icon {
      width: 26px;
      height: 26px;
      stroke: var(--desk-icon);
      stroke-width: 1.55;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
      display: block;
    }
    .ios-folder-mini-icon .ios-line-icon {
      width: 15px;
      height: 15px;
      stroke: var(--desk-icon);
      stroke-width: 1.6;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .ios-app-name {
      font-size: 10.5px;
      font-weight: 500;
      letter-spacing: 0.3px;
      color: var(--sys-label-primary);
      text-shadow: 0 1px 2px rgba(0,0,0,0.28);
      text-align: center;
    }
    body[data-theme="light"] .ios-app-name, .phone-screen[data-theme="light"] .ios-app-name {
      text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    }

    /* iOS 闀挎寜鏅冨姩 (Jiggle) 鐗规晥 */
    body.ios-edit-mode .ios-app-card,
    body.ios-edit-mode .art-photo-square {
      animation: iosJiggle 0.28s infinite alternate ease-in-out;
    }
    body.ios-edit-mode .ios-app-card:nth-child(2n) {
      animation-delay: 0.08s;
    }

    @keyframes iosJiggle {
      0% { transform: rotate(-2.2deg) translateY(-1px); }
      100% { transform: rotate(2.2deg) translateY(1px); }
    }

    /* 鍒犻櫎/绉诲姩寰界珷 */
    .ios-delete-badge {
      display: none;
      position: absolute;
      top: -5px;
      left: -5px;
      width: 20px;
      height: 20px;
      background: #8e8e93;
      color: var(--color-text-primary);
      border-radius: 50%;
      font-size: 12px;
      font-weight: 700;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 6px rgba(0,0,0,0.4);
      z-index: 10;
    }
    body.ios-edit-mode .ios-delete-badge {
      display: flex;
    }

    /* iOS 椤堕儴缂栬緫瀹屾垚娴潯 */
    .ios-edit-done-bar { display: none !important;
      display: none;
      position: absolute;
      top: 52px;
      right: 18px;
      background: rgba(255, 255, 255, 0.25);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid rgba(255,255,255,0.3);
      padding: 4px 14px;
      border-radius: 16px;
      font-size: 13px;
      font-weight: 700;
      color: var(--color-text-primary);
      cursor: pointer;
      z-index: 200;
      box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    }
    body.ios-edit-mode #page-home:not([style*='display: none']) ~ .ios-edit-done-bar,
    body.ios-edit-mode .ios-edit-done-bar {
      display: block !important;
    }
    body:not(.ios-edit-mode) .ios-edit-done-bar {
      display: none !important;
    }
    /* 鍙涓嶅湪涓诲睆 page-home锛屽畬鎴愭诞閽粷瀵逛笉鏄剧ず */
    body.view-active-subpage .ios-edit-done-bar {
      display: none !important;
    }

    /* iOS 缁忓吀鍒嗛〉鎸囩ず鍣?(Dots) */
    .ios-page-dots {
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      margin-top: 2px;
    }
    .ios-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.35);
      transition: all 0.2s ease;
      cursor: pointer;
    }
    .ios-dot.active {
      width: 18px;
      border-radius: 6px;
      background: #ffffff;
      box-shadow: 0 0 8px rgba(255,255,255,0.7);
    }

    /* 搴曢儴 Dock 鏍?*/
    .home-dock-bar {
      background: rgba(255, 255, 255, 0.22);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 34px;
      padding: 10px 18px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      box-shadow: 0 10px 30px rgba(0,0,0,0.4);
      margin: 4px 18px 14px;
    }
    .dock-app-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      transition: transform 0.15s;
    }
    .dock-app-item:active { transform: scale(0.9); }
    .dock-icon {
      width: 52px;
      height: 52px;
      border-radius: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--desk-tile);
      border: 1px solid var(--desk-tile-line);
      backdrop-filter: blur(14px) saturate(150%);
      -webkit-backdrop-filter: blur(14px) saturate(150%);
      box-shadow: 0 8px 18px rgba(18,12,36,0.18), inset 0 1px 0 rgba(255,255,255,0.55);
      font-size: 24px;
      overflow: hidden;
    }
    .dock-icon .ios-line-icon {
      width: 24px;
      height: 24px;
      stroke: var(--desk-icon);
      stroke-width: 1.55;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
      display: block;
    }
    .dock-label { font-size: 10px; font-weight: 500; letter-spacing: 0.3px; color: var(--color-text-primary); text-shadow: 0 1px 3px rgba(0,0,0,0.45); }

    /* ================= 寰俊娣辫壊鑱婂ぉ鐣岄潰 ================= */
    .wechat-header {
      height: 52px;
      padding: 0 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--color-bg-bar, rgba(23, 23, 27, 0.94));
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 0.5px solid var(--color-border, rgba(255, 255, 255, 0.08));
      z-index: 30;
      flex-shrink: 0;
    }
    .wechat-back-btn {
      background: none;
      border: none;
      color: var(--sys-label-primary);
      font-size: 21px;
      cursor: pointer;
      display: flex;
      align-items: center;
      padding: 4px 6px;
    }
    .wechat-title-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      cursor: pointer;
    }
    .wechat-title { font-size: 16.5px; font-weight: 600; color: var(--text-primary); }
    .wechat-sub-hint { font-size: 10.5px; color: var(--color-text-secondary); }

    .wechat-chat-screen {
      flex: 1;
      display: flex;
      flex-direction: column;
      background-color: var(--wechat-bg-chat, #111114);
      position: relative;
      overflow: hidden;
    }
    .chat-wallpaper-layer {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background-size: cover; background-position: center; pointer-events: none; z-index: 1;
    }
    .chat-wallpaper-dim {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background: var(--chat-dim, rgba(10, 10, 14, 0.58));
      backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
      pointer-events: none; z-index: 2;
    }
    .wechat-messages-wrap {
      flex: 1;
      min-height: 0;
      padding: 18px 14px 32px 14px;
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
      display: flex;
      flex-direction: column;
      gap: 14px;
      position: relative;
      z-index: 5;
    }
    .msg-group {
      display: flex; gap: 8px; max-width: 92%;
      animation: pageFade 0.2s ease forwards;
    }
    /* 鍥?锛氱嚎涓婃ā寮忎笓灞炲姩浣滀笌鍐呭績鎴忔í骞呭崱鐗?(涓庢甯稿璇濆畬鍏ㄥ垎绂? */
    .msg-action-card-group {
      align-self: center;
      width: 92%;
      max-width: 94%;
      margin: 4px auto;
      animation: pageFade 0.2s ease forwards;
    }
    .msg-action-narration {
      background: rgba(36, 33, 44, 0.88);
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 14px;
      padding: 12px 16px;
      font-size: 13.5px;
      color: var(--text-primary);
      line-height: 1.65;
      letter-spacing: 0.2px;
      text-align: justify;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }
    .msg-group.bot { align-self: flex-start; }
    .msg-group.user { align-self: flex-end; flex-direction: row-reverse; }

    .msg-avatar {
      width: var(--chat-avatar-size, 40px);
      height: var(--chat-avatar-size, 40px);
      border-radius: var(--chat-avatar-radius, 50%);
      flex-shrink: 0;
      background: linear-gradient(145deg, var(--bg-elevated-solid), var(--bg-surface));
      border: 0.5px solid var(--border-default);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
      overflow: hidden;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      font-size: calc(var(--chat-avatar-size, 40px) * 0.32); font-weight: 600; letter-spacing: 0.5px; color: var(--text-primary);
    }
    .msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

    .msg-time-hint {
      font-size: 10.5px;
      color: var(--text-secondary);
      margin-top: 5px;
      padding: 0 3px;
      letter-spacing: 0.2px;
      opacity: 0.72;
    }
    .chat-quick-strip {
      display: flex; gap: 8px; padding: 6px 14px;
      background: rgba(22, 22, 26, 0.95); overflow-x: auto;
      scrollbar-width: none; z-index: 10; border-top: 0.5px solid rgba(255,255,255,0.05);
    }
    .chat-quick-strip::-webkit-scrollbar { display: none; }
    .quick-pill {
      background: #2c2c30; border: 1px solid rgba(255,255,255,0.08);
      padding: 4px 10px; border-radius: 14px; font-size: 11.5px;
      color: #e5e5ea; white-space: nowrap; cursor: pointer;
    }

    .wechat-input-bar {
      padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 10px));
      background: var(--wechat-bg-bar, #1c1c1f); border-top: 0.5px solid var(--color-border, rgba(255, 255, 255, 0.08));
      display: flex; align-items: center; gap: 6px; z-index: 20;
    }
    .bar-icon-btn {
      width: 28px; height: 28px; background: none; border: none; font-size: 19px;
      color: #98989f; display: flex; align-items: center; justify-content: center; cursor: pointer;
      flex-shrink: 0;
    }
    .wechat-textarea-box {
      flex: 1; min-width: 0; background: #2c2c2e; border: none; border-radius: 6px;
      padding: 8px 10px; font-size: 14.5px; line-height: 1.4; outline: none;
      resize: none; max-height: 90px; color: var(--color-text-primary); font-family: inherit;
    }
    .wechat-send-btn {
      background: #07c160; color: var(--color-text-primary); border: none; border-radius: 6px;
      padding: 6px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
      white-space: nowrap; flex-shrink: 0; transition: transform 0.1s, opacity 0.1s;
      -webkit-tap-highlight-color: transparent;
    }
    .wechat-send-btn:active {
      transform: scale(0.93); opacity: 0.85;
    }
    .wechat-generate-btn {
      background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
      color: var(--color-text-primary); border: none; border-radius: 6px;
      padding: 6px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
      white-space: nowrap; flex-shrink: 0; box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
      transition: transform 0.1s, opacity 0.1s;
      -webkit-tap-highlight-color: transparent;
    }
    .wechat-generate-btn:active {
      transform: scale(0.93); opacity: 0.85;
    }

    /* 鎶藉眽浣撶郴 */
    .plus-action-drawer, .sticker-drawer {
      position: absolute; bottom: 0; left: 0; width: 100%;
      background: var(--bg-surface); border-top-left-radius: 20px; border-top-right-radius: 20px;
      box-shadow: 0 -8px 30px rgba(0,0,0,0.2); border-top: 1px solid var(--border-default);
      z-index: 100; display: flex; flex-direction: column;
      transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .plus-action-drawer.open, .sticker-drawer.open { transform: translateY(0); }
    .drawer-top-handle { width: 36px; height: 4px; background: #3e3e46; border-radius: 4px; margin: 10px auto 4px; }
    .plus-items-grid {
      flex: 1; padding: 14px 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
    }
    .plus-grid-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
    .plus-grid-icon {
      width: 54px; height: 54px; border-radius: 16px; background: #2c2c30;
      border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 24px;
    }
    .plus-grid-label { font-size: 11.5px; color: #98989f; }

    
    /* ================= 姝ゆ椂姝ゅ埢锛氬浘1涓撳睘杈撳嚭妗?================= */
    .rp-composer-shell {
      padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 12px));
      background: var(--bg-elevated);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-top: 0.5px solid var(--border-default);
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 30;
    }
    .rp-action-chips-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 4px;
    }
    .rp-chips-left {
      display: flex;
      gap: 8px;
    }
    .rp-chip-pill {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 6px 13px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 700;
      color: var(--text-primary);
      background: var(--accent-soft);
      border: 1px solid transparent;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      transition: all 0.15s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .rp-chip-pill:active {
      transform: scale(0.93);
      background: var(--glass-strong);
    }
    .rp-chip-pill.alt {
      color: var(--text-secondary);
      background: var(--glass-soft);
      border: 1px solid var(--border-default);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    }
    .rp-chip-pill.alt:active {
      transform: scale(0.93);
      background: rgba(45, 45, 55, 0.95);
      border-color: rgba(255, 255, 255, 0.38);
    }
    .rp-chevron-btn {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      background: var(--glass-soft);
      border: 1px solid var(--border-default);
      color: var(--color-text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
    }

    .rp-input-bubble-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-default);
      border-radius: 20px;
      padding: 10px 14px;
      display: flex;
      align-items: flex-end;
      gap: 10px;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .rp-input-area {
      flex: 1;
      background: none;
      border: none;
      color: var(--color-text-primary);
      font-size: 15px;
      line-height: 1.5;
      outline: none;
      resize: none;
      max-height: 110px;
      font-family: inherit;
    }
    .rp-input-area::placeholder {
      color: var(--color-text-secondary);
    }
    .rp-send-plane-btn {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--accent-soft);
      border: none;
      color: var(--accent-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.2s, transform 0.15s;
    }
    .rp-send-plane-btn:active {
      transform: scale(0.92);
      background: var(--theme-accent);
    }

    /* ================= 鏁呬簨璁惧畾 (鍘熷垱鐙珛鐧藉簳iOS鍗＄墖椋庢牸锛屽弬鑰冭瀹氫絾涓嶉浄鍚? ================= */
    .story-setting-screen {
      flex: 1;
      background: var(--bg-base);
      color: var(--text-primary);
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .story-card-box {
      background: var(--bg-surface);
      border-radius: 18px;
      padding: 16px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.03);
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .story-card-heading {
      font-size: 16px;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .story-card-tip {
      font-size: 12px;
      color: var(--color-text-secondary);
      line-height: 1.45;
    }

    .pill-select-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .story-pill-option {
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 13.5px;
      font-weight: 600;
      background: #f2f2f7;
      color: #3a3a3c;
      border: none;
      cursor: pointer;
      transition: all 0.2s;
    }
    .story-pill-option.active {
      background: #1c1c1e;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    }

    .story-edit-box {
      background: var(--bg-elevated-solid);
      border: 1px solid var(--border-default);
      border-radius: 14px;
      padding: 12px;
      font-size: 13.5px;
      color: var(--text-primary);
      line-height: 1.55;
      outline: none;
      font-family: inherit;
      resize: vertical;
      min-height: 84px;
    }

    .number-stepper-box {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .number-stepper-item {
      flex: 1;
      background: var(--bg-base);
      border-radius: 12px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .number-stepper-input {
      width: 70px;
      background: none;
      border: none;
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
      text-align: right;
      outline: none;
    }

    /* ================= 姝ゆ椂姝ゅ埢锛氭繁搴?SillyTavern 璺戝洟鍓у満 ================= */
    .rp-theater-screen {
  color: var(--text-primary);
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      background: var(--bg-base);
      position: relative;
      overflow: hidden;
}
    .rp-header-meta {
      padding: 10px 16px;
      background: rgba(28, 26, 34, 0.95);
      border-bottom: 1px solid rgba(255,255,255,0.08);
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
      color: #c5b8c8;
    }
    .rp-tag-badge {
      background: rgba(242, 139, 130, 0.2);
      color: var(--theme-accent);
      padding: 3px 8px;
      border-radius: 10px;
      font-weight: 600;
    }

    .rp-dialog-stream {
      flex: 1;
      min-height: 0;
      padding: 16px 16px 170px 16px;
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    /* SillyTavern 缁忓吀闀挎枃鏈彊杩板崱鐗?*/
    .rp-card-entry {
      background: var(--bg-surface);
      border: 1px solid var(--border-default);
      border-radius: 16px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      line-height: 1.65;
      font-size: 14px;
      color: var(--text-primary);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    }
    .rp-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px dashed var(--border-default);
      padding-bottom: 6px;
    }
    .rp-char-name {
      font-weight: 700;
      font-size: 13.5px;
      color: var(--accent-primary);
    }
    .rp-action-text {
      color: var(--text-secondary);
      font-style: italic;
      line-height: 1.55;
    }
    .rp-spoken-text {
      color: var(--color-text-primary);
      font-weight: 500;
    }

    .rp-bottom-bar {
      padding: 10px 14px 18px;
      background: var(--bg-elevated);
      border-top: 1px solid var(--border-default);
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .rp-role-switch-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
      color: var(--text-muted);
    }
    .rp-input-wrap {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .rp-text-input {
      flex: 1;
      background: var(--bg-surface);
      border: 1px solid var(--border-default);
      border-radius: 12px;
      padding: 10px 14px;
      color: var(--text-primary);
      font-size: 14px;
      outline: none;
      resize: none;
      max-height: 80px;
    }
    .rp-send-btn {
      background: var(--theme-accent);
      color: var(--color-text-primary);
      border: none;
      padding: 10px 16px;
      border-radius: 12px;
      font-weight: 700;
      font-size: 13.5px;
      cursor: pointer;
    }

    /* SillyTavern 瑙掕壊鍗′笌涓栫晫鍓ф湰鎶藉眽 */
    .rp-config-drawer {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background: #15131a; z-index: 200;
      display: flex; flex-direction: column;
      transform: translateY(100%);
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .rp-config-drawer.open { transform: translateY(0); }

    /* 閫氱敤琛ㄥ崟浣撶郴 */
    .page-generic-body {
      flex: 1; padding: 18px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none; display: flex; flex-direction: column; gap: 14px; background: var(--color-bg-page, #16161a); color: var(--color-text-primary, #f5f5f7);
    }
    .form-group-card {
      background: var(--color-bg-card, rgba(255, 255, 255, 0.05)); border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08)); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--color-card-shadow, none);
    }
    .form-label-title { font-size: 13px; font-weight: 700; color: var(--theme-accent); }
    .form-input-box {
      background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px 12px; border-radius: 12px; font-size: 13.5px; color: var(--color-text-primary, #ffffff); outline: none; background: var(--color-bg-card-hover, rgba(255, 255, 255, 0.07)); border-color: var(--color-border, rgba(255, 255, 255, 0.1));
    }
    .form-textarea-box {
      background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px 12px; border-radius: 12px; font-size: 13px; color: var(--color-text-primary); outline: none; resize: vertical; min-height: 180px; line-height: 1.5; font-family: inherit;
    }
    .action-btn-main {
      background: #07c160; color: var(--color-text-primary); border: none; padding: 12px; border-radius: 14px; font-size: 14.5px; font-weight: 700; cursor: pointer;
    }

    @media (max-width: 600px) {
      html, body {
        height: 100% !important;
        height: 100dvh !important;
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        padding: 0 !important;
        background: #000 !important;
      }
      .device-wrapper {
        max-width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
      }
      .phone-screen {
        border-radius: 0 !important;
        height: 100% !important;
        height: 100dvh !important;
      }
      .dynamic-island { display: none; }
    }
  
    
    /* ================= 鍔ㄦ€佹墦瀛椾氦浜?(娑堣В绛夊緟鐒﹁檻) ================= */
    .typing-indicator-box {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 6px;
    }
    .typing-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #c084fc;
      animation: typingPulse 1.3s infinite ease-in-out;
    }
    .typing-dot:nth-child(2) {
      animation-delay: 0.22s;
      background: #e879f9;
    }
    .typing-dot:nth-child(3) {
      animation-delay: 0.44s;
      background: #f472b6;
    }
    .typing-hint-text {
      font-size: 11.5px;
      color: var(--text-secondary);
      margin-left: 6px;
      font-weight: 500;
      letter-spacing: 0.3px;
    }
    @keyframes typingPulse {
      0%, 80%, 100% { transform: scale(0.65); opacity: 0.35; }
      40% { transform: scale(1.18); opacity: 1; filter: drop-shadow(0 0 4px rgba(192, 132, 252, 0.8)); }
    }

    /* ================= 涓栫晫涔︼細3D 鎷熺墿涔︽灦妯″紡 ================= */
    .bookshelf-desc-pill {
      background: rgba(255, 255, 255, 0.05);
      border: 1px dashed rgba(255, 255, 255, 0.12);
      border-radius: 14px;
      padding: 10px 14px;
      font-size: 12px;
      color: var(--color-text-secondary);
      line-height: 1.5;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .bookshelf-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 14px;
      padding: 6px 0 30px 0;
    }
    .book-shelf-item {
      position: relative;
      background: var(--bg-surface);
      border: 1px solid var(--border-default);
      border-radius: 16px;
      padding: 16px 14px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 165px;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
      cursor: pointer;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
      overflow: hidden;
    }
    .book-shelf-item:active {
      transform: scale(0.96);
    }
    .book-spine-line {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 6px;
      border-radius: 16px 0 0 16px;
    }
    .book-badge-tag {
      align-self: flex-start;
      font-size: 10.5px;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 10px;
      background: var(--glass-soft);
      color: var(--color-text-primary);
    }
    .book-title-main {
      font-size: 15px;
      font-weight: 800;
      color: var(--color-text-primary);
      margin-top: 8px;
      line-height: 1.35;
      letter-spacing: 0.3px;
    }
    .book-desc-sub {
      font-size: 11.5px;
      color: var(--text-muted);
      line-height: 1.45;
      margin-top: 6px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .book-footer-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 11px;
      color: var(--color-text-secondary);
      margin-top: 10px;
      border-top: 0.5px solid rgba(255, 255, 255, 0.08);
      padding-top: 6px;
    }

    /* 涔﹀嵎璇嶆潯璇︽儏椤?*/
    .book-detail-header-card {
      background: linear-gradient(135deg, rgba(39, 36, 51, 0.9) 0%, rgba(22, 21, 29, 0.95) 100%);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 18px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .entry-card-item {
      background: rgba(28, 27, 34, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 16px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .entry-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .book-act-btn {
      background: var(--glass-soft);
      border: 1px solid var(--border-default);
      border-radius: 8px;
      color: var(--color-text-primary);
      padding: 4px 8px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: background 0.15s, transform 0.1s;
    }
    .book-act-btn:active {
      transform: scale(0.95);
    }
    .book-act-btn.primary {
      background: var(--palace-highlight);
      border-color: var(--palace-highlight);
      color: #ffffff;
      font-weight: 700;
    }
    .book-act-btn.danger {
      color: #ef4444;
      border-color: rgba(239, 68, 68, 0.25);
    }
    .entry-card-title {
      font-size: 14.5px;
      font-weight: 700;
      color: var(--color-text-primary);
    }
    .entry-card-content {
      font-size: 13px;
      color: var(--color-text-secondary);
      line-height: 1.6;
      white-space: pre-wrap;
    }

    /* ================= 璁板繂瀹锛氫翰绗旀矇娣€涓庡弻鎬荤粨 ================= */
    .palace-action-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      padding: 2px 0 8px 0;
    }
    .palace-pill-btn {
      background: rgba(36, 33, 44, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 14px;
      padding: 10px 6px;
      font-size: 12px;
      font-weight: 600;
      color: var(--color-text-primary);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      cursor: pointer;
      transition: background 0.15s, transform 0.1s;
    }
    .palace-pill-btn:active {
      transform: scale(0.95);
      background: rgba(50, 46, 62, 0.9);
    }
    .palace-pill-btn.accent {
      background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
      border-color: rgba(168, 85, 247, 0.4);
      color: #f3e8ff;
    }
    .palace-memory-card {
      background: linear-gradient(145deg, rgba(32, 29, 41, 0.9) 0%, rgba(20, 19, 26, 0.95) 100%);
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 18px;
      padding: 15px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    }
    .palace-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .palace-card-title {
      font-size: 14.5px;
      font-weight: 700;
      color: #f5d0fe;
    }
    .palace-card-date {
      font-size: 11px;
      color: var(--color-text-secondary);
    }
    .palace-card-body {
      font-size: 13px;
      color: var(--color-text-primary);
      line-height: 1.6;
      white-space: pre-wrap;
    }
    
/* iOS 椋庢牸鑱婂ぉ璁惧畾椤甸潰 (瀹屽叏澶嶅埢鎴浘) */
    .ios-setting-screen {
      flex: 1;
      background: var(--bg-base);
      color: var(--text-primary);
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .ios-setting-nav {
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-surface);
      border-bottom: 0.5px solid var(--border-default);
      padding: 0 16px;
      flex-shrink: 0;
    }
    .ios-nav-title {
      font-size: 17px;
      font-weight: 600;
      color: var(--text-primary);
    }
    .ios-nav-action {
      font-size: 16px;
      font-weight: 600;
      color: var(--accent-primary);
      background: none;
      border: none;
      cursor: pointer;
    }
    .ios-card-group {
      background: var(--bg-surface);
      border-radius: 14px;
      overflow: hidden;
      box-shadow: 0 1px 4px rgba(0,0,0,0.04);
      display: flex;
      flex-direction: column;
    }
    .ios-card-header {
      padding: 14px 16px 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .ios-card-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .ios-card-group {
      background: var(--bg-surface);
      border-radius: 16px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.03);
      display: flex;
      flex-direction: column;
      margin-bottom: 14px;
    }
    .ios-cell-row {
      padding: 14px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 0.5px solid var(--border-default);
      min-height: auto; /* 缁濅笉姝婚攣楂樺害锛岄殢鏂囧瓧鑷劧鎾戝紑 */
      box-sizing: border-box;
      gap: 12px;
    }
    .ios-cell-left {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
      min-width: 0;
    }
    .ios-cell-main {
      font-size: 15.5px;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.35;
    }
    .ios-cell-sub {
      font-size: 12.5px;
      color: var(--color-text-secondary);
      line-height: 1.45;
      word-break: break-word;
    }
    .ios-toggle-switch {
      position: relative;
      width: 51px;
      height: 31px;
      background: #e9e9ea;
      border-radius: 16px;
      cursor: pointer;
      transition: background 0.25s;
    }
    .ios-toggle-switch.active {
      background: #34c759;
    }
    .ios-toggle-thumb {
      position: absolute;
      top: 2px;
      left: 2px;
      width: 27px;
      height: 27px;
      background: #ffffff;
      border-radius: 50%;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .ios-toggle-switch.active .ios-toggle-thumb {
      transform: translateX(20px);
    }

    .ios-slider-control {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 6px 0;
    }
    .ios-range-input {
      flex: 1;
      accent-color: var(--accent-primary);
    }
    .ios-slider-val {
      font-size: 16px;
      font-weight: 600;
      color: var(--color-text-secondary);
      width: 28px;
      text-align: right;
    }

    /* 鎬濈淮閾惧叏涓枃寮圭獥 */
    .cot-modal-mask {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 500;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .cot-modal-mask.open {
      display: flex;
      animation: pageFade 0.2s ease forwards;
    }
    .cot-modal-card {
      width: 100%;
      max-height: 80%;
      background: var(--bg-surface);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 24px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    }
    .cot-modal-header {
      padding: 16px 20px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .cot-modal-body {
      padding: 18px 20px;
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      font-size: 13.5px;
      line-height: 1.65;
      color: var(--text-primary);
      white-space: pre-wrap;
    }

  
    /* 姝ゆ椂姝ゅ埢 路 鍥?楂樼骇鎮诞浜や簰鎺у埗鍙?*/
    .theater-input-dock {
      background: rgba(22, 20, 28, 0.95);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 12px));
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 40;
    }
    .theater-top-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 4px;
    }
    .theater-chips-left {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .theater-action-pill {
      background: #e85042; /* 鍥?椴滀寒绾㈠簳 */
      color: var(--color-text-primary);
      font-size: 11.5px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 8px;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      box-shadow: 0 2px 8px rgba(232, 80, 66, 0.35);
      transition: transform 0.1s;
    }
    .theater-action-pill:active {
      transform: scale(0.93);
    }
    .theater-collapse-btn {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: #a09aa6;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    .theater-input-box-wrap {
      position: relative;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 18px;
      padding: 10px 48px 10px 14px;
      display: flex;
      align-items: center;
    }
    .theater-input-area {
      width: 100%;
      background: none;
      border: none;
      outline: none;
      color: var(--color-text-primary);
      font-size: 14.5px;
      line-height: 1.5;
      font-family: inherit;
      resize: none;
      max-height: 90px;
    }
    .theater-input-area::placeholder {
      color: rgba(255, 255, 255, 0.38);
    }
    .theater-send-plane-btn {
      position: absolute;
      right: 10px;
      bottom: 8px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: none;
      border: none;
      color: var(--theme-accent);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      transition: transform 0.15s;
    }
    .theater-send-plane-btn:active {
      transform: scale(0.88);
    }

    /* 鏁呬簨璁惧畾涓撳睘椤甸潰 (iOS娓呮柊鐧藉簳璐ㄦ劅) */
    .story-setting-screen {
      flex: 1;
      background: var(--bg-base);
      color: var(--text-primary);
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      padding: 16px 16px 40px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .story-card-box {
      background: var(--bg-surface);
      border-radius: 18px;
      padding: 18px 16px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.03);
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .story-card-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .story-pill-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .story-choice-pill {
      background: #f0f0f3;
      color: #2b2830;
      border: 1px solid transparent;
      padding: 7px 16px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .story-choice-pill.active {
      background: #1c1c20;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    }
    .story-help-desc {
      font-size: 12px;
      color: var(--color-text-secondary);
      line-height: 1.45;
    }
    .story-textarea-card {
      background: var(--bg-elevated-solid);
      border: 1px solid var(--border-default);
      border-radius: 14px;
      padding: 12px 14px;
      font-size: 13.5px;
      line-height: 1.55;
      color: var(--text-primary);
      outline: none;
      resize: vertical;
      min-height: 85px;
      font-family: inherit;
    }
    .story-word-boxes {
      display: flex;
      gap: 14px;
      align-items: center;
    }
    .story-word-badge {
      flex: 1;
      background: var(--bg-elevated-solid);
      border: 1px solid var(--border-default);
      border-radius: 14px;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .story-word-input {
      width: 70px;
      border: none;
      background: none;
      outline: none;
      font-size: 16px;
      font-weight: 700;
      color: var(--text-primary);
      text-align: right;
    }

  

    /* ================= 寰俊鍥涘ぇ搴曟爮涓庝富鐣岄潰鏍峰紡 ================= */
    #page-wechat-main {
      background: var(--bg-base);
      display: none;
      flex-direction: column;
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      overflow: hidden;
    }

    .wechat-main-header {
      padding-top: max(env(safe-area-inset-top, 44px), 24px);
      height: 86px;
      background: var(--sys-bg-bar);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 0.5px solid var(--sys-separator);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-left: 16px;
      padding-right: 16px;
      position: relative;
      z-index: 50;
      flex-shrink: 0;
    }

    .wechat-header-star-btn {
      background: none;
      border: none;
      color: #07c160;
      font-size: 15px;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 6px 0;
    }

    .wechat-main-title {
      font-size: 17px;
      font-weight: 600;
      color: var(--color-text-primary);
      letter-spacing: 0.3px;
    }

    .wechat-main-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .wechat-header-icon-btn {
      background: none;
      border: none;
      color: var(--color-text-primary);
      font-size: 24px;
      font-weight: 300;
      cursor: pointer;
      line-height: 1;
      padding: 4px;
    }

    .wechat-plus-dropdown {
      position: absolute;
      top: 82px;
      right: 14px;
      background: rgba(40, 40, 44, 0.98);
      backdrop-filter: blur(25px);
      border: 0.5px solid rgba(255, 255, 255, 0.15);
      border-radius: 12px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
      width: 170px;
      z-index: 999;
      overflow: hidden;
      animation: popIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .wechat-plus-item {
      padding: 12px 14px;
      color: var(--color-text-primary);
      font-size: 14px;
      border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
      cursor: pointer;
      transition: background 0.15s;
    }
    .wechat-plus-item:last-child { border-bottom: none; }
    .wechat-plus-item:active { background: rgba(255, 255, 255, 0.1); }

    .wechat-search-wrap {
      padding: 10px 14px 8px;
      background: var(--sys-bg-primary);
      flex-shrink: 0;
    }

    .wechat-search-bar {
      display: flex;
      align-items: center;
      background: var(--sys-bg-secondary);
      border-radius: 8px;
      padding: 6px 10px;
      gap: 6px;
      border: 0.5px solid var(--border-default);
    }

    .search-icon {
      font-size: 13px;
      opacity: 0.5;
    }

    .wechat-search-input {
      background: transparent;
      border: none;
      outline: none;
      color: var(--color-text-primary);
      font-size: 14px;
      flex: 1;
    }
    .wechat-search-input::placeholder { color: var(--text-primary); }

    /* 浠垮浘1涓€у寲鐘舵€佺鍚嶆潯 */
    .wechat-status-motto-banner {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 10px;
      padding: 8px 12px;
      background: rgba(255, 255, 255, 0.04);
      border-radius: 8px;
      border: 0.5px solid var(--border-default);
      cursor: pointer;
    }
    .motto-cube-icon {
      color: var(--color-text-secondary);
      font-size: 15px;
    }
    .motto-text-content {
      font-size: 13px;
      color: var(--color-text-secondary);
      font-style: normal;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }

    /* 寰俊鍥涘ぇ Tab 鍐呭鍖哄煙 */
    .wechat-tabs-content {
      flex: 1;
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
      position: relative;
    }

    .wechat-tab-pane {
      display: none;
      min-height: 100%;
      flex-direction: column;
    }
    .wechat-tab-pane.active {
      display: flex;
    }

    /* 浼氳瘽鍒楄〃 (Tab 1) */
    .wechat-session-list {
      display: flex;
      flex-direction: column;
    }

    .wechat-chat-item {
      display: flex;
      align-items: center;
      padding: 12px 14px;
      gap: 12px;
      background: var(--sys-bg-primary);
      border-bottom: 0.5px solid var(--sys-separator);
      cursor: pointer;
      transition: background 0.15s;
    }
    .wechat-chat-item:active {
      background: var(--bg-elevated-solid);
    }
    .wechat-chat-item.pinned {
      background: var(--sys-bg-secondary);
    }

    .wechat-avatar-wrapper {
      position: relative;
      width: 48px;
      height: 48px;
      flex-shrink: 0;
    }

    .wechat-item-avatar {
      width: 100%;
      height: 100%;
      border-radius: 8px;
      object-fit: cover;
      background: var(--bg-elevated-solid);
    }

    .wechat-online-badge {
      position: absolute;
      bottom: -1px;
      right: -1px;
      width: 11px;
      height: 11px;
      background: #07c160;
      border-radius: 50%;
      border: 2px solid var(--bg-surface);
    }

    .wechat-item-content {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .wechat-item-top {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
    }

    .wechat-item-name {
      font-size: 16px;
      font-weight: 500;
      color: var(--color-text-primary);
    }

    .wechat-item-time {
      font-size: 11.5px;
      color: var(--text-muted);
    }

    
    .wechat-item-bottom {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 4px;
      overflow: hidden;
    }

    .wechat-item-lastmsg {
      font-size: 13px;
      color: var(--color-text-secondary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      display: inline-block;
      max-width: calc(100% - 24px);
      line-height: 1.4;
    }


    .wechat-pinned-star {
      font-size: 11px;
      opacity: 0.5;
    }

    /* 閫氳褰?(Tab 2) */
    .wechat-contacts-scroll {
      padding: 12px 14px 40px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .contacts-category-header {
      font-size: 12px;
      color: var(--color-text-secondary);
      padding: 8px 4px 4px;
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .contact-card-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      background: var(--bg-surface);
      border-radius: 12px;
      border: 0.5px solid var(--border-default);
      cursor: pointer;
    }
    .contact-card-item:active { background: var(--bg-surface); }

    .contact-avatar {
      width: 46px;
      height: 46px;
      border-radius: 8px;
      object-fit: cover;
    }

    .contact-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .contact-name-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .contact-name {
      font-size: 16px;
      font-weight: 600;
      color: var(--color-text-primary);
    }

    .contact-role-tag {
      font-size: 10.5px;
      background: var(--palace-highlight-soft);
      color: var(--palace-highlight-text);
      padding: 2px 6px;
      border-radius: 4px;
      border: 0.5px solid var(--palace-highlight-soft);
    }

    .contact-sub-detail {
      font-size: 12.5px;
      color: var(--text-secondary);
    }

    .contact-action-arrow {
      color: var(--text-muted);
      font-size: 18px;
    }

    .contact-sub-entry {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px;
      background: var(--bg-surface);
      border-radius: 12px;
      border: 0.5px solid var(--border-default);
      cursor: pointer;
    }
    .contact-sub-entry:active { background: var(--bg-elevated-solid); }
    .entry-icon { font-size: 18px; }
    .entry-label { font-size: 14px; color: var(--text-primary); flex: 1; }
    .entry-arrow { color: var(--text-muted); font-size: 18px; }

    /* 鍙戠幇 (Tab 3) */
    .wechat-discover-list {
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .discover-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px;
      background: var(--bg-surface);
      border-radius: 12px;
      border: 0.5px solid var(--border-default);
      cursor: pointer;
      transition: background 0.15s;
    }
    .discover-item:active { background: var(--bg-surface); }

    .discover-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .discover-icon { font-size: 20px; }
    .moments-compass {
      background: linear-gradient(135deg, #ec4899, #f59e0b, #3b82f6);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      display: inline-block;
      font-size: 22px;
    }
    .discover-title { font-size: 15.5px; font-weight: 500; color: var(--color-text-primary); }

    .discover-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .discover-badge-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }
    .discover-preview-avatar {
      width: 30px;
      height: 30px;
      border-radius: 6px;
      object-fit: cover;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }
    .discover-red-dot {
      position: absolute;
      top: -3px;
      right: -3px;
      width: 9px;
      height: 9px;
      background: #fa5151;
      border-radius: 50%;
      border: 1.5px solid var(--bg-elevated);
    }
    .discover-arrow { color: var(--text-primary); font-size: 18px; }

    /* 鎴?(Tab 4) */
    .wechat-me-profile-card {
      display: flex;
      align-items: center;
      padding: 20px 16px;
      background: var(--bg-surface);
      margin: 14px 14px 10px;
      border-radius: 14px;
      border: 0.5px solid var(--border-default);
      gap: 14px;
      cursor: pointer;
    }
    .wechat-me-profile-card:active { background: var(--bg-surface); }

    .me-card-avatar {
      width: 60px;
      height: 60px;
      border-radius: 12px;
      object-fit: cover;
      border: 1px solid rgba(255, 255, 255, 0.15);
    }
    .me-card-info {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .me-card-name { font-size: 18px; font-weight: 600; color: var(--color-text-primary); }
    .me-card-wxid { font-size: 12px; color: var(--color-text-secondary); }
    .me-card-tag {
      font-size: 11px;
      color: var(--palace-highlight-text);
      background: var(--palace-highlight-soft);
      padding: 2px 6px;
      border-radius: 4px;
      align-self: flex-start;
      margin-top: 2px;
    }
    .me-card-qr { color: var(--text-muted); font-size: 18px; }

    .wechat-me-menu-list {
      margin: 0 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .me-menu-item {
      display: flex;
      align-items: center;
      padding: 14px 16px;
      background: var(--bg-surface);
      border-radius: 12px;
      border: 0.5px solid var(--border-default);
      cursor: pointer;
      gap: 12px;
    }
    .me-menu-item:active { background: var(--bg-surface); }
    .me-menu-icon { font-size: 18px; }
    .me-menu-label { font-size: 14px; color: var(--color-text-primary); flex: 1; }
    .me-menu-arrow { color: var(--text-primary); font-size: 18px; }

    /* 寰俊鍥涘ぇ搴曟爮 (楂樹豢鍥?涓巌OS瑙勮寖) */
    .wechat-bottom-tabbar {
      height: 78px;
      padding-bottom: max(env(safe-area-inset-bottom, 12px), 8px);
      background: var(--bg-elevated) !important;
      backdrop-filter: blur(25px);
      -webkit-backdrop-filter: blur(25px);
      border-top: 0.5px solid var(--border-default) !important;
      display: flex;
      align-items: center;
      justify-content: space-around;
      flex-shrink: 0;
      z-index: 60;
    }

    .wechat-tab-btn {
      background: none;
      border: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      cursor: pointer;
      color: var(--text-secondary) !important;
      padding: 6px 12px;
      transition: color 0.15s;
      outline: none;
    }
    .wechat-tab-btn.active {
      color: #07c160;
    }

    .tab-icon-wrap {
      position: relative;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .tab-svg-icon {
      width: 23px;
      height: 23px;
    }

    .tab-label {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.2px;
    }

    .tab-badge {
      position: absolute;
      top: -3px;
      right: -8px;
      background: #fa5151;
      color: var(--color-text-primary);
      font-size: 9px;
      font-weight: 700;
      padding: 1px 4px;
      border-radius: 8px;
      border: 1px solid var(--bg-elevated);
    }

    .tab-dot {
      position: absolute;
      top: -1px;
      right: -3px;
      width: 7px;
      height: 7px;
      background: #fa5151;
      border-radius: 50%;
      border: 1px solid var(--bg-elevated);
    }

    /* ================= 鏈嬪弸鍦堥〉闈笌鍔ㄦ€佹祦鏍峰紡 (浠垮浘2) ================= */
    #page-moments {
      background: var(--bg-base) !important;
      display: none;
      flex-direction: column;
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      overflow: hidden;
      z-index: 70;
    }

    .moments-header {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      padding-top: max(env(safe-area-inset-top, 44px), 24px);
      height: 86px;
      background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-left: 14px;
      padding-right: 14px;
      z-index: 80;
      pointer-events: auto;
    }

    .moments-back-btn {
      background: rgba(0, 0, 0, 0.35);
      backdrop-filter: blur(10px);
      border: 0.5px solid var(--border-default);
      color: var(--color-text-primary);
      font-size: 14.5px;
      font-weight: 500;
      padding: 6px 12px;
      border-radius: 16px;
      cursor: pointer;
    }

    .moments-header-title {
      font-size: 17px;
      font-weight: 600;
      color: var(--color-text-primary);
      text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    }

    .moments-header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .moments-action-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.4);
      backdrop-filter: blur(10px);
      border: 0.5px solid var(--border-default);
      color: var(--color-text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.15s, transform 0.1s;
    }
    .moments-action-btn:active {
      transform: scale(0.92);
      background: rgba(255, 255, 255, 0.2);
    }
    .moments-action-btn.del-active {
      background: rgba(239, 68, 68, 0.6);
      border-color: #ef4444;
    }

    .moments-scroll-body {
      flex: 1;
      overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none;
      -webkit-overflow-scrolling: touch;
      position: relative;
    }

    /* 瀹藉箙灏侀潰涓庡ご鍍忔诞灞?*/
    .moments-cover-container {
      position: relative;
      width: 100%;
      height: 280px;
      background: var(--bg-surface);
      margin-bottom: 44px;
    }

    .moments-cover-bg {
      width: 100%;
      height: 100%;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      cursor: pointer;
      background-image: url('https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=1000&auto=format&fit=crop&q=80');
      position: relative;
    }

    .moments-cover-tip {
      position: absolute;
      bottom: 12px;
      left: 14px;
      font-size: 11px;
      color: rgba(255, 255, 255, 0.6);
      background: rgba(0, 0, 0, 0.35);
      padding: 3px 8px;
      border-radius: 10px;
      pointer-events: none;
      backdrop-filter: blur(4px);
    }

    .moments-user-badge {
      position: absolute;
      bottom: -32px;
      right: 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      z-index: 10;
    }

    .moments-user-name {
      font-size: 17px;
      font-weight: 700;
      color: var(--color-text-primary);
      text-shadow: 0 1px 5px rgba(0,0,0,0.9);
    }

    .moments-avatar-box {
      width: 72px;
      height: 72px;
      border-radius: 14px;
      overflow: hidden;
      border: 2px solid var(--border-default);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
      cursor: pointer;
      background: var(--bg-elevated-solid);
    }

    .moments-avatar-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    /* 鏈嬪弸鍦堝姩鎬佹祦鍒楄〃 */
    .moments-feed-wrap {
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding: 0 16px 30px;
    }

    .moment-card {
      display: flex;
      gap: 12px;
      border-bottom: 0.5px solid var(--border-default);
      padding-bottom: 16px;
      position: relative;
    }

    .moment-author-avatar {
      width: 42px;
      height: 42px;
      border-radius: 8px;
      object-fit: cover;
      flex-shrink: 0;
      background: var(--bg-elevated-solid);
    }

    .moment-card-body {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .moment-card-author {
      font-size: 15px;
      font-weight: 600;
      color: #576b95;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .moment-card-author.bot-name {
      color: #7b9acc;
    }

    .moment-del-btn {
      background: rgba(239, 68, 68, 0.15);
      color: var(--danger-primary);
      border: 0.5px solid rgba(239, 68, 68, 0.3);
      padding: 2px 8px;
      border-radius: 6px;
      font-size: 11px;
      cursor: pointer;
    }

    .moment-text-content {
      font-size: 14.5px;
      color: var(--text-primary);
      line-height: 1.55;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .moment-media-preview {
      margin-top: 6px;
      max-width: 210px;
      max-height: 210px;
      border-radius: 8px;
      object-fit: cover;
      cursor: pointer;
      border: 0.5px solid rgba(255, 255, 255, 0.1);
    }

    .moment-footer-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 6px;
      position: relative;
    }

    .moment-time-label {
      font-size: 12px;
      color: var(--text-muted);
    }

    .moment-actions-trigger {
      width: 32px;
      height: 20px;
      border-radius: 4px;
      background: var(--bg-elevated-solid);
      border: 0.5px solid var(--border-default);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      cursor: pointer;
    }
    .actions-dot {
      width: 3.5px;
      height: 3.5px;
      background: var(--text-muted);
      border-radius: 50%;
    }

    /* 寰俊灏忚嵂涓告皵娉¤彍鍗?(璧?& 璇勮) */
    .moment-action-pill {
      position: absolute;
      right: 38px;
      top: -6px;
      height: 34px;
      background: var(--bg-elevated-solid);
      border-radius: 6px;
      display: flex;
      align-items: center;
      padding: 0 4px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
      border: 0.5px solid var(--border-default);
      z-index: 20;
      animation: pillSlideIn 0.15s ease-out;
    }
    @keyframes pillSlideIn {
      from { opacity: 0; transform: scaleX(0.7); }
      to { opacity: 1; transform: scaleX(1); }
    }

    .pill-btn {
      background: none;
      border: none;
      color: var(--color-text-primary);
      font-size: 13px;
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 6px 12px;
      cursor: pointer;
      white-space: nowrap;
    }
    .pill-btn:active { opacity: 0.7; }
    .pill-divider {
      width: 0.5px;
      height: 16px;
      background: rgba(255, 255, 255, 0.15);
    }

    /* 鐐硅禐涓庤瘎璁哄尯瀹瑰櫒 */
    .moment-interaction-box {
      margin-top: 8px;
      background: var(--bg-base);
      border: 1px solid var(--border-default);
      border-radius: 6px;
      padding: 8px 10px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 13px;
    }

    .moment-likes-list {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      color: #7b9acc;
      border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
      padding-bottom: 4px;
    }
    .like-heart-icon { color: #fa5151; font-size: 12px; }

    .moment-comments-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .moment-comment-item {
      line-height: 1.45;
      color: var(--text-primary);
    }
    .comment-user-name {
      font-weight: 600;
      color: #7b9acc;
    }
    .comment-colon { color: #9ca3af; margin-right: 4px; }
    .comment-text { color: var(--text-primary); }

    /* 鍙戞湅鍙嬪湀鍗婂睆寮圭獥 (#moment-create-modal) */
    .moment-modal-overlay {
      position: fixed;
      top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(12px);
      z-index: 999;
      display: none;
      align-items: flex-end;
    }
    .moment-modal-overlay.open { display: flex; }

    .moment-modal-card {
      width: 100%;
      background: var(--bg-elevated-solid);
      border-top-left-radius: 20px;
      border-top-right-radius: 20px;
      padding: 18px 20px max(env(safe-area-inset-bottom, 24px), 24px);
      border-top: 0.5px solid var(--border-default);
      display: flex;
      flex-direction: column;
      gap: 14px;
      animation: sheetSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes sheetSlideUp {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }

    .moment-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .moment-modal-title { font-size: 16.5px; font-weight: 600; color: var(--color-text-primary); }
    .moment-modal-cancel {
      background: none; border: none; color: var(--color-text-secondary); font-size: 15px; cursor: pointer;
    }
    .moment-modal-submit {
      background: #07c160;
      color: var(--color-text-primary);
      border: none;
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
    }

    .moment-input-textarea {
      width: 100%;
      min-height: 110px;
      background: var(--bg-elevated-solid);
      border: 0.5px solid var(--border-default);
      border-radius: 10px;
      padding: 12px;
      color: var(--color-text-primary);
      font-size: 14.5px;
      outline: none;
      resize: none;
      font-family: inherit;
    }

    .moment-image-picker-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .moment-img-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-primary);
      border: 0.5px solid var(--border-default);
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      cursor: pointer;
    }
    .moment-img-preview-box {
      width: 44px;
      height: 44px;
      border-radius: 6px;
      object-fit: cover;
      display: none;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }



/* ================= 涓撳睘 iOS 鍐呭祵灏忕澶翠笌妯″瀷鎶藉眽鏍峰紡 ================= */
.model-input-pill-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elevated-solid);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.model-input-pill-wrap:focus-within {
  border-color: #07c160;
}

.model-custom-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--color-text-primary);
  font-family: inherit;
}

.model-picker-arrow-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.model-picker-arrow-btn:active {
  color: #07c160;
  transform: scale(0.92);
}

.ios-model-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid var(--border-default);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ios-model-item-row:active {
  background: rgba(7, 193, 96, 0.18);
  border-color: rgba(7, 193, 96, 0.35);
}

.ios-model-name-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-primary);
  word-break: break-all;
}

.ios-model-select-tag {
  font-size: 11.5px;
  color: #07c160;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 10px;
}


/* ================= iOS 璁剧疆椤甸潰绾噣鎺掔増淇瑙勮寖锛堟潨缁濅换浣曟枃瀛楃爫澶存埅鏂級 ================= */
.ios-setting-screen {
  flex: 1 !important;
  background: var(--bg-base) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

.ios-card-group {
  background: var(--bg-surface) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important; /* 缁濆绂佹瑁佸壀鏂囧瓧锛?*/
  margin-bottom: 0 !important;
}

.ios-cell-row {
  padding: 14px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-top: 0.5px solid var(--border-default) !important;
  height: auto !important;
  min-height: unset !important; /* 褰诲簳瑙ｉ櫎楂樺害姝婚攣锛?*/
  box-sizing: border-box !important;
  gap: 12px !important;
  overflow: visible !important;
}

.ios-cell-row:first-child {
  border-top: none !important;
}

.ios-cell-left {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.ios-cell-main {
  font-size: 15.5px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  line-height: 1.4 !important;
  overflow: visible !important;
}

.ios-cell-sub {
  font-size: 12.5px !important;
  color: var(--color-text-secondary) !important;
  line-height: 1.5 !important;
  word-break: break-word !important;
  white-space: normal !important;
  overflow: visible !important;
  display: block !important;
}

/* 婊戝潡瀹瑰櫒瑙勮寖 */
.ios-slider-control {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 4px 0 !important;
  box-sizing: border-box !important;
}

.ios-range-input {
  flex: 1 !important;
  accent-color: var(--accent-primary) !important;
  height: 6px !important;
  cursor: pointer !important;
}

.ios-slider-val {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--color-text-secondary) !important;
  min-width: 24px !important;
  text-align: right !important;
}

/* ================= 璁板繂瀹鎶藉眽鍒嗙被鐘舵€佹牱寮?================= */
.palace-pill-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(124, 58, 237, 0.35) 100%) !important;
  border-color: rgba(168, 85, 247, 0.7) !important;
  color: #f3e8ff !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
  transform: scale(1.02);
}

.palace-banner-action-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}

.palace-banner-action-card:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
}

.ios-page-slide::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
/* 聊天界面参数面板的滑块：跟主题强调色，不用 iOS 蓝 */
#chat-look-font,
#chat-look-avatar {
  accent-color: var(--accent-primary) !important;
}

/* 聊天界面卡：「应用」按钮跟强调色，不用默认荧光绿 */
#chat-page-skin-card .chat-apply-btn {
  background: var(--accent-primary) !important;
  color: #1a1210 !important;
  border: none !important;
  font-weight: 600;
}
#chat-page-skin-card .chat-apply-btn:active {
  filter: brightness(0.94);
}

/* 聊天背景壁纸库：小图块 */
#chat-wall-card .chat-wall-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
#chat-wall-card .chat-wall-swatch {
  display: block;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}
#chat-wall-card .chat-wall-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}
#chat-wall-card .chat-wall-tile.active .chat-wall-swatch {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 2px 10px var(--accent-soft);
}
#chat-wall-card .chat-wall-tile.active .chat-wall-name {
  color: var(--accent-primary);
  font-weight: 600;
}
/* 自调色缓存：调过的颜色留一排小圆角色块，点一下切回 */
#chat-wall-card .chat-color-dot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  cursor: pointer;
  flex: none;
}
#chat-wall-card .chat-color-dot.active {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(224, 109, 100, 0.28));
}

/* 我的图片：已存的自定义背景缩略图，点一下切换 */
#chat-wall-card .chat-wall-apply {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-primary);
  color: #1a1210;
  border: none;
  cursor: pointer;
}
#chat-wall-card .chat-wall-apply:active {
  filter: brightness(0.94);
}
#chat-wall-card .chat-wall-solid-wrap .chat-wall-tile {
  display: flex;
  width: 100%;
}
#chat-wall-card .chat-photo-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}
#chat-wall-card .chat-photo-thumb.active {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 2px 10px var(--accent-soft);
}
#chat-wall-card .chat-photo-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
}
#chat-wall-card .chat-photo-empty {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 54px;
  padding-left: 2px;
}

/* ===== 桌面 App 图标：磨砂底板 token ===== */
:root {
  --desk-tile: rgba(246, 244, 255, 0.52);
  --desk-tile-line: rgba(255, 255, 255, 0.8);
  --desk-icon: #3a3358;
  --desk-ground: #b2b5da;
}
body[data-theme="light"] .ios-app-icon,
body[data-theme="light"] .dock-icon,
body[data-theme="light"] .ios-folder-mini-icon {
  --desk-tile: rgba(255, 255, 255, 0.62);
  --desk-tile-line: rgba(255, 255, 255, 0.92);
  --desk-icon: #3a3358;
}

/* ===== 首页：薰衣草纯色底 · 浅磨砂零件 · 深墨文字 ===== */
#page-home .ios-app-name,
#page-home .dock-label {
  color: #332c4d !important;
  text-shadow: none !important;
}
#page-home .ios-dot { background: rgba(51, 44, 77, 0.28); }
#page-home .ios-dot-hitbox.active .ios-dot {
  background: #332c4d;
  box-shadow: none;
}
#page-home .hero-profile-card {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 14px 34px rgba(50, 40, 90, 0.16);
}
#page-home .hero-info-plate {
  background: rgba(238, 235, 255, 0.56) !important;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: #332c4d;
}
#page-home .hero-info-plate .editable-text-name,
#page-home .hero-info-plate .editable-text-sub,
#page-home .hero-info-plate .editable-text-tag {
  color: #332c4d;
}
#page-home .hero-info-plate .location-bubble {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.7);
  color: #332c4d;
}
#page-home .hero-companion-widget {
  background: rgba(238, 235, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 34px rgba(50, 40, 90, 0.14);
}
#page-home .companion-quote-text { color: #332c4d; text-shadow: none; }
#page-home .companion-status-row { color: rgba(51, 44, 77, 0.62); }
#page-home .companion-tag { background: rgba(146, 134, 196, 0.22); color: #332c4d; }
#page-home .companion-widget-right { color: rgba(51, 44, 77, 0.5); }
#page-home .companion-avatar-dot {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.7);
}

/* ================= 微信长按菜单：白色反应条 + 白色菜单卡（按参考图排版） ================= */
.bubble-menu-stack {
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: scaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bubble-reaction-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.bubble-reaction-emoji {
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 21px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.12s ease;
}

.bubble-reaction-emoji.active {
  background: rgba(0, 0, 0, 0.07);
  transform: scale(1.08);
}

.bubble-reaction-emoji:active {
  transform: scale(0.9);
  background: rgba(0, 0, 0, 0.06);
}

.bubble-menu-card {
  width: 100% !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
  color: #111 !important;
}

.bubble-menu-item {
  color: #111 !important;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08) !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
}

.bubble-menu-item:active {
  background: rgba(0, 0, 0, 0.05) !important;
}

.bubble-menu-item.danger {
  color: #fa5151 !important;
}

.bubble-menu-icon {
  color: #111 !important;
  opacity: 0.9;
}

.bubble-menu-item.danger .bubble-menu-icon {
  color: #fa5151 !important;
  opacity: 1;
}
