/* === style block 1 === */

        /* 游戏管理相关样式 */
.game-settings-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 10px;
    /* 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f8f9fa;
}

.game-settings-list::-webkit-scrollbar {
    width: 4px;
}

.game-settings-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 2px;
}

.game-settings-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.game-settings-list::-webkit-scrollbar-thumb:hover {
    background: #3a5bd1;
}

.game-setting-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-gray);
}

.game-setting-item:last-child {
    border-bottom: none;
}

.game-setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    font-weight: 500;
}

.setting-value {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 50px;
    text-align: right;
}

.setting-help {
    color: #666;
    font-size: 0.7rem;
    cursor: help;
    margin-left: 5px;
}

.slider-container {
    flex: 0 0 auto;
    width: 120px;
    margin-left: auto;
}

.setting-slider {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: var(--light-gray);
    outline: none;
    -webkit-appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.setting-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}
/* 方案列表样式 */
.scheme-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 15px;
    /* 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f8f9fa;
}

.scheme-list::-webkit-scrollbar {
    width: 4px;
}

.scheme-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 2px;
}

.scheme-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.scheme-list::-webkit-scrollbar-thumb:hover {
    background: #3a5bd1;
}

.scheme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: background-color 0.2s;
}

.scheme-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.scheme-item.active {
    background-color: rgba(74, 107, 223, 0.1);
}

.scheme-item:last-child {
    border-bottom: none;
}

.scheme-name {
    font-weight: 500;
}

.scheme-date {
    font-size: 0.8rem;
    color: #666;
}
        /* 新增Tab切换样式 */
        .sidebar-tabs {
            display: flex;
            border-bottom: 1px solid var(--light-gray);
            margin-bottom: 15px;
        }

        .sidebar-tab {
            flex: 1;
            padding: 8px 5px;
            text-align: center;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.3s;
            font-size: 0.85rem;
            font-weight: 500;
        }

        .sidebar-tab.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
        }

        .sidebar-tab-content {
            display: none;
        }

        .sidebar-tab-content.active {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }
        /* 主窗口和同步按钮样式 */
.master-btn, .sync-toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px;
    border-radius: 3px;
    transition: background-color 0.2s;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.master-btn:hover, .sync-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.master-btn.active {
    background-color: rgba(255, 215, 0, 0.3);
    color: gold;
}

.sync-toggle-btn.active {
    background-color: rgba(0, 255, 0, 0.3);
    color: lightgreen;
}
        :root {
            --primary-color: #4a6bdf;
            --secondary-color: #f5f7fa;
            --text-color: #333;
            --light-gray: #e0e0e0;
            --border-radius: 8px;
            --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            --success-color: #28a745;
            --warning-color: #ffc107;
            --error-color: #dc3545;
            --sidebar-width: 350px;
            --window-width: 300px;   /* 由JS按列数与比例推导后回写 */
            --window-height: 540px;  /* 由JS按列数与比例推导后回写 */
            --window-ratio: 0.5625;  /* 宽高比例（宽/高），唯一的尺寸设置 */
            --columns: 2;
            --window-gap: 8px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--secondary-color);
            color: var(--text-color);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .container {
            display: flex;
            flex: 1;
            position: relative;
        }

        .sidebar-toggle {
            position: fixed;
            top: 8px;
            left: 8px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            cursor: pointer;
            z-index: 1002;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--box-shadow);
            transition: all 0.3s ease;
            font-size: 0.85rem;
        }

        .sidebar-toggle:hover {
            background-color: #3a5bd1;
        }

        /* 收起侧边栏时隐藏左侧分组标签条 */
        .account-tabs {
            display: none !important;
        }

.sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: var(--box-shadow);
    padding: 15px;
    transition: transform 0.3s ease;
    z-index: 1001;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f5f5f5;
}

/* 侧栏弹性布局：Tab/头部/拖拽区/按钮固定高度，列表自适应剩余高度，仅在内容超出时才出现滚动条 */
.sidebar > .sidebar-tabs,
.sidebar-tab-content.active > .sub-tabs,
.sidebar-tab-content.active > .script-header,
.sidebar-tab-content.active > .action-buttons,
.sidebar-tab-content.active > .drop-area,
.sidebar-tab-content.active > .group-tabs,
.sub-tab-content.active > .action-buttons {
    flex: 0 0 auto;
}

