/* ============================================================
   小西 · 方块世界专属小助理  —  样式表
   Minecraft 像素/方块化 GUI × 浅色可爱风
   ============================================================ */

/* ---------- 字体 ---------- */
@font-face{
  font-family:"ZCOOL KuaiLe";
  src:url("../fonts/zcool-kuaile-latin.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+2000-206F,U+20A0-20CF,U+2100-214F,U+2190-21FF,U+2200-22FF;
  font-weight:400;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"ZCOOL KuaiLe";
  src:url("../fonts/zcool-kuaile-cn.woff2") format("woff2");
  font-weight:400;font-style:normal;font-display:swap;
}
@font-face{
  font-family:"Press Start 2P";
  src:url("../fonts/press-start-2p-latin.woff2") format("woff2");
  font-weight:400;font-style:normal;font-display:swap;
}

/* ---------- 设计变量（默认 = 粉色主题） ---------- */
:root{
  /* 底色 */
  --bg-page:#EDF6ED;
  --bg-card:#FFFFFF;
  --side-grad-a:#FFF7FB;
  --side-grad-b:#FFE7F1;

  /* 主色（粉） */
  --pink-900:#B84C86;
  --pink-700:#E1739F;
  --pink-500:#FF9DC4;
  --pink-400:#FFAFD0;
  --pink-300:#FFC4DD;
  --pink-200:#FFD3E5;
  --pink-150:#FFE1EC;
  --pink-100:#FFF0F6;
  --pink-50:#FFF9FC;
  --bubble-assistant:#FFF6FA;

  /* 绿（用户侧） */
  --green-500:#8FD9A8;
  --green-300:#B7E4C7;
  --green-200:#E6F7EA;
  --green-line:#A9DBB8;
  --green-text:#4F6B57;
  --online:#6FCF97;

  /* 文字 */
  --ink-900:#6B5560;
  --ink-700:#7A5566;
  --ink-500:#9A7C8B;
  --ink-400:#A9819A;
  --ink-300:#C98FAE;
  --ink-200:#CDA9BC;
  --ink-150:#D3B4C4;

  /* 线 */
  --line-soft:#F8E2EC;
  --line-pink:#FFC4DD;

  /* 结构 */
  --radius-card:24px;
  --radius-bubble:16px;
  --radius-chip:12px;
  --shadow-card:0 18px 44px -10px rgba(212,140,179,.28);
  --shadow-soft:0 8px 20px -8px rgba(230,140,178,.35);

  --font-display:"ZCOOL KuaiLe","PingFang SC","Microsoft YaHei","Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",system-ui,sans-serif;
  --font-pixel:"Press Start 2P","ZCOOL KuaiLe","Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",monospace;
  --font-body:"Sarasa Gothic SC","PingFang SC","Noto Sans SC","Microsoft YaHei","Hiragino Sans GB","Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",system-ui,sans-serif;

  /* —— 换肤用的「主题令牌」—— 由 data-theme 覆盖 —— */
  --th-strong:#B84C86;      /* 标题/强调主色 */
  --th-main:#FF9DC4;        /* 主按钮 / 高亮 */
  --th-mid:#FFC4DD;         /* 边框 / 描边 */
  --th-soft:#FFF0F6;        /* 头像底色 / 浅底 */
  --th-faint:#FFF9FC;       /* 输入框底色 */
  --th-accent:#E8A7C6;      /* 副标题/装饰文字 */
  --th-tint-bg:#FFE7F1;     /* 侧栏渐变 */
  --th-glow:rgba(255,157,196,.10);          /* 背景砖块线 */
  --th-shadow:rgba(212,140,179,.28);        /* 卡片投影 */
  --th-avatar-hue:0deg;     /* 头像色相偏移 */
  --th-avatar-saturate:1.05; /* 头像饱和度（hue-rotate 会降饱和，按主题补回） */
  --th-avatar-brightness:1;  /* 头像亮度 */
  --th-avatar-contrast:1;    /* 头像对比度 */
  --th-btn-dark:#E86FA6;    /* 主按钮深色阴影 */
  --th-btn-disabled:#EFB4CE;
  --th-focus-ring:rgba(255,175,208,.22);  /* 输入框聚焦光晕 */

  /* —— 像素装饰图标（浅色半透明，随主题微调主色）—— */
  --px-pink:#E889B4;
  --px-mint:#8FD9A8;
  --px-amber:#F0C264;
  --px-blue:#7FB8E8;

  --px-heart:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='3' y='2' width='2' height='1' fill='%23E889B4'/%3E%3Crect x='11' y='2' width='2' height='1' fill='%23E889B4'/%3E%3Crect x='2' y='3' width='4' height='1' fill='%23E889B4'/%3E%3Crect x='10' y='3' width='4' height='1' fill='%23E889B4'/%3E%3Crect x='2' y='4' width='12' height='3' fill='%23E889B4'/%3E%3Crect x='3' y='7' width='10' height='1' fill='%23E889B4'/%3E%3Crect x='4' y='8' width='8' height='1' fill='%23E889B4'/%3E%3Crect x='5' y='9' width='6' height='1' fill='%23E889B4'/%3E%3Crect x='6' y='10' width='4' height='1' fill='%23E889B4'/%3E%3Crect x='7' y='11' width='2' height='1' fill='%23E889B4'/%3E%3C/svg%3E");
  --px-star:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='7' y='1' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='7' y='13' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='1' y='7' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='13' y='7' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='7' y='3' width='2' height='10' fill='%23F0C264'/%3E%3Crect x='3' y='7' width='10' height='2' fill='%23F0C264'/%3E%3Crect x='5' y='5' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='9' y='5' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='5' y='9' width='2' height='2' fill='%23F0C264'/%3E%3Crect x='9' y='9' width='2' height='2' fill='%23F0C264'/%3E%3C/svg%3E");
  --px-flower:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='7' y='2' width='2' height='4' fill='%23E889B4'/%3E%3Crect x='2' y='7' width='4' height='2' fill='%23E889B4'/%3E%3Crect x='10' y='7' width='4' height='2' fill='%23E889B4'/%3E%3Crect x='6' y='6' width='4' height='4' fill='%23F0C264'/%3E%3Crect x='7' y='10' width='2' height='5' fill='%238FD9A8'/%3E%3Crect x='4' y='11' width='2' height='2' fill='%238FD9A8'/%3E%3C/svg%3E");
  --px-axolotl:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='4' y='6' width='8' height='5' fill='%23E889B4'/%3E%3Crect x='3' y='7' width='1' height='2' fill='%23E889B4'/%3E%3Crect x='12' y='7' width='1' height='2' fill='%23E889B4'/%3E%3Crect x='2' y='5' width='2' height='1' fill='%23E889B4'/%3E%3Crect x='12' y='5' width='2' height='1' fill='%23E889B4'/%3E%3Crect x='1' y='4' width='2' height='1' fill='%23E889B4'/%3E%3Crect x='13' y='4' width='2' height='1' fill='%23E889B4'/%3E%3Crect x='5' y='7' width='1' height='1' fill='%23333'/%3E%3Crect x='10' y='7' width='1' height='1' fill='%23333'/%3E%3Crect x='6' y='9' width='4' height='1' fill='%23333'/%3E%3Crect x='3' y='13' width='1' height='2' fill='%23E889B4'/%3E%3Crect x='12' y='13' width='1' height='2' fill='%23E889B4'/%3E%3Crect x='6' y='15' width='4' height='1' fill='%23E889B4'/%3E%3C/svg%3E");
  --px-fish:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='4' y='6' width='7' height='4' fill='%237FB8E8'/%3E%3Crect x='2' y='7' width='2' height='2' fill='%237FB8E8'/%3E%3Crect x='1' y='8' width='1' height='1' fill='%237FB8E8'/%3E%3Crect x='11' y='6' width='2' height='1' fill='%237FB8E8'/%3E%3Crect x='11' y='9' width='2' height='1' fill='%237FB8E8'/%3E%3Crect x='13' y='7' width='1' height='2' fill='%237FB8E8'/%3E%3Crect x='9' y='7' width='1' height='1' fill='%23333'/%3E%3C/svg%3E");
  --px-drop:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='7' y='2' width='2' height='2' fill='%237FB8E8'/%3E%3Crect x='5' y='4' width='6' height='2' fill='%237FB8E8'/%3E%3Crect x='4' y='6' width='8' height='2' fill='%237FB8E8'/%3E%3Crect x='4' y='8' width='8' height='2' fill='%237FB8E8'/%3E%3Crect x='5' y='10' width='6' height='2' fill='%237FB8E8'/%3E%3Crect x='6' y='12' width='4' height='2' fill='%237FB8E8'/%3E%3Crect x='7' y='14' width='2' height='1' fill='%237FB8E8'/%3E%3C/svg%3E");
  --px-bubble:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='6' y='1' width='4' height='1' fill='%239FD4F0'/%3E%3Crect x='4' y='2' width='2' height='1' fill='%239FD4F0'/%3E%3Crect x='10' y='2' width='2' height='1' fill='%239FD4F0'/%3E%3Crect x='6' y='2' width='4' height='1' fill='%23E4F3FD'/%3E%3Crect x='3' y='3' width='1' height='2' fill='%239FD4F0'/%3E%3Crect x='12' y='3' width='1' height='2' fill='%239FD4F0'/%3E%3Crect x='4' y='3' width='8' height='1' fill='%23E4F3FD'/%3E%3Crect x='4' y='4' width='8' height='1' fill='%23E4F3FD'/%3E%3Crect x='2' y='5' width='1' height='4' fill='%239FD4F0'/%3E%3Crect x='13' y='5' width='1' height='4' fill='%239FD4F0'/%3E%3Crect x='3' y='5' width='10' height='1' fill='%23E4F3FD'/%3E%3Crect x='3' y='6' width='10' height='1' fill='%23E4F3FD'/%3E%3Crect x='3' y='7' width='10' height='1' fill='%23E4F3FD'/%3E%3Crect x='3' y='8' width='10' height='1' fill='%23E4F3FD'/%3E%3Crect x='3' y='9' width='1' height='2' fill='%239FD4F0'/%3E%3Crect x='12' y='9' width='1' height='2' fill='%239FD4F0'/%3E%3Crect x='4' y='9' width='8' height='1' fill='%23E4F3FD'/%3E%3Crect x='4' y='10' width='8' height='1' fill='%23E4F3FD'/%3E%3Crect x='4' y='11' width='2' height='1' fill='%239FD4F0'/%3E%3Crect x='10' y='11' width='2' height='1' fill='%239FD4F0'/%3E%3Crect x='6' y='11' width='4' height='1' fill='%23E4F3FD'/%3E%3Crect x='6' y='12' width='4' height='1' fill='%239FD4F0'/%3E%3Crect x='5' y='3' width='2' height='1' fill='%23FFFFFF'/%3E%3Crect x='4' y='4' width='2' height='1' fill='%23FFFFFF'/%3E%3C/svg%3E");
}

/* —— 黄色主题 —— */
[data-theme="mint"]{
  --th-strong:#B8892A;
  --th-main:#FFC94D;
  --th-mid:#F5D98B;
  --th-soft:#FFF7E0;
  --th-faint:#FFFDF4;
  --th-accent:#D9AE4A;
  --th-tint-bg:#FFF0C9;
  --th-glow:rgba(255,201,77,.14);
  --th-shadow:rgba(224,178,72,.30);
  --th-avatar-hue:70deg;
  --th-avatar-saturate:1.4;
  --th-avatar-brightness:0.92;
  --th-avatar-contrast:1.12;
  --th-btn-dark:#E0A72E;
  --th-btn-disabled:#F0D89C;
  --th-focus-ring:rgba(255,201,77,.30);

  --pink-900:#A97B1E;
  --pink-700:#C6942C;
  --pink-500:#FFC94D;
  --pink-400:#FFD575;
  --pink-300:#F5D98B;
  --pink-200:#FAE5A8;
  --pink-150:#FCEDC4;
  --pink-100:#FFF7E0;
  --pink-50:#FFFDF4;
  --bubble-assistant:#FFF9E8;
  --line-soft:#FBEFD0;
  --line-pink:#F5D98B;
  --side-grad-a:#FFFBF0;
  --side-grad-b:#FFF0C9;
  --ink-900:#6E5A2C;
  --ink-700:#7A6534;
  --ink-500:#9C8A5C;
  --ink-400:#A8966A;
  --ink-300:#B8A67E;
  --ink-200:#D0C2A0;
  --ink-150:#DBD0B5;
  --shadow-card:0 18px 44px -10px rgba(224,178,72,.30);
  --shadow-soft:0 8px 20px -8px rgba(255,201,77,.35);
}

/* —— 天空蓝主题 —— */
[data-theme="sky"]{
  --th-strong:#3D6B9B;
  --th-main:#7FB8E8;
  --th-mid:#AAD0F0;
  --th-soft:#EAF4FC;
  --th-faint:#F4F9FD;
  --th-accent:#79A7CF;
  --th-tint-bg:#DDEBF8;
  --th-glow:rgba(127,184,232,.12);
  --th-shadow:rgba(100,150,200,.28);
  --th-avatar-hue:-130deg;
  --th-btn-dark:#5B92C6;
  --th-btn-disabled:#AAD0F0;
  --th-focus-ring:rgba(127,184,232,.25);

  --pink-900:#3D6B9B;
  --pink-700:#5B92C6;
  --pink-500:#7FB8E8;
  --pink-400:#94C4EE;
  --pink-300:#AAD0F0;
  --pink-200:#C5DEF5;
  --pink-150:#D8E9F8;
  --pink-100:#EAF4FC;
  --pink-50:#F4F9FD;
  --bubble-assistant:#F0F7FC;
  --line-soft:#E3EEF8;
  --line-pink:#AAD0F0;
  --side-grad-a:#F2F8FD;
  --side-grad-b:#DDEBF8;
  --ink-900:#4A6074;
  --ink-700:#526B80;
  --ink-500:#7C92A3;
  --ink-400:#88A0B2;
  --ink-300:#9DB2C1;
  --ink-200:#BDCBD5;
  --ink-150:#CBD6DE;
  --shadow-card:0 18px 44px -10px rgba(100,150,200,.28);
  --shadow-soft:0 8px 20px -8px rgba(127,184,232,.35);
}

/* ---------- 基础 ---------- */
*,*::before,*::after{box-sizing:border-box;}

html,body{height:100%;}

body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink-900);
  background:var(--bg-page);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow:hidden;
}

