    :root {
      color-scheme: light;
      --ink: #202522;
      --muted: #68716b;
      --line: #d8ded9;
      --paper: #eef2ef;
      --surface: #fff;
      --accent: #3d7353;
      --accent-soft: #e6f0e9;
      --danger: #a14d49;
      --danger-soft: #f6e8e7;
      --key: #272c29;
    }

    * { box-sizing: border-box; }
    html, body { margin: 0; min-height: 100%; }
    body {
      background: var(--paper);
      color: var(--ink);
      font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
      letter-spacing: 0;
    }

    button, input { font: inherit; }
    button { color: inherit; }
    h1, h2, p { margin: 0; }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: repeat(2, minmax(230px, 270px)) minmax(0, 1fr);
    }

    .panel {
      min-width: 0;
      height: 100vh;
      border-right: 1px solid var(--line);
      background: var(--surface);
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      overflow: hidden;
    }

    .motion-panel { grid-column: 1; }
    .expression-panel { grid-column: 2; }

    .panel-head { min-height: 52px; padding: 12px 17px; border-bottom: 1px solid var(--line); background: #fbfcfb; display: flex; align-items: center; }
    .motion-panel .panel-head { background: #f7faf8; }
    .panel-head h2 { padding-left: 10px; border-left: 3px solid currentColor; font-size: 16px; line-height: 1.2; }
    .expression-panel .panel-head h2 { color: #90663c; }
    .motion-panel .panel-head h2 { color: var(--accent); }

    .layout-controls { position: absolute; z-index: 5; right: 12px; bottom: 12px; width: min(250px, calc(100% - 24px)); padding: 8px 10px; border: 1px solid #cdd7d0; border-radius: 7px; background: rgba(255,255,255,.94); box-shadow: 0 8px 22px rgba(35,52,41,.14); }
    .control-row {
      min-width: 0;
      min-height: 30px;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) 56px;
      align-items: center;
      gap: 6px;
      font-size: 11px;
    }
    .control-row input[type="range"] { width: 100%; min-width: 0; accent-color: var(--accent); }
    .control-row input[type="number"] {
      width: 56px;
      min-width: 0;
      height: 25px;
      padding: 2px 4px;
      border: 1px solid var(--line);
      border-radius: 4px;
      background: var(--surface);
    }
    .config-output {
      margin-top: 5px;
      padding: 5px 7px;
      background: #f5f7f5;
      color: var(--muted);
      font-family: Consolas, monospace;
      font-size: 10px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .command {
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 5px;
      background: var(--surface);
      cursor: pointer;
    }
    .action-list { min-height: 0; padding: 12px 12px 16px; overflow: auto; scrollbar-width: thin; scrollbar-color: #b8c6bc transparent; }
    .action-group + .action-group { margin-top: 14px; }
    .action-group-title { margin: 0 3px 7px; color: var(--muted); display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
    .action-group-title::after { height: 1px; flex: 1; background: var(--line); content: ''; }
    .action-group-count { color: #8b958e; font-weight: 500; }
    .action-group-list { display: grid; gap: 6px; }
    .action-row {
      width: 100%;
      min-width: 0;
      min-height: 48px;
      margin: 0;
      padding: 7px 9px;
      border: 1px solid #e1e7e2;
      border-radius: 7px;
      background: #fbfcfb;
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr);
      gap: 10px;
      text-align: left;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(39,55,44,.05);
      transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
    }
    .action-row:hover { border-color: #b6cbbd; background: #f7fbf8; box-shadow: 0 3px 8px rgba(39,55,44,.1); transform: translateY(-1px); }
    .action-row:active { transform: translateY(0); }
    .action-row.is-active { border-color: #85a991; background: var(--accent-soft); box-shadow: inset 0 0 0 1px #b6d0bc, 0 2px 5px rgba(49,92,61,.1); }
    .action-row[hidden] { display: none; }
    kbd {
      min-width: 40px;
      height: 29px;
      align-self: center;
      padding: 0 6px;
      border: 1px solid #17211b;
      border-bottom-width: 3px;
      border-radius: 6px;
      background: var(--key);
      color: #fff;
      display: inline-grid;
      place-items: center;
      font-family: Consolas, monospace;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
      box-shadow: 0 1px 2px rgba(26,39,30,.18);
    }
    kbd.key-motion-main { border-color: #2d6444; background: #3e7654; }
    kbd.key-motion-touch { border-color: #315c69; background: #427688; }
    kbd.key-motion-toggle { border-color: #28675f; background: #397e74; }
    kbd.key-expression-common { border-color: #74512e; background: #966b3e; }
    kbd.key-expression-extra { border-color: #5f6530; background: #747b3e; }
    kbd.key-expression-mouth { border-color: #703d50; background: #90546a; }
    kbd.is-click { border-color: #cbd5ce; background: #edf1ee; color: var(--muted); box-shadow: none; }
    .action-name { min-width: 0; align-self: center; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; line-height: 1.35; }
    .action-label { min-width: 0; overflow-wrap: anywhere; }
    .action-audio { width: 16px; height: 16px; flex: 0 0 auto; color: #a26724; display: inline-grid; place-items: center; }
    .action-audio svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .empty { padding: 24px 8px; color: var(--muted); font-size: 12px; text-align: center; }

    .workspace { position: relative; min-width: 0; min-height: 100vh; grid-column: 3; display: grid; grid-template-rows: auto minmax(0, 1fr); }
    .toolbar {
      min-width: 0;
      min-height: 64px;
      padding: 12px 20px;
      border-bottom: 1px solid var(--line);
      background: rgba(255, 255, 255, .86);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
    }
    .toolbar-context { min-width: 0; display: flex; align-items: center; }
    .model-switcher { margin-right: 18px; padding-right: 18px; border-right: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 5px; }
    .model-tab {
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--surface);
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
    }
    .model-tab:hover { border-color: #aebdb3; color: var(--ink); }
    .model-tab.is-active { border-color: #78a187; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px #c4d9ca; }
    .model-tab:disabled { cursor: wait; opacity: .65; }
    .toolbar-model-name { flex: 0 0 auto; font-size: 20px; line-height: 1.2; white-space: nowrap; }
    .status { min-width: 0; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; }
    .toolbar-context .status { margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--line); }
    .status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #9da49f; box-shadow: 0 0 0 4px #e6eae7; }
    .status.is-ready .status-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
    .status.is-error .status-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
    #status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .toolbar-actions { display: flex; gap: 7px; }
    .command { padding: 0 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
    .command:hover { border-color: #aeb8b1; }
    .command:disabled { cursor: not-allowed; opacity: .5; }

    .stage-wrap { min-width: 0; min-height: 0; padding: 10px; display: grid; place-items: center; overflow: hidden; }
    .stage {
      position: relative;
      width: min(100%, 900px, calc(100vh - 105px));
      aspect-ratio: 1;
      border: 1px solid var(--line);
      border-radius: 6px;
      overflow: hidden;
      background-color: #fff;
      background-image: linear-gradient(45deg,#e8ece9 25%,transparent 25%),linear-gradient(-45deg,#e8ece9 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e8ece9 75%),linear-gradient(-45deg,transparent 75%,#e8ece9 75%);
      background-position: 0 0,0 12px,12px -12px,-12px 0;
      background-size: 24px 24px;
    }
    #live2d-canvas { width: 100%; height: 100%; display: block; outline: none; }
    #live2d-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
    .loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.8); color: var(--muted); font-size: 13px; font-weight: 700; pointer-events: none; }
    .loading[hidden] { display: none; }
    @media (max-width: 1100px) {
      .toolbar { align-items: stretch; flex-direction: column; }
      .toolbar-context { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
      .model-switcher { width: 100%; margin: 0; padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
      .toolbar-context .status { margin-left: 12px; padding-left: 12px; }
      .toolbar-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
      .command { min-width: 0; padding: 0 6px; white-space: normal; }
    }

    @media (max-width: 760px) {
      .app { grid-template-columns: 1fr; }
      .workspace { min-height: auto; grid-column: 1; grid-row: auto; order: 1; }
      .panel { height: auto; min-height: 0; grid-column: 1; grid-row: auto; border-top: 0; border-right: 0; overflow: visible; }
      .motion-panel { order: 2; }
      .expression-panel { order: 3; }
      .layout-controls { position: static; width: auto; margin: 0 10px 10px; }
      .action-list { max-height: none; overflow: visible; }
      .action-group-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .stage { width: min(100%, 760px); }
    }

    @media (max-width: 560px) {
      .toolbar { align-items: stretch; flex-direction: column; }
      .toolbar-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
      .command { min-width: 0; padding: 0 6px; white-space: normal; }
      .stage-wrap { padding: 9px; }
      .action-group-list { grid-template-columns: 1fr; }
      .control-row { grid-template-columns: 38px minmax(0,1fr) 62px; }
      .control-row input[type="number"] { width: 62px; }
    }