/* Webkit浏览器滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #3a5bd1;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:active {
    background: #2a4bc7;
}

.sidebar::-webkit-scrollbar-corner {
    background: #f5f5f5;
}

        .sidebar.collapsed {
            transform: translateX(calc(-1 * var(--sidebar-width)));
        }

        .main-content {
            flex: 1;
            padding: 5px;
            margin-left: var(--sidebar-width);
            transition: margin-left 0.3s ease;
            height: 100vh;
            overflow-y: auto;
            position: relative; /* 作为 ::before 水印的定位基准 */
        }

        /* 右侧主内容区背景水印：仿 src/renderer/bin/index.html:1523 */
        .main-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url(AiKing.png?v=5);
            background-position: center;
            background-repeat: no-repeat;
            background-size: auto;     /* 大屏保持原图尺寸，不被放大 */
            opacity: 0.2;
            pointer-events: none;
        }

        /* 小屏放不下时才缩放，避免被裁 */
        @media (max-width: 768px) {
            .main-content::before {
                background-size: contain;
            }
        }

        .main-content.expanded {
            margin-left: 0;
        }

        h1 {
            color: var(--primary-color);
            margin-bottom: 10px;
            font-weight: 600;
            text-align: center;
            font-size: 1.5rem;
        }

        .description {
            margin-bottom: 15px;
            color: #666;
            line-height: 1.4;
            text-align: center;
            font-size: 0.9rem;
        }

        .action-buttons {
            display: flex;
            gap: 3px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .drop-area {
            border: 2px dashed var(--light-gray);
            border-radius: var(--border-radius);
            margin-top:5px;
            padding: 5px;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            min-height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin-bottom: 10px;
        }

        .drop-area.highlight {
            border-color: var(--primary-color);
            background-color: rgba(74, 107, 223, 0.05);
        }

        .drop-area.error {
            border-color: var(--error-color);
            background-color: rgba(220, 53, 69, 0.05);
        }

        .drop-area p {
            margin-bottom: 10px;
            font-size: 0.9rem;
        }

        .file-input {
            display: none;
        }

        .btn {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: var(--border-radius);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            transition: background-color 0.3s;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .btn:hover {
            background-color: #3a5bd1;
        }

        .btn-secondary {
            background-color: white;
            color: var(--primary-color);
            border: 1px solid var(--primary-color);
        }

        .btn-secondary:hover {
            background-color: rgba(74, 107, 223, 0.1);
        }

        .btn-small {
            padding: 5px 10px;
            font-size: 0.8rem;
        }

        .btn-danger {
            background-color: var(--error-color);
            color: white;
        }

        .btn-danger:hover {
            background-color: #c82333;
        }

/* 如果需要修改其他按钮颜色，可以添加 */
.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

        .btn-warning {
            background-color: var(--warning-color);
            color: black;
        }

        .btn-warning:hover {
            background-color: #e0a800;
        }

.file-list {
    text-align: left;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 15px;
    /* 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f8f9fa;
}

.file-list::-webkit-scrollbar {
    width: 4px;
}

.file-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 2px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #3a5bd1;
}


        .file-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 0;
            border-bottom: 1px solid var(--light-gray);
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .file-item:hover {
            background-color: rgba(0, 0, 0, 0.03);
        }

        .file-item.active {
            background-color: rgba(74, 107, 223, 0.1);
        }

        .file-item:last-child {
            border-bottom: none;
        }

.file-info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.file-status.closed {
    background-color: #666;
}

.file-status.open {
    background-color: var(--success-color);
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* 增加宽度以补偿移除的序号 */
    font-size: 0.9rem;
}

        .file-size {
            color: #666;
            font-size: 0.8rem;
        }

        .drop-info {
            margin-top: 8px;
            font-size: 0.8rem;
            color: #666;
        }

        .script-section {
            margin-top: 10px;
            border-top: 1px solid var(--light-gray);
            padding-top: 5px;
        }

        .script-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 5px;
        }

        .script-title {
            font-weight: 600;
            color: var(--primary-color);
            font-size: 1rem;
        }

.script-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 10px;
    /* 滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f8f9fa;
}

.script-list::-webkit-scrollbar {
    width: 4px;
}

.script-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 2px;
}

.script-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.script-list::-webkit-scrollbar-thumb:hover {
    background: #3a5bd1;
}

.empty-hint {
    padding: 24px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
    line-height: 1.8;
}

.empty-hint i {
    color: var(--primary-color);
}

/* ===== 加载层（照抄 AI之王 src/renderer/loader.css + unified-loader.js 的 .hx-* 视觉） ===== */
.loader-overlay {
  --hx-primary: var(--primary-color, #4a6bdf);
  --hx-bg: var(--bg-secondary, #e9ecf2);
  --hx-panel: var(--bg-color, #f6f7fb);
  --hx-border: var(--border-color, #cfd5df);
  --hx-text: var(--text-secondary, #59636e);
  --hx-accent: var(--warning-color, #ffc107);
  --hx-ok: var(--success-color, #28a745);
  --hx-err: var(--error-color, #dc3545);
  --hx-primary-rgb: 74, 107, 223;
  --hx-core-rgb: 47, 71, 168;
  --hx-ok-rgb: 40, 167, 69;
  --hx-err-rgb: 220, 53, 69;
  --hx-arc: rgba(var(--hx-primary-rgb), 0.82);
  --hx-core: #2f47a8;
  --hx-orbit-blue: #5fb2e6;
  --hx-orbit-pink: #f0a3c3;
  --hx-orbit-blue-rgb: 95, 178, 230;
  --hx-orbit-pink-rgb: 240, 163, 195;

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--hx-bg);
  overflow: hidden;
  opacity: 1;
  transition: opacity .32s ease;
}

body.dark-theme .loader-overlay {
  --hx-primary: var(--primary-color, #5a7be4);
  --hx-bg: var(--bg-secondary, #1e293b);
  --hx-panel: var(--bg-color, #16213e);
  --hx-border: var(--border-color, #444);
  --hx-text: var(--text-secondary, #a0a0a0);
  --hx-accent: var(--warning-color, #ffc107);
  --hx-ok: var(--success-color, #20c997);
  --hx-err: var(--error-color, #dc3545);
  --hx-primary-rgb: 90, 123, 228;
  --hx-core-rgb: 90, 123, 228;
  --hx-ok-rgb: 32, 201, 151;
  --hx-err-rgb: 220, 53, 69;
  --hx-arc: var(--hx-primary);
  --hx-core: var(--hx-primary);
  --hx-orbit-blue: #a6ddf5;
  --hx-orbit-pink: #f7c3d8;
  --hx-orbit-blue-rgb: 166, 221, 245;
  --hx-orbit-pink-rgb: 247, 195, 216;
}

.loader-overlay::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 42%;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--hx-orbit-blue-rgb), 0.16) 0%, transparent 68%);
  pointer-events: none;
}

.hx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-overlay--inset { position: absolute; z-index: 5; }

.loader-overlay.hide { opacity: 0; pointer-events: none; }

.hx-splash {
  position: relative;
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  overflow: visible;
  background: url(AiKing.png?v=5) no-repeat center;
  background-size: 104px auto;
}

.hx-core { display: none; }

.hx-spine {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 176px;
  height: 176px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
  z-index: 1;
}
.loader-overlay.has-spine .hx-splash { width: 176px; height: 176px; }
.loader-overlay.has-spine .hx-spine {
  display: block;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  transform: none;
  z-index: 2;
}
.loader-overlay.has-spine .hx-splash > i { display: none; }
.loader-overlay.has-spine .hx-splash { background-image: none; }
.loader-overlay.has-spine .hx-status,
.loader-overlay.has-spine .hx-sub,
.loader-overlay.has-spine .hx-bar { display: none; }
.loader-overlay.has-spine::before { display: none; }
.loader-overlay.has-spine { background: #0a0e1c; }
html body #splash.loader-overlay.has-spine { background: #0a0e1c; }
.loader-overlay--inset.has-spine .hx-card { position: absolute; inset: 0; }
.loader-overlay--inset.has-spine .hx-splash { position: absolute; inset: 0; width: 100%; height: 100%; transform: none; }
.loader-overlay--inset.has-spine .hx-spine {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
}

.hx-wave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--hx-orbit-blue-rgb), 0.55);
  animation: hx-spin 9s linear infinite;
}

.hx-wave--2 {
  width: 196px;
  height: 196px;
  margin: -98px 0 0 -98px;
  border-style: solid;
  border-color: rgba(var(--hx-orbit-pink-rgb), 0.45);
  animation: hx-spin-rev 13s linear infinite;
}

.hx-wave--2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  margin-left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hx-orbit-pink);
  box-shadow: 0 0 10px var(--hx-orbit-pink), 0 0 2px #fff;
  animation: hx-dotpulse 2.4s ease-in-out infinite;
}

.hx-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(var(--hx-core-rgb), 0.82) 42%, transparent 72%);
  box-shadow: 0 0 16px 4px rgba(var(--hx-primary-rgb), 0.55);
  animation: hx-core-breathe 2.2s ease-in-out infinite;
}

.hx-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 230px;
  height: 230px;
  margin: -115px 0 0 -115px;
  border-radius: 50%;
  background: radial-gradient(circle,
      transparent 34%,
      rgba(var(--hx-orbit-blue-rgb), 0.22) 52%,
      rgba(var(--hx-orbit-pink-rgb), 0.10) 62%,
      transparent 74%);
  filter: blur(16px);
  animation: hx-breathe 4s ease-in-out infinite;
}

.hx-arc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      transparent 0%, rgba(var(--hx-orbit-blue-rgb), 0.82) 16%, transparent 36%,
      rgba(var(--hx-orbit-pink-rgb), 0.82) 58%, transparent 80%);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 60%, #000 73%, transparent 77%);
  mask: radial-gradient(circle, transparent 55%, #000 60%, #000 73%, transparent 77%);
  filter: blur(2.5px);
  animation: hx-spin 7s linear infinite;
}

.hx-head {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  animation: hx-spin 9s linear infinite;
}

.hx-head i {
  position: absolute;
  left: 50%;
  top: -3px;
  margin-left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hx-orbit-blue);
  box-shadow: 0 0 10px var(--hx-orbit-blue), 0 0 2px #fff;
  animation: hx-dotpulse 2.4s ease-in-out infinite;
}

.hx-status {
  display: none;
}

.hx-pulse {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--hx-ok);
  box-shadow: 0 0 0 3px rgba(var(--hx-ok-rgb), 0.18);
  animation: hx-pulse 1.5s ease-in-out infinite;
}

.loader-text {
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--hx-text);
}

.hx-sub {
  display: none;
  max-width: 300px;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
  color: var(--hx-text);
  opacity: .82;
}

.hx-bar {
  display: none;
}

.hx-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg,
      rgba(var(--hx-primary-rgb), 0.92),
      var(--hx-accent),
      rgba(var(--hx-primary-rgb), 0.68),
      rgba(var(--hx-primary-rgb), 0.92));
  background-size: 200% 100%;
  animation: hx-laserflow 2.2s linear infinite;
}

