/* 5.3: restrained surfaces; the artwork adds warmth without changing the brand. */
.qi .s { white-space:normal; line-height:1.5; overflow-wrap:anywhere; }
.qi .qopen { flex:none; white-space:nowrap; text-decoration:none; }
.wait > .ring { display:block; flex:none; }
.strain-c57bl6 { --strain-color:#424a52; } .strain-balbc { --strain-color:#8999ac; }
.strain-kkay { --strain-color:#b38b3d; } .strain-nude { --strain-color:#c6897f; }
.strain-nsg { --strain-color:#719eae; } .strain-icr { --strain-color:#68a59f; }
.strain-dbdb { --strain-color:#747785; } .strain-obob { --strain-color:#aa9070; }
.strain-s129 { --strain-color:#a1886a; } .strain-fvb { --strain-color:#9194b0; }
.strain-dba2 { --strain-color:#8b766b; } .strain-c3h { --strain-color:#827663; }
.strain-rat_sd { --strain-color:#b29491; } .strain-other { --strain-color:#9babab; }
:root { --line:#e4e9e8; --bg:#f5f7f7; --dim:#747d7f; }
[data-theme="dark"] { --line:#2b3334; --bg:#101516; --card:#1b2122; --soft:#232c2d; --dim:#a0abad; --ink:#f3f6f6; }
#v-me { max-width:960px; }
.personal-top { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:12px 0 30px; }
.personal-eyebrow,.personal-kicker { margin:0 0 8px; font-size:10px; font-weight:700; letter-spacing:.16em; color:var(--dim); }
.personal-top h1 { margin:0; font-size:30px; font-weight:650; }
.personal-identity { display:flex; align-items:center; gap:18px; padding:26px 28px; border-radius:24px; background:var(--card); }
.personal-avatar { display:grid; place-items:center; width:64px; height:64px; flex:none; border-radius:20px; background:var(--soft); }
.personal-avatar .icon { width:43px; height:43px; }
.personal-identity > div { min-width:0; }
.personal-identity h2 { font-size:25px; font-weight:650; margin:0 0 6px; overflow-wrap:anywhere; }
.personal-identity p { color:var(--dim); font-size:13px; margin:0; line-height:1.6; }
.personal-private { margin-left:auto; display:flex; align-items:center; gap:5px; font-size:12px; color:var(--blue); white-space:nowrap; }
.personal-private .icon { width:15px; height:15px; }
.personal-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:25px 0; margin-bottom:8px; }
.personal-stats a { display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--ink); border-right:1px solid var(--line); }
.personal-stats a:last-child { border:0; }
.personal-stats b { font-size:29px; font-weight:600; font-variant-numeric:tabular-nums; }
.personal-stats span { font-size:12px; color:var(--dim); }
.personal-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.personal-feature { display:flex; align-items:center; gap:6px; padding:27px 25px; background:var(--card); border:1px solid transparent; border-radius:24px; color:var(--ink); overflow:hidden; transition:transform .2s,border-color .2s; }
.personal-feature > div { min-width:0; flex:1; }
.personal-feature h2 { margin:0 0 7px; font-size:21px; font-weight:650; }
.personal-feature p { color:var(--dim); font-size:12px; margin:0 0 19px; }
.personal-feature > img { width:112px; height:112px; object-fit:contain; flex:none; }
.personal-arrow { font-size:12px; color:var(--blue); display:flex; align-items:center; gap:5px; }
.personal-arrow .icon { width:13px; height:13px; }
.personal-actions { margin:18px 0 0; padding:6px 24px; border-radius:24px; }
.personal-actions a { display:flex; align-items:center; gap:16px; padding:20px 0; color:var(--ink); border-bottom:1px solid var(--line); }
.personal-actions a:last-child { border:0; }
.personal-action-icon { display:grid; place-items:center; width:42px; height:42px; flex:none; background:var(--soft); color:var(--blue); border-radius:14px; }
.personal-actions a > span:nth-child(2) { flex:1; min-width:0; }
.personal-actions b { display:block; font-size:14px; font-weight:600; }
.personal-actions small { display:block; color:var(--dim); font-size:12px; margin-top:5px; }
.personal-actions a > .icon { width:16px; height:16px; color:var(--dim); }
.personal-status { display:flex; align-items:center; gap:10px; margin:25px 6px 12px; }
.personal-status b { display:block; font-size:12px; font-weight:500; }
.personal-status small { display:block; color:var(--dim); font-size:11px; margin-top:3px; }
.personal-status > a { margin-left:auto; font-size:12px; }
.status-orb { width:7px; height:7px; border-radius:50%; background:var(--cyan); flex:none; }
.status-orb.pending { background:var(--amber); }
.tiles { grid-template-columns:repeat(auto-fill,minmax(168px,1fr)); gap:16px; }
.tile { box-shadow:0 3px 12px #17242a05; border-radius:22px; }
.tile-a { aspect-ratio:auto; min-height:245px; padding:17px; }
.tile-a .tile-name { font-weight:650; font-size:20px; }
.animal-art { position:relative; display:block; align-self:center; width:128px; height:96px; flex:none; margin:9px 0 5px; }
.animal-art > img { width:100%; height:100%; object-fit:contain; }
.strain-dot { position:absolute; bottom:4px; right:3px; width:10px; height:10px; border-radius:50%; background:var(--strain-color); border:2px solid var(--card); }
.strain-label { color:var(--dim); font-size:11px; font-weight:600; margin-top:3px; overflow-wrap:anywhere; }
.tile-a .tile-sub { margin:4px 0 12px; font-weight:500; font-size:12px; min-height:34px; flex:1; }
.tile-foot { border-top:1px solid var(--line); padding-top:11px; }
.tile-foot b { font-weight:650; }
.cage-art { width:70px; height:60px; object-fit:contain; margin-left:auto; align-self:center; }
.tile-mid { align-items:center; }
.animal-art-hero { width:82px; height:74px; margin:0; }
.tk-top h1 { font-weight:650; }
.tk-sub { font-weight:450; line-height:1.7; }
.nav-mouse { width:28px; height:24px; object-fit:contain; }
@media(hover:hover) { .personal-feature:hover { border-color:var(--cyan); transform:translateY(-2px); } }
@media(max-width:600px) {
 .personal-top { margin:6px 0 22px; gap:8px; }
 .personal-top h1 { font-size:27px; }
 .personal-top .btn { padding:8px 10px; font-size:12px; }
 .personal-identity { padding:22px 18px; gap:13px; flex-wrap:wrap; }
 .personal-identity h2 { font-size:23px; }
 .personal-private { margin-left:77px; margin-top:-2px; }
 .personal-grid { gap:12px; grid-template-columns:1fr; }
 .personal-feature { padding:21px 23px; min-height:150px; }
 .personal-feature > img { width:112px; height:105px; }
 .personal-feature h2 { font-size:21px; }
 .personal-actions { padding:3px 18px; }
 .tiles { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .tile-a { padding:14px; }
 .animal-art { width:116px; height:92px; max-width:100%; }
 .animal-art-hero { width:62px; height:64px; }
 .tk-top { gap:10px; }
 .tile:not(.tile-a) { padding:14px; }
 .cage-art { width:50px; height:44px; }
 .tile-n { font-size:34px; }
}
@media(prefers-reduced-motion:reduce) { .personal-feature,.tile { transition:none; } }

/* ---------- 5.4.1 ---------- */

/* 标识跟随主题反色。
   以前用的是 #i-logo：blade 写死 fill="#2b2f34"，而 .mark/.lmark 的底色也写死 #fbfbfd，
   深色模式下整块都不跟着变。改用 #i-mark（fill=currentColor，两条竖杠是 mask 挖空），
   底色和字色交给变量，浅色＝白底深标，深色＝深底浅标。 */
.mark, .lmark { background: var(--logo-bg); border: 1px solid var(--logo-line); color: var(--logo-ink); }
.mark .icon, .lmark .icon, .personal-avatar .icon { stroke: none; color: inherit; }
.personal-avatar { background: var(--logo-bg); border: 1px solid var(--logo-line); color: var(--logo-ink); }
:root { --logo-bg: #fbfbfd; --logo-line: #e6e6ec; --logo-ink: #2b2f34; }
[data-theme="dark"] { --logo-bg: #1b2122; --logo-line: #2c3436; --logo-ink: #f2f5f5; }

/* 选项式列表：竖向滚动，一行一个品系，左边是这个品系的图 */
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; overflow-x: hidden;
  padding: 4px; margin: 6px -4px 4px; border-radius: 14px; background: var(--soft);
  overscroll-behavior: contain; scrollbar-gutter: stable; }
.pick-list button { display: block; width: 100%; max-width: 100%; min-width: 0; padding: 0; border-radius: 12px;
  background: var(--card); border: 1.5px solid transparent; text-align: left; }
.pick-list button.on { border-color: var(--blue); background: var(--blue-s); }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.pick-art { flex: none; width: 54px; height: 40px; display: grid; place-items: center; overflow: hidden;
  border-radius: 9px; background: var(--soft2); }
.pick-art img { width: 52px; height: 39px; object-fit: contain; }
.pick-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pick-txt b { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-txt small { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-list button.on .pick-txt b { color: var(--blue-d); }

/* 日历：当天照片、待办、造模入口 */
.jd { position: relative; }
.jdot { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.jd.on .jdot { background: var(--cyan); }
.jrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.jrow:last-child { border-bottom: 0; }
.jshot { flex: none; width: 54px; height: 54px; border-radius: 11px; overflow: hidden;
  background: var(--soft); display: grid; place-items: center; color: var(--dim2); }
.jshot img { width: 100%; height: 100%; object-fit: cover; }
.jshot .icon { width: 20px; height: 20px; }
.jrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.jrow-main b { overflow-wrap: anywhere; }
.jtodos { display: flex; flex-direction: column; }
.jtodo { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.jtodo:last-child { border-bottom: 0; }
.jtodo span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jtodo b { font-weight: 650; overflow-wrap: anywhere; }
.jtodo.done b { text-decoration: line-through; color: var(--dim); }
.jtodo input { flex: none; width: 19px; height: 19px; accent-color: var(--blue); }
.jplan { margin-top: 16px; }
.jm-cage { margin-bottom: 14px; }
.jm-all { margin-bottom: 6px; padding: 5px 11px; border-radius: 999px; background: var(--soft);
  color: var(--dim); font-size: 12.5px; font-weight: 700; }

/* 全部照片：不管识别成没成功，存了图就能看 */
.fphotos .fic { color: var(--blue); }
.pwall-note { margin: 0 0 14px; }
.pwall { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pw { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-img { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 14px;
  overflow: hidden; background: var(--soft); transition: transform .12s var(--e); }
.pw-img:active { transform: scale(.97); }
.pw-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pw-tag { position: absolute; left: 7px; bottom: 7px; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; background: var(--card); color: var(--dim); }
.pw-tag.work { background: var(--blue-s); color: var(--blue-d); }
.pw-tag.bad { background: var(--amber-s); color: var(--amber-d); }
.pw figcaption { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pw figcaption a { font-size: 13px; font-weight: 650; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw figcaption small { font-size: 11px; }
.sk.pw { aspect-ratio: 1; border-radius: 14px; }
@media (max-width: 760px) { .pwall { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; } }

/* 扫描结果的勾选列表：竖向滚动，整行可点，复选框做大一点好按 */
.pickbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.pickbar button { padding: 6px 13px; border-radius: 999px; background: var(--soft); color: var(--dim);
  font-size: 12.5px; font-weight: 700; }
.pickbar button:active { background: var(--soft2); color: var(--ink); }
.picklist { max-height: 44vh; overflow-y: auto; overflow-x: hidden; border-radius: 12px;
  background: var(--soft); padding: 4px; overscroll-behavior: contain; }
.pickrow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  background: var(--card); margin-bottom: 4px; cursor: pointer; }
.pickrow:last-child { margin-bottom: 0; }
.pickrow input { flex: none; width: 20px; height: 20px; accent-color: var(--blue); }
.pickrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pickrow-main b { font-weight: 700; overflow-wrap: anywhere; }
.pickrow-main small { font-size: 11.5px; color: var(--dim); overflow-wrap: anywhere; }
.pickrow:has(input:checked) { background: var(--blue-s); }

/* 笼卡确认：先把照片摆出来，再让人核对读出来的字段 */
.cardwrap { margin: 4px 0 14px; border-radius: 14px; overflow: hidden; background: var(--soft); }
.cardshot { display: block; width: 100%; max-height: 240px; object-fit: contain; }
.caution ul { margin: 6px 0 0; padding-left: 20px; }
.caution li { margin: 3px 0; }

/* 批量读笼卡：一行一张，读完就地显示结果 */
.batchlist { max-height: 46vh; overflow-y: auto; overflow-x: hidden; border-radius: 12px;
  background: var(--soft); padding: 4px; }
.batchrow { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  background: var(--card); margin-bottom: 4px; }
.batchrow:last-child { margin-bottom: 0; }
.batch-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--soft2);
  color: var(--dim); font: 700 11.5px/22px var(--f); text-align: center; }
.batchrow.ok .batch-n { background: var(--blue); color: var(--card); }
.batchrow.bad .batch-n { background: var(--amber); color: var(--card); }
.batch-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.batch-main b { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-main small { font-size: 11.5px; overflow-wrap: anywhere; }
/* Source review keeps the existing black/white/Tiffany identity. */
.intake-actions { flex-wrap:wrap; gap:10px; }
.intake-card .t3 { gap:12px; }
.review-block { min-width:0; border:1px solid var(--line,#dedede); border-radius:14px; padding:16px; margin:22px 0; }
.review-block legend { padding:0 6px; font-weight:700; }
.review-grid th { min-width:130px; white-space:normal; }
.review-grid th select { display:block; min-width:120px; margin-top:10px; font-size:12px; }
.review-grid td { padding:5px; }
.review-grid td input { width:120px; min-width:0; }
.review-grid .review-uncertain { border:2px dashed #548984; }
.review-check { display:flex; align-items:flex-start; gap:10px; margin-top:18px; font-size:13px; line-height:1.6; }
.review-check input { width:18px; height:18px; flex:none; margin-top:2px; }
.review-photo img { display:block; width:100%; height:auto; margin-top:14px; }
.measured-chart { margin:12px 0 24px; }
.measured-bars { display:flex; align-items:flex-end; gap:20px; overflow-x:auto; padding:25px 12px 12px; border-bottom:1px solid var(--line,#ddd); }
.measured-col { flex:1 0 44px; min-width:44px; max-width:90px; text-align:center; }
.measured-col > b { display:block; margin-top:12px; overflow-wrap:anywhere; font-size:12px; }
.measured-track { height:160px; display:flex; align-items:flex-end; justify-content:center; }
.measured-bar { position:relative; width:28px; background:#69c8c0; border-radius:5px 5px 0 0; transform-origin:bottom; animation:measured-rise .6s cubic-bezier(.2,.7,.3,1) both; }
.measured-bar span { position:absolute; top:-24px; left:50%; transform:translateX(-50%); font-size:12px; font-variant-numeric:tabular-nums; white-space:nowrap; }
@keyframes measured-rise { from { transform:scaleY(0); opacity:0; } to { transform:scaleY(1); opacity:1; } }
@media (prefers-reduced-motion:reduce) { .measured-bar { animation:none; } }

/* 核对表：重复行标红，一眼看到不用逐行找 */
.review-dup td input { background: var(--red-s); border-color: var(--red); }
.review-dup td:first-child input { font-weight: 800; }
.review-dupnote { margin: 0 0 8px; padding: 9px 12px; border-radius: 10px;
  background: var(--red-s); color: var(--red); font-size: 12.5px; line-height: 1.7; }
.review-dupnote.warn { background: var(--amber-s); color: var(--amber-d); }
/* 宽度按 data-pct 给：CSP 是 style-src 'self'，不能写行内 style，所以把 0–100 枚举出来 */
.pbar[data-pct="0"] .pbar-fill { width: 0%; }
.pbar[data-pct="1"] .pbar-fill { width: 1%; }
.pbar[data-pct="2"] .pbar-fill { width: 2%; }
.pbar[data-pct="3"] .pbar-fill { width: 3%; }
.pbar[data-pct="4"] .pbar-fill { width: 4%; }
.pbar[data-pct="5"] .pbar-fill { width: 5%; }
.pbar[data-pct="6"] .pbar-fill { width: 6%; }
.pbar[data-pct="7"] .pbar-fill { width: 7%; }
.pbar[data-pct="8"] .pbar-fill { width: 8%; }
.pbar[data-pct="9"] .pbar-fill { width: 9%; }
.pbar[data-pct="10"] .pbar-fill { width: 10%; }
.pbar[data-pct="11"] .pbar-fill { width: 11%; }
.pbar[data-pct="12"] .pbar-fill { width: 12%; }
.pbar[data-pct="13"] .pbar-fill { width: 13%; }
.pbar[data-pct="14"] .pbar-fill { width: 14%; }
.pbar[data-pct="15"] .pbar-fill { width: 15%; }
.pbar[data-pct="16"] .pbar-fill { width: 16%; }
.pbar[data-pct="17"] .pbar-fill { width: 17%; }
.pbar[data-pct="18"] .pbar-fill { width: 18%; }
.pbar[data-pct="19"] .pbar-fill { width: 19%; }
.pbar[data-pct="20"] .pbar-fill { width: 20%; }
.pbar[data-pct="21"] .pbar-fill { width: 21%; }
.pbar[data-pct="22"] .pbar-fill { width: 22%; }
.pbar[data-pct="23"] .pbar-fill { width: 23%; }
.pbar[data-pct="24"] .pbar-fill { width: 24%; }
.pbar[data-pct="25"] .pbar-fill { width: 25%; }
.pbar[data-pct="26"] .pbar-fill { width: 26%; }
.pbar[data-pct="27"] .pbar-fill { width: 27%; }
.pbar[data-pct="28"] .pbar-fill { width: 28%; }
.pbar[data-pct="29"] .pbar-fill { width: 29%; }
.pbar[data-pct="30"] .pbar-fill { width: 30%; }
.pbar[data-pct="31"] .pbar-fill { width: 31%; }
.pbar[data-pct="32"] .pbar-fill { width: 32%; }
.pbar[data-pct="33"] .pbar-fill { width: 33%; }
.pbar[data-pct="34"] .pbar-fill { width: 34%; }
.pbar[data-pct="35"] .pbar-fill { width: 35%; }
.pbar[data-pct="36"] .pbar-fill { width: 36%; }
.pbar[data-pct="37"] .pbar-fill { width: 37%; }
.pbar[data-pct="38"] .pbar-fill { width: 38%; }
.pbar[data-pct="39"] .pbar-fill { width: 39%; }
.pbar[data-pct="40"] .pbar-fill { width: 40%; }
.pbar[data-pct="41"] .pbar-fill { width: 41%; }
.pbar[data-pct="42"] .pbar-fill { width: 42%; }
.pbar[data-pct="43"] .pbar-fill { width: 43%; }
.pbar[data-pct="44"] .pbar-fill { width: 44%; }
.pbar[data-pct="45"] .pbar-fill { width: 45%; }
.pbar[data-pct="46"] .pbar-fill { width: 46%; }
.pbar[data-pct="47"] .pbar-fill { width: 47%; }
.pbar[data-pct="48"] .pbar-fill { width: 48%; }
.pbar[data-pct="49"] .pbar-fill { width: 49%; }
.pbar[data-pct="50"] .pbar-fill { width: 50%; }
.pbar[data-pct="51"] .pbar-fill { width: 51%; }
.pbar[data-pct="52"] .pbar-fill { width: 52%; }
.pbar[data-pct="53"] .pbar-fill { width: 53%; }
.pbar[data-pct="54"] .pbar-fill { width: 54%; }
.pbar[data-pct="55"] .pbar-fill { width: 55%; }
.pbar[data-pct="56"] .pbar-fill { width: 56%; }
.pbar[data-pct="57"] .pbar-fill { width: 57%; }
.pbar[data-pct="58"] .pbar-fill { width: 58%; }
.pbar[data-pct="59"] .pbar-fill { width: 59%; }
.pbar[data-pct="60"] .pbar-fill { width: 60%; }
.pbar[data-pct="61"] .pbar-fill { width: 61%; }
.pbar[data-pct="62"] .pbar-fill { width: 62%; }
.pbar[data-pct="63"] .pbar-fill { width: 63%; }
.pbar[data-pct="64"] .pbar-fill { width: 64%; }
.pbar[data-pct="65"] .pbar-fill { width: 65%; }
.pbar[data-pct="66"] .pbar-fill { width: 66%; }
.pbar[data-pct="67"] .pbar-fill { width: 67%; }
.pbar[data-pct="68"] .pbar-fill { width: 68%; }
.pbar[data-pct="69"] .pbar-fill { width: 69%; }
.pbar[data-pct="70"] .pbar-fill { width: 70%; }
.pbar[data-pct="71"] .pbar-fill { width: 71%; }
.pbar[data-pct="72"] .pbar-fill { width: 72%; }
.pbar[data-pct="73"] .pbar-fill { width: 73%; }
.pbar[data-pct="74"] .pbar-fill { width: 74%; }
.pbar[data-pct="75"] .pbar-fill { width: 75%; }
.pbar[data-pct="76"] .pbar-fill { width: 76%; }
.pbar[data-pct="77"] .pbar-fill { width: 77%; }
.pbar[data-pct="78"] .pbar-fill { width: 78%; }
.pbar[data-pct="79"] .pbar-fill { width: 79%; }
.pbar[data-pct="80"] .pbar-fill { width: 80%; }
.pbar[data-pct="81"] .pbar-fill { width: 81%; }
.pbar[data-pct="82"] .pbar-fill { width: 82%; }
.pbar[data-pct="83"] .pbar-fill { width: 83%; }
.pbar[data-pct="84"] .pbar-fill { width: 84%; }
.pbar[data-pct="85"] .pbar-fill { width: 85%; }
.pbar[data-pct="86"] .pbar-fill { width: 86%; }
.pbar[data-pct="87"] .pbar-fill { width: 87%; }
.pbar[data-pct="88"] .pbar-fill { width: 88%; }
.pbar[data-pct="89"] .pbar-fill { width: 89%; }
.pbar[data-pct="90"] .pbar-fill { width: 90%; }
.pbar[data-pct="91"] .pbar-fill { width: 91%; }
.pbar[data-pct="92"] .pbar-fill { width: 92%; }
.pbar[data-pct="93"] .pbar-fill { width: 93%; }
.pbar[data-pct="94"] .pbar-fill { width: 94%; }
.pbar[data-pct="95"] .pbar-fill { width: 95%; }
.pbar[data-pct="96"] .pbar-fill { width: 96%; }
.pbar[data-pct="97"] .pbar-fill { width: 97%; }
.pbar[data-pct="98"] .pbar-fill { width: 98%; }
.pbar[data-pct="99"] .pbar-fill { width: 99%; }
.pbar[data-pct="100"] .pbar-fill { width: 100%; }
.pbar-pct { margin: 0 0 8px; font-size: 12.5px; font-weight: 800; color: var(--blue-d);
  font-variant-numeric: tabular-nums; }
.qbytes { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* 未标品系的鼠：用灰度 + 问号角标区分开。
   以前它和 BALB/c、ICR、NSG、FVB 共用同一张白鼠图，看着像「已经标好了」。 */
.strain-other > img { filter: grayscale(1) contrast(.9) opacity(.75); }
.strain-other::after { content: "?"; position: absolute; right: 4px; bottom: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--soft2); color: var(--dim);
  font: 800 12px/18px var(--f); text-align: center; }

/* 笼内勾选删除 */
.tile.pickable { cursor: pointer; }
.tile-pick { position: absolute; top: 12px; right: 12px; width: 21px; height: 21px;
  accent-color: var(--blue); z-index: 2; }
.tile.pickable { position: relative; }
.tile.pickable:has(.tile-pick:checked) { border-color: var(--red); background: var(--red-s); }

/* ===================================================== 5.9.4 笼内编辑与收纳
   规则不变：这个应用的 CSP 是 style-src 'self'，任何行内 style 都会被静默拦掉。
   下面所有效果都必须靠类名，不能在 JS 里拼 style="…"。 */

/* 每块砖上：整块可点开，右上角那支笔只改这一只。
   笔是真按钮，不能套在 <a> 里，所以用一条铺满的隐形链接做「点开」。 */
.tile-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tile-a { position: relative; }
.tile-edit { position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card);
  color: var(--dim); cursor: pointer; opacity: 0; transition: opacity .12s, color .12s; }
.tile-edit .icon { width: 15px; height: 15px; }
.tile-a:hover .tile-edit, .tile-edit:focus-visible { opacity: 1; }
.tile-edit:hover { color: var(--ink); border-color: var(--dim2); }
/* 触屏没有 hover，笔要一直看得见 —— 否则手机上等于没有这个功能 */
@media (hover: none) { .tile-edit { opacity: .55; } }

/* 笼卡还在识别 / 需要定夺：方块上直接说，别等点进去才发现 */
.tile-state { display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 13px; font-weight: 650; color: var(--dim); }
.tile-state .icon { width: 14px; height: 14px; }
.tile-pending { border-style: dashed; }
/* 「待填笼号」不是出错，是还没填完 —— 用中性色，别用警示色吓人。
   真正需要人来定夺的只有笼号重复那一种。 */
.tile-needs_label, .tile-failed { border-style: dashed; }
.tile-needs_label .tile-state, .tile-failed .tile-state { color: var(--dim); }
.tile-conflict { border-color: var(--amber); }
.tile-conflict .tile-state { color: var(--amber-d); }
.spin { width: 13px; height: 13px; border: 2px solid var(--dim2); border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* 收纳：不常用的按钮折起来 */
.tk-fold { width: 100%; }
.tk-fold > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px;
  font-size: 14px; font-weight: 600; color: var(--dim); background: var(--card); }
.tk-fold > summary::-webkit-details-marker { display: none; }
.tk-fold > summary::after { content: '⌄'; font-size: 13px; line-height: 1; }
.tk-fold[open] > summary::after { content: '⌃'; }
.tk-fold > summary:hover { color: var(--ink); }
.tk-fold-in { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* 批量模式的工具条 */
.pickbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); box-shadow: var(--sh); }
.pickbar span { font-weight: 700; font-size: 14px; margin-right: auto; }
.pickbar button { border: 1px solid var(--line); border-radius: 9px; background: transparent;
  padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.tk-more.bulk button[disabled] { opacity: .4; cursor: not-allowed; }

/* 笼位标题旁边那支笔 */
.tk-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card);
  color: var(--dim); cursor: pointer; }
.tk-icon:hover { color: var(--ink); }
.tk-icon .icon { width: 17px; height: 17px; }

/* 一句话说明当前这一笼的状态 */
.tk-note { margin: 0 0 12px; padding: 10px 13px; border-radius: 11px;
  background: var(--soft); color: var(--dim); font-size: 14px; }
.tk-note.warn { background: var(--amber-s); color: var(--amber-d); font-weight: 600; }

/* 笼卡原图 */
.cardshot-btn { display: block; width: 100%; padding: 0; margin: 0 0 14px;
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: var(--card); cursor: zoom-in; }
.cardshot-btn .cardshot { display: block; width: 100%; max-height: 190px; object-fit: cover; }
.cardshot.big { max-height: 70vh; object-fit: contain; width: 100%; }

/* 批量改名的预览：一行一条「旧 → 新」，确认了才落库 */
.renlist { max-height: 46vh; overflow-y: auto; margin: 6px 0 12px;
  border: 1px solid var(--line); border-radius: 12px; }
.renrow { display: flex; align-items: center; gap: 10px; padding: 9px 13px; }
.renrow + .renrow { border-top: 1px solid var(--line); }
.ren-old { color: var(--dim); text-decoration: line-through; flex: 1; }
.ren-arrow { color: var(--dim2); display: inline-grid; place-items: center; }
.ren-arrow .icon { width: 15px; height: 15px; }
.ren-new { flex: 1; font-weight: 700; }

/* 相册点进子类后的返回按钮 */
#galBack { margin-bottom: 10px; }

/* 批量工具条里的「取消」：它只是退出，不该抢主按钮的视觉重量 */
.pickbar button.quiet { color: var(--dim); }
.pickbar button.quiet:hover { color: var(--ink); }
.pickbar button[disabled] { opacity: .4; cursor: not-allowed; }

/* 电脑上把一堆笼卡拖进来 */
#trackerBody.dropping { outline: 2px dashed var(--blue); outline-offset: -6px;
  border-radius: 14px; background: var(--blue-s); }
#trackerBody.dropping * { pointer-events: none; }   /* 别让子元素抢走 drop 事件 */
.only-wide { display: none; }
@media (min-width: 720px) and (hover: hover) { .only-wide { display: inline; } }

/* 批量上传时浮在下面的那条进度 */
.uppanel { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 60;
  width: min(420px, calc(100vw - 32px)); padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  box-shadow: var(--sh2); display: grid; gap: 8px; }
.uppanel b { font-size: 14px; }
.uppanel .pbar { margin: 0; }

/* 毛色选项左边那只小鼠：裸鼠和大鼠单独给个底色，好区分 */
.pick-art.coat-nude { background: #f6e7e4; }
.pick-art.coat-rat { background: #efe6e5; }
.pick-art.coat-gold { background: #f7efdc; }
.pick-art.coat-brown { background: #efe7de; }
.pick-art.coat-black { background: #e6e8ea; }
.pick-art.coat-white { background: #eef1f4; }
@media (prefers-color-scheme: dark) {
  .pick-art.coat-nude, .pick-art.coat-rat, .pick-art.coat-gold,
  .pick-art.coat-brown, .pick-art.coat-black, .pick-art.coat-white { background: var(--soft); }
}

/* 公告横幅 */
#noticeBar { display: grid; gap: 8px; margin: 0 0 12px; }
.notice { display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--soft); }
.notice-main { flex: 1; min-width: 0; }
.notice b { font-size: 14px; }
.notice p { margin: 4px 0 0; font-size: 13px; color: var(--dim); }
.notice-when { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }
.notice-x { flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--dim); cursor: pointer; }
.notice-x:hover { color: var(--ink); background: var(--card); }
.notice-x .icon { width: 13px; height: 13px; }
.notice.n-maintenance { border-color: var(--amber); background: var(--amber-s); }
.notice.n-maintenance b, .notice.n-maintenance .notice-when { color: var(--amber-d); }
.notice.n-maintenance.live { border-width: 2px; }
.notice.n-maintenance.live b::before { content: '● '; color: var(--red); }

/* 设置页里的公告列表 */
.notice-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; }
.notice-row + .notice-row { border-top: 1px solid var(--line); }
.notice-row .grow { flex: 1; min-width: 0; }
.notice-row small { display: block; color: var(--dim); font-size: 12px; }
.notice-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  background: var(--soft); color: var(--dim); }
.notice-tag.upcoming { background: var(--blue-s); color: var(--blue-d); }
.notice-tag.current { background: var(--amber-s); color: var(--amber-d); }
.notice-tag.over { opacity: .6; }

/* 「整理成 SnapTracker 表」：和导出、重新识别不是一类事（它会往 SnapTracker 里写），
   所以给一个单独的颜色，别和普通按钮混在一起 */
.tocard { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-color: var(--cyan); }
.tocard-main { flex: 1; min-width: 200px; }
.tocard-main b { display: block; font-size: 15px; }
.tocard-main small { color: var(--dim); font-size: 13px; }
.btn.tobtn { background: var(--cyan); border-color: var(--cyan); color: #fff; font-weight: 650; }
.btn.tobtn:hover { filter: brightness(1.06); }

/* 预览表：列多的时候横向滚，别把整页撑宽 */
.totable { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.totable table { border-collapse: collapse; min-width: 100%; font-size: 13px; }
.totable th { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line);
  background: var(--soft); vertical-align: top; }
.totable .th-col { display: block; font-weight: 700; margin-bottom: 4px; white-space: nowrap; }
.totable th select { width: 100%; font-size: 12px; padding: 3px 4px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.totable td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.totable td input { width: 100%; min-width: 72px; padding: 4px 6px; font-size: 13px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); }
.totable td input:focus { border-color: var(--blue); background: var(--card); outline: none; }

/* ===================================================== 6.0 称重与排队

   两条横幅：识别排队（进行中）和该称了（待办）。摆在方块上面，
   因为这两件事都是「现在要知道」，不是点进去才发现。 */
.tk-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 11px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px; }
.tk-bar b { flex: none; }
.tk-bar span { color: var(--dim); font-size: 13px; flex: 1; min-width: 140px; }
.tk-bar .icon { width: 15px; height: 15px; flex: none; }
.tk-bar button { flex: none; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); padding: 5px 11px; font-size: 13px; color: var(--ink); cursor: pointer; }
.tk-bar.work { background: var(--blue-s); border-color: var(--blue); }
.tk-bar.work b { color: var(--blue-d); }
.tk-bar.weigh { background: var(--amber-s); border-color: var(--amber); }
.tk-bar.weigh b, .tk-bar.weigh .icon { color: var(--amber-d); }

/* 方块上「几天前称的」 */
.tile-weigh { display: block; margin-top: 4px; font-size: 12px; color: var(--dim2); }
.tile-weigh.due { color: var(--amber-d); font-weight: 650; }

/* 称重那一行：编号 | 输入框 | 变化量。
   变化量就在旁边，不用心算 —— 掉多少一眼看见。 */
.wrow { display: grid; grid-template-columns: minmax(58px, auto) 1fr minmax(96px, auto);
  align-items: center; gap: 10px; }
.wtag { font-weight: 700; font-size: 14px; }
.wrow input { min-width: 0; }
.wdelta { font-size: 12px; color: var(--dim2); text-align: right; white-space: nowrap; }
.wdelta.up { color: var(--green); }
.wdelta.down { color: var(--dim); }
.wdelta.warn { color: var(--amber-d); font-weight: 650; }
.wdelta.bad { color: var(--red); font-weight: 700; }

/* 弹窗左上角的返回。手机上够不到底部按钮时，这个才是顺手的出口。 */
.dlg-back { position: absolute; top: 14px; left: 14px; z-index: 2;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--dim); cursor: pointer; }
.dlg-back:hover { color: var(--ink); border-color: var(--dim2); }
.dlg-back .icon { width: 15px; height: 15px; }
#dlg form { position: relative; }
h2.has-back { padding-left: 42px; min-height: 32px; }

/* 连不上时那一屏：中性，不用警示色 —— 这不是用户做错了什么 */
.tk-offline { padding: 40px 20px; text-align: center; display: grid; gap: 10px;
  justify-items: center; color: var(--dim); }
.tk-offline b { color: var(--ink); font-size: 15px; }

/* 提问 */
.ask-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 4px; }
.ask-chip {
  font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--soft); color: var(--dim);
}
.ask-chip:hover { color: var(--ink); border-color: var(--dim2); }

.ask-explain { margin: 2px 0 12px; font-size: 14px; font-weight: 600; }

.ask-table { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.ask-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.ask-table th, .ask-table td { padding: 7px 11px; text-align: left; white-space: nowrap; }
.ask-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--soft); color: var(--dim);
  font-size: 12px; font-weight: 700; letter-spacing: .03em;
  border-bottom: 1px solid var(--line);
}
.ask-table tbody tr + tr td { border-top: 1px solid var(--line); }
.ask-table td.num { text-align: right; font-variant-numeric: tabular-nums;
                    font-family: var(--mono, ui-monospace, monospace); }
.ask-table td.down { color: var(--red); font-weight: 600; }

.ask-sql {
  display: block; font-family: var(--mono, ui-monospace, monospace);
  font-size: 11.5px; line-height: 1.6; color: var(--dim);
  background: var(--soft); padding: 10px 12px; border-radius: 9px;
  white-space: pre-wrap; word-break: break-word; max-height: 24vh; overflow: auto;
}

/* ===================================================== Chat
   一块对话画布：输入固定在底部，结果向上堆叠。
   结果不是一段话，是真表格 —— 每个数字都来自数据库。 */

.chatview { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.chat-canvas {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 4px 0 16px;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { .chat-canvas { scroll-behavior: auto; } }

/* 空画布：不摆一个空框，直接给能问的 */
.chat-empty {
  margin: auto; text-align: center; max-width: 34rem;
  display: grid; gap: 10px; justify-items: center; padding: 24px 8px;
}
.chat-empty .icon.big { width: 34px; height: 34px; color: var(--dim2); }
.chat-empty h2 { margin: 0; font-size: 19px; }
.chat-empty p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.6; }
.chat-warn { color: var(--amber-d); font-weight: 600; }

.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.chat-chip {
  font: inherit; font-size: 13px; padding: 7px 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--dim); text-align: left;
}
.chat-chip:hover { color: var(--ink); border-color: var(--dim2); }

/* 你说的话 */
.chat-you {
  align-self: flex-end; max-width: min(78%, 34rem);
  background: var(--blue-s); color: var(--blue-d);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 14px; font-size: 14.5px; font-weight: 500;
  overflow-wrap: anywhere;
}

/* 它给的结果 */
.chat-it {
  align-self: stretch;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 13px 15px;
  display: grid; gap: 9px;
}
.chat-explain { margin: 0; font-size: 14px; font-weight: 650; }
.chat-sub { margin: 0; color: var(--dim); font-size: 13.5px; }
.chat-why { margin: 0; font-size: 14px; color: var(--dim); }
.chat-think { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; }

.chat-table { overflow: auto; max-height: 52vh; border: 1px solid var(--line); border-radius: 10px; }
.chat-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.chat-table th, .chat-table td { padding: 7px 11px; text-align: left; white-space: nowrap; }
.chat-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--soft); color: var(--dim);
  font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line);
}
.chat-table tbody tr + tr td { border-top: 1px solid var(--line); }
.chat-table td.num { text-align: right; font-variant-numeric: tabular-nums;
                     font-family: var(--mono, ui-monospace, monospace); }
.chat-table td.down { color: var(--red); font-weight: 600; }

.chat-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-open {
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink);
}
.chat-open:hover { border-color: var(--dim2); }

.chat-sql summary {
  list-style: none; cursor: pointer; font-size: 12.5px; color: var(--dim2);
}
.chat-sql summary::-webkit-details-marker { display: none; }
.chat-sql summary:hover { color: var(--dim); }
.chat-sql code {
  display: block; margin-top: 7px;
  font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; line-height: 1.6;
  color: var(--dim); background: var(--soft); padding: 9px 11px; border-radius: 8px;
  white-space: pre-wrap; word-break: break-word; max-height: 22vh; overflow: auto;
}

/* 输入条固定在底部 */
.chat-bar {
  flex: none; display: flex; gap: 9px; align-items: center;
  padding: 10px 0 2px; background: var(--bg);
  border-top: 1px solid var(--line);
}
.chat-bar input {
  flex: 1; font: inherit; font-size: 15px; padding: 11px 15px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
}
.chat-bar input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.chat-bar button {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--blue); color: #fff; cursor: pointer;
}
.chat-bar button .icon { width: 19px; height: 19px; }
.chat-bar button:hover { filter: brightness(1.08); }

/* 改数据前的确认。没点确认之前，什么都没变。 */
.chat-confirm {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 11px 13px; border-radius: 11px;
  background: var(--amber-s); border: 1px solid var(--amber);
}
.chat-confirm b { font-size: 14px; color: var(--amber-d); }
.chat-confirm.danger { background: var(--red-s); border-color: var(--red); }
.chat-confirm.danger b { color: var(--red); }
.chat-confirm-hint { font-size: 12.5px; color: var(--dim); flex: 1; min-width: 12rem; }
.chat-confirm-acts { display: flex; gap: 8px; }
.chat-no, .chat-yes {
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 15px;
  border-radius: 8px; cursor: pointer; border: 1px solid transparent;
}
.chat-no { background: transparent; border-color: var(--line); color: var(--ink); }
.chat-yes { background: var(--amber-d); color: #fff; }
.chat-confirm.danger .chat-yes { background: var(--red); }
.chat-yes:disabled { opacity: .6; cursor: default; }
.chat-done { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--green); }


/* ===================================================== Chat 6.2
   一次回答可能有好几步，每一步一块；结果可能是表、曲线、图、文件或一段文字。
   块与块之间用一条细线分开 —— 让人看得出哪一步做了什么。 */

.chat-step { display: grid; gap: 9px; }
.chat-step + .chat-step { border-top: 1px solid var(--line); padding-top: 12px; }
.chat-meta { margin: 0; font-size: 11.5px; color: var(--dim2); }

/* 应用自己生成的文字（解读、方法学）。不是模型在对话里现写的。 */
.chat-text {
  font-size: 14px; line-height: 1.75; color: var(--ink);
  background: var(--soft); border-radius: 10px; padding: 11px 13px;
  white-space: normal; overflow-wrap: anywhere;
}

/* 出图。按记录页同一套规范渲染，这里只负责摆好。 */
.chat-img {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; display: grid; place-items: center; padding: 8px;
}
.chat-img img { max-width: 100%; height: auto; display: block; }

/* 指标曲线。和 Tracker 用的是同一个绘图模块。 */
.chat-chart { width: 100%; min-height: 190px; }

/* 每一页右下角的入口。避开底部导航，也避开 iPhone 的下巴。 */
.askhere {
  position: fixed; right: 16px; z-index: 40;
  bottom: 18px;
  display: flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
}
.askhere .icon { width: 17px; height: 17px; color: var(--blue); }
.askhere:hover { border-color: var(--dim2); }
/* 底部导航只在窄屏出现（--bar 也只在那里定义），所以只有窄屏要给它让位。 */
@media (max-width: 760px) {
  .askhere { bottom: calc(var(--bar) + 14px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 420px) { .askhere span { display: none; } .askhere { padding: 11px; } }

/* ===================================================== Chat 发图
   待发区的缩略图条，和「你」气泡里的附图。
   注意 .chat-attach 自己带了 display:flex —— hidden 属性会被它盖掉，
   所以专门写一条 [hidden] 把空条收回去。 */

.chat-attach {
  flex: none; display: flex; gap: 10px; align-items: center;
  padding: 9px 6px 0; overflow-x: auto;
}
.chat-attach[hidden] { display: none; }
.chat-attach-item { position: relative; flex: none; }
.chat-attach-item img {
  width: 56px; height: 56px; object-fit: cover; display: block;
  border-radius: 10px; border: 1px solid var(--line); background: var(--soft);
}
.chat-attach-x {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--card); color: var(--dim);
}
.chat-attach-x .icon { width: 10px; height: 10px; }
.chat-attach-x:hover { color: var(--ink); border-color: var(--dim2); }

/* 输入条里的附图按钮：次级样式，描边浅底，不和发送键撞色 */
.chat-bar button.chat-imgbtn {
  background: var(--card); color: var(--dim); border: 1px solid var(--line);
}
.chat-bar button.chat-imgbtn:hover { filter: none; color: var(--ink); border-color: var(--dim2); }

/* 「你」气泡里的附图：横排小图，压在文字上方 */
.chat-you-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.chat-you-imgs:last-child { margin-bottom: 0; }
.chat-you-imgs img {
  width: 72px; height: 72px; object-fit: cover; display: block;
  border-radius: 9px; border: 1px solid var(--line); background: var(--soft);
}

/* 本次发送带来的原图：多张一排小图，单张给一张正经的图卡，点开进灯箱 */
.chat-you-pics {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  margin-bottom: 7px;
}
.chat-you-pics:last-child { margin-bottom: 0; }
.chat-you-pics img {
  width: 72px; height: 72px; object-fit: cover; display: block; cursor: zoom-in;
  border-radius: 9px; border: 1px solid var(--line); background: var(--soft);
}
.chat-you-pics.one img {
  width: auto; height: auto; max-width: 15rem; max-height: 13rem;
  border-radius: 11px; box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}
@media (max-width: 560px) {
  .chat-you-pics.one img { max-width: 11rem; max-height: 10rem; }
}

/* ===================================================== Chat 7.0
   左边一列对话记录，右边是画布。手机上侧栏是抽屉。

   动画守两条老规矩（4.1 / 4.3 栽过）：只动 transform / opacity，
   起始位移小到「动画不跑也没事」—— 窗口在后台被节流时动画会停在第一帧。 */

.chatview { flex-direction: row; gap: 0; position: relative; }

.chat-side {
  flex: none; width: 15.5rem; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  border-right: 1px solid var(--line); padding: 4px 14px 10px 0;
}
.chat-side-top { display: grid; gap: 8px; }
.chat-side-top .btn { justify-content: center; }
#chatFind {
  font: inherit; font-size: 13.5px; padding: 8px 12px; width: 100%;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
}
.chat-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.chat-side-empty { margin: 8px 2px; color: var(--dim2); font-size: 13px; line-height: 1.6; }

.chat-sess { display: flex; align-items: stretch; border-radius: 9px; }
.chat-sess.on { background: var(--soft); }
.chat-sess-open {
  flex: 1; min-width: 0; text-align: left; font: inherit; cursor: pointer;
  background: transparent; border: 0; padding: 8px 6px 8px 10px;
  display: grid; gap: 2px; color: var(--ink); border-radius: 9px;
}
.chat-sess-open b {
  font-size: 13.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.chat-sess-open small { font-size: 11.5px; color: var(--dim2); }
.chat-pin-dot { color: var(--blue); margin-right: 4px; }
.chat-sess-more {
  flex: none; width: 28px; font: inherit; font-size: 15px; cursor: pointer;
  background: transparent; border: 0; color: var(--dim2); border-radius: 9px;
}
@media (hover: hover) {
  .chat-sess:hover { background: var(--soft); }
  .chat-sess-more:hover { color: var(--ink); }
}

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column;
             min-height: 0; padding-left: 14px; }
.chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 2px 0 8px; }
.chat-head h2 {
  flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-side-btn {
  display: none; flex: none; width: 34px; height: 34px; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card);
  color: var(--ink); cursor: pointer;
}
.chat-side-btn .icon { width: 17px; height: 17px; }
.chat-shade { display: none; }

/* 手机：侧栏变抽屉，从左边滑进来 */
@media (max-width: 860px) {
  .chat-side {
    position: absolute; inset: 0 auto 0 0; z-index: 30; width: min(17rem, 82vw);
    background: var(--bg); padding: 10px 12px; border-radius: 0 14px 14px 0;
    box-shadow: 0 10px 40px rgb(0 0 0 / 18%);
    transform: translate3d(-101%, 0, 0); transition: transform .22s ease;
  }
  .chat-main { padding-left: 0; }
  .chat-side-btn { display: grid; }
  .side-on .chat-side { transform: translate3d(0, 0, 0); }
  .side-on .chat-shade {
    display: block; position: absolute; inset: 0; z-index: 20;
    background: rgb(0 0 0 / 28%);
  }
}
@media (prefers-reduced-motion: reduce) { .chat-side { transition: none; } }

/* 三个点。不是转圈 —— 转圈看着像卡住了，点是在「想」。
   最要紧的是它**不该给人负反馈**：不变红、不说「失败」、不加感叹号。 */
.chat-it.thinking { border-style: dashed; }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--dim2);
  animation: dot 1.25s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes dot {
  0%, 60%, 100% { opacity: .3; transform: translate3d(0, 0, 0); }
  30% { opacity: 1; transform: translate3d(0, -3px, 0); }
}
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }

/* 选项：「你要哪一张」摆出来让人点，而不是问回去。 */
.chat-choose { display: grid; gap: 9px; }
.chat-choose-q { margin: 0; font-size: 14.5px; font-weight: 600; }
.chat-opts { display: grid; gap: 7px; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }
.chat-opt {
  display: flex; align-items: center; gap: 10px; text-align: left;
  font: inherit; cursor: pointer; padding: 8px 12px 8px 8px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--ink);
  transition: border-color .14s ease, transform .14s ease;
}
.chat-opt img {
  flex: none; width: 42px; height: 42px; border-radius: 8px;
  object-fit: cover; background: var(--soft);
}
.chat-opt span { min-width: 0; display: grid; gap: 1px; }
.chat-opt b { font-size: 13.5px; font-weight: 600; overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; }
.chat-opt small { font-size: 11.5px; color: var(--dim2); }
.chat-opt.danger { border-color: var(--red); color: var(--red); }
.chat-opt.danger b { color: var(--red); }
@media (hover: hover) {
  .chat-opt:hover { border-color: var(--blue); transform: translate3d(0, -1px, 0); }
  .chat-opt.danger:hover { border-color: var(--red); }
}
@media (prefers-reduced-motion: reduce) { .chat-opt { transition: none; } }

/* 照片墙：翻照片时看得见图，不是看一列文件名。 */
.chat-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.chat-card {
  display: grid; gap: 3px; padding: 0 0 7px; text-align: left; cursor: pointer;
  font: inherit; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--ink); overflow: hidden;
}
.chat-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); display: block; }
.chat-card b { font-size: 12.5px; font-weight: 600; padding: 5px 9px 0;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card small { font-size: 11px; color: var(--dim2); padding: 0 9px; }
@media (hover: hover) { .chat-card:hover { border-color: var(--blue); } }

/* 「接着可以…」。答完给两句能点的，不要每次都让人自己憋下一句。 */
.chat-next { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.chat-next-label { font-size: 12px; color: var(--dim2); }

.chat-you-imgs {
  display: inline-flex; align-items: center; gap: 4px; margin-right: 7px;
  font-size: 12px; opacity: .85;
}
.chat-you-imgs .icon { width: 14px; height: 14px; }
.btn.ghost { background: transparent; }
.profile-links .danger-text { color: var(--red); }

/* 缩略图坏了：灰底占位，不显示浏览器的破图标 */
.chat-opt img.broken, .chat-card img.broken { visibility: hidden; }
.chat-card img.broken { background: var(--soft); visibility: visible; color: transparent; }
