/* ============================================================
   Serein 内置 AI 对话（.sa-*）——白色、极简、果冻质感的玻璃
   模糊只用在两处固定层：顶栏与底部输入胶囊（下面有内容滚动经过，模糊才看得出）
   ============================================================ */
.sa-screen > .app-header { display: none; }
.sa-screen { background: #fcfcfd; }
.sa-root {
  --bg: #fcfcfd; --ink: #1c1c20; --ink2: #4b4b53; --sub: #8e8e96; --faint: rgba(20, 20, 40, .055);
  --glass: rgba(255, 255, 255, .62); --glass-b: rgba(255, 255, 255, .92);
  --sh: 0 10px 30px rgba(44, 44, 84, .075); --hi: inset 0 1px 0 rgba(255, 255, 255, .96);
  --lo: inset 0 -7px 14px rgba(196, 198, 214, .22);
  --ub1: #f4f4f7; --ub2: #e7e7ed; --ab1: #ffffff; --ab2: #f4f4f7;
  --code: #f4f4f7; --fill: rgba(120, 120, 134, .1); --btn1: #4a4a50; --btn2: #2a2a2e; --btnI: #fff;
  --acc: #8a7ba8; --red: #c9483f;
  --sa-fs: 16px;
  --top: calc(24px + env(safe-area-inset-top, 0px));
  flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: "SereinCustom", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}
.sa-root.sa-night {
  --bg: #121214; --ink: #ececf0; --ink2: #c3c3cb; --sub: #85858f; --faint: rgba(255, 255, 255, .065);
  --glass: rgba(34, 34, 38, .62); --glass-b: rgba(255, 255, 255, .07);
  --sh: 0 10px 30px rgba(0, 0, 0, .38); --hi: inset 0 1px 0 rgba(255, 255, 255, .08);
  --lo: inset 0 -7px 14px rgba(0, 0, 0, .22);
  --ub1: #36363c; --ub2: #2b2b30; --ab1: #232327; --ab2: #1d1d21;
  --code: #1b1b1f; --fill: rgba(255, 255, 255, .08); --btn1: #f1f1f4; --btn2: #d2d2d8; --btnI: #1c1c20;
}
.sa-screen:has(.sa-night) { background: #121214; }
.sa-root button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sa-root svg { display: block; }

/* 背景两团极浅的雾（静态，不动画） */
.sa-amb { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.sa-amb i { position: absolute; border-radius: 50%; }
.sa-amb i:first-child { width: 120%; height: 60%; right: -55%; top: -18%; background: radial-gradient(closest-side, rgba(220, 216, 234, .42), rgba(220, 216, 234, 0)); }
.sa-amb i:last-child { width: 110%; height: 55%; left: -55%; bottom: -10%; background: radial-gradient(closest-side, rgba(214, 220, 230, .38), rgba(214, 220, 230, 0)); }
.sa-night .sa-amb i:first-child { background: radial-gradient(closest-side, rgba(96, 88, 120, .18), rgba(96, 88, 120, 0)); }
.sa-night .sa-amb i:last-child { background: radial-gradient(closest-side, rgba(70, 78, 92, .16), rgba(70, 78, 92, 0)); }

/* ---------- 顶栏：薄、玻璃、下缘渐隐 ---------- */
.sa-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 0;
  padding: var(--top) 6px 4px;
}
.sa-top::before {
  content: ""; position: absolute; inset: 0 0 -14px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 70%, transparent 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.sa-ib { flex: none; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--ink2); border-radius: 50%; }
.sa-ib svg { width: 22px; height: 22px; }
.sa-ib:active { background: var(--fill); }
.sa-ib.ph { visibility: hidden; }
.sa-ttl { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.15; cursor: pointer; padding: 0 4px; }
.sa-ttl b { font-size: 15.5px; font-weight: 650; letter-spacing: .2px; color: var(--ink); }
.sa-ttl span { font-size: 11px; color: var(--sub); margin-top: 2px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-ttl span:empty { display: none; }

/* ---------- 消息区 ---------- */
.sa-msgs {
  flex: 1 1 auto; min-height: 0; position: relative; z-index: 1;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--top) + 52px) 0 128px;
}
.sa-list { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.sa-ts { text-align: center; font-size: 11.5px; color: var(--sub); margin: 16px 0 10px; letter-spacing: .3px; }
.sa-more { display: block; margin: 4px auto 10px; font-size: 12.5px !important; color: var(--sub) !important; padding: 6px 14px !important; border-radius: 14px; background: var(--fill) !important; }

.sa-av { flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: block; background: var(--ab2); box-shadow: 0 2px 8px rgba(40, 40, 80, .1), inset 0 0 0 .5px rgba(0, 0, 0, .04); }
.sa-av img, .sa-av svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa-av.big { width: 72px; height: 72px; box-shadow: 0 14px 34px rgba(60, 56, 100, .14), 0 0 0 8px rgba(255, 255, 255, .5); }
.sa-night .sa-av.big { box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 8px rgba(255, 255, 255, .04); }
/* 聊天列表里的 Serein 行（在 .sa-root 之外） */
.sa-av.li { width: 50px; height: 50px; box-shadow: 0 3px 10px rgba(40, 40, 80, .1); }
.tag.sa-tag { background: #efedf4; color: #6f6585; }

/* 我 */
.sa-m.u { display: flex; flex-direction: column; align-items: flex-end; margin: 6px 0 16px; }
.sa-ub {
  position: relative; max-width: 84%; padding: 10px 15px; border-radius: 21px 21px 7px 21px;
  background: linear-gradient(180deg, var(--ub1), var(--ub2));
  box-shadow: var(--hi), var(--lo), 0 5px 16px rgba(44, 44, 84, .055);
  font-size: var(--sa-fs); line-height: 1.58; color: var(--ink); word-break: break-word;
  transition: transform .18s;
}
.sa-ub.pressed, .sa-bub.pressed, .sa-doc.pressed { transform: scale(.975); }
.sa-uq { font-size: 12.5px; line-height: 1.45; color: var(--sub); padding-left: 9px; border-left: 2px solid var(--acc); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sa-utags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.sa-utag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink2); }
.sa-utag svg { width: 13px; height: 13px; }
.sa-utags + .sa-ut { margin-top: 1px; }
.sa-uimgs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 86%; margin-bottom: 6px; }
.sa-uimgs img { width: 104px; height: 104px; object-fit: cover; border-radius: 16px; box-shadow: 0 5px 16px rgba(44, 44, 84, .1); }
.sa-uimgs img:only-child { width: auto; height: auto; max-width: 220px; max-height: 260px; }
.sa-ufiles { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-bottom: 6px; max-width: 86%; }
.sa-fchip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 9px 13px 9px 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .05); }
.sa-fchip svg { width: 20px; height: 20px; flex: none; color: var(--ink2); }
.sa-fchip b { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-fchip small { font-size: 11px; color: var(--sub); flex: none; }

/* 表情回应 */
.sa-rx {
  position: absolute; left: -10px; bottom: -11px; min-width: 26px; height: 24px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1;
  border-radius: 13px; background: var(--ab1); box-shadow: var(--hi), 0 3px 10px rgba(44, 44, 84, .14);
}
.sa-bub .sa-rx { left: auto; right: -10px; }
.sa-rxrow { margin-top: 4px; }
.sa-rxrow .sa-rx { position: static; }

/* Serein */
.sa-m.a { margin: 4px 0 18px; }
.sa-m.a.cont { margin-top: -6px; }
.sa-ahd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sa-ahd b { font-size: 13.5px; font-weight: 650; color: var(--ink); letter-spacing: .2px; }
.sa-ahd small { font-size: 11px; color: var(--sub); }
.sa-m.a.bubble .sa-abody { padding-left: 34px; }
.sa-bub {
  position: relative; width: fit-content; max-width: 92%; margin: 0 0 6px; padding: 10px 15px;
  border-radius: 21px 21px 21px 7px; background: linear-gradient(180deg, var(--ab1), var(--ab2));
  border: .5px solid rgba(0, 0, 0, .035);
  box-shadow: var(--hi), var(--lo), 0 5px 16px rgba(44, 44, 84, .055);
  font-size: var(--sa-fs); line-height: 1.62; word-break: break-word; transition: transform .18s;
}
.sa-night .sa-bub { border-color: rgba(255, 255, 255, .04); }
.sa-bub > :first-child { margin-top: 0; }
.sa-bub > :last-child { margin-bottom: 0; }
.sa-bub .sa-code, .sa-bub .sa-web { margin-left: -6px; margin-right: -6px; }
.sa-bub:has(.sa-web) { width: 100%; }

.sa-doc { font-size: var(--sa-fs); line-height: 1.78; color: var(--ink); word-break: break-word; transition: transform .18s; }
.sa-doc > :first-child, .sa-bub > :first-child { margin-top: 0; }
.sa-doc p, .sa-bub p { margin: 0 0 .78em; }
.sa-doc > :last-child { margin-bottom: 0; }
.sa-doc h2, .sa-doc h3, .sa-doc h4, .sa-bub h2, .sa-bub h3, .sa-bub h4 { font-weight: 650; line-height: 1.4; margin: 1.15em 0 .5em; letter-spacing: .1px; }
.sa-doc h2, .sa-bub h2 { font-size: 1.22em; }
.sa-doc h3, .sa-bub h3 { font-size: 1.1em; }
.sa-doc h4, .sa-bub h4 { font-size: 1em; }
.sa-doc ul, .sa-doc ol, .sa-bub ul, .sa-bub ol { margin: .3em 0 .8em; padding-left: 1.35em; }
.sa-doc li, .sa-bub li { margin: .28em 0; }
.sa-doc li::marker, .sa-bub li::marker { color: var(--sub); }
.sa-task { list-style: none; position: relative; }
.sa-task i { position: absolute; left: -1.3em; top: .38em; width: 14px; height: 14px; border-radius: 5px; background: var(--fill); }
.sa-task i.on { background: var(--btn2); }
.sa-task i.on::after { content: ""; position: absolute; left: 4.5px; top: 2px; width: 4px; height: 7px; border: solid var(--btnI); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.sa-doc blockquote, .sa-bub blockquote { margin: .6em 0 .9em; padding: 2px 0 2px 13px; border-left: 2.5px solid var(--faint); color: var(--ink2); }
.sa-doc hr, .sa-bub hr { border: none; height: 1px; background: var(--faint); margin: 1.3em 0; }
.sa-doc b, .sa-bub b { font-weight: 650; }
.sa-doc code, .sa-bub code, .sa-ut code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; padding: 1.5px 6px; border-radius: 7px; background: var(--fill); }
.sa-doc a, .sa-bub a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-underline-offset: 3px; word-break: break-all; }
.sa-doc .sa-cite, .sa-bub .sa-cite {
  display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px;
  margin: 0 1px; border-radius: 9px; font-size: 10.5px; line-height: 1; text-decoration: none; vertical-align: 2px;
  background: var(--fill); color: var(--ink2);
}
.sa-mdimg { max-width: 100%; border-radius: 14px; display: block; margin: .6em 0; }
.sa-tbl { overflow-x: auto; margin: .7em 0 1em; border-radius: 14px; background: var(--ab1); box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .05); border: .5px solid var(--faint); }
.sa-tbl table { border-collapse: collapse; min-width: 100%; font-size: .9em; line-height: 1.55; }
.sa-tbl th, .sa-tbl td { padding: 9px 12px; text-align: left; border-bottom: .5px solid var(--faint); white-space: nowrap; }
.sa-tbl td { white-space: normal; min-width: 72px; }
.sa-tbl th { font-weight: 650; background: var(--fill); }
.sa-tbl tr:last-child td { border-bottom: none; }

