/* 励磁方式三维接线演示 —— 样式表 */
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; overflow: hidden; height: 100%;
    background: #12141f; font-family: "Microsoft YaHei", sans-serif; color: #e0e0ff; }

  /* ============ 顶部模式切换 ============ */
  #topbar {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; padding: 10px 14px;
    background: rgba(20, 20, 40, 0.9);
    border: 1px solid #4a4a7a; border-radius: 12px;
    backdrop-filter: blur(10px); z-index: 10;
  }
  .mode-btn {
    padding: 9px 16px; border-radius: 8px; cursor: pointer;
    background: transparent; color: #aaaacc;
    border: 1px solid #4a4a7a; font-size: 13px;
    font-family: inherit; font-weight: 600;
    transition: all .22s ease; white-space: nowrap;
  }
  .mode-btn:hover { background: rgba(80, 120, 200, 0.15); color: #ddeeff; }
  .mode-btn.active {
    background: linear-gradient(135deg, #3a6ea5, #6a5acd);
    color: #ffffff; border-color: #7ec8ff;
    box-shadow: 0 0 14px rgba(126, 200, 255, 0.55);
  }
  .mode-btn.accent {
    color: #ffcf8a; border-color: #8a6a3a;
  }
  .mode-btn.accent:hover { background: rgba(220, 150, 60, 0.18); color: #ffe6b8; }
  .mode-btn.accent.on {
    background: linear-gradient(135deg, #a5522a, #d98a3a);
    color: #fff; border-color: #ffb066;
    box-shadow: 0 0 14px rgba(255, 150, 60, 0.6);
  }
  .sep { width: 1px; background: #3a3a5a; margin: 2px 4px; }

  /* ============ 左侧图例 ============ */
  #legend {
    position: fixed; top: 100px; left: 20px;
    background: rgba(20, 20, 40, 0.88);
    border: 1px solid #4a4a7a; border-radius: 10px;
    padding: 14px 18px; font-size: 13px; line-height: 1.9;
    backdrop-filter: blur(10px); min-width: 190px; max-width: 260px;
    transition: opacity .3s ease; z-index: 9;
  }
  #legend h3 { margin: 0 0 10px; font-size: 14px; color: #7ec8ff; font-weight: 700; }
  .legend-item { display: flex; align-items: center; gap: 9px; }
  .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
  .swatch { width: 22px; height: 4px; border-radius: 2px; flex-shrink: 0; }
  #legend .desc {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid #333a55;
    color: #9999bb; font-size: 12px; line-height: 1.6;
  }

  /* ============ 短路演示面板 ============ */
  #panel {
    position: fixed; right: 18px; bottom: 18px; width: 404px;
    background: rgba(18, 20, 34, 0.94);
    border: 1px solid #4a4a7a; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    backdrop-filter: blur(12px); z-index: 12;
    overflow: hidden;
  }
  #panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; cursor: pointer;
    background: linear-gradient(90deg, rgba(200,120,40,.25), rgba(200,120,40,.05));
    border-bottom: 1px solid #3a3a5a;
    font-size: 13px; font-weight: 700; color: #ffc98a; letter-spacing: .5px;
  }
  #panel-head .hint { font-weight: 400; font-size: 11px; color: #8a8aa8; margin-left: 8px; }
  #panel-toggle {
    background: transparent; border: 1px solid #5a5a7a; color: #aaaacc;
    width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 14px;
    line-height: 1; font-family: inherit;
  }
  #panel-body { padding: 10px 12px 12px; }
  #panel.collapsed #panel-body { display: none; }
  #chart { display: block; width: 100%; height: auto; border-radius: 8px; }
  #panel-ctrl {
    display: flex; align-items: center; gap: 8px; margin-top: 9px;
    font-size: 12px; color: #9a9abc; flex-wrap: wrap;
  }
  #panel-ctrl button {
    background: rgba(90,110,180,.2); border: 1px solid #4a5a8a; color: #cfe0ff;
    padding: 5px 12px; border-radius: 6px; cursor: pointer;
    font-family: inherit; font-size: 12px; font-weight: 600;
  }
  #panel-ctrl button:hover { background: rgba(110,140,220,.3); }
  #readout { color: #ffd9a8; font-variant-numeric: tabular-nums; }
  #panel-legend {
    display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: #9a9abc;
  }
  #panel-legend i {
    display: inline-block; width: 20px; height: 3px; border-radius: 2px;
    vertical-align: middle; margin-right: 6px;
  }

  /* ============ 底部提示 ============ */
  #hint {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    color: #5d5d7d; font-size: 12px; pointer-events: none; z-index: 8;
  }

  /* ============ 加载遮罩 ============ */
  #loading {
    position: fixed; inset: 0; display: flex;
    align-items: center; justify-content: center;
    background: #12141f; z-index: 100;
    transition: opacity .5s ease;
    font-size: 15px; color: #7ec8ff;
  }
  #loading.hidden { opacity: 0; pointer-events: none; }