.loader-overlay.is-error .hx-pulse {
  background: var(--hx-err);
  box-shadow: 0 0 0 3px rgba(var(--hx-err-rgb), 0.18);
}

.loader-overlay.is-error .loader-text { color: var(--hx-err); }

.loader-overlay.is-error .hx-sub { color: var(--hx-err); opacity: .9; }

@keyframes hx-spin {
  to { transform: rotate(360deg); }
}

@keyframes hx-spin-rev {
  to { transform: rotate(-360deg); }
}

@keyframes hx-dotpulse {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

@keyframes hx-breathe {
  0%, 100% { opacity: .4; transform: scale(.96); }
  50% { opacity: .72; transform: scale(1.07); }
}

@keyframes hx-wave {
  0% { transform: scale(.35); opacity: .5; }
  70% { opacity: 0; }
  100% { transform: scale(1.75); opacity: 0; }
}

@keyframes hx-core-breathe {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.22); opacity: 1; }
}

@keyframes hx-halo {
  0%, 100% { transform: scale(.86); opacity: .5; }
  50% { transform: scale(1.06); opacity: .85; }
}

@keyframes hx-pulse {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes hx-sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

@keyframes hx-laserflow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@media (max-width: 340px) {
  .loader-overlay { gap: 16px; }
  .loader-overlay::before { width: 280px; height: 280px; margin: -140px 0 0 -140px; }
  .hx-card { gap: 14px; }
  .hx-splash { width: 110px; height: 110px; background-size: 76px auto; }
  .hx-spine { width: 140px; height: 140px; }
  .loader-overlay.has-spine .hx-splash { width: 140px; height: 140px; }
  .hx-arc { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .hx-wave { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .hx-wave--2 { width: 144px; height: 144px; margin: -72px 0 0 -72px; }
  .hx-head { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .hx-halo { width: 170px; height: 170px; margin: -85px 0 0 -85px; }
  .hx-bar { width: 160px; }
  .loader-text { font-size: 11.5px; }
}

@media (max-height: 260px) {
  .loader-overlay { gap: 12px; }
  .hx-card { gap: 14px; padding: 18px 24px 16px; }
  .hx-bar { display: none; }
}

/* 游戏窗口内的 loading 动画按窗口宽度等比缩放（容器查询），避免小窗里 halo/波浪超出窗口被裁切 */
@container (max-width: 280px) {
  .loader-overlay--inset:not(.has-spine) .hx-splash { transform: scale(.8); }
}
@container (max-width: 220px) {
  .loader-overlay--inset:not(.has-spine) .hx-splash { transform: scale(.62); }
}
@container (max-width: 170px) {
  .loader-overlay--inset:not(.has-spine) .hx-splash { transform: scale(.48); }
}
@container (max-width: 130px) {
  .loader-overlay--inset:not(.has-spine) .hx-splash { transform: scale(.36); }
}
@container (max-width: 100px) {
  .loader-overlay--inset:not(.has-spine) .hx-splash { transform: scale(.28); }
}

@media (prefers-reduced-motion: reduce) {
  .hx-arc, .hx-head, .hx-head i, .hx-core, .hx-halo, .hx-wave, .hx-wave--2, .hx-wave--2::after, .hx-pulse, .hx-bar-fill { animation: none; }
}

/* 强制加载层为暗色（与 AI之王 截图一致，不依赖管理器主题变量） */
.loader-overlay {
  background: radial-gradient(120% 90% at 50% 0%, #1e293b 0%, #0f1626 100%) !important;
  --hx-orbit-blue: #a6ddf5;
  --hx-orbit-pink: #f7c3d8;
  --hx-orbit-blue-rgb: 166, 221, 245;
  --hx-orbit-pink-rgb: 247, 195, 216;
  --hx-primary: #5a7be4;
  --hx-primary-rgb: 90, 123, 228;
}

/* 启动页淡出 / 窗口遮罩隐藏（沿用现有显示控制） */
.app-loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.window-loading.hidden {
  display: none;
}

/* window-content 作为进入游戏遮罩(--inset) 的定位上下文，并裁掉溢出；并作为容器查询上下文，供 loading 动画按窗口宽度缩放 */
.window-content {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
}

        .script-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 0;
            border-bottom: 1px solid var(--light-gray);
        }

        .script-item:last-child {
            border-bottom: none;
        }

        .script-info {
            flex-grow: 1;
            overflow: hidden;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .script-name {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 160px;
            font-size: 0.9rem;
        }

        .script-actions {
            display: flex;
            gap: 5px;
        }

        .script-checkbox {
            width: 16px;
            height: 16px;
        }

        .windows-container {
            text-align: left;
            height: 100%;
        }

        .windows-grid {
            display: grid;
            grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
            gap: var(--window-gap);
            justify-items: center;
        }

        .window-item {
            border: 1px solid var(--light-gray);
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: var(--box-shadow);
            /* 只过渡 transform/box-shadow（悬停上浮），不过渡 width/height/position：
               否则新建窗口按“加窗前列数”算一次尺寸、autoArrange 再按新列数改一次，
               transition:all 会把这次修正动画成“由大变小”。改为即时，直接以正确大小出现。 */
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            height: var(--window-height);
            isolation: isolate; /* 独立层叠上下文：窗口内高 z-index(加载遮罩等)不外溢盖住左侧栏 */
        }

        .window-item.highlighted {
            border: 2px solid var(--primary-color);
            box-shadow: 0 0 10px rgba(74, 107, 223, 0.5);
        }

        .window-item.fullscreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 1000;
            border-radius: 0;
            max-width: none;
        }

        /* ===== 布局（照搬手机端 SPLIT / GRID） =====
           大小窗 SPLIT：按游戏比例分宫格——小窗 1×1、大窗 3×3，4×4=16 宫格正好放 8 个窗（零空白）。
           宫格尺寸由 applyWindowLayout() 按游戏宽高比算成 px 后写入，轨道整体居中（边距留白但不拉伸窗口）。
           九宫格 GRID：均分宫格（沿用现有 --columns 排布） */
        .windows-grid.layout-preview {
            grid-template-columns: repeat(4, minmax(0, 1fr));
            grid-template-rows: repeat(4, minmax(0, 1fr));
            align-content: center;
            justify-content: center;
        }

        /* 只有一个窗口（没有缩略窗）时，主窗占满整行 */
        .windows-grid.layout-preview.no-thumbs {
            grid-template-columns: minmax(0, 1fr);
            grid-template-rows: minmax(0, 1fr);
        }

        /* 有侧边缩略窗（>4 个）：主窗在右下，左侧竖排补位 */
        .windows-grid.layout-preview.has-side-thumbs .window-item.is-main {
            grid-column: 2 / -1;
            grid-row: 2 / -1;
        }

        /* 游戏子Tab：优化 / 窗口 */
        .sub-tabs {
            display: flex;
            margin-bottom: 10px;
            border-bottom: 1px solid var(--light-gray);
        }
        .sub-tab {
            flex: 1;
            padding: 6px 5px;
            text-align: center;
            font-size: 13px;
            color: var(--text-color, #333);
            cursor: pointer;
            border-bottom: 2px solid transparent;
            user-select: none;
        }
        .sub-tab.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: 600;
        }
        .sub-tab-content { display: none; }
        .sub-tab-content.active {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }

        .window-item {
            position: relative;
        }

        /* 主窗：跨满整行（大小窗形态下按子类型细分定位） */
        .window-item.is-main {
            grid-column: 1 / -1;
        }

        .windows-grid.layout-preview:not(.has-side-thumbs):not(.no-thumbs) .window-item.is-main {
            grid-row: 2 / -1;
        }

        .windows-grid.layout-preview.no-thumbs .window-item.is-main {
            grid-row: 1 / -1;
        }

        /* 缩略窗：占满 1×1 宫格（宫格比例=屏幕比例），隐藏标题栏，整窗可点击切主窗 */
        .window-item.is-thumb {
            width: 100% !important;
            height: 100% !important;
            max-width: none;
            min-width: 0;
        }

        .windows-grid.layout-preview .window-item.is-thumb {
            grid-row: 1;
        }

        .window-item.is-thumb .window-header {
            display: none;
        }

        /* 缩略窗不吃指针事件，改由覆盖层接管点击（切主窗） */
        .window-item.is-thumb .window-content {
            pointer-events: none;
            /* 标题栏已隐藏，内容区要占满整个缩略窗 */
            height: 100%;
        }

        .window-item.is-thumb::after {
            content: '';
            position: absolute;
            inset: 0;
            cursor: pointer;
            background: transparent;
            z-index: 1;
        }

        .window-item.is-thumb.is-active-thumb {
            border: 2px solid var(--primary-color);
        }

        /* 缩略窗顶部信息条：名称 + 主控图标 + 关闭按钮 */
        .thumb-overlay {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 14px;
            padding: 0 2px;
            background: rgba(74, 107, 223, 0.55);
            color: #fff;
            align-items: center;
            gap: 2px;
            font-size: 9px;
            line-height: 1;
            z-index: 2;
            pointer-events: auto;
        }

        .window-item.is-thumb .thumb-overlay {
            display: flex;
        }

        .thumb-name {
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
        }

        .thumb-master-icon {
            display: none;
            align-items: center;
            justify-content: center;
            width: 10px;
            height: 10px;
            color: gold;
            font-size: 8px;
            flex-shrink: 0;
        }

        .thumb-close-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 10px;
            height: 10px;
            padding: 0;
            margin: 0;
            border: none;
            background: transparent;
            color: #fff;
            font-size: 8px;
            line-height: 1;
            cursor: pointer;
            flex-shrink: 0;
            border-radius: 2px;
        }

        .thumb-close-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            color: #fff;
        }

        /* 主控窗口：金色实线边框（画在窗口外圈，不遮挡游戏画面） */
        .window-item.is-master {
            border: 2px solid #d29922;
            box-shadow: 0 0 8px rgba(210, 153, 34, 0.6);
        }

        .window-item:hover {
            transform: translateY(-3px);
        }

        .window-header {
            background-color: var(--primary-color);
            color: white;
            padding: 5px 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            min-height: 30px;
        }

        .window-title-container {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            overflow: hidden;
        }

        .window-index {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: white;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: bold;
            flex-shrink: 0;
        }

        .window-title {
            font-weight: 500;
            font-size: 0.85rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

        .window-actions {
            display: flex;
            gap: 5px;
        }
/* 新页面打开按钮样式 */
.external-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px;
    border-radius: 3px;
    transition: background-color 0.2s;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.external-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 移动端优化 */
@media (max-width: 768px) {
    :root {
        --window-gap: 3px;
    }
    /* 不再按视口宽度无脑隐藏「刷新 / 外部打开」：改成由 JS 按窗口实际宽度判断
       放不放得下（见 fitWindowActions），手机上大窗同样要能看到这两个按钮。 */
    .external-btn {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* PC（宽屏）隐藏「布局」设置项：大小窗只在手机小窗才有意义 */
@media (min-width: 769px) {
    .layout-mode-selector-wrapper {
        display: none;
    }
}

@media (max-width: 480px) {
    .external-btn {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
}
        .window-content {
            height: calc(100% - 30px);
            background-color: #f9f9f9;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .window-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }
#closeSchemePanelBtn,#closeSettingsBtn{
                color: #3053ff;
}
        .icon-btn {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            font-size: 0.75rem;
            padding: 3px;
            border-radius: 3px;
            transition: background-color 0.2s;
            width: 22px;
            height: 22px;
            /* 不被压缩：否则窗口变窄时按钮被挤小，JS 量到的宽度偏小、判断不出"放不下" */
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .icon-btn:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .settings-panel, .script-panel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            z-index: 1003;
            width: 500px;
            max-width: 90vw;
            max-height: 90vh;
            overflow-y: auto;
            display: none;
        }

        .settings-panel.active, .script-panel.active {
            display: block;
        }

        .settings-header, .script-header-panel {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--light-gray);
        }

        .settings-title, .script-title-panel {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--primary-color);
        }

        .settings-content, .script-content {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .setting-item, .script-item-panel {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .setting-label, .script-label {
            font-weight: 500;
        }

        .setting-input {
            width: 110px;
            padding: 5px 10px;
            border: 1px solid var(--light-gray);
            border-radius: var(--border-radius);
        }

        /* 布局区数字输入框：与滑块容器对齐 */
        #layoutSettings .setting-input {
            width: 100%;
            box-sizing: border-box;
            padding: 4px 8px;
            text-align: right;
        }

        /* 宽高比例：宽 : 高 */
        .ratio-inputs {
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 0 0 auto;
            width: 120px;
            margin-left: auto;
        }

        #layoutSettings .ratio-inputs .setting-input {
            flex: 1;
            min-width: 55px;
            text-align: center;
            padding: 4px 4px;
        }

        .ratio-colon {
            color: var(--text-color);
            font-weight: 600;
        }

        .layout-mode-selector {
            display: flex;
            gap: 6px;
            margin-left: auto;
        }

        .layout-mode-btn {
            padding: 5px 10px;
            border: 1px solid var(--light-gray);
            border-radius: var(--border-radius);
            background-color: #fff;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            color: var(--text-color);
            font-size: 0.85rem;
        }

        .layout-mode-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .layout-mode-btn.active {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
        }

        .sort-mode-selector {
            display: flex;
            gap: 6px;
            margin-left: auto;
        }

        .sort-mode-btn {
            padding: 5px 10px;
            border: 1px solid var(--light-gray);
            border-radius: var(--border-radius);
            background-color: #fff;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            color: var(--text-color);
            font-size: 0.85rem;
        }

        .sort-mode-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .sort-mode-btn.active {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
        }

        .setting-item.disabled {
            opacity: 0.5;
            pointer-events: none;
        }

        /* 布局区禁用态（非九宫格形态下"排序方式/每行数量"不生效） */
        .game-setting-item.disabled {
            opacity: 0.5;
            pointer-events: none;
        }

        .script-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--light-gray);
            border-radius: var(--border-radius);
            font-family: monospace;
            resize: vertical;
            min-height: 120px;
        }

        .script-name-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--light-gray);
            border-radius: var(--border-radius);
        }

        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1002;
            display: none;
        }

        .overlay.active {
            display: block;
        }

        /* 自定义确认弹窗 */
        .custom-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 3000;
            display: none;
            align-items: center;
            justify-content: center;
        }

        .custom-modal-overlay.active {
            display: flex;
        }

        .custom-modal {
            background: #fff;
            border-radius: 8px;
            padding: 20px;
            width: 420px;
            max-width: 90%;
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
        }

        .custom-modal-message {
            margin-bottom: 18px;
            line-height: 1.6;
            color: var(--text-color);
            white-space: normal;
            word-break: break-all;
            overflow-wrap: break-word;
        }

        .custom-modal-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        footer {
            margin-top: 20px;
            color: #888;
            font-size: 0.8rem;
            text-align: center;
        }

      /* 账号Tab列表样式 */