/* 代码 */
.sa-code { margin: .7em 0 1em; border-radius: 16px; background: var(--code); box-shadow: var(--hi), inset 0 0 0 .5px var(--faint); overflow: hidden; }
.sa-codehd { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px 0 14px; font-size: 11.5px; color: var(--sub); letter-spacing: .3px; }
.sa-cbtn { display: inline-flex !important; align-items: center; gap: 4px; padding: 5px 8px !important; border-radius: 10px; color: var(--sub) !important; font-size: 11.5px !important; }
.sa-cbtn svg { width: 15px; height: 15px; }
.sa-cbtn em { font-style: normal; }
.sa-cbtn:active { background: var(--fill) !important; }
.sa-code pre { margin: 0; padding: 6px 14px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sa-code code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.6px; line-height: 1.62; white-space: pre; padding: 0; background: none; color: var(--ink); }
.sa-code.live pre { max-height: 360px; overflow-y: auto; }
/* 网页 */
.sa-web { margin: .7em 0 1em; border-radius: 18px; overflow: hidden; background: var(--ab1); box-shadow: var(--hi), 0 8px 26px rgba(44, 44, 84, .08); border: .5px solid var(--faint); }
.sa-webhd { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-bottom: .5px solid var(--faint); }
.sa-webt { font-size: 12.5px; font-weight: 600; color: var(--ink2); flex: 1; }
.sa-webtabs { display: inline-flex; padding: 2px; border-radius: 11px; background: var(--fill); }
.sa-webtabs button { font-size: 12px !important; padding: 4px 11px !important; border-radius: 9px; color: var(--sub) !important; }
.sa-webtabs button.on { background: var(--ab1) !important; color: var(--ink) !important; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.sa-webf { display: block; width: 100%; height: 420px; border: 0; background: #fff; }
.sa-webf[hidden] { display: none; }
.sa-webcode { margin: 0; border-radius: 0; box-shadow: none; }
.sa-webcode[hidden] { display: none; }
.sa-webcode pre { max-height: 420px; overflow-y: auto; }
.sa-webov { position: absolute; inset: 0; z-index: 40; background: #fff; }
.sa-webov iframe { width: 100%; height: 100%; border: 0; display: block; }
.sa-webx { position: absolute; right: 14px; top: calc(var(--top) + 6px); width: 38px; height: 38px; border-radius: 50%; display: flex !important; align-items: center; justify-content: center; background: rgba(255, 255, 255, .82) !important; color: #1c1c20 !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .16); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sa-webx svg { width: 18px; height: 18px; }

/* 思考过程 / 搜索来源（置顶，可收起） */
.sa-think, .sa-src { margin: 0 0 12px; }
.sa-thd, .sa-shd {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 10px; border-radius: 15px; cursor: pointer;
  background: var(--fill); font-size: 12.5px; color: var(--sub); user-select: none;
}
.sa-thd em, .sa-shd em { font-style: normal; }
.sa-thd svg, .sa-shd > svg:last-child { width: 14px; height: 14px; transition: transform .22s; }
.sa-shd > svg:first-child { width: 14px; height: 14px; }
.sa-think.open .sa-thd svg, .sa-src.open .sa-shd > svg:last-child { transform: rotate(180deg); }
.sa-tdot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); flex: none; }
.sa-think.live .sa-tdot, .sa-src.live .sa-shd > svg { animation: saPulse 1.2s ease-in-out infinite; }
@keyframes saPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.sa-tbd { display: none; margin: 10px 0 2px 3px; padding: 1px 0 1px 13px; border-left: 2px solid var(--faint); font-size: 13.5px; line-height: 1.75; color: var(--sub); word-break: break-word; }
.sa-think.open .sa-tbd { display: block; }
.sa-think.live.open .sa-tbd { max-height: 260px; overflow-y: auto; }
.sa-sbd { display: none; margin-top: 8px; flex-direction: column; gap: 6px; }
.sa-src.open .sa-sbd { display: flex; }
.sa-sbd a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 14px; background: var(--ab1); box-shadow: var(--hi), 0 3px 12px rgba(44, 44, 84, .05); border: .5px solid var(--faint); text-decoration: none; color: var(--ink); min-width: 0; }
.sa-sbd i { font-style: normal; flex: none; width: 18px; height: 18px; border-radius: 9px; background: var(--fill); font-size: 10.5px; display: flex; align-items: center; justify-content: center; color: var(--ink2); }
.sa-sbd span { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-sbd small { flex: none; font-size: 11px; color: var(--sub); max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 生成的图 */
.sa-gens { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.sa-gen { width: min(100%, 300px); border-radius: 20px; display: block; object-fit: cover; box-shadow: 0 10px 30px rgba(44, 44, 84, .12); background: var(--fill); }
.sa-gens .sa-gen:not(:only-child) { width: calc(50% - 4px); }
.sa-gen.ph { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; overflow: hidden; box-shadow: var(--hi), inset 0 0 0 .5px var(--faint); }
.sa-gen.ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); animation: saShim 1.6s linear infinite; }
.sa-night .sa-gen.ph::before { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%); }
.sa-gen.ph.err::before { display: none; }
@keyframes saShim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sa-gen.ph span { font-size: 12.5px; color: var(--sub); position: relative; padding: 0 14px; text-align: center; }
.sa-gen.ph button { position: relative; font-size: 12.5px !important; padding: 6px 14px !important; border-radius: 14px; background: var(--ab1) !important; box-shadow: var(--hi), 0 3px 10px rgba(44, 44, 84, .1); }

.sa-err { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 9px 10px 9px 12px; border-radius: 14px; background: var(--fill); font-size: 13px; color: var(--ink2); box-shadow: inset 2px 0 0 var(--red); }
.sa-err span { flex: 1; min-width: 0; word-break: break-word; }
.sa-err button { flex: none; font-size: 12.5px !important; padding: 6px 13px !important; border-radius: 12px; background: var(--ab1) !important; box-shadow: var(--hi), 0 2px 8px rgba(44, 44, 84, .08); }
.sa-stopped { margin-top: 6px; font-size: 12px; color: var(--sub); }
.sa-memchip { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--sub); max-width: 100%; }
.sa-memchip svg { width: 14px; height: 14px; color: var(--acc); flex: none; }
.sa-memchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-acts { display: flex; gap: 2px; margin: 8px 0 0 -7px; }
.sa-m.a.bubble .sa-acts { margin-left: -7px; }
.sa-acts button { width: 34px; height: 32px; display: flex !important; align-items: center; justify-content: center; border-radius: 10px; color: var(--sub) !important; }
.sa-acts button svg { width: 18px; height: 18px; }
.sa-acts button:active { background: var(--fill) !important; }
.sa-caret { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink2); margin: 6px 0 0 1px; animation: saPulse 1s ease-in-out infinite; }
.sa-wait { display: flex; gap: 5px; padding: 8px 2px; }
.sa-m.a.bubble .sa-wait { width: fit-content; padding: 13px 16px; border-radius: 21px 21px 21px 7px; background: linear-gradient(180deg, var(--ab1), var(--ab2)); box-shadow: var(--hi), 0 5px 16px rgba(44, 44, 84, .055); }
.sa-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--sub); animation: saDot 1.2s ease-in-out infinite; }
.sa-wait i:nth-child(2) { animation-delay: .15s; }
.sa-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes saDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }

