/*
 * Aiglaze 首页 · 全息陈列室
 * 全屏黑底，中间是一幅由光点组成的全息影像（AI 助理小釉），上面叠一层很薄的等宽文字界面：
 * 左边是标签和业务卡片，右边是介绍 / 对话栏。页面本身不滚动，两栏各自滚动。
 * 颜色：黑、白、灰，加一个淡紫做强调；粉色只用在出错提示上。
 */

:root {
    --accent: #aa88ff;
    --blush: #ff8fa8;
    --text: #dddddd;
    --muted: #8a8a8a;
    --chip: #1c1c1c;
    --line: #2a2a2a;
    --panel: #0a0a0a;
    --paper: #e6e6e6;
    --mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", monospace;
    --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; background: #000; color: var(--text); overflow: hidden;
    font: 13px/1.35 var(--mono); letter-spacing: .02em; text-transform: uppercase;
    -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
html:lang(zh-CN) body { line-height: 1.55; }
button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 0; text-align: inherit; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 24px; top: -60px; z-index: 5; background: var(--paper); color: #000; padding: 8px 12px; text-decoration: none; }
.skip:focus { top: 12px; }
.noscript { position: fixed; left: 24px; bottom: 16px; z-index: 3; margin: 0; color: var(--muted); max-width: 320px; }

#cloud { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: pan-y; }
.ui { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.ui a, .ui button, .tags, .list, .col { pointer-events: auto; }

/* ---------- 品牌、右上角 ---------- */
.brand { position: absolute; top: 24px; left: 24px; mix-blend-mode: plus-lighter; }
.brand__link { display: flex; gap: 14px; align-items: center; color: #fff; text-decoration: none; }
.brand__mark { color: #fff; flex: none; transition: color .3s; }
.brand__link:hover .brand__mark { color: var(--accent); }
.brand__name { display: block; font-size: 20px; line-height: 1.1; color: #fff; }
.brand__sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.tools { position: absolute; top: 24px; right: 24px; display: flex; gap: 8px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: #fff; font-size: 14px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
button.round { transition: border-color .3s, color .3s; }
button.round:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 标签 ---------- */
.tags { position: absolute; top: 120px; left: 24px; width: 320px; display: flex; flex-wrap: wrap; gap: 6px; mix-blend-mode: plus-lighter; }
.chip { background: var(--chip); padding: 5px 9px; font-size: 11px; line-height: 1.35; color: #cfcfcf; transition: background .3s, color .3s; }
.chip:hover { background: #2c2c2c; color: #fff; }
.chip.is-on, .chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--paper); color: #000; }

/* ---------- 左栏：业务卡片 ---------- */
.list { position: absolute; top: 204px; left: 24px; bottom: 0; width: 320px; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; padding-bottom: 40px; }
.list::-webkit-scrollbar { display: none; }
.card { border-top: 1px solid var(--line); }
.card__hit { display: block; width: 100%; padding: 18px 0; }
.thumb { display: block; height: 160px; border-radius: 2px; background: var(--panel); overflow: hidden; outline: 1px solid transparent; outline-offset: -1px; transition: outline-color .3s; }
.thumb canvas { display: block; width: 100%; height: 100%; opacity: .78; transition: opacity .3s, transform .9s var(--ease); }
.card__hit:hover .thumb canvas { opacity: 1; transform: scale(1.05); }
.card.is-on .thumb { outline-color: var(--accent); }
.card.is-on .thumb canvas { opacity: 1; }
.meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: 12px; }
.meta > span:first-child { color: #fff; transition: color .3s; }
.meta > span:last-child { color: var(--muted); text-align: right; flex: none; }
.card.is-on .meta > span:first-child { color: var(--accent); }

/* ---------- 右栏 ---------- */
.col { position: absolute; top: 92px; right: 56px; bottom: 0; width: 380px; display: flex; flex-direction: column; min-height: 0; }
.col:focus { outline: none; } /* “跳到正文”会把焦点放到这一栏上，不需要描边 */
.col__tabs { display: flex; gap: 6px; flex: none; margin-bottom: 20px; }
.tab__count { color: var(--muted); margin-left: 6px; }
.chip[aria-selected="true"] .tab__count { color: inherit; opacity: .6; }

.about { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 0 14px 46vh 0; mix-blend-mode: plus-lighter; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; outline-offset: -1px; }
.about::-webkit-scrollbar, .thread::-webkit-scrollbar { width: 4px; }
.about::-webkit-scrollbar-thumb, .thread::-webkit-scrollbar-thumb { background: var(--line); }
.block { margin-bottom: 2.8em; }
.block > :last-child { margin-bottom: 0; }
h1 { font-size: 22px; line-height: 1.35; font-weight: 400; color: #fff; margin: 0 0 .9em; text-wrap: balance; }
h2 { font-size: 13px; font-weight: 400; color: var(--accent); margin: 0 0 1em; transition: color .3s; }
h2::before { content: "["; }
h2::after { content: "]"; }
.block.is-on h2 { color: #fff; }
.about p { margin: 0 0 1em; text-align: justify; }
/* 大写只用在标签、标题这类短字上；成段的正文保持原样，英文才好读，品牌名也不会被改成全大写 */
.about p, .about li, .about dd { text-transform: none; }
/* 中文夹着英文单词时，两端对齐会把字距拉得忽宽忽窄；中文本来就字字等宽，左对齐右边也是齐的 */
html:lang(zh-CN) .about p, html:lang(zh-CN) .about dd { text-align: left; }
.about ul { margin: 0 0 1em; padding: 0; list-style: inside; }
.about li { margin: .15em 0; }
.about li::marker { color: var(--muted); }
.about a, .link { display: block; width: fit-content; color: var(--text); text-decoration: underline; text-underline-offset: 3px; margin: 4px 0; transition: opacity .3s; }
.about a:hover, .link:hover { opacity: .7; }
.link--inline { display: inline; margin: 0; }
.about dl { margin: 0; }
.about dt { color: #fff; margin-top: 1.1em; }
.about dd { margin: .35em 0 0; text-align: justify; }
.muted { color: var(--muted); }
.go { display: inline-flex; gap: 8px; align-items: center; background: var(--paper); color: #000; padding: 8px 12px; font-size: 12px; transition: background .3s; }
.go:hover { background: var(--accent); }
.go:disabled { background: var(--chip); color: var(--muted); cursor: default; }
.games { list-style: none !important; display: grid; gap: 2px; }
.games a { display: flex; width: auto; justify-content: space-between; gap: 14px; }
.games small { font-size: inherit; color: var(--muted); text-align: right; }

/* ---------- 对话 ---------- */
.talk { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.slip { flex: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.slip__head { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 0; }
.slip__label { color: var(--accent); }
.slip__label::before { content: "["; }
.slip__label::after { content: "]"; }
.slip__count { color: #fff; font-variant-numeric: tabular-nums; }
.slip__dots { display: flex; gap: 3px; margin-left: auto; }
.slip__dots i { width: 6px; height: 6px; background: var(--line); transition: background .4s; }
.slip__dots i.on { background: var(--accent); }
.slip__dots i.new { animation: pop .7s var(--ease); }
.slip__more { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.slip__list { padding-bottom: 10px; max-height: 38vh; overflow-y: auto; }
.slip__list dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; }
.slip__list dt { color: var(--muted); }
.slip__list dd { margin: 0; color: #fff; text-transform: none; overflow-wrap: anywhere; }
.slip__list p { margin: 0 0 6px; }

.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 10px 16px 0; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; outline-offset: -1px; }
.msg { margin: 0; text-transform: none; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: #fff; }
.msg::before { content: "[" attr(data-who) "]"; display: block; font-size: 11px; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.msg--me { color: var(--text); padding-left: 28px; }
.msg--me::before { color: var(--muted); }
.msg--new { animation: rise .5s var(--ease); }
.msg--typing i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: var(--accent); animation: blink 1.1s infinite; }
.msg--typing i:nth-child(2) { animation-delay: .18s; }
.msg--typing i:nth-child(3) { animation-delay: .36s; }
.msg--error { color: var(--blush); }
.msg--error::before { content: none; }
.msg--error button { margin-left: 10px; color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px; }
.composer { flex: none; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; height: 40px; max-height: 110px; resize: none; background: var(--panel); border: 1px solid var(--line); border-radius: 0; color: #fff; font: inherit; font-size: 14px; line-height: 1.5; letter-spacing: 0; text-transform: none; padding: 8px 10px; caret-color: var(--accent); transition: border-color .3s; }
.composer textarea::placeholder { color: var(--muted); }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.go--send { height: 40px; }
.talk__note { flex: none; font-size: 11px; margin: 8px 0 18px; }

/* ---------- 跟着全息像走的取景框、名牌和气泡 ---------- */
/* 取景框：四个角标出影像的范围，左上角一行读数（现在是什么形态、多少粒子） */
.hud { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s; will-change: transform; }
.is-live .hud { opacity: 1; }
.hud i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--accent); opacity: .75; }
.hud i:nth-child(1) { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.hud i:nth-child(2) { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.hud i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.hud i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.hud__info { position: absolute; left: 22px; top: -7px; font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.plate { position: absolute; left: 0; top: 0; display: grid; gap: 1px; justify-items: center; padding: 6px 12px; font-size: 11px; white-space: nowrap; will-change: transform; }
.plate__name { color: #fff; }
.plate__hint { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; transition: opacity .3s; }
.plate:hover .plate__hint { opacity: .7; }
.is-talk .plate__hint { visibility: hidden; }

.bubble { position: absolute; left: 0; top: 0; max-width: 220px; background: var(--paper); color: #000; padding: 7px 10px; font-size: 12px; line-height: 1.45; text-transform: none; letter-spacing: 0; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; pointer-events: none; will-change: transform; }
.bubble::after { content: ""; position: absolute; left: 12px; bottom: -4px; width: 9px; height: 9px; background: inherit; transform: rotate(45deg); }
.bubble.is-on { opacity: 1; visibility: visible; transition: opacity .25s; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(2.2); background: #fff; } 100% { transform: scale(1); } }

/* ---------- 窄一点的桌面 ---------- */
@media (max-width: 1100px) {
    .col { right: 24px; width: 320px; }
}
@media (max-height: 640px) and (min-width: 921px) {
    .tags { top: 92px; }
    .list { top: 168px; }
}

/* ---------- 手机和竖着拿的平板：上面是小釉，下面一块可滚动的面板 ----------
   920 以下左右两栏加中间的她放不下，所以用这个排法。这个数和 js/home.js 里的 isMobile() 要一致。 */
@media (max-width: 920px) {
    .tags, .list, .plate { display: none; }
    .brand { top: 14px; left: 16px; }
    .brand__mark { width: 34px; height: 34px; }
    .tools { top: 14px; right: 16px; }
    .round { width: 44px; height: 44px; }
    .counter { display: none; }
    .col { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 56vh; height: 56svh; padding: 12px 16px 0; background: #000; border-top: 1px solid var(--line); }
    /* 对话时面板再高一点，把地方让给对话记录 */
    .is-talk .col { height: 62vh; height: 62svh; }
    /* 平板上一行不要太长 */
    .col > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
    .col__tabs { margin-bottom: 14px; }
    /* 手指点的东西做大一点 */
    .chip { padding: 10px 12px; font-size: 12px; }
    .go { padding: 12px 14px; }
    .about a, .link { padding: 6px 0; margin: 2px 0; }
    .link--inline, .msg--error button { padding: 8px 4px; }
    .about { padding: 0 6px 30vh 0; mix-blend-mode: normal; }
    .about p, .about dd { text-align: left; }
    /* 快捷回复排成一行横着滑，不占竖向的地方 */
    .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
    .chips::-webkit-scrollbar { display: none; }
    .chips .chip { flex: none; }
    .composer textarea { font-size: 16px; height: 44px; }
    .go--send { height: 44px; padding: 0 14px; }
    .talk__note { margin: 6px 0 max(10px, env(safe-area-inset-bottom)); }
    .bubble { max-width: 180px; }
    .hud__info { display: none; }
}

/* ---------- 横着拿的手机：屏幕很矮，面板放右边，小釉在左边 ---------- */
@media (max-width: 920px) and (max-height: 480px) and (orientation: landscape) {
    .col, .is-talk .col { top: 0; left: 42%; height: auto; border-top: 0; border-left: 1px solid var(--line); }
    .tools { right: calc(58% + 12px); }
    .brand__sub { display: none; }
    .about { padding-bottom: 40vh; }
}

@media (prefers-reduced-motion: reduce) {
    /* 动画只播一遍就停，否则“正在输入”的三个点会变成闪烁 */
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
