/* 页面和机身。屏里的内容在 screen.css。 */
:root {
  --ink: #161616;
  --muted: #5c584f;
  font-family: "Iowan Old Style", "Songti SC", "Source Han Serif SC", Palatino, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #d9d3c7; color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.stage { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
.top { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 22px; }
.kicker { margin: 0 0 4px; letter-spacing: 0.14em; font-size: 12px; color: var(--muted); font-family: "Avenir Next", "PingFang SC", sans-serif; }
h1 { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
.hint { margin: 0; max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.5; font-family: "Avenir Next", "PingFang SC", sans-serif; }

.layout { display: grid; grid-template-columns: auto minmax(280px, 1fr); gap: 28px; align-items: start; }

/* 机身尺寸按官方正面渲染图量的：屏在图上是 360×643 px，缩到 246 px 宽，比例 0.683。 */
.device { padding-right: 78px; }
.shell {
  --menu-key-left: 27px;
  --menu-key-size: 25px;
  --chin-key-width: 51px;
  --prev-key-left: 159px;
  --next-key-left: 222px;
  position: relative;
  width: 300px;
  height: 522px;
  background: #f4f2f7;
  border-radius: 20px;
  box-shadow:
    0 2px 12px rgba(20, 14, 10, 0.12),
    0 8px 24px rgba(20, 14, 10, 0.08),
    0 0 0 1px #cfccd2,
    inset 0 3px 0 #5d5c60,
    inset -6px 0 0 #b4b2b7,
    inset 5px 0 0 #cfcdd2,
    inset 0 -2px 0 #dcdadf;
}
.plate {
  position: absolute;
  left: 8px;
  top: 10px;
  right: 9px;
  bottom: 10px;
  background: #dbd9dd;
  border: 1px solid #b4b2b7;
  border-radius: 13px;
}
.panel {
  position: absolute;
  left: 27px;
  top: 27px;
  width: 246px;
  height: 438px;
  background: #f2f2f1;
  color: var(--ink);
  outline: 1px solid #cfcfcf;
  overflow: hidden;
  user-select: none;
}
.panel.flash { animation: flash 260ms steps(2, end); }
@keyframes flash { 50% { filter: invert(1); } }

/* 屏下：左边橙点是菜单，右边两颗灰键是返回/上一页、前进/下一页。 */
.cap { position: absolute; border: 0; padding: 0; color: transparent; }
/* 实体按键自行处理短按 / 长按，手指轻微移动不能交给浏览器滚屏。 */
.cap, .key { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* 点击机身和实体键不留浏览器默认蓝圈；Tab 操作仍保留灰阶焦点提示。 */
.shell, .cap, .key { -webkit-tap-highlight-color: transparent; }
.shell:focus, .cap:focus, .key:focus { outline: none; }
.shell:focus-visible, .cap:focus-visible, .key:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
.cap.menu { left: var(--menu-key-left); top: 477px; width: var(--menu-key-size); height: var(--menu-key-size); border-radius: 50%; background: #e28a06; }
.cap.prev, .cap.next { top: 480px; width: var(--chin-key-width); height: 20px; border-radius: 999px; background: #a9a7ab; }
.cap.prev { left: var(--prev-key-left); }
.cap.next { left: var(--next-key-left); }
.cap:hover { filter: brightness(1.06); }
.cap.down, .cap:active { transform: translateY(1px); filter: brightness(0.9); }
@media (pointer: coarse) {
  /* 不改键帽外观，只把可触摸高度扩大到至少 44px。 */
  .cap::before { content: ""; position: absolute; inset: -12px -4px; }
  .cap.menu::before { inset: -10px; }
}

/* 右侧三颗键帽、四个功能（按关机画面上的按键说明对位）：
   上面短的是 AI 唤醒；中间长条一颗键帽，上半加音量、下半减音量；下面短的是电源。 */
.key {
  position: absolute;
  right: -5px;
  width: 5px;
  border: 0;
  padding: 0;
  color: transparent;
  background: linear-gradient(90deg, #bb7b4f, #df9a4e 40%, #e3954a 75%, #ac733a);
  border-radius: 3px;
  box-shadow: 1px 0 1px rgba(80, 40, 10, 0.25);
}
.key::before { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; right: -14px; }
.key.ai { top: 94px; height: 58px; }
.key.up { top: 183px; height: 57px; border-radius: 3px 3px 0 0; box-shadow: 1px 0 1px rgba(80, 40, 10, 0.25), inset 0 -1px 0 rgba(120, 60, 20, 0.45); }
.key.vdown { top: 240px; height: 57px; border-radius: 0 0 3px 3px; }
.key.power { top: 328px; height: 29px; }
.key:hover { filter: brightness(1.08); }
.key.down, .key:active { transform: translateX(-2px); filter: brightness(0.88); }

.tag {
  position: absolute;
  left: calc(100% + 20px);
  transform: translateY(-50%);
  font: 12px/1.2 "Avenir Next", "PingFang SC", sans-serif;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
.tag::before { content: ""; position: absolute; right: calc(100% + 4px); top: 50%; width: 8px; border-top: 1px solid #a9a194; }
.tag.t-ai { top: 123px; }
.tag.t-up { top: 211px; }
.tag.t-down { top: 269px; }
.tag.t-power { top: 342px; }

.legend, .now {
  width: 300px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}
.now { color: var(--ink); }
.now p { margin: 0 0 6px; color: var(--muted); }
.now dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.now dt { color: var(--muted); white-space: nowrap; }
.now dd { margin: 0; }

.notes { font-size: 15px; }
.notes h2 { margin: 20px 0 8px; font-size: 16px; }
.notes h2:first-child { margin-top: 0; }
.notes ol, .notes ul { margin: 0; padding-left: 1.2em; line-height: 1.55; }
.notes li { margin: 3px 0; }
.log-title { margin: 20px 0 8px; font-size: 13px; letter-spacing: 0.08em; color: var(--muted); font-family: "Avenir Next", "PingFang SC", sans-serif; }
.log { margin: 0; padding-left: 1.2em; min-height: 4em; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: 13px; color: #3d3a34; }
.log li { margin: 3px 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: start; }
}

.diagnostic-detail { border:1px solid currentColor; padding:12px; margin-bottom:12px; }

/* 页头「输入法」按钮和输入法查看器（页面外框，不在设备屏幕里）。 */
.top-tools { display: flex; gap: 8px; align-items: center; }
.ime-open { border: 1px solid #c4c0b5; background: #fbfaf7; border-radius: 8px; padding: 6px 12px; font: 12px "Avenir Next", "PingFang SC", sans-serif; color: #161616; }
.ime-open:hover { background: #dedbd2; }
body.ime-open { overflow: hidden; }
.ime-viewer { position: fixed; inset: 0; z-index: 50; background: rgba(40, 34, 24, 0.42); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 24px 16px; font-family: "Avenir Next", "PingFang SC", sans-serif; }
.ime-viewer[hidden] { display: none; }
.ime-card { width: min(1120px, 100%); background: #ece8df; border-radius: 14px; padding: 16px 18px 18px; box-shadow: 0 18px 50px rgba(20, 16, 8, 0.3); }
.ime-card header { display: flex; gap: 14px; align-items: baseline; }
.ime-card header b { font-size: 18px; white-space: nowrap; }
.ime-card header span { flex: 1; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ime-x { border: 0; background: none; font-size: 22px; line-height: 1; padding: 0 4px; color: #5c584f; }
.ime-tools { display: flex; gap: 14px; align-items: center; margin: 10px 0 12px; font-size: 13px; }
.ime-tools label { display: flex; gap: 6px; align-items: center; }
.ime-tools button { border: 1px solid #c4c0b5; background: #fbfaf7; border-radius: 8px; padding: 4px 10px; font-size: 12px; }
.ime-body { display: grid; grid-template-columns: 1fr 250px; gap: 18px; align-items: start; }
.ime-screens { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.ime-screen-wrap { width: 320px; }
.ime-label { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.ime-shell { width: 320px; height: 570px; border-radius: 16px; background: #f4f2f7; box-shadow: 0 0 0 1px #cfccd2, 0 8px 22px rgba(40, 32, 18, 0.14); padding: 7px; }
/* 屏幕按 246×438 画（真屏 684×1216 的 0.36），放大 1.3 倍看清楚。 */
.ime-screen.panel { position: relative; left: 0; top: 0; transform: scale(1.3); transform-origin: 0 0; }
.ime-now { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: #3d3a34; min-height: 3em; }
.ime-states h3 { margin: 0 0 8px; font-size: 14px; }
.ime-state-list { display: flex; flex-direction: column; gap: 6px; }
.ime-state-list button { text-align: left; border: 1px solid #c4c0b5; background: #fbfaf7; border-radius: 8px; padding: 6px 9px; display: flex; flex-direction: column; gap: 2px; }
.ime-state-list button b { font-size: 13px; }
.ime-state-list button span { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.ime-state-list button.on { background: #161616; border-color: #161616; color: #fbfaf7; }
.ime-state-list button.on span { color: #d8d5cc; }
@media (max-width: 980px) { .ime-body { grid-template-columns: 1fr; } }

/* 嵌入宣传页时只保留设备机身与侧键标签 */
body.is-embed, html:has(body.is-embed) { background: transparent; overflow: hidden; }
body.is-embed .stage { padding: 8px 6px; max-width: none; }
body.is-embed .top, body.is-embed .notes { display: none; }
body.is-embed .layout { grid-template-columns: auto; justify-content: center; }
body.is-embed .device { padding-right: 72px; }
body.is-embed .tag { display: none; }

/* 面向用户的入口 play.html：只有新设计，没有对照页签、说明面板和输入法查看器 */
body.is-play .design-tabs, body.is-play .ime-open, body.is-play .notes { display: none; }
body.is-play .layout { grid-template-columns: auto; justify-content: center; }
body.is-play .device { padding-right: 72px; }