/* 空对话 */
.sa-empty { min-height: calc(100vh - 300px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 0 10px; }
.sa-ename { margin-top: 20px; font-size: 22px; font-weight: 650; letter-spacing: .6px; }
.sa-esub { margin-top: 6px; font-size: 14px; color: var(--sub); }
.sa-starts { margin-top: 30px; width: 100%; max-width: 360px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sa-starts button {
  display: flex !important; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 14px 13px !important;
  border-radius: 20px; text-align: left; background: var(--glass) !important; border: 1px solid var(--glass-b) !important;
  box-shadow: var(--hi), var(--lo), var(--sh); transition: transform .16s;
}
.sa-starts button:active { transform: scale(.97); }
.sa-starts svg { width: 22px; height: 22px; color: var(--ink2); }
.sa-starts span { font-size: 13.5px; color: var(--ink); font-weight: 550; }

.sa-tobot {
  position: absolute; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 7;
  width: 38px; height: 38px; border-radius: 50%; display: flex !important; align-items: center; justify-content: center;
  background: var(--glass) !important; border: 1px solid var(--glass-b) !important; color: var(--ink2) !important;
  box-shadow: var(--hi), var(--sh);
}
.sa-tobot[hidden] { display: none !important; }
.sa-tobot svg { width: 18px; height: 18px; }

/* ---------- 底部：漂浮的果冻胶囊 ---------- */
.sa-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; padding: 18px 10px calc(8px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.sa-bar::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to top, var(--bg) 22%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.sa-bar > * { pointer-events: auto; }
.sa-cap {
  max-width: 760px; margin: 0 auto; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--glass-b);
  -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8);
  box-shadow: var(--hi), var(--lo), 0 12px 34px rgba(44, 44, 84, .09);
}
.sa-night .sa-cap { box-shadow: var(--hi), var(--lo), 0 12px 34px rgba(0, 0, 0, .45); }
.sa-row { display: flex; align-items: flex-end; gap: 6px; padding: 6px; }
.sa-plus, .sa-send { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex !important; align-items: center; justify-content: center; transition: transform .16s, background .2s; }
.sa-plus { color: var(--ink2) !important; background: linear-gradient(180deg, var(--ab1), var(--ab2)) !important; box-shadow: var(--hi), 0 2px 8px rgba(44, 44, 84, .1), inset 0 0 0 .5px var(--faint); }
.sa-plus svg { width: 19px; height: 19px; transition: transform .22s; }
.sa-plus.on svg { transform: rotate(45deg); }
.sa-plus:active, .sa-send:active { transform: scale(.92); }
.sa-send { color: var(--btnI) !important; background: linear-gradient(180deg, var(--btn1), var(--btn2)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 12px rgba(30, 30, 40, .2); }
.sa-send svg { width: 19px; height: 19px; }
.sa-send.off { background: color-mix(in srgb, var(--sub) 38%, transparent) !important; box-shadow: none; color: var(--bg) !important; }
.sa-send.stop svg { width: 22px; height: 22px; }
.sa-ta {
  flex: 1; min-width: 0; border: none; outline: none; resize: none; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; line-height: 22px; padding: 7px 4px; height: 36px; max-height: 150px;
  -webkit-user-select: text; user-select: text;
}
.sa-ta::placeholder { color: var(--sub); }

.sa-attach { padding: 8px 8px 0; display: flex; flex-direction: column; gap: 8px; }
.sa-attach[hidden] { display: none; }
.sa-q { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0 10px; border-left: 2px solid var(--acc); margin-left: 4px; }
.sa-q span { flex: 1; min-width: 0; font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-q button, .sa-th button { flex: none; width: 22px; height: 22px; display: flex !important; align-items: center; justify-content: center; border-radius: 50%; color: var(--sub) !important; }
.sa-q button svg { width: 14px; height: 14px; }
.sa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 2px; }
.sa-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 7px 0 9px; border-radius: 14px; background: linear-gradient(180deg, var(--ab1), var(--ab2)); box-shadow: var(--hi), 0 2px 8px rgba(44, 44, 84, .08), inset 0 0 0 .5px var(--faint); font-size: 12.5px; cursor: pointer; }
.sa-chip svg { width: 15px; height: 15px; color: var(--ink2); }
.sa-chip svg:last-child { width: 12px; height: 12px; color: var(--sub); }
.sa-chip b { font-weight: 550; }
.sa-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--acc); margin-right: 1px; }
.sa-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 2px; -webkit-overflow-scrolling: touch; }
.sa-th { position: relative; flex: none; width: 60px; height: 60px; border-radius: 15px; overflow: hidden; background: var(--fill); box-shadow: 0 3px 10px rgba(44, 44, 84, .08); }
.sa-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa-th button { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; background: rgba(28, 28, 32, .55) !important; color: #fff !important; }
.sa-th button svg { width: 11px; height: 11px; }
.sa-th.f { width: auto; max-width: 180px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 8px 30px 8px 10px; background: linear-gradient(180deg, var(--ab1), var(--ab2)); box-shadow: var(--hi), inset 0 0 0 .5px var(--faint); }
.sa-th.f svg { width: 18px; height: 18px; color: var(--ink2); }
.sa-th.f b { font-size: 11.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ＋ 面板 */
.sa-pop {
  position: absolute; left: 14px; bottom: calc(100% - 12px); width: 204px; padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--ab1) 90%, transparent); border: 1px solid var(--glass-b);
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: var(--hi), 0 18px 46px rgba(44, 44, 84, .16);
  transform-origin: 18px 100%; transform: scale(.9) translateY(8px); opacity: 0; transition: transform .2s cubic-bezier(.2, .9, .3, 1.2), opacity .16s;
}
.sa-night .sa-pop { box-shadow: var(--hi), 0 18px 46px rgba(0, 0, 0, .55); }
.sa-pop.in { transform: none; opacity: 1; }
.sa-pop button { width: 100%; display: flex !important; align-items: center; gap: 12px; padding: 10px 12px !important; border-radius: 15px; font-size: 14.5px !important; text-align: left; }
.sa-pop button:active { background: var(--fill) !important; }
.sa-pop button svg { width: 21px; height: 21px; color: var(--ink2); flex: none; }
.sa-pop button span { flex: 1; }
.sa-popdot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.sa-pop button.on .sa-popdot { background: var(--acc); }
.sa-popsep { display: block; height: .5px; background: var(--faint); margin: 4px 12px; }
/* @ 唤出 */
.sa-at { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 12px); display: flex; gap: 6px; flex-wrap: wrap; max-width: 728px; margin: 0 auto; }
.sa-at[hidden] { display: none; }
.sa-at button { display: inline-flex !important; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px !important; border-radius: 17px; font-size: 13.5px !important; background: var(--glass) !important; border: 1px solid var(--glass-b) !important; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--hi), var(--sh); }
.sa-at svg { width: 17px; height: 17px; color: var(--ink2); }

