* { margin: 0; padding: 0; box-sizing: border-box; }
    html, body {
      width: 100%; height: 100%;
      overflow: hidden;
      background: #000;
      font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "Songti SC", Georgia, "Times New Roman", serif;
      color: #fff;
    }
    #canvas-container { width: 100%; height: 100%; }

    /* 赛博物理终端风格变量 */
    :root {
      --em: #8b5cf6;
      --cy: #22d3ee;
      --panel: rgba(6, 8, 10, 0.82);
    }

    @keyframes cornerGlow {
      0%, 100% { opacity: 0.5; filter: drop-shadow(0 0 3px var(--cy)); }
      50% { opacity: 1; filter: drop-shadow(0 0 6px var(--cy)); }
    }

    /* 控制面板 — HUD 文本框效果 */
    #ui {
      position: absolute;
      top: 16px; left: 16px;
      z-index: 10;
      width: 360px;
      transition: width 0.25s ease, border-color 0.3s, box-shadow 0.3s, transform 0.3s ease;
      max-height: calc(100vh - 32px);
      overflow-y: auto;
      background: var(--panel);
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 0;
      padding: 20px 22px;
      backdrop-filter: blur(18px);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.4),
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 0 40px rgba(34, 211, 238, 0.03);
    }
    #ui::before {
      content: "";
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background:
        repeating-linear-gradient(
          0deg,
          transparent,
          transparent 2px,
          rgba(34, 211, 238, 0.015) 2px,
          rgba(34, 211, 238, 0.015) 4px
        );
      pointer-events: none;
      z-index: 0;
    }
    #ui:hover {
      border-color: rgba(139, 92, 246, 0.32);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.4),
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 0 50px rgba(139, 92, 246, 0.06);
    }

    /* 四角括号 */
    .rc {
      position: absolute;
      width: 10px; height: 10px;
      border: 1.5px solid var(--cy);
      z-index: 11;
      pointer-events: none;
      animation: cornerGlow 3s ease-in-out infinite;
    }
    .rc.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
    .rc.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
    .rc.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
    .rc.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }
    #ui:hover .rc {
      border-color: var(--em);
      width: 16px; height: 16px;
      transition: all 0.25s;
    }

    #ui::-webkit-scrollbar { width: 4px; }
    #ui::-webkit-scrollbar-track { background: transparent; }
    #ui::-webkit-scrollbar-thumb {
      background: rgba(34, 211, 238, 0.18);
      border-radius: 0;
    }
    #ui::-webkit-scrollbar-thumb:hover { background: var(--em); }

    .panel-header {
      position: relative;
      z-index: 1;
      margin-bottom: 18px;
    }
    .panel-width-toggle {
      position: absolute;
      top: 0;
      right: 0;
      width: 28px;
      height: 28px;
      padding: 0;
      margin: 0;
      background: rgba(139, 92, 246, 0.1);
      border: 1px solid rgba(139, 92, 246, 0.3);
      color: rgba(255, 255, 255, 0.8);
      font-size: 14px;
      line-height: 1;
      cursor: pointer;
      transition: all 0.18s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .panel-width-toggle:hover {
      background: rgba(139, 92, 246, 0.25);
      border-color: rgba(139, 92, 246, 0.6);
      color: #fff;
    }
    .panel-width-toggle.narrow {
      background: rgba(34, 211, 238, 0.12);
      border-color: rgba(34, 211, 238, 0.45);
    }
    #ui.ui-narrow { width: 300px; }
    @media (max-width: 768px) {
      #ui.ui-narrow { width: min(300px, 85vw); }
    }
    .panel-meta {
      font-size: 9px;
      letter-spacing: 2px;
      color: var(--em);
      opacity: 0.85;
      margin-bottom: 6px;
      font-family: "JetBrains Mono", "Consolas", monospace;
    }
    #ui h1 {
      font-size: 22px;
      font-weight: 600;
      margin-bottom: 4px;
      letter-spacing: 2px;
      color: #fff;
      text-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
      font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "Songti SC", Georgia, serif;
    }
    #ui .subtitle {
      font-size: 11px;
      opacity: 0.5;
      margin-bottom: 12px;
      letter-spacing: 0.6px;
    }

    .hud-title-line {
      height: 1px;
      background: linear-gradient(90deg, var(--em), rgba(139, 92, 246, 0.2), transparent);
      box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
    }

    /* 面板切换标签 */
    .tab-row {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 16px;
    }
    .tab {
      background: rgba(139, 92, 246, 0.06);
      border: 1px solid rgba(139, 92, 246, 0.22);
      color: rgba(255, 255, 255, 0.7);
      padding: 7px 0;
      font-family: inherit;
      font-size: 12px;
      letter-spacing: 0.8px;
      cursor: pointer;
      transition: all 0.18s ease;
      text-align: center;
    }
    .tab:hover {
      background: rgba(139, 92, 246, 0.12);
      color: #fff;
    }
    .tab.active {
      background: rgba(139, 92, 246, 0.22);
      border-color: rgba(139, 92, 246, 0.55);
      color: #fff;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    }

    /* 星座搜索 */
    .search-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      margin-bottom: 10px;
    }
    .search-row input[type=text] {
      background: rgba(139, 92, 246, 0.08);
      border: 1px solid rgba(139, 92, 246, 0.22);
      color: #fff;
      padding: 8px 10px;
      font-family: inherit;
      font-size: 12px;
      letter-spacing: 0.4px;
      outline: none;
    }
    .search-row input[type=text]:focus {
      border-color: rgba(139, 92, 246, 0.55);
      background: rgba(139, 92, 246, 0.14);
    }
    .search-row button {
      padding: 8px 14px;
      margin: 0;
    }
    .hint {
      font-size: 11px;
      color: var(--cy);
      opacity: 0.85;
      min-height: 16px;
      font-family: "JetBrains Mono", "Consolas", monospace;
    }

    .section {
      position: relative;
      z-index: 1;
      margin-bottom: 20px;
      padding: 14px 16px;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.06);
      transition: border-color 0.25s, background 0.25s;
    }
    .section:hover {
      background: rgba(255, 255, 255, 0.035);
      border-color: rgba(139, 92, 246, 0.22);
    }
    .section:last-child { margin-bottom: 0; }
    .section-title {
      font-size: 13px;
      color: #e2e8f0;
      margin-bottom: 12px;
      letter-spacing: 1px;
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "Songti SC", Georgia, serif;
      cursor: pointer;
      user-select: none;
      transition: color 0.2s;
    }
    .section-title:hover { color: #fff; }
    .section-title-text { display: flex; align-items: center; gap: 6px; }
    .section-icon { color: var(--em); font-size: 10px; }
    .section-caret {
      font-size: 9px;
      color: var(--em);
      opacity: 0.8;
      transition: transform 0.25s ease;
    }
    .section.collapsed .section-caret { transform: rotate(-90deg); }
    .section-content {
      overflow: hidden;
      max-height: 400px;
      opacity: 1;
      transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
    }
    .section.collapsed .section-content {
      max-height: 0;
      opacity: 0;
      margin-top: 0;
    }

    /* 功能按钮 */
    .btn-group {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
    }
    .btn-group-3 {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 12px;
    }
    button {
      background: rgba(139, 92, 246, 0.06);
      border: 1px solid rgba(139, 92, 246, 0.22);
      color: rgba(255, 255, 255, 0.88);
      padding: 8px 10px;
      border-radius: 0;
      cursor: pointer;
      font-size: 12px;
      font-family: inherit;
      letter-spacing: 0.6px;
      transition: all 0.18s ease;
      text-align: left;
      position: relative;
      overflow: hidden;
    }
    button::after {
      content: "";
      position: absolute;
      top: 0; left: 0; right: 0; height: 1px;
      background: rgba(139, 92, 246, 0.18);
    }
    button:hover {
      background: rgba(139, 92, 246, 0.14);
      border-color: rgba(139, 92, 246, 0.45);
      color: #fff;
      box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    }
    button.active, button.on {
      background: rgba(139, 92, 246, 0.16);
      border-color: rgba(139, 92, 246, 0.65);
      color: #fff;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 0 12px rgba(139, 92, 246, 0.2);
    }
    button.toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
    }
    button.toggle::before {
      content: "";
      order: 2;
      width: 7px; height: 7px;
      border: 1px solid rgba(255,255,255,0.35);
      background: transparent;
      transition: all 0.18s;
      border-radius: 0;
    }
    button.toggle.on::before {
      background: var(--em);
      border-color: var(--em);
      box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
    }

    /* 滑动条 */
    .slider-row {
      display: grid;
      grid-template-columns: 72px 1fr 50px;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
      padding: 3px 0;
    }
    .slider-row:last-child { margin-bottom: 0; }
    .slider-row label {
      font-size: 12px;
      opacity: 0.82;
      letter-spacing: 0.6px;
    }
    .slider-row input[type=range] {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 3px;
      background: rgba(139, 92, 246, 0.18);
      border-radius: 0;
      outline: none;
      cursor: pointer;
      position: relative;
    }
    .slider-row input[type=range]::-webkit-slider-runnable-track {
      height: 3px;
      background: transparent;
      border-radius: 0;
    }
    .slider-row input[type=range]::-moz-range-track {
      height: 3px;
      background: transparent;
      border-radius: 0;
    }
    .slider-row input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 9px;
      height: 13px;
      margin-top: -5px;
      background: var(--em);
      border: 0;
      border-radius: 0;
      box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
      transition: all 0.15s ease;
    }
    .slider-row input[type=range]::-moz-range-thumb {
      width: 9px;
      height: 13px;
      background: var(--em);
      border: 0;
      border-radius: 0;
      box-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
      transition: all 0.15s ease;
    }
    .slider-row input[type=range]:hover::-webkit-slider-thumb {
      background: #a78bfa;
      box-shadow: 0 0 12px rgba(139, 92, 246, 0.9);
    }
    .slider-row input[type=range]:hover::-moz-range-thumb {
      background: #a78bfa;
      box-shadow: 0 0 12px rgba(139, 92, 246, 0.9);
    }
    .slider-row input[type=range]:active::-webkit-slider-thumb {
      background: var(--cy);
    }
    .slider-row input[type=range]:active::-moz-range-thumb {
      background: var(--cy);
    }
    .slider-row .value {
      font-size: 11px;
      text-align: right;
      font-variant-numeric: tabular-nums;
      color: var(--em);
      opacity: 0.95;
      letter-spacing: 0.4px;
      padding: 3px 6px;
      background: rgba(139, 92, 246, 0.07);
      border: 1px solid rgba(139, 92, 246, 0.18);
      border-radius: 0;
      font-family: "JetBrains Mono", "Consolas", monospace;
    }

    /* 连线颜色选择器 */
    .color-input-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .color-input-wrap input[type=color] {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 22px;
      border: 1px solid rgba(139, 92, 246, 0.22);
      background: transparent;
      cursor: pointer;
      padding: 0;
    }
    .color-input-wrap input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
    .color-input-wrap input[type=color]::-webkit-color-swatch { border: none; }
    .color-input-wrap input[type=color]::-moz-color-swatch { border: none; }
    .color-input-wrap button {
      flex-shrink: 0;
      width: 26px;
      height: 22px;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      line-height: 1;
    }
    .color-row .value {
      font-size: 10px;
      padding: 3px 3px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* 下拉选择 */
    .select-row {
      display: grid;
      grid-template-columns: 72px 1fr;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
      padding: 3px 0;
    }
    .select-row:last-child { margin-bottom: 0; }
    .select-row label {
      font-size: 12px;
      opacity: 0.82;
      letter-spacing: 0.6px;
    }
    .select-row select {
      width: 100%;
      background: rgba(139, 92, 246, 0.08);
      border: 1px solid rgba(139, 92, 246, 0.22);
      color: #fff;
      padding: 7px 8px;
      font-family: inherit;
      font-size: 12px;
      letter-spacing: 0.4px;
      outline: none;
      cursor: pointer;
      border-radius: 0;
      appearance: none;
      -webkit-appearance: none;
    }
    .select-row select:hover,
    .select-row select:focus {
      border-color: rgba(139, 92, 246, 0.5);
      background: rgba(139, 92, 246, 0.14);
    }
    .select-row option {
      background: #0b0c10;
      color: #fff;
    }

    /* 星宿选择可搜索下拉框 */
    .xiu-knowledge-combo {
      position: relative;
      width: 100%;
    }
    .xiu-knowledge-combo input[type=text] {
      width: 100%;
      background: rgba(139, 92, 246, 0.08);
      border: 1px solid rgba(139, 92, 246, 0.22);
      color: #fff;
      padding: 7px 8px;
      font-family: inherit;
      font-size: 12px;
      letter-spacing: 0.4px;
      outline: none;
      border-radius: 0;
    }
    .xiu-knowledge-combo input[type=text]:hover,
    .xiu-knowledge-combo input[type=text]:focus {
      border-color: rgba(139, 92, 246, 0.5);
      background: rgba(139, 92, 246, 0.14);
    }
    .xiu-knowledge-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      z-index: 100;
      max-height: 220px;
      overflow-y: auto;
      background: rgba(10, 11, 14, 0.96);
      border: 1px solid rgba(139, 92, 246, 0.35);
      border-top: none;
      display: none;
      box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .xiu-knowledge-dropdown.active {
      display: block;
    }
    .xiu-knowledge-dropdown-item {
      padding: 8px 10px;
      font-size: 12px;
      cursor: pointer;
      color: rgba(255, 255, 255, 0.88);
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      transition: background 0.15s;
    }
    .xiu-knowledge-dropdown-item:hover,
    .xiu-knowledge-dropdown-item.active {
      background: rgba(139, 92, 246, 0.22);
      color: #fff;
    }
    .xiu-knowledge-dropdown-item .item-meta {
      font-size: 10px;
      color: var(--cy);
      opacity: 0.85;
      margin-left: 6px;
    }
    .xiu-knowledge-dropdown-empty {
      padding: 10px;
      font-size: 11px;
      color: rgba(255, 255, 255, 0.5);
      font-style: italic;
    }

    /* 星宿知识文本区 */
    .knowledge-content {
      margin-top: 12px;
      padding: 12px;
      background: rgba(139, 92, 246, 0.06);
      border: 1px solid rgba(139, 92, 246, 0.18);
      font-size: 12px;
      line-height: 1.7;
      max-height: min(50vh, 420px);
      overflow-y: auto;
    }
    .knowledge-content::-webkit-scrollbar { width: 4px; }
    .knowledge-content::-webkit-scrollbar-track { background: transparent; }
    .knowledge-content::-webkit-scrollbar-thumb {
      background: rgba(139, 92, 246, 0.25);
      border-radius: 0;
    }
    .knowledge-content h4 {
      color: var(--em);
      margin-bottom: 6px;
      font-size: 13px;
      letter-spacing: 0.6px;
    }
    .knowledge-content p {
      opacity: 0.9;
      margin-bottom: 8px;
    }
    .knowledge-content p:last-child { margin-bottom: 0; }
    .knowledge-placeholder {
      opacity: 0.6;
      font-style: italic;
    }
    .knowledge-meta {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(139, 92, 246, 0.18);
      font-size: 11px;
      color: var(--cy);
      opacity: 0.85;
    }

    /* 星官详解卡片 */
    .asterism-list-title {
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid rgba(139, 92, 246, 0.18);
      font-size: 12px;
      font-weight: 600;
      color: var(--em);
      letter-spacing: 0.6px;
    }
    .asterism-list {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .asterism-card {
      background: rgba(0, 0, 0, 0.22);
      border: 1px solid rgba(255, 255, 255, 0.08);
      transition: border-color 0.2s, background 0.2s;
    }
    .asterism-card:hover {
      border-color: rgba(139, 92, 246, 0.35);
      background: rgba(139, 92, 246, 0.08);
    }
    .asterism-card-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 10px;
      cursor: pointer;
      user-select: none;
      font-size: 12px;
    }
    .asterism-card-caret {
      color: var(--cy);
      font-size: 10px;
      width: 10px;
      text-align: center;
      flex-shrink: 0;
    }
    .asterism-name {
      font-weight: 600;
      color: #fff;
      flex-shrink: 0;
    }
    .asterism-pinyin {
      color: var(--cy);
      opacity: 0.85;
      font-size: 11px;
      flex-shrink: 0;
    }
    .asterism-en {
      color: rgba(255, 255, 255, 0.55);
      font-size: 10px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      min-width: 0;
    }
    .asterism-locate-btn {
      margin: 0;
      padding: 3px 8px;
      font-size: 10px;
      background: rgba(139, 92, 246, 0.18);
      border: 1px solid rgba(139, 92, 246, 0.4);
      color: #fff;
      cursor: pointer;
      transition: all 0.18s;
      flex-shrink: 0;
    }
    .asterism-locate-btn:hover {
      background: rgba(139, 92, 246, 0.35);
      border-color: rgba(139, 92, 246, 0.7);
    }
    .asterism-card-body {
      padding: 0 12px 12px 30px;
      font-size: 11.5px;
      line-height: 1.75;
      color: rgba(255, 255, 255, 0.86);
      overflow: hidden;
      transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s;
      max-height: 600px;
      opacity: 1;
    }
    .asterism-card-body.collapsed {
      max-height: 0;
      padding-top: 0;
      padding-bottom: 0;
      opacity: 0;
    }
    .asterism-card-body p {
      margin-bottom: 7px;
    }
    .asterism-card-body p:last-child {
      margin-bottom: 0;
    }
    .asterism-card-body strong {
      color: var(--cy);
      font-weight: 600;
    }
    .asterism-card-footer {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid rgba(139, 92, 246, 0.15);
      font-size: 11px;
      color: rgba(255, 255, 255, 0.55);
      font-family: "JetBrains Mono", "Consolas", monospace;
      letter-spacing: 0.3px;
    }

    /* 底部信息条 */
    #info-bar {
      position: absolute;
      bottom: 16px; left: 16px; right: 16px;
      z-index: 10;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      pointer-events: none;
    }
    .info-panel {
      background: var(--panel);
      border: 1px solid rgba(255,255,255,0.09);
      border-radius: 0;
      padding: 11px 15px;
      backdrop-filter: blur(14px);
      font-size: 12px;
      line-height: 1.7;
      pointer-events: auto;
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.35),
        0 14px 40px rgba(0,0,0,0.45),
        inset 0 0 30px rgba(139, 92, 246, 0.03);
    }
    .info-panel .label { opacity: 0.5; }
    .info-panel .value { font-variant-numeric: tabular-nums; color: #e2e8f0; }
    #hover-name { color: var(--em); font-weight: 600; text-shadow: 0 0 10px rgba(139, 92, 246, 0.4); }

    /* 月球信息卡 */
    .moon-info-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 14px;
      font-size: 12px;
      line-height: 1.6;
    }
    .moon-info-grid .label { opacity: 0.55; }
    .moon-info-grid .value { font-variant-numeric: tabular-nums; color: #fff8dc; }
    #moon-phase-name { color: var(--em); font-weight: 600; }

    /* 提示框 */
    #tooltip {
      position: absolute;
      z-index: 20;
      background: var(--panel);
      border: 1px solid rgba(139, 92, 246, 0.28);
      padding: 12px 16px;
      border-radius: 0;
      font-size: 13px;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.12s;
      max-width: 260px;
      backdrop-filter: blur(12px);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.35),
        0 14px 40px rgba(0,0,0,0.5),
        inset 0 0 30px rgba(139, 92, 246, 0.04);
    }
    #tooltip h3 { font-size: 14px; margin-bottom: 6px; color: var(--em); font-weight: 600; letter-spacing: 0.8px; text-shadow: 0 0 10px rgba(139, 92, 246, 0.4); }
    #tooltip p { opacity: 0.85; line-height: 1.6; font-size: 12px; }

    /* 加载 */
    #loading {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      z-index: 30;
      background: var(--panel);
      padding: 22px 34px;
      border-radius: 0;
      font-size: 13px;
      letter-spacing: 1px;
      pointer-events: none;
      transition: opacity 0.3s;
      border: 1px solid rgba(139, 92, 246, 0.28);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.35),
        0 16px 50px rgba(0,0,0,0.5),
        inset 0 0 30px rgba(139, 92, 246, 0.04);
      font-family: "JetBrains Mono", "Consolas", monospace;
      color: var(--em);
    }
    #loading::after {
      content: "";
      display: inline-block;
      width: 14px; height: 14px;
      margin-left: 10px;
      border: 2px solid rgba(139, 92, 246, 0.15);
      border-top-color: var(--em);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      vertical-align: middle;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* 右上角参数控制面板 */
    #ui-main {
      position: absolute;
      top: 16px;
      right: 16px;
      z-index: 10;
      width: 300px;
      max-height: calc(100vh - 32px);
      overflow-y: auto;
      background: var(--panel);
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 0;
      padding: 20px 22px;
      backdrop-filter: blur(18px);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.4),
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 0 40px rgba(34, 211, 238, 0.03);
      transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s ease;
    }
    #ui-main::before {
      content: "";
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background:
        repeating-linear-gradient(
          0deg,
          transparent,
          transparent 2px,
          rgba(34, 211, 238, 0.015) 2px,
          rgba(34, 211, 238, 0.015) 4px
        );
      pointer-events: none;
      z-index: 0;
    }
    #ui-main:hover {
      border-color: rgba(139, 92, 246, 0.32);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.4),
        0 20px 60px rgba(0,0,0,0.6),
        inset 0 0 50px rgba(139, 92, 246, 0.06);
    }

    /* 面板折叠按钮（PC / 移动端通用） */
    #panel-toggle,
    #panel-main-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 12px;
      z-index: 30;
      width: 42px;
      height: 42px;
      padding: 0;
      background: var(--panel);
      border: 1px solid rgba(139, 92, 246, 0.35);
      color: #fff;
      font-size: 22px;
      line-height: 1;
      text-align: center;
      cursor: pointer;
      backdrop-filter: blur(14px);
      box-shadow:
        0 0 0 1px rgba(0,0,0,0.35),
        0 10px 30px rgba(0,0,0,0.45);
      transition: all 0.2s ease;
    }
    #panel-toggle { left: 12px; }
    #panel-main-toggle { right: 12px; font-size: 20px; }
    #panel-toggle:hover,
    #panel-toggle:focus,
    #panel-main-toggle:hover,
    #panel-main-toggle:focus {
      border-color: rgba(139, 92, 246, 0.7);
      background: rgba(139, 92, 246, 0.14);
      outline: none;
    }

    /* PC 端收起状态 */
    @media (min-width: 769px) {
      #ui.closed {
        transform: translateX(calc(-100% - 40px));
      }
      #ui-main.closed {
        transform: translateX(calc(100% + 40px));
      }
      #panel-toggle,
      #panel-main-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
      }
    }

    /* 移动端适配 */
    @media (max-width: 768px) {
      #ui {
        position: fixed;
        top: 0;
        left: 0;
        width: min(360px, 85vw);
        transition: transform 0.3s ease, box-shadow 0.3s ease, width 0.25s ease;
        height: 100vh;
        max-height: 100vh;
        padding: 16px 18px;
        transform: translateX(-100%);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border-top: none;
        border-bottom: none;
        border-left: none;
      }
      #ui.open {
        transform: translateX(0);
      }
      #ui-main {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: min(320px, 85vw);
        height: 100vh;
        max-height: 100vh;
        padding: 16px 18px;
        transform: translateX(100%);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border-top: none;
        border-bottom: none;
        border-right: none;
      }
      #ui-main.open {
        transform: translateX(0);
      }
      #ui .panel-header h1,
      #ui-main .panel-header h1 {
        font-size: 18px;
      }
      #ui .subtitle,
      #ui-main .subtitle {
        font-size: 10px;
      }
      .section-title {
        font-size: 12px;
      }
      .btn-group {
        grid-template-columns: repeat(2, 1fr);
      }
      .btn-group-3 {
        grid-template-columns: repeat(3, 1fr);
      }
      #info-bar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
      }
      .info-panel {
        padding: 8px 10px;
        font-size: 11px;
      }
    }
