    :root {
      --bg-deep: #0a0e1a;
      --bg-panel: rgba(15, 25, 45, 0.82);
      --border: rgba(0, 212, 255, 0.22);
      --cyan: #3dd9ff;
      --cyan-dim: rgba(61, 217, 255, 0.45);
      --accent: #00d4ff;
      --accent-dim: rgba(0, 212, 255, 0.45);
      --text: #e8f4fc;
      --text-muted: #7a9bb8;
      --shadow-glow: 0 0 24px rgba(61, 217, 255, 0.15);
      --radius: 12px;
      --panel-width: min(320px, 26vw);
      --font-display: "Orbitron", sans-serif;
      --font-body: "Noto Sans SC", sans-serif;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html {
      height: 100%;
    }

    body {
      font-family: var(--font-body);
      background: var(--bg-deep);
      color: var(--text);
      min-height: 100%;
      height: 100%;
      overflow: hidden;
    }

    .starfield {
      position: fixed;
      inset: 0;
      pointer-events: none;
      background:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
        radial-gradient(1px 1px at 80% 40%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
        radial-gradient(1px 1px at 45% 75%, rgba(255, 255, 255, 0.2) 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 88%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
        radial-gradient(ellipse 120% 80% at 50% 100%, rgba(20, 50, 90, 0.45), transparent 55%),
        var(--bg-deep);
      z-index: 0;
    }

    .app {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: auto 1fr;
      height: 100%;
      min-height: 100%;
    }

    .panel-column {
      position: relative;
      width: var(--panel-width);
      min-width: 280px;
      height: 100%;
      align-self: stretch;
      flex-shrink: 0;
      min-height: 0;
      overflow: visible;
      transition: width 0.22s ease, min-width 0.22s ease;
    }

    .app.panel-collapsed .panel-column {
      width: 0;
      min-width: 0;
    }

    .sidebar {
      width: 100%;
      height: 100%;
      min-height: 0;
      padding: 1rem 0.75rem;
      background: var(--bg-panel);
      border-right: 1px solid var(--border);
      box-shadow: var(--shadow-glow);
      backdrop-filter: blur(12px);
      overflow: hidden;
      transition: opacity 0.18s ease, border-color 0.22s ease;
    }

    .app.panel-collapsed .sidebar {
      border-right-color: transparent;
      opacity: 0;
      pointer-events: none;
    }

    .sidebar > .panel-body {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
      height: 100%;
      min-height: 0;
      overflow: hidden;
    }

    .app.panel-collapsed .sidebar > .panel-body {
      display: none;
    }

    .panel-toggle-btn {
      position: absolute;
      left: 100%;
      top: 50%;
      z-index: 20;
      transform: translateY(-50%);
      width: 28px;
      height: 52px;
      padding: 0;
      font-size: 13px;
      line-height: 1;
      border-radius: 0 8px 8px 0;
      border: 1px solid var(--border);
      border-left: none;
      background: rgba(12, 22, 40, 0.95);
      color: var(--text);
      cursor: pointer;
      font-family: inherit;
      box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
      transition: background 0.2s, border-color 0.2s, color 0.2s;
    }

    .panel-toggle-btn:hover {
      border-color: var(--cyan);
      color: var(--cyan);
      background: rgba(61, 217, 255, 0.12);
    }

    .panel-header {
      flex-shrink: 0;
      margin: -1rem -0.75rem 0;
      padding: 18px 14px 14px;
      border-bottom: 1px solid var(--border);
      background: linear-gradient(
        165deg,
        rgba(0, 212, 255, 0.14) 0%,
        rgba(0, 100, 160, 0.06) 45%,
        transparent 100%
      );
      box-shadow: inset 0 -1px 0 rgba(0, 212, 255, 0.1);
    }

    .panel-title {
      margin: 0;
      font-family: var(--font-body);
      font-size: 1.2rem;
      font-weight: 700;
      letter-spacing: 0.12em;
      line-height: 1.4;
      color: #f2fbff;
      text-shadow:
        0 0 14px rgba(0, 212, 255, 0.65),
        0 0 32px rgba(0, 212, 255, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.45);
    }

    .panel-title-mark {
      font-family: var(--font-display);
      font-weight: 800;
      font-size: 1.22em;
      letter-spacing: 0.06em;
      color: var(--accent);
      margin: 0 0.1em;
      vertical-align: -0.02em;
      text-shadow:
        0 0 18px rgba(0, 212, 255, 0.95),
        0 0 36px rgba(0, 212, 255, 0.45);
    }

    .sidebar-content {
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: var(--cyan-dim) transparent;
    }

    .panel-bottom {
      flex-shrink: 0;
      margin: 0 -0.75rem -1rem;
      padding: 10px 14px 18px;
      border-top: 1px solid var(--border);
      background: rgba(5, 12, 24, 0.45);
    }

    .panel-bottom .section-label {
      margin-top: 0;
    }

    .section-label {
      font-family: var(--font-display);
      font-size: 0.62rem;
      letter-spacing: 0.2em;
      color: var(--accent);
      margin: 0 0 8px;
      opacity: 0.9;
    }

    .sidebar-content > .control-group {
      padding: 10px 10px 11px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: rgba(0, 20, 40, 0.5);
    }

    .sidebar-content > .control-group[hidden] {
      display: none;
    }

    .panel-select {
      width: 100%;
      padding: 6px 32px 6px 11px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: rgba(0, 40, 70, 0.5);
      color: var(--text);
      font-family: var(--font-body);
      font-size: 0.82rem;
      line-height: 1.25;
      cursor: pointer;
      outline: none;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300d4ff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    .panel-select:hover,
    .panel-select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
    }

    .panel-select option {
      background: #0a1828;
      color: var(--text);
    }

    .control-group-layers .layer-checkboxes {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 6px 10px;
      margin-top: 0;
    }

    .control-group-layers .layer-checkboxes > label {
      display: flex;
      align-items: flex-start;
      gap: 6px;
      margin-bottom: 0;
      font-size: 0.75rem;
      line-height: 1.35;
      color: var(--text-muted);
      font-family: var(--font-body);
      min-width: 0;
      cursor: pointer;
    }

    .control-group input[type="checkbox"] {
      width: auto;
      margin: 0;
      flex-shrink: 0;
      transform: translateY(1px);
      accent-color: var(--accent);
      cursor: pointer;
    }

    .knowledge-box {
      margin: 0 0 10px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: rgba(0, 20, 40, 0.5);
      font-size: 0.8rem;
      line-height: 1.75;
      max-height: min(42vh, 320px);
      overflow-y: auto;
    }

    .knowledge-box h3 {
      font-size: 0.85rem;
      color: var(--accent);
      margin-bottom: 8px;
      font-weight: 600;
    }

    .knowledge-box p {
      margin: 0 0 0.5rem;
    }

    .knowledge-box ul {
      margin: 8px 0 0 18px;
      color: var(--text-muted);
    }

    .knowledge-box li { margin-bottom: 4px; }
    .knowledge-box strong { color: var(--text); }

    .copyright-entry {
      flex-shrink: 0;
      margin: 4px 0 0;
      padding-top: 10px;
      border-top: 1px solid var(--border);
    }

    .copyright-text-btn {
      display: block;
      width: 100%;
      padding: 10px 12px;
      font-size: 13px;
      font-family: var(--font-body);
      color: var(--text-muted);
      background: transparent;
      border: 1px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      text-align: center;
      transition: border-color 0.2s, color 0.2s;
    }

    .copyright-text-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    .copyright-modal { max-width: 440px; }
    .copyright-modal .modal-title { text-align: center; }
    .copyright-modal .modal-actions { justify-content: center; }

    .copyright-qr-grid {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 14px 16px;
      margin-bottom: 14px;
    }

    .copyright-qr-item {
      margin: 0;
      flex: 1 1 150px;
      max-width: 200px;
      text-align: center;
    }

    .copyright-qr-caption {
      margin: 8px 0 0;
      font-size: 12px;
      color: #9fb4e8;
    }

    .copyright-qr-image {
      display: block;
      width: 100%;
      max-width: 200px;
      height: auto;
      margin: 0 auto;
      border-radius: 8px;
      border: 1px solid rgba(45, 67, 127, 0.5);
    }

    .copyright-note {
      margin: 0;
      font-size: 13px;
      line-height: 1.55;
      color: #c8d6ff;
      text-align: center;
    }

    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 20000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(0, 0, 0, 0.5);
    }

    .modal-overlay[hidden] { display: none !important; }

    .modal-dialog {
      width: 100%;
      max-width: 380px;
      padding: 18px 16px;
      border-radius: 12px;
      background: linear-gradient(180deg, #0a1428 0%, #050a14 100%);
      border: 1px solid #2d437f;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
      color: #e0e9ff;
    }

    .modal-title {
      margin: 0 0 14px;
      font-size: 17px;
      font-weight: 600;
      color: #b8d4ff;
    }

    .modal-actions {
      display: flex;
      gap: 10px;
      margin-top: 18px;
      justify-content: flex-end;
    }

    .modal-btn {
      padding: 8px 18px;
      font-size: 14px;
      border-radius: 8px;
      cursor: pointer;
      border: 1px solid #35509a;
      background: #10214b;
      color: #eff3ff;
      font-family: inherit;
    }

    .modal-btn-primary {
      border-color: #4a6caf;
      background: #1a3a7a;
    }

    .stage {
      position: relative;
      min-width: 0;
      min-height: 0;
      height: 100%;
    }

    .stage-inner {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
    }

    .diagram-stack {
      position: absolute;
      inset: 0;
    }

    #canvas-wrap {
      position: absolute;
      inset: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      background: #0b1a2e;
    }

    #canvas-wrap canvas {
      position: absolute;
      inset: 0;
      display: block;
      width: 100%;
      height: 100%;
    }

    #canvas-wrap.mode-water-body,
    #canvas-wrap.mode-cycle-significance {
      visibility: hidden;
      pointer-events: none;
    }

    #canvas-wrap.mode-cycle-links {
      cursor: pointer;
    }

    #loading {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(11, 26, 46, 0.92);
      color: #c8dff5;
      font-size: 15px;
      z-index: 5;
      transition: opacity 0.5s;
      pointer-events: none;
    }

    #loading.hide {
      opacity: 0;
      visibility: hidden;
    }

    .panel {
      position: absolute;
      z-index: 10;
      background: var(--bg-panel);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      backdrop-filter: blur(10px);
      box-shadow: var(--shadow-glow);
    }

    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.5rem 0.75rem;
      border-bottom: 1px solid var(--border);
      font-size: 0.8rem;
      font-weight: 600;
    }

    .collapse-btn {
      background: none;
      border: none;
      color: var(--cyan);
      cursor: pointer;
      font-size: 0.75rem;
    }

    .panel .panel-body {
      padding: 0.65rem 0.85rem;
      font-size: 0.74rem;
      line-height: 1.65;
      color: var(--text-muted);
      max-height: min(280px, 38vh);
      overflow-y: auto;
    }

    .panel .panel-body strong { color: var(--text); }
    .panel .panel-body p { margin: 0 0 0.55rem; }
    .panel .panel-body p:last-child { margin-bottom: 0; }

    .panel-tools {
      top: 12px;
      right: 12px;
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      padding: 0.4rem;
      background: transparent;
      border: none;
      box-shadow: none;
      backdrop-filter: none;
    }

    .tool-btn {
      padding: 0.35rem 0.55rem;
      font-size: 0.68rem;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg-panel);
      color: var(--text);
      cursor: pointer;
      white-space: nowrap;
    }

    .tool-btn[hidden] {
      display: none !important;
    }

    .tool-btn:hover {
      border-color: var(--cyan);
      color: var(--cyan);
    }

    .stage-hint {
      position: absolute;
      bottom: 14px;
      left: 50%;
      transform: translateX(-50%);
      color: rgba(200, 223, 245, 0.65);
      font-size: 0.72rem;
      background: rgba(8, 20, 40, 0.55);
      padding: 5px 14px;
      border-radius: 20px;
      border: 1px solid rgba(110, 181, 255, 0.2);
      pointer-events: none;
      z-index: 4;
    }

    body.is-fullscreen {
      overflow: hidden;
      background: var(--bg-deep);
    }

    html:fullscreen,
    html:-webkit-full-screen {
      width: 100%;
      height: 100%;
      background: var(--bg-deep);
    }

    html:fullscreen body,
    html:-webkit-full-screen body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: var(--bg-deep);
    }

    body.is-fullscreen .app {
      width: 100%;
      height: 100%;
      min-height: 100%;
      grid-template-columns: auto 1fr;
    }

    body.is-fullscreen .stage {
      height: 100%;
      min-height: 0;
    }

    body.is-fullscreen .stage-inner {
      height: 100%;
    }

    body.is-fullscreen .wb-diagram {
      max-height: calc(100% - 5rem);
    }

    .water-body-view {
      position: absolute;
      inset: 0;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.5rem 2rem 4.75rem;
      overflow: auto;
      background: transparent;
    }

    .water-body-view.is-hidden {
      display: none !important;
    }

    #canvas-wrap.mode-water-body ~ .water-body-view {
      display: flex;
    }

    .cycle-significance-view {
      position: absolute;
      inset: 0;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      padding: 0.5rem 0.75rem;
      overflow: hidden;
      background: #0b1a2e;
    }

    .cycle-significance-view.is-hidden,
    .cycle-significance-view[hidden] {
      display: none !important;
    }

    .cycle-significance-image {
      display: block;
      width: 100%;
      height: 100%;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      object-position: center;
      filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.35));
    }

    .wb-layout {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
    }

    .wb-diagram {
      display: block;
      width: min(900px, 96%);
      height: auto;
      max-height: calc(100vh - 7rem);
    }

    .wb-scene {
      transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .wb-reveal {
      animation: wbReveal 0.5s ease-out both;
    }

    @keyframes wbReveal {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .wb-demo-btn {
      position: absolute;
      bottom: 46px;
      left: 50%;
      z-index: 6;
      transform: translateX(-50%);
      padding: 0.55rem 1.35rem;
      font-family: var(--font-body);
      font-size: 0.82rem;
      font-weight: 500;
      letter-spacing: 0.04em;
      color: var(--text);
      background: rgba(15, 25, 45, 0.88);
      border: 1px solid var(--border);
      border-radius: 999px;
      cursor: pointer;
      box-shadow: var(--shadow-glow);
      backdrop-filter: blur(10px);
      transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
    }

    .wb-demo-btn:hover {
      border-color: var(--cyan);
      color: var(--cyan);
      box-shadow: 0 0 20px rgba(61, 217, 255, 0.25);
    }

    .wb-demo-btn[hidden] {
      display: none !important;
    }

    .cycle-factor-panel {
      position: absolute;
      bottom: 54px;
      left: 50%;
      z-index: 6;
      transform: translateX(-50%);
      max-width: min(760px, 92%);
      padding: 0.65rem 0.85rem 0.75rem;
      background: rgba(12, 22, 40, 0.92);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      backdrop-filter: blur(10px);
      box-shadow: var(--shadow-glow);
    }

    .cycle-factor-panel[hidden] {
      display: none !important;
    }

    .cycle-factor-hint {
      position: absolute;
      bottom: 54px;
      left: 50%;
      z-index: 6;
      transform: translateX(-50%);
      max-width: min(520px, 92%);
      padding: 0.55rem 1.1rem;
      font-size: 0.8rem;
      color: rgba(200, 223, 245, 0.92);
      text-align: center;
      background: rgba(12, 22, 40, 0.88);
      border: 1px solid rgba(110, 181, 255, 0.28);
      border-radius: 999px;
      backdrop-filter: blur(10px);
      box-shadow: var(--shadow-glow);
      pointer-events: none;
    }

    .cycle-factor-hint[hidden] {
      display: none !important;
    }

    .cycle-factor-title {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--cyan);
      text-align: center;
      margin-bottom: 0.55rem;
    }

    .cycle-factor-list {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      justify-content: center;
    }

    .cycle-factor-chip {
      position: relative;
      padding: 0.35rem 0.65rem 0.35rem 0.5rem;
      background: rgba(8, 20, 40, 0.65);
      border: 1px solid rgba(110, 181, 255, 0.22);
      border-radius: 8px;
      font-size: 0.76rem;
      color: var(--text);
    }

    .cycle-factor-badge {
      position: absolute;
      top: -5px;
      right: -5px;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      border: 1px solid rgba(255, 255, 255, 0.35);
    }

    .cycle-factor-badge--pos {
      background: #2a9d6e;
      color: #fff;
    }

    .cycle-factor-badge--neg {
      background: #c94d4d;
      color: #fff;
    }

    .wb-txt {
      font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
      fill: #c8dff5;
    }

    .wb-txt-inner {
      font-size: 14px;
      font-weight: 600;
      fill: #ffffff;
      stroke: rgba(8, 18, 35, 0.62);
      stroke-width: 0.35px;
      paint-order: stroke fill;
    }

    .wb-txt-inner--land {
      font-size: 9px;
      font-weight: 600;
    }

    .wb-txt-out {
      font-size: 12px;
      fill: #ffffff;
    }

    .wb-txt-out--slice {
      font-size: 10px;
      fill: #ffffff;
    }

    .wb-txt-arrow {
      font-size: 12px;
      font-weight: 500;
      fill: #ffffff;
    }

    .wb-txt-list {
      font-size: 12px;
      fill: #ffffff;
    }

    .wb-txt-list-pct {
      font-size: 12px;
      font-weight: 600;
      fill: #ffffff;
    }

    .wb-fallback {
      color: #c8dff5;
      font-size: 15px;
      text-align: center;
    }

    #canvas-wrap.mode-water-body canvas,
    #canvas-wrap.mode-cycle-significance canvas {
      display: none !important;
    }

    @media (max-width: 900px) {
      .app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
      }

      .panel-column {
        width: 100%;
        max-width: none;
        min-width: 0;
      }

      .sidebar { max-height: 42vh; }

      .panel-toggle-btn {
        left: auto;
        right: 12px;
        top: auto;
        bottom: 12px;
        transform: none;
        border-radius: 8px;
        border-left: 1px solid var(--border);
        width: 36px;
        height: 36px;
      }
    }