.account-tabs {
    position: fixed;
    top: 40px;
    left: 0;
    width: 50px;
    height: calc(100vh - 60px); /* 设置固定高度 */
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto; /* 添加垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动 */
    padding: 2px;
    transition: all 0.3s ease;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.1);
}

/* Webkit浏览器滚动条样式 */
.account-tabs::-webkit-scrollbar {
    width: 4px;
}

.account-tabs::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.account-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.account-tabs::-webkit-scrollbar-thumb:hover {
    background: #3a5bd1;
}

.account-tabs.active {
    display: flex;
}

.account-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0px;
    margin-bottom: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* 防止标签被压缩 */
}

/* 移动端优化 */
@media (max-width: 768px) {
    .account-tabs {
        width: 45px;
        height: calc(100vh - 50px);
    }
}

@media (max-width: 480px) {
    .account-tabs {
        width: 40px;
        height: calc(100vh - 45px);
    }
    
    .account-tab {
        padding: 3px 0;
        margin-bottom: 4px;
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .account-tabs {
        height: calc(100vh - 40px);
    }
}

        .account-tab:hover {
            background-color: rgba(74, 107, 223, 0.2);
        }

        .account-tab.active {
            background-color: rgba(74, 107, 223, 0.3);
        }

        .account-number {
            font-size: 1rem;
            font-weight: bold;
            margin-bottom: 2px;
            width: 100%;
            text-align: center;
        }

        .account-number.online {
            color: var(--success-color);
        }

        .account-number.offline {
            color: var(--error-color);
        }

        .account-tooltip {
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            background-color: #333;
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 0.8rem;
            white-space: nowrap;
            z-index: 1001;
            display: none;
            margin-left: 10px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        .account-tab:hover .account-tooltip {
            display: block;
        }
/* 在 .file-actions 样式附近添加 */
.file-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* 文件操作图标按钮样式 */
.file-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 修改开始按钮颜色 */
.file-icon-btn.open {
    color: #28a745; /* 保持绿色 */
    border: 1px solid #28a745;
}

.file-icon-btn.open:hover {
    background-color: rgba(40, 167, 69, 0.1);
}

.file-icon-btn.delete {
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.file-icon-btn.delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* 停止按钮（开启后替换打开按钮） */
.file-icon-btn.stop {
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.file-icon-btn.stop:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* 修改显示名称按钮 */
.file-icon-btn.edit {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.file-icon-btn.edit:hover {
    background-color: rgba(74, 107, 223, 0.1);
}

/* 拖拽排序 / 拖到分组 */
.file-item.dragging {
    opacity: 0.5;
}

.file-item.drag-over {
    border-top: 2px solid var(--primary-color);
}

.group-tab.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: 1px;
}

.custom-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    margin-bottom: 14px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
}

.file-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-icon-btn:disabled:hover {
    background-color: transparent;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .file-icon-btn {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .file-icon-btn {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}
        /* 移动端优化 */
        @media (max-width: 1024px) {
            .sidebar {
                width: 300px;
            }
            
            .main-content {
                margin-left: 300px;
            }
        }

        @media (max-width: 768px) {
            :root {
                --columns: 1;
            }
            
.sidebar {
        width: 300px;
        /* 移动端滚动条更细 */
        scrollbar-width: none; /* Firefox隐藏 */
    }
              .sidebar::-webkit-scrollbar {
        width: 3px;
    }
     .sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    .file-list, .script-list, .game-settings-list, .scheme-list {
        scrollbar-width: none; /* Firefox隐藏 */
    }
    
    .file-list::-webkit-scrollbar,
    .script-list::-webkit-scrollbar,
    .game-settings-list::-webkit-scrollbar,
    .scheme-list::-webkit-scrollbar {
        width: 2px;
    }
            .main-content {
                margin-left: 300px;
                padding: 5px;
            }
            
            .window-item.fullscreen {
                height: 100vh;
            }
            
            .action-buttons {
                justify-content: center;
            }
            
            .account-tabs {
                width: 40px;
            }
            
            .account-number {
                font-size: 0.9rem;
            }
            
            .window-header {
                padding: 4px 8px;
            }
            
            .window-title {
                font-size: 0.8rem;
            }
            
            .icon-btn {
                width: 20px;
                height: 20px;
                font-size: 0.7rem;
            }
        }

        @media (max-width: 480px) {
.sidebar {
width: 80%;
max-width: none;
background: rgba(255, 255, 255, 0.5);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
        /* 移动端隐藏滚动条，使用原生滚动 */
        scrollbar-width: none;
    }
    
    .sidebar::-webkit-scrollbar {
        display: none;
    }
    
    .file-list, .script-list, .game-settings-list, .scheme-list {
        scrollbar-width: none;
    }
    
    .file-list::-webkit-scrollbar,
    .script-list::-webkit-scrollbar,
    .game-settings-list::-webkit-scrollbar,
    .scheme-list::-webkit-scrollbar {
        display: none;
    }
            
            .sidebar.collapsed {
                transform: translateX(-100%);
            }
            
            .main-content {
                margin-left: 0;
                padding: 5px;
            }
            
            .window-item {
                width: 100%;
                margin: 0 auto;
            }
            
            .action-buttons {
                flex-direction: row;
                flex-wrap: nowrap;
                justify-content: center;
            }
            
            .btn {
                /* width: 100%; */
                justify-content: center;
            }
            
            .account-tabs {
                width: 35px;
            }
            
            .account-number {
                font-size: 0.8rem;
            }
            
            .window-header {
                padding: 3px 6px;
                min-height: 28px;
            }
            
            .window-title {
                font-size: 0.75rem;
            }
            
            .icon-btn {
                width: 18px;
                height: 18px;
                font-size: 0.65rem;
            }
        }

        /* 横屏优化 */
        @media (max-height: 500px) and (orientation: landscape) {
            .sidebar {
                height: 100vh;
                overflow-y: auto;
            }
            
            .file-list, .script-list {
                max-height: 150px;
            }
            
            .window-item {
                height: calc(100vh - 40px);
            }
            
            .account-tabs {
                height: calc(100vh - 40px);
            }
        }
/* 确保分组按钮区域的按钮大小一致 */
.group-tabs .btn-small {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
/* 滚动条动画效果 */
.sidebar::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb,
.script-list::-webkit-scrollbar-thumb,
.game-settings-list::-webkit-scrollbar-thumb,
.scheme-list::-webkit-scrollbar-thumb {
    transition: all 0.3s ease;
}
/* 平滑滚动效果 */
.sidebar,
.file-list,
.script-list,
.game-settings-list,
.scheme-list,
.account-tabs {
    scroll-behavior: smooth;
}

/* 移动端优化滚动性能 */
@media (max-width: 768px) {
    .sidebar,
    .file-list,
    .script-list,
    .game-settings-list,
    .scheme-list,
    .account-tabs {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
}
/* 滚动时的高亮效果 */
.sidebar:focus-within::-webkit-scrollbar-thumb {
    background: #3a5bd1;
    box-shadow: 0 0 4px rgba(74, 107, 223, 0.5);
}
/* 分组标签样式 */
.group-tab {
    padding: 4px 8px;
    background-color: transparent;
    border: 2px solid;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    user-select: none;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 15px;
    align-items: center;
}

.group-tab:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.group-tab.active {
    color: white !important;
    transform: scale(1.05);
}

.group-tab.editing {
    background-color: #fff3cd;
    border-color: var(--warning-color) !important;
}

.group-edit-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: inherit;
    width: 80px;
    padding: 0;
    font-weight: bold;
    text-align: center;
}

/* 文件状态圆框样式 */
.file-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
    background-color: #666; /* 默认关闭状态颜色 */
}

.file-status.open {
    background-color: var(--success-color); /* 打开状态颜色 */
}

.file-status.closed {
    background-color: #666; /* 关闭状态颜色 */
}

/* 窗口序号样式 */
.window-index {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    flex-shrink: 0;
    border: 1px solid var(--primary-color); /* 默认边框 */
}

/* 窗口边框样式 */
.window-item {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    /* 只过渡 transform/box-shadow：过渡 width/height 会把“建窗后修正尺寸”动画成大小变化 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: var(--window-height);
}
    