/* =====================================================================
   次元陪伴 4.0 · 样式表（微信复刻 · v2 视觉精修）
   ---------------------------------------------------------------------
   手机优先；宽屏下是一个居中的「手机窗口」。
   色值对齐微信：微信绿 #07c160 / 我的气泡 #95ec69 / 列表底 #ededed
   ---- 类名与 assets/js/*.js 里的 DOM 结构一一对应，改样式别改类名 ----
   ===================================================================== */

:root {
  --wx-green: #07c160;
  --wx-green-dim: #06ad56;
  --wx-bg: #ededed;
  --wx-nav: rgba(247, 247, 247, .94);
  --wx-line: rgba(0, 0, 0, .075);
  --wx-text: #191919;
  --wx-sub: #9c9c9c;
  --wx-time: #b2b2b2;
  --my-bubble: #95ec69;
  --other-bubble: #ffffff;
  --accent: #4a9eff;          /* 被每个学生的主题色覆盖 */
  --nav-h: 52px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
          "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  color: var(--wx-text);
  background: #0c0d10;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { display: block; }
svg .f { fill: currentColor; stroke: none; }

/* ------------------------------------------------------------ 图标（内联 SVG）*/
.nav-btn svg, .icon-btn svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.tab .ico svg {
  width: 25px; height: 25px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.empty svg {
  width: 56px; height: 56px; margin: 0 auto 14px;
  fill: none; stroke: #c9c9c9; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.warn-ico {
  width: 15px; height: 15px; display: inline-block; vertical-align: -2px;
  margin-right: 5px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------ 手机外壳 */
.app {
  position: relative;
  width: 100%; max-width: 520px; height: 100dvh; margin: 0 auto;
  background: var(--wx-bg);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 760px) {
  body { background: radial-gradient(1200px 620px at 50% -8%, #24262c, #0a0b0d 72%); }
  .app {
    height: min(940px, 94dvh);
    margin-top: max(0px, calc((100dvh - min(940px, 94dvh)) / 2));
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .07);
  }
}

/* ------------------------------------------------------------ 导航栏 */
.navbar {
  position: relative; z-index: 30; flex: 0 0 auto;
  display: flex; align-items: center; gap: 4px;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--wx-nav);
  backdrop-filter: saturate(1.8) blur(14px);
  box-shadow: 0 .5px 0 var(--wx-line);
}
.navbar .title {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-size: 17px; font-weight: 600; letter-spacing: .2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.navbar .title small {
  display: block; margin-top: 1px;
  font-size: 11px; font-weight: 400; letter-spacing: 0;
  color: var(--wx-sub);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.nav-btn {
  flex: 0 0 auto; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #333;
  transition: background .13s, opacity .13s;
}
.nav-btn:hover { background: rgba(0, 0, 0, .05); }
.nav-btn:active { background: rgba(0, 0, 0, .09); }
.nav-btn.text { width: auto; padding: 0 10px; font-size: 15px; }

/* ------------------------------------------------------------ 主页 */
.home { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.home-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.search-bar { position: relative; padding: 9px 12px; background: #f7f7f7; }
.search-bar::before {
  content: ""; position: absolute; left: 24px; top: 50%;
  width: 15px; height: 15px; margin-top: -7px; pointer-events: none;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.search-bar input {
  width: 100%; height: 36px; border: 0; border-radius: 9px;
  background: #fff; padding: 0 12px 0 34px;
  font-size: 14.5px; outline: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}
.search-bar input::placeholder { color: #b6b6b6; }

.chat-list { background: #fff; }
.chat-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #fff; cursor: pointer;
  transition: background .13s;
}
.chat-item::after {
  content: ""; position: absolute; left: 76px; right: 0; bottom: 0;
  height: .5px; background: var(--wx-line);
}
.chat-item:last-child::after { display: none; }
.chat-item:hover { background: #fafafa; }
.chat-item:active { background: #ececec; }
.chat-item .avatar {
  width: 50px; height: 50px; flex: 0 0 auto;
  border-radius: 9px; object-fit: cover; background: #dcdcdc;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .06);
}
.chat-item .main { flex: 1 1 auto; min-width: 0; }
.chat-item .row1 { display: flex; align-items: baseline; gap: 8px; }
.chat-item .name {
  flex: 1 1 auto; min-width: 0; font-size: 16.5px; font-weight: 500;
  letter-spacing: .2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.chat-item .time { flex: 0 0 auto; font-size: 11.5px; color: var(--wx-time); }
.chat-item .row2 { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.chat-item .preview {
  flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--wx-sub);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.list-group-title {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  text-align: center; font-size: 12px; color: #b6b6b6; letter-spacing: .2px;
}

/* ------------------------------------------------------------ 底部 tab */
.tabbar {
  flex: 0 0 auto; display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--wx-nav);
  backdrop-filter: saturate(1.8) blur(14px);
  box-shadow: 0 -.5px 0 var(--wx-line);
}
.tab {
  flex: 1 1 0; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; color: #7a7a7a;
  transition: color .13s;
}
.tab:active { opacity: .6; }
.tab.active { color: var(--wx-green); }

/* ------------------------------------------------------------ 聊天页 */
.chat {
  position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
  background-color: #d9d9d9;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
/* 背景压一层淡淡的雾，气泡压在人物上也看得清 */
.chat::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .12) 24%,
    rgba(255, 255, 255, .14) 68%, rgba(255, 255, 255, .28) 100%);
  backdrop-filter: blur(2px) saturate(1.04);
}
.msg-scroll {
  position: relative; z-index: 1;
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 12px 10px;
  display: flex; flex-direction: column; gap: 12px;
}

/* 时间分隔 / 系统提示 */
.time-sep {
  align-self: center; padding: 3px 9px; border-radius: 5px;
  font-size: 11px; color: #fff; letter-spacing: .3px;
  background: rgba(0, 0, 0, .18);
  backdrop-filter: blur(6px);
}
.sys-note {
  align-self: center; max-width: 88%; padding: 7px 12px; border-radius: 8px;
  font-size: 11.5px; line-height: 1.55; text-align: center; color: #fff;
  background: rgba(0, 0, 0, .26);
  backdrop-filter: blur(6px);
}
.sys-note.warn { background: rgba(196, 48, 48, .84); }

/* 消息行 */
.msg { display: flex; gap: 9px; align-items: flex-start; max-width: 100%; animation: msgIn .2s ease both; }
.msg.right { flex-direction: row-reverse; }
.msg .m-avatar {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 8px; object-fit: cover;
  background: #cfcfcf;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16), inset 0 0 0 .5px rgba(0, 0, 0, .05);
}
.msg .stack { display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 104px); }
.msg .bubble {
  position: relative; padding: 9px 13px; border-radius: 10px;
  background: var(--other-bubble);
  font-size: 15.5px; line-height: 1.52; letter-spacing: .2px;
  word-break: break-word; white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .055);
}
.msg.right .bubble { background: var(--my-bubble); }
.msg .bubble::after {
  content: ""; position: absolute; top: 11px; left: -5px;
  border: 5px solid transparent; border-left: 0;
  border-right-color: var(--other-bubble);
}
.msg.right .bubble::after {
  left: auto; right: -5px;
  border-left: 5px solid var(--my-bubble); border-right: 0;
}
.msg .bubble .action { color: #8d8d8d; }
.msg .bubble.sticker { padding: 0; background: transparent; box-shadow: none; }
.msg .bubble.sticker::after { display: none; }
.msg .bubble.sticker img {
  display: block; max-width: min(172px, 42vw); max-height: 200px;
  border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

/* 思考链 */
.think {
  align-self: flex-start; margin-left: 47px;
  max-width: calc(100% - 104px); overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .07); border-left: 2px solid var(--accent);
  border-radius: 9px; background: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  font-size: 12.5px; color: #5f5f5f;
}
.think-head {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px; cursor: pointer; user-select: none;
  font-weight: 500; letter-spacing: .2px;
}
.think-head .caret { font-size: 10px; color: #9a9a9a; transition: transform .16s; }
.think.open .think-head .caret { transform: rotate(90deg); }
.think:not(.done) .think-head .t-label { animation: pulse 1.5s ease-in-out infinite; }
.think-body {
  display: none; padding: 2px 10px 9px; margin-top: 1px;
  max-height: 240px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.6;
  border-top: 1px dashed rgba(0, 0, 0, .07);
}
.think.open .think-body { display: block; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* 正在输入 */
.typing { display: inline-flex; align-items: center; gap: 4px; height: 14px; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #b8b8b8;
  animation: tblink 1.25s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes tblink {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.cursor::after { content: "▍"; color: #9a9a9a; animation: tblink 1s infinite; }

/* ------------------------------------------------------------ 输入栏 */
.inputbar {
  position: relative; z-index: 20; flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--wx-nav);
  backdrop-filter: saturate(1.8) blur(14px);
  box-shadow: 0 -.5px 0 var(--wx-line);
}
.inputbar .icon-btn {
  flex: 0 0 auto; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; color: #4a4a4a;
  transition: background .13s;
}
.inputbar .icon-btn:hover { background: rgba(0, 0, 0, .05); }
.inputbar textarea {
  flex: 1 1 auto; min-height: 36px; max-height: 110px;
  padding: 8px 11px; border: 0; border-radius: 9px; outline: none; resize: none;
  background: #fff; font-size: 15.5px; line-height: 1.4;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .05);
}
.send-btn {
  flex: 0 0 auto; height: 36px; padding: 0 15px; border-radius: 9px;
  background: var(--wx-green); color: #fff;
  font-size: 14.5px; font-weight: 500; letter-spacing: .5px;
  transition: background .13s, opacity .13s;
}
.send-btn:hover { background: var(--wx-green-dim); }
.send-btn:active { opacity: .82; }
.send-btn:disabled { background: #d4d4d4; color: #f7f7f7; cursor: not-allowed; }
.send-btn.ghost { background: #fff; color: #333; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }

/* ------------------------------------------------------------ 表情包面板 */
.sticker-panel {
  position: relative; z-index: 20; flex: 0 0 auto;
  display: none; max-height: 320px; overflow-y: auto;
  background: #f7f7f7; box-shadow: 0 -.5px 0 var(--wx-line);
}
.sticker-panel.open { display: block; animation: panelUp .16s ease; }
@keyframes panelUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sticker-panel .sp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 2px; font-size: 12px; color: var(--wx-sub);
}
.sticker-panel .sp-head .sp-close { color: var(--accent); cursor: pointer; }
.sticker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 8px 12px 14px;
}
.sticker-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px; border-radius: 11px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: transform .12s, box-shadow .12s;
}
.sticker-grid button:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .1); }
.sticker-grid button:active { transform: scale(.96); }
.sticker-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 7px; }
.sticker-grid span { font-size: 10.5px; color: var(--wx-sub); }

/* ------------------------------------------------------------ 抽屉 / 弹窗 */
.sheet-mask {
  position: absolute; inset: 0; z-index: 60; display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(1px);
}
.sheet-mask.open { display: flex; }
.sheet {
  width: 100%; max-height: 88%; overflow-y: auto;
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .18);
  animation: sheetUp .22s cubic-bezier(.22, .8, .3, 1);
}
@keyframes sheetUp { from { transform: translateY(22px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet::before {
  content: ""; display: block; width: 36px; height: 4px; margin: 2px auto 12px;
  border-radius: 2px; background: #e2e2e2;
}
.sheet h3 {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px; font-size: 17px; font-weight: 600; letter-spacing: .2px;
}
.sheet h3 .close {
  width: 30px; height: 30px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 50%;
  color: #aaa; font-size: 17px; transition: background .13s;
}
.sheet h3 .close:hover { background: #f2f2f2; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: #666; }
.field input[type=text], .field input[type=password],
.field textarea, .field select {
  width: 100%; padding: 10px 11px; border: 1px solid #e6e6e6; border-radius: 9px;
  background: #fafafa; font-size: 14px; outline: none;
  transition: border-color .13s, background .13s;
}
.field input:focus, .field textarea:focus { border-color: var(--wx-green); background: #fff; }
.field textarea { min-height: 118px; resize: vertical; line-height: 1.55; }
.field .hint { margin-top: 6px; font-size: 11.5px; line-height: 1.65; color: var(--wx-sub); }
.field .row { display: flex; align-items: center; gap: 8px; }
.field .row .btn { flex: 0 0 auto; white-space: nowrap; }   /* 修：「保存」被压成竖排两行 */

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: .5px solid #f0f0f0;
}
.switch-row:last-of-type { border-bottom: 0; }
.switch-row .lbl { font-size: 14.5px; }
.switch-row .sub { margin-top: 3px; font-size: 11.5px; color: var(--wx-sub); line-height: 1.5; }
.switch {
  flex: 0 0 auto; width: 46px; height: 27px; border-radius: 14px;
  background: #dcdcdc; position: relative; transition: background .18s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s;
}
.switch.on { background: var(--wx-green); }
.switch.on::after { transform: translateX(19px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 9px; white-space: nowrap;
  background: var(--wx-green); color: #fff;
  font-size: 14.5px; font-weight: 500;
  transition: filter .13s, opacity .13s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { opacity: .85; }
.btn.gray { background: #f2f2f2; color: #333; }
.btn.red { background: #fa5151; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row .btn { flex: 1 1 0; }

.pill {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 9px;
  border-radius: 11px; font-size: 11.5px;
  background: #eef4ff; color: #2b6cb0;
}
.pill.bad { background: #ffecec; color: #c0392b; }
.pill.ok { background: #eafaf0; color: #1a9e57; }

/* ------------------------------------------------------------ 吐司 */
.toast {
  position: absolute; left: 50%; bottom: 104px; z-index: 90;
  transform: translateX(-50%) translateY(6px);
  max-width: 84%; padding: 10px 15px; border-radius: 10px;
  background: rgba(0, 0, 0, .82); color: #fff;
  font-size: 13px; line-height: 1.55; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------ 空态 */
.empty {
  padding: 44px 22px; text-align: center;
  font-size: 13px; line-height: 1.9; color: var(--wx-sub);
}

/* 新消息弹入 */
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 滚动条静音化 */
.msg-scroll::-webkit-scrollbar, .home-body::-webkit-scrollbar,
.sheet::-webkit-scrollbar, .sticker-panel::-webkit-scrollbar,
.think-body::-webkit-scrollbar { width: 0; height: 0; }

/* ------------------------------------------------------------ 视图切换 */
.home { position: relative; }
.view { display: none; }
.view.active { display: block; }

/* ------------------------------------------------------------ 通讯录 */
.contacts { background: #fff; }
.contacts-group-title {
  padding: 5px 14px; font-size: 12.5px; letter-spacing: .6px;
  color: #7d7d7d; background: #f4f4f4;
}
.contact-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 24px 9px 14px; background: #fff; cursor: pointer;
  transition: background .13s;
}
.contact-item::after {
  content: ""; position: absolute; left: 66px; right: 0; bottom: 0;
  height: .5px; background: var(--wx-line);
}
.contact-item:hover { background: #fafafa; }
.contact-item:active { background: #ececec; }
.contact-item .avatar {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 8px;
  object-fit: cover; background: #dcdcdc;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .06);
}
.contact-item .cmain { flex: 1 1 auto; min-width: 0; }
.contact-item .cname { font-size: 16px; letter-spacing: .2px; }
.contact-item .csub {
  margin-top: 3px; font-size: 11.5px; color: var(--wx-sub);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* 右侧字母索引 */
.index-bar {
  position: absolute; right: 3px; top: 50%; z-index: 6;
  transform: translateY(-50%);
  display: none; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 6px; border-radius: 12px;
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(6px);
}
.index-bar.show { display: flex; }
.index-bar b {
  font-size: 10.5px; font-weight: 600; line-height: 1.32;
  color: #767676; cursor: pointer; transition: color .12s;
}
.index-bar b:hover { color: var(--wx-green); }

/* 点索引时弹出的大字母（微信同款反馈） */
.index-bubble {
  position: absolute; left: 50%; top: 42%; z-index: 7;
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: #fff; font-size: 34px; font-weight: 600;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  opacity: 0; transform: scale(.86); pointer-events: none;
  transition: opacity .16s, transform .16s;
}
.index-bubble.show { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
/* ------------------------------------------------------------ 系统介绍页 */
.about { padding-bottom: 8px; }
.about-hero {
  padding: 28px 18px 22px; text-align: center;
  background: #fff; margin-bottom: 10px;
}
.about-logo {
  width: 68px; height: 68px; margin: 0 auto 13px; border-radius: 19px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #07c160, #0aa85a);
  box-shadow: 0 10px 26px rgba(7, 193, 96, .28);
}
.about-logo svg { width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.about-title { font-size: 21px; font-weight: 600; letter-spacing: .6px; }
.about-sub { margin-top: 6px; font-size: 12.5px; color: var(--wx-sub); }
.about-badge {
  display: inline-block; margin-top: 13px; padding: 4px 12px; border-radius: 11px;
  font-size: 11.5px; background: #eafaf0; color: #1a9e57;
}
.about-card { background: #fff; margin-bottom: 10px; padding: 2px 16px 12px; }
.about-card-title { padding: 14px 0 10px; font-size: 13px; color: #8a8a8a; letter-spacing: .3px; }
.kv {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-top: .5px solid #f2f2f2; font-size: 14.5px;
}
.about-card-title + .kv { border-top: 0; }
.kv b { font-weight: 500; font-size: 13.5px; color: #4a4a4a; text-align: right; }
.kv b.ok { color: #1a9e57; }
.kv b.bad { color: #c0392b; }
.about-flow {
  padding: 2px 0 8px; font-size: 12.5px; line-height: 2; color: #555;
  white-space: pre-wrap; word-break: break-word;
}
.about-path { padding: 10px 0; border-top: .5px solid #f2f2f2; display: flex; flex-direction: column; gap: 4px; }
.about-path:first-of-type { border-top: 0; }
.about-path span { font-size: 14px; }
.about-path code, .about-tip code {
  align-self: flex-start; padding: 2px 7px; border-radius: 5px;
  font-family: Consolas, "Courier New", monospace; font-size: 11.5px;
  color: #2b6cb0; background: #f3f8ff; word-break: break-all;
}
.about-path i { font-style: normal; font-size: 11.5px; color: var(--wx-sub); }
.about-tip { padding: 2px 0 6px; font-size: 13px; line-height: 2; color: #555; }
.about-tip code { display: inline-block; margin: 2px 0; }
.about-foot {
  padding: 18px 22px 26px; text-align: center;
  font-size: 11.5px; line-height: 1.9; color: #a8a8a8;
}
/* ------------------------------------------------------------ 助手回答里的代码 */
.msg .bubble pre {
  margin: 6px 0; padding: 9px 11px; border-radius: 8px;
  background: #f5f6f8; overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.6; white-space: pre;
}
.msg.right .bubble pre { background: rgba(0, 0, 0, .07); }
.msg .bubble code {
  padding: 1px 5px; border-radius: 4px; background: #f1f2f4;
  font-family: Consolas, "Courier New", monospace; font-size: 13px;
}
.msg .bubble pre code { padding: 0; background: none; font-size: 12.5px; }
.msg .bubble b { font-weight: 600; }

/* ============ 聊天页顶部：当前服务商 / 模型 胶囊 ============ */
/* flex-basis 设成 0%：标题完全按「剩下的空间」来分配，胶囊才不会被挤出屏幕 */
.navbar .title { flex: 1 1 0%; min-width: 0; }
.navbar .title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-chip {
  flex: 0 0 auto;
  box-sizing: border-box;
  max-width: 132px;
  margin: 0 4px;
  padding: 3px 8px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 11px;
  background: rgba(255, 255, 255, .75);
  color: #576b95;
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.model-chip:active { background: rgba(0, 0, 0, .07); }
@media (max-width: 380px) { .model-chip { max-width: 92px; font-size: 10px; } }
/* ===================================================== 板块（作品）切换条
   注意：这里是 .home（纵向 flex）的子项，必须写 flex: 0 0 auto，
   否则会被 .home-body 挤扁成一条（曾经就是这个 bug）。 */
.section-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 8px;
  min-height: 45px; box-sizing: border-box;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #f7f7f7;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .045);
}
.section-bar::-webkit-scrollbar { display: none; }
.section-chip {
  flex: 0 0 auto; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 12.5px; line-height: 1; padding: 7px 12px;
  border-radius: 999px; border: 1px solid rgba(0, 0, 0, .07);
  background: #fff; color: #4a4a4a;
  transition: background .15s, color .15s, transform .1s;
}
.section-chip:hover { background: #f2f2f2; }
.section-chip:active { transform: scale(.97); }
.section-chip.active {
  background: var(--chip, #07c160); border-color: transparent; color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
html[data-theme="dark"] .section-bar { background: #1f1f1f; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); }
html[data-theme="dark"] .section-chip { background: #2b2b2b; color: #ccc; border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .section-chip:hover { background: #333; }

/* 页面外围背景：桌面端浏览器里手机壳周围那圈颜色（手机上看不到） */
html, body { background: #ededed; }
html[data-theme="dark"], html[data-theme="dark"] body { background: #111; }
@media (min-width: 760px) {
  html, body { background: #e6e6e6; }
}

/* ===================================================== AI 聊天服务使用规范 */
.terms-entry { cursor: pointer; }
.terms-body { padding: 2px 2px 6px; word-break: break-word; overflow-wrap: anywhere; }
.terms-intro { margin: 4px 0 12px; color: #444; font-size: 14.5px; line-height: 1.75; }
.terms-item { margin: 0 0 14px; }
.terms-t {
  font-size: 14.5px; font-weight: 600; color: #1a1a1a; margin-bottom: 4px;
  padding-left: 9px; border-left: 3px solid var(--wx-green, #07c160); line-height: 1.5;
}
.terms-d { font-size: 14px; color: #555; line-height: 1.78; }
.terms-footer {
  margin: 16px 0 6px; padding-top: 12px; font-size: 14px; color: #333;
  border-top: 1px solid rgba(0, 0, 0, .07); line-height: 1.75;
}
.terms-updated { margin: 8px 0 2px; font-size: 12px; color: #aaa; text-align: right; }
html[data-theme="dark"] .terms-intro, html[data-theme="dark"] .terms-d { color: #bbb; }
html[data-theme="dark"] .terms-t { color: #eee; }
html[data-theme="dark"] .terms-footer { color: #ddd; border-top-color: rgba(255,255,255,.08); }

/* 规范弹层的「我已知悉」按钮 */
.terms-ack { margin: 18px 0 4px; }
.terms-ack-btn {
  width: 100%; padding: 11px; border: 0; border-radius: 10px;
  background: var(--wx-green, #07c160); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.terms-ack-btn:active { filter: brightness(.94); }