/* ---------- 对话抽屉 ---------- */
.sa-drw { position: absolute; inset: 0; z-index: 30; background: rgba(18, 18, 26, 0); transition: background .24s; }
.sa-drw.in { background: rgba(18, 18, 26, .2); }
.sa-drp {
  position: absolute; left: 0; top: 0; bottom: 0; width: 84%; max-width: 340px; display: flex; flex-direction: column;
  background: var(--bg); box-shadow: 18px 0 50px rgba(30, 30, 60, .12);
  border-radius: 0 28px 28px 0; padding-top: var(--top);
  transform: translateX(-104%); transition: transform .28s cubic-bezier(.22, .8, .25, 1);
}
.sa-drw.in .sa-drp { transform: none; }
.sa-drhd { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 20px; }
.sa-drhd b { font-size: 22px; font-weight: 700; letter-spacing: .4px; }
.sa-drs { display: flex; align-items: center; gap: 8px; margin: 8px 16px 6px; padding: 0 12px; height: 40px; border-radius: 14px; background: var(--fill); }
.sa-drs svg { width: 16px; height: 16px; color: var(--sub); flex: none; }
.sa-drs input { flex: 1; min-width: 0; border: none; outline: none; background: none; font: inherit; font-size: 16px; color: var(--ink); -webkit-user-select: text; user-select: text; }
.sa-drs input::placeholder { color: var(--sub); }
.sa-drl { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 10px; -webkit-overflow-scrolling: touch; }
.sa-drg { font-size: 11.5px; color: var(--sub); margin: 14px 10px 6px; letter-spacing: .4px; }
.sa-dri { padding: 10px 12px; border-radius: 16px; cursor: pointer; transition: background .15s; }
.sa-dri:active { background: var(--fill); }
.sa-dri.on { background: linear-gradient(180deg, var(--ab1), var(--ab2)); box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .07), inset 0 0 0 .5px var(--faint); }
.sa-dri b { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-dri small { display: block; margin-top: 3px; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-drlive { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); flex: none; animation: saPulse 1.2s infinite; }
.sa-dre { text-align: center; color: var(--sub); font-size: 13px; padding: 40px 0; }
.sa-drf { display: flex; gap: 6px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: .5px solid var(--faint); }
.sa-drf button { flex: 1; display: flex !important; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0 8px !important; border-radius: 16px; font-size: 12px !important; color: var(--ink2) !important; position: relative; }
.sa-drf button:active { background: var(--fill) !important; }
.sa-drf svg { width: 21px; height: 21px; }
.sa-drf small { position: absolute; top: 5px; right: calc(50% - 22px); font-size: 10px; color: var(--sub); }

/* ---------- 弹层 ---------- */
.sa-mask { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(18, 18, 26, 0); transition: background .2s; }
.sa-mask.in { background: rgba(18, 18, 26, .22); }
.sa-mask.bot { align-items: flex-end; padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
.sa-modal, .sa-sheet {
  width: 100%; max-width: 360px; border-radius: 26px; padding: 20px 18px 16px;
  background: color-mix(in srgb, var(--ab1) 96%, transparent); border: 1px solid var(--glass-b);
  box-shadow: var(--hi), 0 24px 60px rgba(30, 30, 60, .2);
  transform: scale(.94); opacity: 0; transition: transform .22s cubic-bezier(.2, .9, .3, 1.15), opacity .18s;
}
.sa-mask.in .sa-modal { transform: none; opacity: 1; }
.sa-sheet { max-width: 520px; padding: 10px; transform: translateY(30px); }
.sa-mask.in .sa-sheet { transform: none; opacity: 1; }
.sa-mt { font-size: 16.5px; font-weight: 650; text-align: center; }
.sa-mn { margin-top: 8px; font-size: 13.5px; color: var(--sub); text-align: center; line-height: 1.55; }
.sa-modal .sa-in { margin-top: 14px; }
.sa-mbtns { display: flex; gap: 10px; margin-top: 18px; }
.sa-mbtns .sa-btn { flex: 1; }
.sa-btn { height: 46px; display: inline-flex !important; align-items: center; justify-content: center; gap: 7px; border-radius: 23px; font-size: 15px !important; font-weight: 600; color: var(--btnI) !important; background: linear-gradient(180deg, var(--btn1), var(--btn2)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 16px rgba(30, 30, 40, .16); padding: 0 18px !important; }
.sa-btn.ghost { color: var(--ink) !important; background: linear-gradient(180deg, var(--ab1), var(--ab2)) !important; box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .07), inset 0 0 0 .5px var(--faint); }
.sa-btn svg { width: 18px; height: 18px; }
.sa-btn:active { transform: scale(.97); }
.sa-sheetl { display: flex; flex-direction: column; }
.sa-si { display: flex !important; align-items: center; gap: 14px; padding: 13px 14px !important; border-radius: 16px; font-size: 15.5px !important; text-align: left; }
.sa-si:active { background: var(--fill) !important; }
.sa-si svg { width: 21px; height: 21px; color: var(--ink2); }
.sa-si.red svg { color: var(--red); }
.sa-rxbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 6px 10px; border-bottom: .5px solid var(--faint); margin-bottom: 4px; }
.sa-rxbar button { width: 42px; height: 42px; border-radius: 50%; font-size: 23px !important; display: flex !important; align-items: center; justify-content: center; transition: transform .14s; }
.sa-rxbar button:active { transform: scale(1.18); }
.sa-rxbar button.on { background: var(--fill) !important; }
.sa-rxbar button.add { background: var(--fill) !important; color: var(--ink2) !important; }
.sa-rxbar button.add svg { width: 18px; height: 18px; }

.sa-view { position: absolute; inset: 0; z-index: 60; background: rgba(10, 10, 14, 0); display: flex; align-items: center; justify-content: center; transition: background .2s; }
.sa-view.in { background: rgba(10, 10, 14, .94); }
.sa-view img { max-width: 100%; max-height: 78%; object-fit: contain; border-radius: 6px; opacity: 0; transition: opacity .2s; -webkit-touch-callout: default; }
.sa-view.in img { opacity: 1; }
.sa-viewbar { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 10px; }
.sa-viewbar button { height: 42px; display: inline-flex !important; align-items: center; gap: 7px; padding: 0 16px !important; border-radius: 21px; background: rgba(255, 255, 255, .12) !important; color: #fff !important; font-size: 13.5px !important; }
.sa-viewbar button:first-child { width: 42px; padding: 0 !important; justify-content: center; }
.sa-viewbar svg { width: 18px; height: 18px; }

/* ---------- 二级页（设置 / 记忆 / 摘要） ---------- */
.sa-page { position: absolute; inset: 0; z-index: 25; background: var(--bg); transform: translateX(100%); transition: transform .3s cubic-bezier(.22, .8, .25, 1); display: flex; flex-direction: column; }
.sa-page.in { transform: none; }
.sa-pgb { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--top) + 46px) 16px calc(40px + env(safe-area-inset-bottom, 0px)); }
.sa-pgb > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.sa-sec { margin-bottom: 4px; }
.sa-sech { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--sub); margin: 20px 8px 8px; letter-spacing: .5px; }
.sa-card { border-radius: 22px; padding: 4px 16px; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--hi), var(--lo), var(--sh); }
.sa-card > :last-child { border-bottom: none !important; }
.sa-srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: .5px solid var(--faint); font-size: 15px; width: 100%; text-align: left; }
.sa-srow > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.sa-srow.col { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 0; }
.sa-srow.go em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--sub); }
.sa-srow.go > svg { width: 15px; height: 15px; color: var(--sub); transform: rotate(180deg); flex: none; }
.sa-srow.red > span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: 2px; }
.sa-srow.solo { margin-top: 14px; padding: 0 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-b) !important; box-shadow: var(--hi), var(--sh); }
.sa-val { font-style: normal; font-size: 14px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.sa-cfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 12px; font-size: 12px; color: var(--sub); }
.sa-cfoot.top { padding-top: 12px; }
.sa-lk { flex: none; font-size: 12.5px !important; padding: 6px 12px !important; border-radius: 13px; background: var(--fill) !important; color: var(--ink) !important; }
.sa-avedit { display: inline-flex; align-items: center; gap: 8px; }
.sa-avedit .sa-av { width: 34px; height: 34px; }

