/* App 样式（一）：聊天、档案、点唱机、冲浪、终端、画板 */

/* ---------- 626 助手 ---------- */
.chat { display: flex; flex-direction: column; height: 100%; gap: 10px; }
.chat__log { flex: 1; min-height: 0; overflow: auto; display: grid; align-content: start; gap: 12px; padding: 4px 2px; }
.msg { display: flex; align-items: flex-end; gap: 8px; animation: rise .2s steps(2) both; }
.msg--me { justify-content: flex-end; }
.msg__ava { height: 48px; flex: none; }
.msg__b { --pf: var(--ink); max-width: 78%; padding: 4px 10px; line-height: 20px; background: var(--panel-2); box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line); }
.msg--me .msg__b { background: var(--sand); color: var(--ink); box-shadow: 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink); }
.is-typing i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; background: var(--stitch-hi); animation: hop .6s steps(2) infinite; }
.is-typing i:nth-child(2) { animation-delay: .15s; }
.is-typing i:nth-child(3) { animation-delay: .3s; }
.chat__chips { display: flex; flex-wrap: wrap; gap: 10px; min-height: 0; }
.chat__chips:not(:empty) { padding: 4px 3px; }
.chat__form { display: flex; gap: 12px; padding: 3px; }
.chat__form .btn { flex: none; white-space: nowrap; }

