:root {
  color-scheme: light;
  --background: #f7f6f2;
  --ink: #1c1c22;
  --muted: #575665;
  --line: #dedce4;
  --accent: #6343e6;
  --accent-dark: #4c2cc5;
  --accent-light: #eee9ff;
  --font: "Inter", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font: 16px/1.55 var(--font);
  background: var(--background);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
a { color: var(--accent-dark); text-underline-offset: .23em; }
a:hover { color: #32159c; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 4rem, 70rem); margin-inline: auto; }
.skip { position: fixed; z-index: 2; top: .75rem; left: .75rem; padding: .6rem .9rem; background: white; transform: translateY(-200%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.35rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-size: 1.3rem; font-weight: 800; letter-spacing: -.055em; }
.brand:hover { color: var(--ink); }
.brand small { font-size: .8rem; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: .3rem; }
.brand-mark { display: grid; width: 1.85rem; height: 1.85rem; place-items: center; border-radius: .42rem; background: #d4fc54; flex: none; }
.brand-mark::after {
  content: ""; width: 1.12rem; height: 1.18rem; background: #171911;
  clip-path: polygon(58% 0, 8% 54%, 44% 54%, 31% 100%, 96% 36%, 56% 36%, 70% 0);
}
.header-row nav { display: flex; flex-wrap: wrap; gap: .55rem clamp(.8rem, 3vw, 2rem); }
.header-row nav a { color: var(--muted); font-size: .9rem; text-decoration: none; }
.header-row nav a:hover { color: var(--accent-dark); }
.button {
  display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center;
  padding: .55rem .95rem; border: 1px solid #d2cedd; border-radius: .62rem;
  font-size: .9rem; font-weight: 720; white-space: nowrap; text-decoration: none;
}
.button-outline { background: #fff; color: var(--ink); }
.button-outline:hover { background: var(--accent-light); color: var(--accent-dark); border-color: #c8bbfb; }
.button-primary { background: var(--accent); color: white; border-color: var(--accent); }
.button-primary:hover { background: var(--accent-dark); color: white; }

.hero { display: flex; align-items: end; justify-content: space-between; gap: 1rem 3rem; padding-top: clamp(2rem, 5.6vw, 4.2rem); padding-bottom: 1.65rem; }
.stage { margin: 0 0 .6rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.stage span { width: .48rem; height: .48rem; border-radius: 50%; background: var(--accent); }
.hero h1 { margin: 0; font-size: clamp(3rem, 8.15vw, 7.2rem); line-height: .99; font-weight: 900; letter-spacing: -.085em; white-space: nowrap; }
.hero h1 span { color: var(--accent); }
.hero-copy { padding-bottom: .12rem; min-width: 15rem; }
.hero-copy p { margin: 0 0 .4rem; color: var(--muted); }
.hero-copy p:first-child { font-size: clamp(1.1rem, 2vw, 1.65rem); color: var(--ink); font-weight: 740; letter-spacing: -.035em; }

.workbench {
  padding: clamp(.65rem, 2.35vw, 1.7rem); border: 1px solid #e3dbf8; border-radius: 1.25rem;
  background: radial-gradient(ellipse at 50% 15%, #e2d7ff, transparent 78%), #eee9f8;
}
.ime { width: min(100%, 55rem); margin-inline: auto; overflow: hidden; border: 1px solid #cac4d8; border-radius: 1rem; background: #fff; box-shadow: 0 1.25rem 2.8rem #54457825, 0 .2rem .8rem #54457812; }
.ime-toolbar { min-height: 3.45rem; display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .5rem 1rem; background: #fff; }
.ime-title { display: flex; align-items: center; gap: .5rem; }
.ime-title .brand-mark { width: 1.5rem; height: 1.5rem; }
.ime-title .brand-mark::after { width: .87rem; height: .99rem; }
.ime-title h2 { margin: 0; font-size: 1rem; font-weight: 750; }
.layout-tabs { display: flex; gap: .2rem; padding: .18rem; background: #f1eef7; border-radius: .55rem; }
.layout-tabs button { min-width: 3rem; min-height: 1.95rem; border: 0; border-radius: .42rem; padding: .18rem .55rem; background: transparent; color: #535166; font-size: .875rem; }
.layout-tabs button[aria-pressed="true"] { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 4px #4b386c25; font-weight: 740; }
.layout-tabs button:hover:not([aria-pressed="true"]) { background: #e7e0f9; }

.editor { min-height: 7.8rem; padding: .65rem 1.1rem 1.05rem; border-top: 1px solid #eeecf1; background: #fcfbfd; cursor: text; }
.editor:focus-visible { outline-offset: -3px; }
.editor-top { display: flex; align-items: center; justify-content: space-between; gap: .55rem; color: #6b687b; font-size: .85rem; }
.clear { min-height: 1.9rem; flex: none; padding: .18rem .4rem; border: 1px solid transparent; border-radius: .36rem; color: #615b73; background: transparent; font-size: .85rem; }
.clear:hover { background: #f0ebfb; color: var(--accent-dark); }
.text-area { margin-top: .55rem; color: #262331; line-height: 1.45; font-weight: 660; font-size: clamp(1.3rem, 3.1vw, 2.15rem); white-space: pre-wrap; overflow-wrap: anywhere; }
#placeholder { color: #716b80; font-weight: 500; }
.caret { display: inline-block; height: 1.03em; width: 2px; margin-left: .15em; background: var(--accent); vertical-align: -.12em; }

.keyboard { padding: .68rem .8rem .8rem; background: linear-gradient(#f0edf5, #e9e5f0); border-top: 1px solid #d7d1e2; }
.candidate-line { display: flex; gap: .48rem; padding: .3rem; margin-bottom: .65rem; align-items: stretch; min-height: 3.35rem; border-radius: .64rem; background: #fff; border: 1px solid #ddd7ea; }
.composition { flex: 0 1 8.75rem; min-width: 4.5rem; display: flex; align-items: center; gap: .42rem; padding-inline: .5rem; border-right: 1px solid #eee9f5; }
.composition-label { flex: none; font-size: .77rem; color: #554b72; }
.composition code { min-width: 0; max-width: 6.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent-dark); font: 730 .95rem ui-monospace, Consolas, monospace; }
.candidates { min-width: 0; flex: 1; display: flex; align-items: center; gap: .28rem; overflow-x: auto; padding: .15rem .2rem; }
.candidate {
  flex: none; min-height: 2.15rem; display: flex; align-items: center; gap: .33rem; padding: .26rem .55rem;
  border: 1px solid transparent; border-radius: .4rem; background: #fff; color: var(--ink); white-space: nowrap; font-size: 1rem;
}
.candidate:first-child, .candidate:hover { background: var(--accent-light); color: var(--accent-dark); }
.candidate span { color: #746c8e; font: .76rem ui-monospace, Consolas, monospace; }
.candidate-message { color: var(--muted); margin: 0; font-size: .86rem; }
.key-rack { display: grid; gap: .42rem; }
.key-row { display: flex; gap: .42rem; justify-content: center; }
.key-row.inset { padding-inline: 4%; }
.key {
  flex: 1; display: grid; place-content: center; min-width: 0; min-height: 2.6rem; padding: .2rem .15rem; color: var(--ink);
  border: 1px solid #d5cfdf; border-bottom: 2px solid #c5bed2; border-radius: .48rem;
  background: #fff; font-size: 1rem; font-weight: 650; text-align: center; white-space: nowrap; touch-action: manipulation;
}
.key:hover { background: #faf6ff; border-color: #bdaaf9; }
.key:active { transform: translateY(1px); }
.key.key-delete { flex: 0 0 2.6rem; min-height: 2.4rem; background: #f3eff8; color: #554578; font-size: 1.25rem; }
.key.wide { flex: 1.55; }
.key.space { flex: 4; color: #59526a; font-size: .88rem; }
.key.function { background: #f2edf7; color: #554578; font-size: .86rem; }
.key.enter { flex: 1.6; background: var(--accent); border-color: var(--accent-dark); color: white; font-size: .88rem; }
.key.enter:hover { background: var(--accent-dark); }
.key small { display: block; font-size: .75rem; line-height: 1.15; font-weight: 520; letter-spacing: .045em; color: #665d79; }
.key-num { min-height: 2.65rem; font-size: 1.06rem; line-height: 1.12; }
.no-script { margin: .65rem 0; color: var(--muted); }

.demo-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; width: min(100%, 55rem); margin: .75rem auto 0; align-items: center; }
.demo-footer p { margin: 0; font-size: .85rem; color: #584d70; }
.quick-start { display: flex; gap: .35rem; }
.quick-start button { background: #f9f5ff; color: var(--accent-dark); border: 1px solid #d9cff2; border-radius: .45rem; min-height: 1.85rem; padding: .13rem .5rem; font-size: .85rem; }
.quick-start button:hover { background: #eae0ff; }

.details, .release { padding-block: clamp(2.7rem, 6vw, 5.15rem); }
.details h2, .platform-section h2, .release h2 { margin: 0 0 .75rem; font-size: clamp(1.95rem, 4vw, 3.25rem); line-height: 1.13; letter-spacing: -.065em; }
.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.feature-list article { border: 1px solid var(--line); border-radius: .85rem; background: #fff; padding: 1.25rem; }
.feature-symbol { width: 2.42rem; height: 2.42rem; display: grid; place-items: center; border-radius: .56rem; background: var(--accent-light); color: var(--accent-dark); font-size: 1.15rem; font-weight: 820; }
.sound-symbol { display: flex; gap: .13rem; justify-content: center; }
.sound-symbol i { width: .14rem; height: .5rem; border-radius: .2rem; background: var(--accent-dark); }
.sound-symbol i:nth-child(even) { height: .85rem; }
.sound-symbol i:nth-child(3) { height: 1.2rem; }
.feature-list h3 { margin: .7rem 0 .35rem; font-size: 1.25rem; }
.feature-list p, .platform-section p, .release p { margin: 0 0 .6rem; color: var(--muted); line-height: 1.65; }
.feature-list a, .platform-section a { font-size: .9rem; }
.platform-section { background: #edeaf5; padding-block: clamp(2.65rem, 6vw, 4rem); border-block: 1px solid #e1dce9; }
.platform-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1rem 2rem; }
.platform-grid dl { margin: 0; border-top: 1px solid #d4ccdf; }
.platform-grid dl > div { display: grid; grid-template-columns: minmax(7.5rem, .4fr) 1fr; gap: .5rem 1rem; padding: .8rem .1rem; border-bottom: 1px solid #d4ccdf; }
.platform-grid dt { font-weight: 760; }
.platform-grid dt span { display: block; width: fit-content; margin-top: .2rem; padding: .06rem .35rem; border-radius: .25rem; background: #ded3fc; color: #472fa4; font-size: .76rem; font-weight: 670; white-space: nowrap; }
.platform-grid dd { margin: 0; color: var(--muted); }
.release { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.6rem; }
.release p { max-width: 34rem; margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.site-footer { border-top: 1px solid var(--line); }

@media (max-width: 55rem) {
  .wrap { width: calc(100% - 2.3rem); }
  .hero { gap: 1rem; }
  .release { flex-wrap: wrap; }
  .platform-grid { grid-template-columns: 1fr; }
}
@media (max-width: 38rem) {
  .wrap { width: calc(100% - 1.3rem); }
  .site-header .header-row { flex-wrap: wrap; min-height: 4rem; padding-block: .55rem; gap: .33rem .65rem; }
  .site-header nav { width: 100%; order: 3; padding-top: .2rem; }
  .hero { display: grid; padding: 1.75rem .25rem 1rem; }
  .stage { margin-bottom: .4rem; }
  .hero-copy { min-width: 0; }
  .hero-copy p { font-size: .91rem; }
  .workbench { padding: .42rem; border-radius: .85rem; }
  .ime { border-radius: .75rem; }
  .ime-toolbar { padding-inline: .6rem; }
  .editor { padding-inline: .65rem; min-height: 6.85rem; }
  .keyboard { padding-inline: .28rem; }
  .candidate-line { gap: .17rem; }
  .composition { gap: .16rem; flex-basis: 4.1rem; min-width: 3.6rem; align-items: start; flex-direction: column; justify-content: center; padding-inline: .24rem; }
  .composition code { max-width: 3.6rem; font-size: .79rem; }
  .composition-label { font-size: .69rem; }
  .candidate { padding-inline: .28rem; gap: .2rem; font-size: .9rem; }
  .candidates { padding-inline: .12rem; gap: .12rem; }
  .key.key-delete { flex-basis: 2rem; }
  .key-row { gap: .22rem; }
  .key { min-height: 2.5rem; border-radius: .35rem; font-size: .84rem; }
  .key.space, .key.function, .key.enter { font-size: .76rem; }
  .demo-footer { padding-inline: .22rem; }
  .feature-list { grid-template-columns: 1fr; gap: .6rem; }
  .platform-grid dl > div { grid-template-columns: minmax(6rem, .4fr) 1fr; gap: .5rem; }
  .site-footer .header-row { flex-wrap: wrap; padding-block: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .key:active { transform: none; }
}