/* 开关 */
.sa-sw { position: relative; flex: none; width: 50px; height: 30px; }
.sa-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 1; cursor: pointer; }
.sa-sw i { position: absolute; inset: 0; border-radius: 15px; background: color-mix(in srgb, var(--sub) 26%, transparent); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08); transition: background .22s; }
.sa-sw i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #fff, #f1f1f4); box-shadow: 0 2px 6px rgba(0, 0, 0, .18), inset 0 -2px 4px rgba(200, 200, 214, .35); transition: transform .26s cubic-bezier(.3, 1.3, .5, 1); }
.sa-sw input:checked + i { background: linear-gradient(180deg, #5a5a62, #3a3a40); }
.sa-night .sa-sw input:checked + i { background: linear-gradient(180deg, #8a8a94, #6c6c76); }
.sa-sw input:checked + i::after { transform: translateX(20px); }

/* 样卡 */
.sa-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; border-bottom: .5px solid var(--faint); }
.sa-picks.three { grid-template-columns: 1fr 1fr 1fr; }
.sa-pk { display: flex !important; flex-direction: column; align-items: center; gap: 8px; }
.sa-pk b { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 550; color: var(--ink2); }
.sa-pk b::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.sa-pk.on b { color: var(--ink); }
.sa-pk.on b::before { background: var(--acc); }
.sa-mini { position: relative; width: 100%; aspect-ratio: 1.18; border-radius: 15px; overflow: hidden; box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .08), inset 0 0 0 .5px var(--faint); display: block; transition: transform .16s; }
.sa-pk:active .sa-mini { transform: scale(.96); }
.sa-mini i { position: absolute; display: block; border-radius: 6px; }
.th-day { background: #fcfcfd; }
.th-night { background: #18181b; }
.th-auto { background: linear-gradient(135deg, #fcfcfd 50%, #18181b 50%); }
.th-day i, .th-auto i { background: linear-gradient(180deg, #f3f3f6, #e6e6eb); }
.th-night i { background: #34343a; }
.sa-mini.th-day i:nth-child(1), .sa-mini.th-night i:nth-child(1), .sa-mini.th-auto i:nth-child(1) { right: 12%; top: 18%; width: 46%; height: 16%; border-radius: 7px 7px 3px 7px; }
.sa-mini.th-day i:nth-child(2), .sa-mini.th-night i:nth-child(2), .sa-mini.th-auto i:nth-child(2) { left: 12%; top: 44%; width: 62%; height: 7%; border-radius: 3px; opacity: .9; }
.sa-mini.th-day i:nth-child(3), .sa-mini.th-night i:nth-child(3), .sa-mini.th-auto i:nth-child(3) { left: 12%; top: 58%; width: 44%; height: 7%; border-radius: 3px; opacity: .9; }
.sa-mini.th-auto i:nth-child(2), .sa-mini.th-auto i:nth-child(3) { background: #8e8e96; }
.md-long, .md-bubble { background: var(--bg); }
.md-long i { left: 12%; height: 6%; border-radius: 3px; background: color-mix(in srgb, var(--sub) 40%, transparent); }
.md-long i:nth-child(1) { top: 20%; width: 34%; background: color-mix(in srgb, var(--ink) 55%, transparent); }
.md-long i:nth-child(2) { top: 38%; width: 76%; }
.md-long i:nth-child(3) { top: 52%; width: 70%; }
.md-long i:nth-child(4) { top: 66%; width: 52%; }
.md-bubble i { left: 12%; height: 14%; border-radius: 7px 7px 7px 3px; background: linear-gradient(180deg, var(--ab1), var(--ab2)); box-shadow: 0 2px 6px rgba(44, 44, 84, .1); }
.md-bubble i:nth-child(1) { top: 16%; width: 40%; }
.md-bubble i:nth-child(2) { top: 36%; width: 58%; }
.md-bubble i:nth-child(3) { top: 56%; width: 32%; }
.md-bubble i:nth-child(4) { top: 76%; width: 20%; height: 10%; left: auto; right: 12%; border-radius: 6px 6px 3px 6px; background: linear-gradient(180deg, var(--ub1), var(--ub2)); }
.sa-pk.tx { padding: 12px 6px !important; border-radius: 16px; background: linear-gradient(180deg, var(--ab1), var(--ab2)) !important; box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .06), inset 0 0 0 .5px var(--faint); gap: 4px; }
.sa-pk.tx small { font-size: 10.5px; color: var(--sub); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 分段 */
.sa-seg { display: flex; padding: 3px; border-radius: 14px; background: var(--fill); margin: 4px 0; }
.sa-card > .sa-seg { margin: 14px 0 6px; }
.sa-seg button { flex: 1; height: 32px; border-radius: 11px; font-size: 13px !important; color: var(--sub) !important; transition: background .2s, color .2s; }
.sa-seg button.on { background: linear-gradient(180deg, var(--ab1), var(--ab2)) !important; color: var(--ink) !important; box-shadow: var(--hi), 0 2px 7px rgba(44, 44, 84, .1); font-weight: 600; }

/* 滑条 */
.sa-range { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: -4px 0 6px; display: block; }
.sa-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--sub) 28%, transparent); }
.sa-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: linear-gradient(180deg, #fff, #f0f0f3); box-shadow: 0 2px 7px rgba(0, 0, 0, .2), inset 0 -2px 4px rgba(200, 200, 214, .35); }
.sa-range::-moz-range-track { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--sub) 28%, transparent); }
.sa-range::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0, 0, 0, .2); }
.sa-dual { padding: 4px 0 16px; border-bottom: .5px solid var(--faint); }
.sa-dualv { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 14px; }
.sa-dualv b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.sa-dualv span { color: var(--sub); }
.sa-dualv em { font-style: normal; font-size: 12.5px; color: var(--sub); margin-left: 2px; }
.sa-dualt { position: relative; height: 28px; margin: 0 12px; touch-action: none; cursor: pointer; }
.sa-dualt::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--sub) 28%, transparent); }
.sa-dualt .fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--btn1), var(--btn2)); }
.sa-dualt span { position: absolute; top: 2px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: linear-gradient(180deg, #fff, #f0f0f3); box-shadow: 0 2px 7px rgba(0, 0, 0, .2), inset 0 -2px 4px rgba(200, 200, 214, .35); }

/* 输入框 */
.sa-in { width: 100%; box-sizing: border-box; border: none; outline: none; border-radius: 14px; padding: 12px 13px; font: inherit; font-size: 16px; color: var(--ink); background: var(--fill); -webkit-user-select: text; user-select: text; -webkit-appearance: none; }
.sa-in::placeholder { color: var(--sub); }
.sa-in.ta { resize: none; line-height: 1.6; min-height: 120px; display: block; }
.sa-in.ta.sel { font-size: 14.5px; min-height: 260px; }
.sa-card > .sa-in.ta { margin-top: 14px; }
.sa-in.sm { width: 150px; text-align: right; padding: 8px 12px; background: transparent; color: var(--ink2); }
.sa-in.sm:focus { background: var(--fill); }
.sa-fields { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 12px; border-bottom: .5px solid var(--faint); }

/* 记忆 */
.sa-membtns { display: flex; gap: 10px; margin: 16px auto 4px; }
.sa-membtns .sa-btn { flex: 1; font-size: 14px !important; height: 44px; }
.sa-card.memlist { padding: 4px 6px 4px 16px; }
.sa-mi { position: relative; padding: 13px 64px 12px 0; border-bottom: .5px solid var(--faint); }
.sa-mi p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink); word-break: break-word; }
.sa-mi small { display: block; margin-top: 4px; font-size: 11px; color: var(--sub); }
.sa-mi span { position: absolute; right: 0; top: 10px; display: flex; }
.sa-mi span button { width: 32px; height: 32px; display: flex !important; align-items: center; justify-content: center; border-radius: 10px; color: var(--sub) !important; }
.sa-mi span button svg { width: 17px; height: 17px; }
.sa-pgempty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 0; color: var(--sub); font-size: 13.5px; }
.sa-pgempty svg { width: 30px; height: 30px; }