/* ---------- 档案 ---------- */
.dossier { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.dossier__photo { position: relative; padding: 10px; background: var(--ink); }
.dossier__photo .sticker { height: 130px; }
.stamp { position: absolute; right: -16px; bottom: -4px; padding: 0 6px; transform: rotate(-12deg); border: 2px solid var(--hibiscus); color: var(--hibiscus); background: #0e1640e6; }
.dossier__meta { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; }
.dossier__meta dt { color: var(--dim); }
.stats li { display: grid; grid-template-columns: 52px 1fr; column-gap: 10px; align-items: center; }
.stats b { height: 12px; background: var(--ink); position: relative; }
.stats b::after { content: ''; position: absolute; inset: 0; width: calc(var(--v) * 1%); background: repeating-linear-gradient(90deg, var(--stitch-hi) 0 9px, transparent 9px 12px); animation: fill 1s steps(10) both .2s; }
.stats b.is-warn::after { background: repeating-linear-gradient(90deg, var(--hibiscus) 0 9px, transparent 9px 12px); }
.stats b.is-max::after { background: repeating-linear-gradient(90deg, var(--angel) 0 9px, transparent 9px 12px); }
.stats em { grid-column: 2; font-style: normal; color: var(--dim); line-height: 20px; }
@keyframes fill { from { width: 0; } }
.classified { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 12px; padding: 10px; border: 2px dashed var(--hibiscus); background: repeating-linear-gradient(45deg, #2a0f2a 0 8px, #200b22 8px 16px); animation: pop .25s steps(3); }
.classified__img { height: 96px; filter: hue-rotate(-40deg) saturate(1.4) drop-shadow(0 0 6px #ff5d73); }
.classified__tag { color: var(--hibiscus); }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.face { padding: 4px; border: 2px solid transparent; background: var(--panel-2); height: 70px; display: grid; place-items: center; }
.face .sticker { max-height: 60px; max-width: 100%; }
.face:hover { border-color: var(--sun); }
.face:hover .sticker { animation: hop .4s steps(2) infinite; }

/* ---------- 点唱机 ---------- */
.jb { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.jb__deck { position: relative; width: 168px; height: 168px; padding: 8px; background: #8a5a3a; box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 4px #6b4429; }
.record { width: 152px; height: 152px; border-radius: 50%; display: grid; place-items: center; background: repeating-radial-gradient(circle, #1b1d2e 0 3px, #2a2d45 3px 5px); box-shadow: 0 0 0 3px var(--ink); }
.record.is-on { animation: spin 2.4s linear infinite; }
.record__label { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; display: grid; place-items: end center; background: var(--hibiscus); box-shadow: 0 0 0 3px var(--ink); }
.record__label .sticker { height: 62px; }
@keyframes spin { to { transform: rotate(360deg); } }
.jb__arm { position: absolute; right: 2px; top: 6px; width: 8px; height: 92px; background: var(--sand); box-shadow: 0 0 0 2px var(--ink); transform-origin: 50% 6px; transform: rotate(-24deg); transition: transform .5s var(--ease); }
.jb__arm.is-on { transform: rotate(6deg); }
.jb__title { font-size: 24px; line-height: 1.3; color: var(--sun); }
.jb__sub { color: var(--dim); }
.jb__ctrl { display: flex; gap: 14px; margin: 12px 0; }
.jb__play { min-width: 92px; }
.jb__prog { height: 8px; background: var(--ink); }
.jb__prog i { display: block; height: 100%; width: 0; background: var(--stitch); }
.jb__viz { width: 100%; height: 60px; margin-top: 10px; image-rendering: pixelated; background: var(--ink); }
.jb__list { margin-top: 18px; display: grid; gap: 8px; }
.jb__list button { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px; border: 0; background: var(--panel-2); text-align: left; }
.jb__list button b { flex: 1; font-weight: normal; }
.jb__list button span { color: var(--dim); }
.jb__list li.is-cur button span { color: var(--sand); }
.jb__list li.is-cur button { background: var(--stitch); }
.jb__list li.is-cur button::before { content: '♪ '; color: var(--sun); }

/* ---------- 冲浪 ---------- */
.surf__hud { display: flex; justify-content: space-between; margin-bottom: 8px; }
.surf__hud b { color: var(--sun); font-weight: normal; }
.surf__cv { display: block; width: 100%; height: auto; aspect-ratio: 2; background: #4f8fe6; box-shadow: 0 0 0 3px var(--ink); cursor: pointer; touch-action: manipulation; }
.surf__cv:focus { outline: none; }

/* ---------- 终端 ---------- */
.win[data-app="terminal"] .win__body { padding: 0; }
.term { height: 100%; overflow: auto; padding: 12px 14px; background: #070b1e; color: #b8f5c8; line-height: 20px; cursor: text; }
.term__l { white-space: pre-wrap; word-break: break-all; }
.term__l.is-echo { color: var(--sand); }
.term__l.is-dim { color: var(--dim); }
.term__l.is-err { color: var(--hibiscus); }
.term__l.is-gold { color: var(--sun); }
.term__l.is-blue { color: var(--stitch-hi); }
.term__line { display: flex; gap: 8px; }
.term__ps { color: var(--leaf); flex: none; }
.term__in { flex: 1; min-width: 0; border: 0; background: none; color: var(--sand); caret-color: var(--sun); outline: none; padding: 0; }

/* ---------- 画板 ---------- */
.paint { display: grid; grid-template-columns: auto 1fr; gap: 20px; }
.paint__board { padding: 6px; background: var(--ink); align-self: start; }
.paint__cv {
  display: block; width: 320px; height: 320px; image-rendering: pixelated; cursor: crosshair; touch-action: none;
  background: #fffdf6 repeating-conic-gradient(#f3ead6 0 25%, transparent 0 50%) 0 0 / 20px 20px;
}
.paint__side { display: grid; align-content: start; gap: 14px; }
.paint__tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 3px; }
.paint__pal { display: grid; grid-template-columns: repeat(8, 26px); gap: 6px; }
.swatch { width: 26px; height: 26px; border: 2px solid var(--ink); background: var(--c); padding: 0; }
.swatch[aria-checked="true"] { outline: 3px solid var(--sun); outline-offset: 1px; }
.paint__acts { display: flex; flex-wrap: wrap; gap: 12px; padding: 3px; }

@media (max-width: 720px) {
  .dossier, .jb, .paint { grid-template-columns: 1fr; justify-items: center; }
  .paint__cv { width: min(300px, 80vw); height: min(300px, 80vw); }
}