h1,h2,p{margin:0;}
button{font-family:inherit;border:0;background:none;cursor:pointer;color:inherit;}
img{display:block;max-width:100%;}
textarea{font-family:inherit;}

::selection{background:var(--pink-200);color:var(--pink-900);}

/* ---------- 背景：像素砖块层 ---------- */
.bg-blocks{
  position:fixed;inset:0;z-index:0;pointer-events:none;
  background-image:
    linear-gradient(to right,var(--th-glow) 2px,transparent 2px),
    linear-gradient(to bottom,var(--th-glow) 2px,transparent 2px);
  background-size:48px 48px;
  mask-image:radial-gradient(circle at 50% 40%,#000 20%,transparent 78%);
  -webkit-mask-image:radial-gradient(circle at 50% 40%,#000 20%,transparent 78%);
  transition:background-image .4s ease;
}
body::before,
body::after{
  content:"";position:fixed;z-index:0;pointer-events:none;border-radius:10px;
}
body::before{
  width:72px;height:72px;left:6vw;top:12vh;
  background:rgba(255,196,221,.42);
  box-shadow:88px 148px 0 -14px rgba(183,228,199,.42), 208px 32px 0 -22px rgba(255,175,208,.5);
  animation:floaty 7s ease-in-out infinite;
}
body::after{
  width:56px;height:56px;right:7vw;bottom:14vh;
  background:rgba(183,228,199,.45);
  box-shadow:-118px -104px 0 -12px rgba(255,196,221,.5), -232px 40px 0 -18px rgba(255,225,236,.75);
  animation:floaty 9s ease-in-out infinite reverse;
}
@keyframes floaty{
  0%,100%{transform:translate3d(0,0,0) rotate(0)}
  50%{transform:translate3d(0,-14px,0) rotate(2deg)}
}

/* ---------- 背景：柔和光斑（更大面积） ---------- */
.glow-blobs{
  position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;
}
.glow-blobs::before,
.glow-blobs::after{
  content:"";position:absolute;border-radius:50%;filter:blur(60px);
}
.glow-blobs::before{
  width:48vw;height:48vw;left:-12vw;top:-14vh;
  background:radial-gradient(circle,rgba(255,175,208,.34),transparent 68%);
  animation:drift 16s ease-in-out infinite;
}
.glow-blobs::after{
  width:44vw;height:44vw;right:-10vw;bottom:-16vh;
  background:radial-gradient(circle,rgba(183,228,199,.32),transparent 66%);
  animation:drift 20s ease-in-out infinite reverse;
}
@keyframes drift{
  0%,100%{transform:translate3d(0,0,0) scale(1)}
  50%{transform:translate3d(3vw,-2vh,0) scale(1.08)}
}

/* ---------- 背景：像素小图标漂浮层（卡片外） ---------- */
.pixel-float{
  position:fixed;inset:0;z-index:0;pointer-events:none;
}
.pixel-float i{
  position:absolute;display:block;
  background-repeat:no-repeat;background-size:contain;
  opacity:.22;filter:saturate(.9);
  animation:floaty 8s ease-in-out infinite;
}
.pixel-float i:nth-child(1){width:38px;height:38px;left:5vw;top:64vh;background-image:var(--px-heart);animation-duration:9s}
.pixel-float i:nth-child(2){width:30px;height:30px;right:6vw;top:22vh;background-image:var(--px-star);animation-duration:11s;animation-delay:-2s}
.pixel-float i:nth-child(3){width:34px;height:34px;right:12vw;top:68vh;background-image:var(--px-flower);animation-duration:10s;animation-delay:-4s}
.pixel-float i:nth-child(4){width:44px;height:44px;left:11vw;top:16vh;background-image:var(--px-axolotl);animation-duration:12s;animation-delay:-1s}
.pixel-float i:nth-child(5){width:28px;height:28px;left:20vw;bottom:12vh;background-image:var(--px-fish);animation-duration:9s;animation-delay:-3s}
.pixel-float i:nth-child(6){width:26px;height:26px;right:18vw;bottom:20vh;background-image:var(--px-drop);animation-duration:13s;animation-delay:-5s}
.pixel-float i:nth-child(7){width:30px;height:30px;left:9vw;top:32vh;background-image:var(--px-bubble);animation-duration:10s;animation-delay:-1.5s}
.pixel-float i:nth-child(8){width:24px;height:24px;right:9vw;top:44vh;background-image:var(--px-star);animation-duration:9s;animation-delay:-3.5s}
.pixel-float i:nth-child(9){width:32px;height:32px;left:26vw;bottom:30vh;background-image:var(--px-flower);animation-duration:12s;animation-delay:-2.5s}
.pixel-float i:nth-child(10){width:28px;height:28px;right:22vw;top:14vh;background-image:var(--px-drop);animation-duration:11s;animation-delay:-4.5s}
.pixel-float i:nth-child(11){width:36px;height:36px;left:14vw;top:78vh;background-image:var(--px-bubble);animation-duration:13s;animation-delay:-6s}
.pixel-float i:nth-child(12){width:26px;height:26px;right:4vw;top:60vh;background-image:var(--px-heart);animation-duration:10s;animation-delay:-2s}

/* ---------- 舞台 / 卡片 ---------- */
.stage{
  position:relative;z-index:1;
  height:100dvh;
  display:flex;align-items:center;justify-content:center;
  padding:28px;
}

.app{
  position:relative;
  width:100%;max-width:1440px;
  height:100%;max-height:900px;
  display:flex;
  background:var(--bg-card);
  border-radius:var(--radius-card);
  box-shadow:var(--shadow-card);
  overflow:hidden;
  animation:appIn .6s cubic-bezier(.22,1,.36,1) both;
}
.app::after{
  content:"";position:absolute;inset:0;border-radius:var(--radius-card);
  border:2px solid var(--th-mid);pointer-events:none;
  z-index:5;
  transition:border-color .4s ease;
}
@keyframes appIn{
  from{opacity:0;transform:translateY(18px) scale(.985)}
  to{opacity:1;transform:none}
}

/* ============================================================
   左：助手资料栏
   ============================================================ */
.sidebar{
  position:relative;flex:0 0 320px;width:320px;
  display:flex;flex-direction:column;
  gap:16px;align-items:center;
  padding:30px 24px;
  background:linear-gradient(180deg,var(--side-grad-a) 0%,var(--side-grad-b) 100%);
  overflow-y:auto;overflow-x:hidden;
  scrollbar-width:thin;scrollbar-color:var(--pink-200) transparent;
}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:var(--pink-200);border-radius:3px}

/* 卡片内部：侧栏像素装饰（轻淡） */
.sidebar-deco{
  position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;
}
.sidebar-deco i{
  position:absolute;display:block;background-repeat:no-repeat;background-size:contain;
  opacity:.2;animation:floaty 11s ease-in-out infinite;
}
.sidebar-deco i:nth-child(1){width:30px;height:30px;left:10%;top:16%;background-image:var(--px-axolotl);animation-duration:13s}
.sidebar-deco i:nth-child(2){width:26px;height:26px;right:12%;top:38%;background-image:var(--px-flower);animation-duration:10s;animation-delay:-3s}
.sidebar-deco i:nth-child(3){width:24px;height:24px;left:14%;bottom:16%;background-image:var(--px-star);animation-duration:12s;animation-delay:-5s}
.sidebar-deco i:nth-child(4){width:28px;height:28px;right:16%;bottom:34%;background-image:var(--px-fish);animation-duration:14s;animation-delay:-2s}
.sidebar-deco i:nth-child(5){width:22px;height:22px;right:10%;top:60%;background-image:var(--px-bubble);animation-duration:12s;animation-delay:-1s}
.sidebar-deco i:nth-child(6){width:24px;height:24px;left:8%;bottom:42%;background-image:var(--px-drop);animation-duration:11s;animation-delay:-4s}
/* 侧栏内容提升到装饰之上（排除装饰层自身） */
.sidebar > :not(.sidebar-deco){position:relative;z-index:1}

/* 品牌行 */
.brand{
  display:flex;align-items:center;gap:10px;width:100%;
}
.brand__icon{flex:0 0 26px;width:26px;height:26px}
.brand__icon svg{width:100%;height:100%;display:block}
.brand__icon .bi-bg{fill:var(--pink-200);transition:fill .4s ease}
.brand__icon .bi-main{fill:var(--pink-500);transition:fill .4s ease}
.brand__icon .bi-mid{fill:var(--pink-300);transition:fill .4s ease}
.brand__texts{display:flex;flex-direction:column;gap:3px;min-width:0}
.brand__title{
  font-family:var(--font-display);font-size:16px;color:var(--pink-900);
  line-height:1.1;letter-spacing:.02em;
}
.brand__sub{
  font-family:var(--font-pixel);font-size:8px;letter-spacing:.06em;
  color:var(--th-accent);line-height:1;
}

/* 头像 */
.portrait{
  position:relative;
  width:180px;height:180px;flex:0 0 180px;
  border-radius:24px;
  overflow:hidden;
  background:var(--pink-100);
  border:4px solid var(--th-mid);
  box-shadow:0 10px 22px -4px var(--shadow-soft);
  animation:portraitIn .7s .1s cubic-bezier(.22,1,.36,1) both;
}
.portrait img{
  width:100%;height:100%;object-fit:cover;
  filter:hue-rotate(var(--th-avatar-hue,0deg)) saturate(var(--th-avatar-saturate,1.05)) brightness(var(--th-avatar-brightness,1)) contrast(var(--th-avatar-contrast,1));
  transition:filter .4s ease;
}
@keyframes portraitIn{
  from{opacity:0;transform:scale(.9) rotate(-3deg)}
  to{opacity:1;transform:none}
}
.portrait__spark{
  position:absolute;width:8px;height:8px;background:#fff;border-radius:2px;
  box-shadow:0 0 10px rgba(255,255,255,.9);opacity:.85;
  animation:twinkle 2.6s ease-in-out infinite;
}
.portrait__spark--a{top:14px;right:16px}
.portrait__spark--b{bottom:20px;left:14px;animation-delay:1.3s;width:6px;height:6px}
@keyframes twinkle{
  0%,100%{opacity:.25;transform:scale(.7)}
  50%{opacity:1;transform:scale(1.15)}
}

/* 名字 / 定位 */
.name{
  font-family:var(--font-display);font-size:26px;line-height:1.15;
  color:var(--pink-900);text-align:center;width:100%;
  animation:riseIn .5s .18s both;
}
.role{
  font-size:13px;color:var(--ink-300);text-align:center;width:100%;
  margin-top:-8px;animation:riseIn .5s .24s both;
}
@keyframes riseIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* 状态胶囊 */
.status{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 16px;border-radius:20px;
  background:#fff;border:2px solid var(--th-mid);
  box-shadow:0 2px 0 var(--th-mid);
  animation:riseIn .5s .3s both;
}
.status__dot{
  width:9px;height:9px;border-radius:50%;background:var(--online);
  box-shadow:0 0 0 3px rgba(111,207,151,.22);
  animation:pulse 2s ease-in-out infinite;
}
@keyframes pulse{
  0%,100%{box-shadow:0 0 0 3px rgba(111,207,151,.22)}
  50%{box-shadow:0 0 0 6px rgba(111,207,151,.05)}
}
.status__text{font-size:12px;color:var(--ink-400)}

.divider{
  width:100%;height:2px;border-radius:2px;background:var(--line-soft);flex:0 0 2px;
}

/* 快捷提问 */
.quick__label{
  width:100%;font-size:12px;font-weight:600;color:var(--ink-300);letter-spacing:.04em;
}
.quick{display:flex;flex-direction:column;gap:10px;width:100%}
.quick__chip{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  padding:13px 16px;border-radius:var(--radius-chip);
  background:#fff;border:2px solid var(--th-mid);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease;
}
.quick__chip:hover{
  transform:translate(-1px,-2px);
  border-color:var(--pink-300);
  box-shadow:3px 4px 0 rgba(255,175,208,.55);
  background:var(--pink-50);
}
.quick__chip:active{transform:translate(0,0);box-shadow:0 0 0 rgba(0,0,0,0)}
.quick__dot{
  flex:0 0 9px;width:9px;height:9px;border-radius:2px;background:var(--pink-400);
  transition:background .16s ease;
}
.quick__chip:hover .quick__dot{background:var(--pink-500)}
.quick__text{font-size:13px;color:var(--ink-500);line-height:1.4;min-width:0}

.spacer{flex:1 1 auto;min-height:8px}

/* 底部贴士 */
.tip{
  width:100%;padding:16px;border-radius:14px;
  background:#fff;border:2px solid var(--th-mid);
  box-shadow:0 4px 0 var(--th-mid);
}
.tip__title{
  font-family:var(--font-display);font-size:14px;color:var(--pink-900);margin-bottom:8px;
}
.tip__text{font-size:12px;line-height:20px;color:var(--ink-500)}

/* ============================================================
   右：聊天主区
   ============================================================ */
.chat{
  flex:1 1 auto;min-width:0;
  display:flex;flex-direction:column;
  background:#fff;
  position:relative;
}
/* 白色聊天框内部：透明「我的世界」白色气泡漂浮层 */
.chat-bubbles{
  position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;
}
.chat-bubbles i{
  position:absolute;display:block;
  background-repeat:no-repeat;background-size:contain;
  animation:floaty 12s ease-in-out infinite;
}
.chat-bubbles i:nth-child(1){width:30px;height:30px;left:10%;top:16%;opacity:.38;animation-duration:11s}
.chat-bubbles i:nth-child(2){width:20px;height:20px;right:14%;top:30%;opacity:.3;animation-duration:13s;animation-delay:-2s}
.chat-bubbles i:nth-child(3){width:26px;height:26px;left:5%;top:62%;opacity:.32;animation-duration:10s;animation-delay:-4s}
.chat-bubbles i:nth-child(4){width:18px;height:18px;right:7%;top:72%;opacity:.28;animation-duration:12s;animation-delay:-1s}
.chat-bubbles i:nth-child(5){width:22px;height:22px;left:44%;top:12%;opacity:.3;animation-duration:14s;animation-delay:-3s}
.chat-bubbles i:nth-child(6){width:18px;height:18px;right:34%;bottom:18%;opacity:.26;animation-duration:11s;animation-delay:-5s}
.chat-bubbles i:nth-child(7){width:24px;height:24px;left:20%;top:44%;opacity:.32;animation-duration:13s;animation-delay:-2.5s}
.chat-bubbles i:nth-child(8){width:16px;height:16px;right:22%;top:62%;opacity:.26;animation-duration:10s;animation-delay:-4.5s}
.chat-bubbles i{background-image:var(--px-bubble)}
/* 聊天区内容提升到气泡层之上 */
.chat > :not(.chat-bubbles){position:relative;z-index:1}

/* 顶部栏 */
.chat__top{
  flex:0 0 80px;height:80px;
  display:flex;align-items:center;gap:14px;
  padding:0 24px 0 28px;
  border-bottom:2px solid var(--line-soft);
  background:#fff;
}
.chat__profile-toggle{
  display:none;
  flex:0 0 46px;width:46px;height:46px;border-radius:12px;overflow:hidden;
  border:2px solid var(--line-pink);background:var(--pink-100);padding:0;
}
.chat__profile-toggle img{width:100%;height:100%;object-fit:cover;filter:hue-rotate(var(--th-avatar-hue,0deg)) saturate(var(--th-avatar-saturate,1.05)) brightness(var(--th-avatar-brightness,1)) contrast(var(--th-avatar-contrast,1));transition:filter .4s ease}

.chat__meta{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1 1 auto}
.chat__title{
  font-family:var(--font-display);font-size:17px;line-height:1.15;color:var(--ink-700);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.chat__subtitle{
  font-size:12px;color:var(--ink-200);line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

.chat__actions{display:flex;align-items:center;gap:14px;flex:0 0 auto}
.icon-btn{
  width:34px;height:34px;border-radius:10px;display:grid;place-items:center;
  border:2px solid var(--th-mid);background:#fff;color:var(--ink-300);
  transition:transform .15s ease,box-shadow .15s ease,color .15s ease,border-color .15s ease;
}
.icon-btn svg{width:18px;height:18px}
.icon-btn:hover{
  color:var(--pink-700);border-color:var(--pink-300);
  transform:translateY(-1px);box-shadow:2px 3px 0 rgba(255,175,208,.5);
}
.icon-btn:active{transform:none;box-shadow:none}

.win-dots{display:flex;gap:8px;align-items:center}
.win-dot{
  width:16px;height:16px;border-radius:5px;display:block;padding:0;
  border:2px solid transparent;cursor:pointer;position:relative;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.win-dot:hover{transform:translateY(-2px);box-shadow:0 3px 0 rgba(0,0,0,.10)}
.win-dot:active{transform:none;box-shadow:none}
.win-dot[aria-pressed="true"]{
  border-color:var(--ink-900);
  box-shadow:0 0 0 2px #fff inset;
}
/* 色块颜色 = 点击后界面变成的颜色 */
.win-dot--1{background:#FF9DC4}
.win-dot--2{background:#FFC94D}
.win-dot--3{background:#7FB8E8}

/* 消息滚动区 */
.chat__messages{
  flex:1 1 auto;min-height:0;
  display:flex;flex-direction:column;gap:18px;
  padding:26px 36px 20px;
  overflow-y:auto;overflow-x:hidden;
  scroll-behavior:smooth;
  scrollbar-width:thin;scrollbar-color:var(--pink-200) transparent;
  position:relative;
}
/* 卡片内部：像素装饰（消息区，轻淡） */
.messages-deco{
  position:absolute;inset:0;pointer-events:none;z-index:0;
}
.messages-deco i{
  position:absolute;display:block;background-repeat:no-repeat;background-size:contain;
  opacity:.18;animation:floaty 10s ease-in-out infinite;
}
.messages-deco i:nth-child(1){width:34px;height:34px;right:6%;top:10%;background-image:var(--px-heart);animation-duration:12s}
.messages-deco i:nth-child(2){width:26px;height:26px;left:4%;top:26%;background-image:var(--px-star);animation-duration:10s;animation-delay:-2s}
.messages-deco i:nth-child(3){width:30px;height:30px;right:3%;bottom:12%;background-image:var(--px-drop);animation-duration:13s;animation-delay:-4s}
.messages-deco i:nth-child(4){width:30px;height:30px;left:8%;bottom:22%;background-image:var(--px-fish);animation-duration:11s;animation-delay:-1s}
.chat__messages::-webkit-scrollbar{width:8px}
.chat__messages::-webkit-scrollbar-track{background:transparent}
.chat__messages::-webkit-scrollbar-thumb{background:var(--pink-200);border-radius:4px}
.chat__messages::-webkit-scrollbar-thumb:hover{background:var(--pink-300)}

/* 单条消息 */
.msg{
  position:relative;z-index:1;
  display:flex;gap:12px;align-items:flex-start;
  animation:msgIn .38s cubic-bezier(.22,1,.36,1) both;
}
@keyframes msgIn{
  from{opacity:0;transform:translateY(10px) scale(.97)}
  to{opacity:1;transform:none}
}
.msg--user{justify-content:flex-end}

.msg__avatar{
  flex:0 0 44px;width:44px;height:44px;border-radius:12px;overflow:hidden;
  border:2px solid var(--line-pink);background:var(--pink-100);
}
.msg__avatar img{width:100%;height:100%;object-fit:cover;filter:hue-rotate(var(--th-avatar-hue,0deg)) saturate(var(--th-avatar-saturate,1.05)) brightness(var(--th-avatar-brightness,1)) contrast(var(--th-avatar-contrast,1));transition:filter .4s ease}
.msg--user .msg__avatar{
  border-color:var(--green-line);background:var(--green-200);
  display:grid;place-items:center;
}
.face{display:block;width:22px;height:22px}
.face svg{width:100%;height:100%;display:block}

/* 气泡 */
.bubble{
  position:relative;
  max-width:min(370px,70%);
  padding:11px 15px;
  font-size:14px;line-height:22px;
  border-radius:var(--radius-bubble);
  border:2px solid var(--line-pink);
  background:var(--bubble-assistant);
  color:var(--ink-900);
  word-break:break-word;overflow-wrap:anywhere;
  white-space:pre-wrap;
}
.msg--assistant .bubble{border-top-left-radius:4px}
.bubble--user{
  border-color:var(--green-line);
  background:var(--green-200);
  color:var(--green-text);
  border-top-right-radius:4px;
  border-top-left-radius:var(--radius-bubble);
}
.bubble strong{color:var(--pink-900);font-weight:700}
.bubble--user strong{color:#3F5A47}
.bubble a{color:var(--pink-700);text-decoration:underline;text-underline-offset:2px}

/* 正在输入 */
.bubble--typing{
  display:inline-flex;align-items:center;gap:7px;
  padding:13px 17px;
}
.dot{
  width:9px;height:9px;border-radius:50%;background:var(--pink-400);
  animation:dotBounce 1.2s infinite ease-in-out;
}
.dot:nth-child(2){background:var(--pink-300);animation-delay:.18s}
.dot:nth-child(3){background:var(--pink-150);animation-delay:.36s}
@keyframes dotBounce{
  0%,60%,100%{transform:translateY(0);opacity:.65}
  30%{transform:translateY(-6px);opacity:1}
}

/* 消息小工具 */
.msg__tools{
  display:flex;gap:6px;margin-top:8px;opacity:0;
  transition:opacity .18s ease;
}
.msg--assistant .msg__tools{padding-left:2px}
.msg--user .msg__tools{justify-content:flex-end}
.msg:hover .msg__tools,
.msg__tools:focus-within{opacity:1}
.msg__tool{
  font-size:11px;color:var(--ink-300);
  padding:3px 9px;border-radius:8px;
  border:1.5px solid var(--pink-150);background:#fff;
  transition:color .15s ease,border-color .15s ease,background .15s ease;
}
.msg__tool:hover{color:var(--pink-700);border-color:var(--pink-300);background:var(--pink-50)}

/* 消息列以 0 为基准拉伸占满剩余宽度 —— 气泡的百分比 max-width 才有确定参照，不会溢出 */
.msg__col{
  flex:1 1 0%;min-width:0;
  display:flex;flex-direction:column;align-items:flex-start;
}
.msg--user .msg__col{align-items:flex-end}

/* ============================================================
   输入区
   ============================================================ */
.chat__composer{
  flex:0 0 auto;
  padding:12px 36px 18px;
  display:flex;flex-direction:column;gap:8px;
  background:#fff;
}
.composer{display:flex;align-items:center;gap:10px}
.composer__box{
  flex:1 1 auto;min-width:0;
  display:flex;align-items:center;
  min-height:50px;padding:0 16px;
  background:var(--pink-50);
  border:2px solid var(--line-pink);
  border-radius:14px;
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.composer__box:focus-within{
  border-color:var(--pink-400);
  background:#fff;
  box-shadow:0 0 0 4px var(--th-focus-ring);
}
.composer__input{
  flex:1 1 auto;width:100%;
  border:0;outline:0;background:transparent;resize:none;
  font-size:14px;line-height:22px;color:var(--ink-900);
  max-height:132px;padding:14px 0;
}
.composer__input::placeholder{color:var(--ink-200)}
.composer__send{
  flex:0 0 50px;width:50px;height:50px;border-radius:14px;
  background:var(--pink-500);display:grid;place-items:center;
  box-shadow:0 4px 0 var(--th-btn-dark);
  transition:transform .14s ease,box-shadow .14s ease,background .14s ease;
}
.composer__send svg{width:21px;height:21px}
.composer__send:hover{background:var(--pink-400);transform:translateY(-1px);box-shadow:0 5px 0 var(--th-btn-dark)}
.composer__send:active{transform:translateY(3px);box-shadow:0 1px 0 var(--th-btn-dark)}
.composer__send:disabled{background:var(--pink-200);box-shadow:0 4px 0 var(--th-btn-disabled);cursor:not-allowed;transform:none}
.composer__hint{
  text-align:center;font-size:11px;color:var(--ink-150);letter-spacing:.02em;
}

/* ============================================================
   Toast
   ============================================================ */
.toast{
  position:fixed;left:50%;bottom:38px;transform:translate(-50%,20px);
  padding:11px 20px;border-radius:12px;
  background:rgba(107,85,96,.94);color:#fff;font-size:13px;
  box-shadow:0 10px 26px -8px rgba(107,85,96,.6);
  opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease;
  z-index:99;
}
.toast.is-on{opacity:1;transform:translate(-50%,0)}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width:1180px){
  .stage{padding:16px}
  .sidebar{flex-basis:280px;width:280px;padding:24px 18px}
  .portrait{width:150px;height:150px;flex-basis:150px}
  .name{font-size:23px}
  .chat__messages{padding:24px 26px 20px}
  .chat__composer{padding:12px 26px 18px}
  .bubble{max-width:min(420px,80%)}
}

@media (max-width:900px){
  body{overflow:auto}
  .stage{padding:0;height:100dvh}
  .app{
    max-height:none;height:100dvh;border-radius:0;
    flex-direction:column;overflow:hidden;
  }
  .app::after{border-radius:0;border-width:0}
  .sidebar{
    flex:0 0 auto;width:100%;
    flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px;
    padding:14px 18px;
    max-height:0;padding-top:0;padding-bottom:0;border-bottom:0;
    transition:max-height .32s ease,padding .32s ease;
    overflow:hidden;
  }
  .app.is-profile-open .sidebar{
    max-height:min(62dvh,460px);
    padding-top:16px;padding-bottom:18px;
    border-bottom:2px solid var(--line-soft);
    overflow-y:auto;
  }
  .sidebar .spacer{display:none}
  .brand{order:1;width:auto;flex:1 1 auto}
  .portrait{order:3;width:96px;height:96px;flex-basis:96px;border-width:3px;margin:0 auto;border-radius:18px}
  .name{order:4;width:auto;font-size:22px}
  .role{order:5;width:100%;margin-top:-4px}
  .status{order:6;margin:0 auto}
  .divider{order:7}
  .quick__label{order:8}
  .quick{order:9;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
  .quick__chip{flex:0 0 auto;width:auto;white-space:nowrap}
  .tip{order:10;display:none}

  .chat__profile-toggle{display:block}
  .chat__top{flex-basis:64px;height:64px;padding:0 16px;gap:12px}
  .chat__title{font-size:16px}
  .win-dots{display:none}
  .chat__actions{gap:10px}
  .chat__messages{padding:18px 16px 14px;gap:16px}
  .chat__composer{padding:10px 16px calc(14px + env(safe-area-inset-bottom))}
  .bubble{max-width:82%;font-size:14px}
  .msg__avatar,.chat__profile-toggle{flex-basis:38px}
  .msg__avatar{width:38px;height:38px}
  .composer__send{flex-basis:52px;width:52px;height:52px}
  .composer__box{min-height:52px}
  .composer__input{padding:15px 0}
}

@media (max-width:420px){
  .bubble{max-width:88%}
  .chat__subtitle{display:none}
}

/* 尊重减少动效偏好 */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}