/* ---------- v0.56.1 ---------- */
/* 设置页左右晃动：三张接口卡被很长的模型名撑宽溢出——各列可缩、页面不横向滚动 */
.sa-page, .sa-pgb { overflow-x: hidden; }
.sa-pgb { touch-action: pan-y; }
.sa-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sa-picks.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sa-pk { min-width: 0; }
.sa-pk.tx b, .sa-pk.tx small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sa-pk.tx b::before { display: none; }
.sa-pk.tx.on { box-shadow: var(--hi), 0 4px 14px rgba(44, 44, 84, .06), inset 0 0 0 .5px var(--faint); }
.sa-pk.tx.on small::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--acc); margin-right: 5px; vertical-align: 1px; }
.sa-srow > * { min-width: 0; }
.sa-seg button { min-width: 0; white-space: nowrap; }

/* 聊天背景 */
.sa-wall { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; pointer-events: none; }
.sa-wall[hidden] { display: none; }
.sa-wall i { position: absolute; inset: -20px; background: var(--bg); }
.sa-root.has-bg .sa-amb { display: none; }
.sa-root.has-bg .sa-bar::before { background: linear-gradient(to top, color-mix(in srgb, var(--bg) 55%, transparent) 10%, transparent); }
.sa-bgthumb { width: 34px; height: 34px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: 0 2px 8px rgba(40, 40, 80, .12); }

