/* 日语打字练习（members/pages/typing.php）：题目大字与模拟键盘。深色跟随 <html data-theme="dark">。 */
body:has([data-public-words].is-immersive) > header,
body:has([data-public-words].is-immersive) > footer { display: none; }
.typing-prompt:focus-visible { outline: 2px solid var(--color-primary, #2b4590); outline-offset: 3px; }
.typing-prompt { scroll-margin-top: 5rem; }
.typing-prompt-content { max-width: 48rem; margin-inline: auto; }
.typing-prompt-display { margin-bottom: .5rem; overflow-wrap: anywhere; }
.typing-prompt-audio { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-bottom: .45rem; }
.typing-audio-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #53647e; cursor: pointer; }
.typing-audio-icon i { font-size: 1.25rem; line-height: 1; }
.typing-audio-icon:hover { background: #edf3fb; color: #304b94; }
.typing-audio-icon:focus-visible { outline: 2px solid #304b94; outline-offset: 2px; }
[data-theme="dark"] .typing-audio-icon { color: #cbd5e1; }
[data-theme="dark"] .typing-audio-icon:hover { background: #243247; color: #fff; }
.typing-prompt-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem .9rem; margin-top: .65rem; }
.typing-prompt-meta .typing-romaji { margin-top: 0; }
.typing-finger-hint { margin: 0; padding: .28rem .65rem; border-radius: 999px; background: #f1f5f9; }
.typing-start-hint { margin: .85rem auto 0; max-width: 34rem; line-height: 1.6; }
.typing-timing-hint { margin: .25rem auto 0; max-width: 38rem; line-height: 1.5; }
.typing-kana-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center; min-width: 0; min-height: 5.5rem; }
.typing-kana-stage .typing-kana { grid-column: 2; min-width: 0; margin: .25rem 0; }
.typing-next-preview { grid-column: 3; justify-self: start; min-width: 0; max-width: 100%; margin: 0; padding: .25rem; opacity: .5; text-align: left; line-height: 1.3; }
.typing-next-preview span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; font-size: 1.05rem; }
.typing-kana-stage.is-long { grid-template-columns: minmax(0, 1fr); }
.typing-kana-stage.is-long .typing-kana { grid-column: 1; }
.typing-kana-stage.is-long .typing-next-preview { grid-column: 1; justify-self: end; max-width: min(45%, 12rem); margin-top: .35rem; }
[data-theme="dark"] .typing-finger-hint { background: #243247; }
[data-theme="dark"] .typing-next-preview span { color: #e2e8f0; }
@media (max-width: 400px) { .typing-prompt-meta { gap: .35rem; } .typing-prompt-audio { gap: .2rem; } .typing-next-preview { font-size: .7rem; } .typing-next-preview span { font-size: .875rem; } }
.typing-reward { position: fixed; inset: 0; width: min(31rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 0; overflow-y: auto; border: 1px solid #f4d791; border-radius: 1.4rem; background: #fffdf7; color: #26344f; box-shadow: 0 24px 70px rgb(15 23 42 / .28); }
.typing-reward::backdrop { background: rgb(15 23 42 / .64); }
.typing-reward-inner { padding: clamp(1.2rem, 4vw, 2.25rem); text-align: center; background: radial-gradient(circle at 50% 0, #fff0c5 0, #fffdf7 48%); }
.typing-reward-art { display: flex; align-items: center; justify-content: center; gap: .6rem; height: 5.5rem; color: #e8a522; font-size: 2rem; line-height: 1; }
.typing-reward-art span:nth-child(2) { font-size: 4rem; text-shadow: 0 5px 15px rgb(232 165 34 / .25); }
.typing-reward[open] .typing-reward-art span { animation: typing-reward-pop .65s both; }
.typing-reward[open] .typing-reward-art span:nth-child(1) { animation-delay: .08s; }
.typing-reward[open] .typing-reward-art span:nth-child(3) { animation-delay: .16s; }
@keyframes typing-reward-pop { from { opacity: 0; transform: translateY(1rem) scale(.5) rotate(-15deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
.typing-reward-kicker { margin-top: .4rem; color: #966323; font-size: .9rem; font-weight: 700; }
.typing-reward-title { margin-top: .3rem; font-size: clamp(1.55rem, 5vw, 2rem); font-weight: 800; line-height: 1.25; }
.typing-reward-subtitle { margin-top: .5rem; color: #6a7180; }
.typing-reward-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: 1.5rem; }
.typing-reward-stats > div { min-width: 0; padding: .8rem .3rem; border: 1px solid #f5e5bc; border-radius: .8rem; background: #fff; }
.typing-reward-stats strong, .typing-reward-stats span { display: block; }
.typing-reward-stats strong { font-size: 1.35rem; line-height: 1.2; }
.typing-reward-stats span { margin-top: .2rem; color: #626f82; font-size: .75rem; overflow-wrap: anywhere; }
.typing-reward-detail { margin-top: 1rem; color: #526176; font-size: .85rem; }
.typing-reward-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.5rem; padding-bottom: max(0px, env(safe-area-inset-bottom)); }
.typing-reward-actions button { min-height: 44px; }
[data-theme="dark"] .typing-reward { border-color: #735629; background: #192238; color: #fff; }
[data-theme="dark"] .typing-reward-inner { background: radial-gradient(circle at 50% 0, #48391c 0, #192238 50%); }
[data-theme="dark"] .typing-reward-kicker { color: #f5c86e; }
[data-theme="dark"] .typing-reward-subtitle, [data-theme="dark"] .typing-reward-detail { color: #cbd5e1; }
[data-theme="dark"] .typing-reward-stats > div { border-color: #5e4c31; background: #263248; }
[data-theme="dark"] .typing-reward-stats span { color: #cbd5e1; }
@media (prefers-reduced-motion: reduce) { .typing-reward[open] .typing-reward-art span { animation: none; } }
.typing-shortcut-hint { margin-top: .4rem; }
.typing-layout-choice { box-shadow: none; }
.typing-layout-choice[aria-pressed="true"] { background: #eef2ff; border-color: #9aabd1; color: #304b94; box-shadow: none; }
.typing-layout-choice[aria-pressed="true"]:hover { background: #e3eaf8; }
.typing-primary-action { min-height: 2.25rem; padding-inline: 1rem; font-weight: 700; }
.typing-start-panel { margin: 1.25rem auto 0; max-width: 42rem; }
.typing-primary-action, .typing-start-cta { background: linear-gradient(135deg, #355bb5, #253d83); border-color: #304f9e; box-shadow: 0 4px 12px rgb(43 69 144 / .2); }
.typing-start-cta { position: relative; overflow: hidden; isolation: isolate; min-height: 3.5rem; max-width: 100%; padding: .8rem 1.75rem; gap: .8rem; border-radius: .4rem; font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; background: #b7282e; border-color: #95232a; color: #fff; box-shadow: 0 3px 0 #862027, 0 5px 10px rgb(120 30 35 / .12); }
.typing-start-cta:hover { background: #9c2028; color: #fff; }
.typing-start-cta > * { position: relative; z-index: 1; }
.typing-start-cta > i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; background: rgb(255 255 255 / .16); }
/* A solid triangle has predictable optical centering, independent of the icon font. */
.typing-start-cta > i::before { content: ''; display: block; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; transform: translateX(1.5px); }
.typing-start-cta kbd { padding: .2rem .4rem; border: 1px solid rgb(255 255 255 / .4); border-radius: .35rem; font-size: .75rem; font-weight: 500; background: rgb(0 0 0 / .14); }
.typing-start-cta:focus-visible { outline: 3px solid #d16a6d; outline-offset: 4px; }
.typing-start-cta:not(:disabled)::after { content: ''; position: absolute; z-index: 0; pointer-events: none; top: -50%; bottom: -50%; left: -50%; width: 40%; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .1), transparent); transform: skewX(-18deg); animation: typing-start-sheen 5s ease-in-out infinite; }
@keyframes typing-start-sheen { 0% { transform: translateX(0) skewX(-18deg); opacity: 0; } 4% { opacity: 1; } 22%, 100% { transform: translateX(500%) skewX(-18deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typing-start-cta:not(:disabled)::after { animation: none; display: none; } }
@media (max-width: 400px) { .typing-start-cta { width: 100%; padding-inline: .75rem; font-size: 1.05rem; } }
[data-theme="dark"] .typing-layout-choice[aria-pressed="true"] { background: #25334d; border-color: #647da8; color: #c4d5fa; }
[data-theme="dark"] .typing-layout-choice[aria-pressed="true"]:hover { background: #304260; }
.typing-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem .75rem; margin-top: .5rem; }
.typing-stats > div { display: flex; align-items: baseline; justify-content: center; gap: .4rem; min-width: 0; padding: 0; background: transparent; }
.typing-stats dt { min-width: 0; font-size: .75rem; line-height: 1.3; }
.typing-stats dd { flex-shrink: 0; font-size: 1rem; line-height: 1.3; }
@media (max-width: 640px) { .typing-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.typing-progress { display: block; width: 100%; height: .375rem; margin-top: .35rem; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: #dbe3ef; color: var(--color-primary, #2b4590); accent-color: var(--color-primary, #2b4590); }
.typing-progress::-webkit-progress-bar { background: #dbe3ef; border-radius: 999px; }
.typing-progress::-webkit-progress-value { background: var(--color-primary, #2b4590); border-radius: 999px; }
.typing-progress::-moz-progress-bar { background: var(--color-primary, #2b4590); border-radius: 999px; }
[data-theme="dark"] .typing-progress { background: #475569; color: #93b4ff; accent-color: #93b4ff; }
[data-theme="dark"] .typing-progress::-webkit-progress-bar { background: #475569; }
[data-theme="dark"] .typing-progress::-webkit-progress-value { background: #93b4ff; }
[data-theme="dark"] .typing-progress::-moz-progress-bar { background: #93b4ff; }
.typing-mobile-key { display: none; margin-top: .5rem; align-items: center; justify-content: center; gap: .35rem; }
.typing-mobile-key kbd { min-width: 2rem; border: 1px solid #94a3b8; border-bottom-width: 2px; border-radius: .35rem; padding: .15rem .35rem; font: 700 .95rem ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--color-primary, #2b4590); }
@media (max-width: 640px) { .typing-mobile-key { display: flex; } }
[data-theme="dark"] .typing-prompt:focus-visible { outline-color: #93b4ff; }
.typing-settings { position: fixed; inset: 0; margin: auto; width: min(32rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.typing-settings::backdrop { background: rgb(15 23 42 / .5); }
.typing-settings[open] { display: flex; flex-direction: column; overflow: hidden; }
.typing-settings-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.typing-settings-actions { flex: none; padding: .75rem 1rem; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
.typing-settings-actions button { min-height: 44px; }
.typing-quick-settings { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.typing-quick-toggle { display: inline-flex; width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center; border: 1px solid #cbd5e1; border-radius: .65rem; background: #fff; color: #475569; cursor: pointer; font-size: 1.2rem; }
.typing-quick-toggle[aria-pressed="true"] { border-color: var(--color-primary, #2b4590); background: color-mix(in srgb, var(--color-primary, #2b4590) 12%, #fff); color: var(--color-primary, #2b4590); }
.typing-quick-toggle:hover { border-color: var(--color-primary, #2b4590); }
.typing-quick-toggle:focus-visible { outline: 2px solid var(--color-primary, #2b4590); outline-offset: 2px; }
@media (max-width: 360px) { .typing-quick-settings { gap: 0; } }
[data-theme="dark"] .typing-quick-toggle { border-color: #475569; background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .typing-quick-toggle[aria-pressed="true"] { border-color: #93b4ff; background: #1e3a8a; color: #fff; }
[data-theme="dark"] .typing-quick-toggle:focus-visible { outline-color: #93b4ff; }
.typing-layout-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.typing-layout-options > label { min-width: 0; gap: .4rem; padding: .65rem .5rem; font-size: .875rem; }
.typing-layout-options input { flex-shrink: 0; }
.typing-layout-options span { min-width: 0; }
.typing-keyboard-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .75rem; }
.typing-keyboard-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-width: 0; }
.typing-keyboard-views { margin-left: auto; }
.typing-keyboard-toolbar .ui-btn { min-height: 40px; white-space: normal; overflow-wrap: anywhere; }
.typing-keyboard-toolbar .ui-btn i { font-size: 1rem; }
@media (max-width: 640px) { .typing-keyboard-views { margin-left: 0; } .typing-keyboard-toolbar .ui-btn { min-height: 44px; } }
@media (max-height: 450px) { .typing-settings { max-height: calc(100dvh - 1rem); } .typing-settings-actions { padding-top: .5rem; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); } }
/* Keep this page compatible with the currently deployed shared utility bundle. */
[data-typing-practice] .max-w-full { max-width: 100%; }
/* Page-scoped mode preserves the shell's own collapsed/drawer preferences. */
body:has([data-typing-practice].is-immersive) #member-sidebar,
body:has([data-typing-practice].is-immersive) [data-drawer-overlay],
body:has([data-typing-practice].is-immersive) .shell-main > header,
body:has([data-typing-practice].is-immersive) .shell-main > footer,
body:has([data-typing-practice].is-immersive) > nav { display: none !important; }
body:has([data-typing-practice].is-immersive) .shell-main { padding-left: 0; transition: none; }
body:has([data-typing-practice].is-immersive) #main { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.typing-kana { margin-top: .25rem; font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 600; letter-spacing: .04em; line-height: 1.3; color: #94a3b8; overflow-wrap: anywhere; }
.typing-kana:has(span:only-child) { font-size: clamp(3.5rem, 10vw, 4.25rem); line-height: 1.2; }
.typing-kana .is-done { color: #0f172a; }
.typing-kana .is-current { color: var(--color-primary, #2b4590); text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 3px; }
.typing-romaji { margin-top: .5rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.25rem; letter-spacing: .08em; color: #94a3b8; overflow-wrap: anywhere; }
.typing-romaji .is-done { color: #16a34a; }
.typing-romaji .is-miss { color: #dc2626; }

.typing-kb { min-width: 40rem; max-width: 56rem; margin: 0 auto; display: flex; flex-direction: column; gap: .35rem; user-select: none; }
.typing-kb.is-large { max-width: 66rem; }
.typing-kb.is-large .typing-key { height: 3.5rem; font-size: .95rem; }
.typing-kb.is-large .typing-key-kana { font-size: .85rem; }
.typing-kb-row { display: flex; gap: .35rem; }
.typing-key { flex: 1 1 0; position: relative; height: 3rem; border-radius: .45rem; border: 1px solid #cbd5e1; border-bottom-width: 3px; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; color: #334155; transition: background-color .08s, transform .08s; }
.typing-key.is-home::after { content: ''; position: absolute; bottom: .35rem; left: 50%; width: .8rem; height: 2px; margin-left: -.4rem; border-radius: 1px; background: currentColor; opacity: .5; }
.typing-key-label { position: relative; }
/* Keep the learning target readable above the translucent hand, including JIS kana. */
.typing-key-label, .typing-key-kana { z-index: 1; }
.typing-kb.is-jis .typing-key-label { position: absolute; left: .4rem; top: .25rem; }
.typing-key-kana { position: absolute; right: .4rem; bottom: .3rem; font-size: .75rem; color: #b91c1c; }
.typing-key.is-hint { background: color-mix(in srgb, var(--color-primary, #2b4590) 16%, #fff); border-color: var(--color-primary, #2b4590); color: var(--color-primary, #2b4590); font-weight: 700; }
.typing-key.is-down { transform: translateY(2px); border-bottom-width: 1px; background: #e2e8f0; }
.typing-key.is-wrong { background: #fee2e2; border-color: #dc2626; color: #b91c1c; }

[data-theme="dark"] .typing-kana { color: #475569; }
[data-theme="dark"] .typing-kana .is-done { color: #f1f5f9; }
[data-theme="dark"] .typing-kana .is-current { color: #93b4ff; }
[data-theme="dark"] .typing-romaji { color: #64748b; }
[data-theme="dark"] .typing-romaji .is-done { color: #4ade80; }
[data-theme="dark"] .typing-romaji .is-miss { color: #f87171; }
[data-theme="dark"] .typing-key { background: #1e293b; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .typing-key-kana { color: #fca5a5; }
[data-theme="dark"] .typing-key.is-hint { background: #1e3a8a; border-color: #93b4ff; color: #fff; }
[data-theme="dark"] .typing-key.is-down { background: #334155; }
[data-theme="dark"] .typing-key.is-wrong { background: #7f1d1d; border-color: #f87171; color: #fff; }

@media (max-width: 640px) { .typing-kb { min-width: 34rem; gap: .25rem; } .typing-kb-row { gap: .25rem; } .typing-key { height: 2.5rem; font-size: .7rem; } .typing-key-kana { font-size: .65rem; } }
@media (max-width: 640px) { .typing-kb.is-large { min-width: 40rem; } .typing-kb.is-large .typing-key { height: 2.9rem; font-size: .82rem; } .typing-kb.is-large .typing-key-kana { font-size: .72rem; } }

/* 指法：按手指分色（金山打字通式），半透明双手画在键盘上（SVG，坐标取各键的布局位置）；俯视时整块键盘绕底边后倾成梯形。 */
.typing-stage { padding: .25rem 0; }
.typing-stage.has-hands { padding-bottom: 9rem; }
.typing-stage.is-tilt { perspective: 42rem; }
.typing-stage.is-tilt .typing-kb { transform: rotateX(28deg); transform-origin: 50% 100%; }
.typing-kb { position: relative; }
.typing-hands { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% + 7.75rem); overflow: visible; pointer-events: none; }
.typing-hands { --hand-light: #fae4d6; --hand-mid: #eec2a6; --hand-edge: #dca484; --hand-line: #a76b4c; --hand-nail: #fff3ed; }
.typing-hands path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.typing-skin-light { stop-color: var(--hand-light); }
.typing-skin-mid { stop-color: var(--hand-mid); }
.typing-skin-edge { stop-color: var(--hand-edge); }
.typing-hands .is-hand { fill: url(#typing-skin); stroke: var(--hand-line); opacity: .64; }
.typing-hands .is-nail { fill: var(--hand-nail); stroke: var(--hand-line); opacity: .55; }
.typing-hands .is-crease { stroke: var(--hand-line); opacity: .32; }
.typing-hands .is-tendon { stroke: var(--hand-line); opacity: .13; }
.typing-finger-focus { stop-color: var(--color-primary, #2b4590); }
.typing-hands .is-active-finger { fill: url(#typing-finger-focus); opacity: .16; }
.typing-hands .is-tip.is-on { stroke: var(--color-primary, #2b4590); opacity: .95; }
.typing-kb.show-fingers .typing-key[data-finger="lp"], .typing-kb.show-fingers .typing-key[data-finger="rp"] { background: #fde2e4; }
.typing-kb.show-fingers .typing-key[data-finger="lr"], .typing-kb.show-fingers .typing-key[data-finger="rr"] { background: #fff1c2; }
.typing-kb.show-fingers .typing-key[data-finger="lm"], .typing-kb.show-fingers .typing-key[data-finger="rm"] { background: #d9f2df; }
.typing-kb.show-fingers .typing-key[data-finger="li"], .typing-kb.show-fingers .typing-key[data-finger="ri"] { background: #dbeafe; }
.typing-kb.show-fingers .typing-key[data-finger="th"] { background: #ede4fb; }
.typing-kb.show-fingers .typing-key.is-hint { background: color-mix(in srgb, var(--color-primary, #2b4590) 22%, #fff); }
.typing-finger-text { color: var(--color-primary, #2b4590); }
[data-theme="dark"] .typing-hands { --hand-light: #d7b39c; --hand-mid: #b88c70; --hand-edge: #8e654f; --hand-line: #f0cbb1; --hand-nail: #eac7b9; }
[data-theme="dark"] .typing-hands .is-hand { opacity: .51; }
[data-theme="dark"] .typing-hands .is-tip.is-on { stroke: #93b4ff; }
[data-theme="dark"] .typing-finger-focus { stop-color: #93b4ff; }
[data-theme="dark"] .typing-hands .is-active-finger { opacity: .23; }
[data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="lp"], [data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="rp"] { background: #4a2a30; }
[data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="lr"], [data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="rr"] { background: #45391a; }
[data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="lm"], [data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="rm"] { background: #1f3d2a; }
[data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="li"], [data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="ri"] { background: #1e3350; }
[data-theme="dark"] .typing-kb.show-fingers .typing-key[data-finger="th"] { background: #33294a; }
[data-theme="dark"] .typing-kb.show-fingers .typing-key.is-hint { background: #1e3a8a; }
[data-theme="dark"] .typing-finger-text { color: #93b4ff; }

/* 手机九宫格页（members/pages/typing-flick.php）：仿 iPhone——机身、状态栏、对话气泡、输入框、候选栏与 iOS 日文 12 键（5 列 × 4 行，改行占两行）。
   颜色取 iOS 系统键盘：浅色底 #d1d4d9、字母键白、功能键 #abb0ba；深色底 #2b2b2d、字母键 #6b6b6e、功能键 #464648。 */
.ios-phone { --kb-bg: #d1d4d9; --key: #fff; --key-fn: #abb0ba; --key-ink: #000; --key-shadow: #898a8d; --screen: #fff; --bubble: #e9e9eb;
  position: relative; max-width: 24rem; margin: 0 auto; overflow: hidden; border: .7rem solid #111; border-radius: 3.2rem; background: var(--screen);
  box-shadow: 0 0 0 2px #3a3a3c, 0 18px 40px rgb(15 23 42 / .3); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif; color: #000; }
[data-theme="dark"] .ios-phone { --kb-bg: #2b2b2d; --key: #6b6b6e; --key-fn: #464648; --key-ink: #fff; --key-shadow: #000; --screen: #000; --bubble: #262628; color: #fff; }
.ios-status { display: flex; align-items: center; justify-content: space-between; height: 2.9rem; padding: .3rem 1.6rem 0; font-size: .95rem; font-weight: 600; }
.ios-island { width: 6.5rem; height: 1.8rem; border-radius: 1rem; background: #000; }
.ios-status-icons { display: flex; gap: .2rem; font-size: 1rem; }
.ios-clock { min-width: 3rem; }
.ios-screen { min-height: 9rem; padding: .75rem 1rem .5rem; }
.ios-bubble { max-width: 92%; padding: .55rem .9rem; border-radius: 1.2rem; border-bottom-left-radius: .35rem; background: var(--bubble); }
.ios-bubble-sub { font-size: .8rem; opacity: .65; }
.ios-target { font-size: 1.85rem; font-weight: 600; line-height: 1.35; letter-spacing: .03em; overflow-wrap: anywhere; color: #8e8e93; }
.ios-target .is-done { color: inherit; color: var(--key-ink); }
.ios-target .is-current { color: #007aff; text-decoration: underline; text-underline-offset: .28em; text-decoration-thickness: 3px; }
.ios-hint { margin-top: .6rem; font-size: .75rem; color: #62626b; min-height: 1rem; }
.ios-hint-focus { color: #b7282e; font-weight: 700; }
.ios-hint-direction { display: inline-block; width: 1em; text-align: center; }
[data-theme="dark"] .ios-hint { color: #b5b5bd; }
[data-theme="dark"] .ios-hint-focus { color: #ff9b83; }
.ios-attr { margin-top: .35rem; font-size: .65rem; color: #8e8e93; }
.ios-compose { padding: .4rem .75rem .5rem; border-top: 1px solid rgb(127 127 127 / .2); }
.ios-field { min-height: 2.2rem; padding: .35rem .9rem; border: 1px solid rgb(127 127 127 / .35); border-radius: 1.1rem; font-size: 1.1rem; overflow-wrap: anywhere; }
.ios-field .is-pending { background: rgb(0 122 255 / .18); text-decoration: underline; }
.ios-caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: -.2em; background: #007aff; animation: ios-blink 1s steps(1) infinite; }
@keyframes ios-blink { 50% { opacity: 0; } }
.ios-kb { background: var(--kb-bg); padding: 0 .25rem .4rem; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ios-kb * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ios-cands { display: flex; height: 2.6rem; overflow-x: auto; scrollbar-width: none; }
.ios-cands.is-wrong { background: rgb(255 59 48 / .25); }
.ios-cand { flex: none; padding: 0 .85rem; border: 0; background: none; color: var(--key-ink); font-size: 1.05rem; cursor: pointer; }
.ios-cand + .ios-cand { border-left: 1px solid rgb(127 127 127 / .35); }
.ios-cand:first-child { color: #8e8e93; }
.ios-cand:hover { background: rgb(127 127 127 / .15); }
.ios-pad { display: grid; grid-template-columns: minmax(0, .8fr) repeat(3, minmax(0, 1fr)) minmax(0, .8fr); grid-template-rows: repeat(4, 3.2rem); gap: .4rem; padding: .2rem .15rem 0; touch-action: none; }
.ios-key { position: relative; min-width: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: .4rem; background: var(--key); color: var(--key-ink);
  box-shadow: 0 1px 0 var(--key-shadow); font-size: 1.45rem; cursor: pointer; touch-action: none; }
.ios-key.is-fn { background: var(--key-fn); font-size: .85rem; white-space: nowrap; letter-spacing: -.02em; }
.ios-key.is-inert { cursor: default; opacity: .75; }
.ios-key.is-down { background: var(--key-fn); }
.ios-key.is-fn.is-down { background: var(--key); }
.ios-key.is-hint { box-shadow: 0 0 0 2px #007aff, 0 1px 0 var(--key-shadow); }
.ios-key.is-wrong { background: #ff3b30; color: #fff; }
.ios-home { width: 8rem; height: .3rem; margin: .7rem auto .1rem; border-radius: 1rem; background: var(--key-ink); opacity: .85; }
/* 按住时的十字导引：中心与上下左右各一格，当前方向蓝底 */
.ios-cross { position: absolute; left: 50%; top: 50%; z-index: 5; width: 0; height: 0; pointer-events: none; }
.ios-cross-cell { position: absolute; width: 2.7rem; height: 2.7rem; margin: -1.35rem 0 0 -1.35rem; display: flex; align-items: center; justify-content: center;
  border-radius: .5rem; background: #fff; color: #000; font-size: 1.35rem; box-shadow: 0 2px 8px rgb(0 0 0 / .3); }
.ios-cross-cell.is-l { transform: translateX(-2.75rem); }
.ios-cross-cell.is-u { transform: translateY(-2.75rem); }
.ios-cross-cell.is-r { transform: translateX(2.75rem); }
.ios-cross-cell.is-d { transform: translateY(2.75rem); }
.ios-cross-cell.is-on { background: #007aff; color: #fff; }

/* 按实际练习区宽度排版，避免侧栏展开后挤窄设置；宽屏把手机放在两侧等宽的中央。 */
[x-data="flickPractice"] { container-type: inline-size; }
.flick-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.flick-phone-area { position: relative; width: 100%; max-width: 24rem; margin: 0 auto; }
@container (min-width: 64rem) {
    .flick-grid { grid-template-columns: minmax(0, 1fr) 24rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
    .flick-phone-area { grid-column: 2; grid-row: 1; }
    .flick-grid > section { grid-column: 3; grid-row: 1; }
    .flick-grid > div:first-child dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 机身侧键：右侧电源键，左侧两个音量键（box-shadow 画第二个） */
.ios-shell::before { content: ''; position: absolute; right: -0.28rem; top: 10rem; width: 0.28rem; height: 3.6rem; border-radius: 0 0.18rem 0.18rem 0; background: #2a2a2c; }
.ios-shell::after { content: ''; position: absolute; left: -0.28rem; top: 7.6rem; width: 0.28rem; height: 1.9rem; border-radius: 0.18rem 0 0 0.18rem; background: #2a2a2c; box-shadow: 0 2.6rem 0 #2a2a2c; }