/* 表情包 */
.sa-stks { display: flex; gap: 8px; margin-top: 8px; }
.sa-stk { display: block; width: 120px; max-height: 140px; object-fit: contain; border-radius: 12px; }
.sa-stk.u { margin-bottom: 4px; }
.sa-stkp { padding: 12px 10px 14px; }
.sa-stkc { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 10px; -webkit-overflow-scrolling: touch; }
.sa-stkc:empty { display: none; }
.sa-stkc button { flex: none; height: 30px; padding: 0 13px !important; border-radius: 15px; font-size: 13px !important; color: var(--sub) !important; background: var(--fill) !important; }
.sa-stkc button.on { color: var(--ink) !important; background: linear-gradient(180deg, var(--ab1), var(--ab2)) !important; box-shadow: var(--hi), 0 2px 7px rgba(44, 44, 84, .1); font-weight: 600; }
.sa-stkg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sa-stkg { align-content: start; }
/* 方格用 padding 撑高（v0.56.185）：此前靠 aspect-ratio，表情多到要滚动时 iOS 会把行高压扁，表情叠成一团 */
.sa-stkg button { position: relative; height: 0; padding: 0 0 100% !important; border-radius: 14px; background: var(--fill) !important; display: block !important; overflow: hidden; }
.sa-stkg img { position: absolute; left: 7%; top: 7%; width: 86%; height: 86%; object-fit: contain; }
.sa-th.s img { object-fit: contain; }

/* ---------- v0.56.2 表情包分类选择 ---------- */
.sa-stkrow em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--sub); }
.sa-stkrow > svg:last-child { width: 15px; height: 15px; color: var(--sub); flex: none; transition: transform .22s; }
.sa-stkrow.open > svg:last-child { transform: rotate(180deg); }
.sa-catpick { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 14px; border-bottom: .5px solid var(--faint); }
.sa-catpick button { display: inline-flex !important; align-items: center; gap: 6px; height: 32px; padding: 0 13px !important; border-radius: 16px; font-size: 13px !important; color: var(--sub) !important; background: var(--fill) !important; }
.sa-catpick button::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.sa-catpick button.on { color: var(--ink) !important; background: linear-gradient(180deg, var(--ab1), var(--ab2)) !important; box-shadow: var(--hi), 0 2px 7px rgba(44, 44, 84, .1); }
.sa-catpick button.on::before { background: var(--acc); }

/* v0.56.93 记忆单条开关、摘要字数 */
.sa-mi { padding-right: 118px; }
.sa-mi span { align-items: center; gap: 2px; }
.sa-sw.sm { width: 40px; height: 24px; margin-right: 4px; }
.sa-sw.sm i { border-radius: 12px; }
.sa-sw.sm i::after { width: 20px; height: 20px; }
.sa-sw.sm input:checked + i::after { transform: translateX(16px); }
.sa-mi.off p, .sa-mi.off small { opacity: .42; }
.sa-sumlen { text-align: right; margin: 2px 4px 0; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
