/**
 * CS2 购买绑定生成器 - 样式表
 * 版本: v87.0
 * 更新日志:
 * - 新增 @keyframes key-editing-glow 动画，用于实现按键在“编辑”状态下的橙色呼吸灯特效。
 * - 修改了 .key.selected 样式，使其默认显示蓝色呼吸灯（用于新绑定）。
 * - 新增 .key.selected.is-editing 复合选择器，将按键的背景和边框也修改为橙色，并应用新的橙色呼吸灯动画，以增强视觉反馈。
 */

/* ============================================= */
/* 动画定义 */
/* ============================================= */
@keyframes new-glow-animation {
    0% { box-shadow: 0 0 5px 0px var(--new-glow); }
    50% { box-shadow: 0 0 10px 3px var(--new-glow); }
    100% { box-shadow: 0 0 5px 0px var(--new-glow); }
}

@keyframes orange-breath {
    0% { background-color: var(--bg-card); box-shadow: 0 0 5px 0px transparent; }
    50% { background-color: var(--orange-breath-color); box-shadow: 0 0 12px 4px var(--t-color); }
    100% { background-color: var(--bg-card); box-shadow: 0 0 5px 0px transparent; }
}

@keyframes key-selected-glow {
    0% { box-shadow: 0 0 8px 1px var(--accent-color); }
    50% { box-shadow: 0 0 16px 4px var(--accent-color); }
    100% { box-shadow: 0 0 8px 1px var(--accent-color); }
}

@keyframes key-editing-glow {
    0% { box-shadow: 0 0 8px 1px var(--t-color); }
    50% { box-shadow: 0 0 16px 4px var(--t-color); }
    100% { box-shadow: 0 0 8px 1px var(--t-color); }
}


@keyframes wave-animation {
    from { background-position-x: 0; }
    to { background-position-x: -20px; } /* 必须是背景尺寸的负值 */
}

/* ============================================= */
/* 全局变量 / 主题颜色 (Light & Dark Themes) */
/* ============================================= */
:root {
    --bg-primary: #f0f2f5; --bg-secondary: #ffffff; --bg-card: #f7f7f7; --bg-hover: #e9ecef;
    --text-primary: #1a1a1a; --text-muted: #6c757d; --border-color: #dee2e6;
    --key-bg: #ffffff; --key-bg-disabled: #e9ecef; --key-text-disabled: #adb5bd;
    --key-shadow: 0 2px 0 #ced4da;
    --new-glow: #0d6efd;
    --orange-breath-color: #ffe8d1;
}
body.dark-mode {
    --bg-primary: #121212; --bg-secondary: #1e1e1e; --bg-card: #2a2a2a; --bg-hover: #343a40;
    --text-primary: #e0e0e0; --text-muted: #888888; --border-color: #333333;
    --key-bg: #444; --key-bg-disabled: #333; --key-text-disabled: #6c757d;
    --key-shadow: 0 2px 0 #222;
    --new-glow: #a2bfff;
    --orange-breath-color: #5e3d1e;
}
:root {
    --accent-color: #0d6efd; --warning-color: #dc3545; --success-color: #198754;
    --ct-color: #0d6efd; 
    --t-color: #fd7e14;
    --color-orange: #fd7e14;
    --color-purple: #6f42c1;
    --color-yellow: #ffc107;
    --color-cyan: #0dcaf0;
    --dark-gray: #6c757d;
}

/* ============================================= */
/* 基础 & 布局 */
/* ============================================= */
body { background-color: var(--bg-primary); color: var(--text-primary); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 20px; transition: background-color 0.3s, color 0.3s; }
.main-container { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr); gap: 20px; max-width: 1600px; margin: auto; align-items: start; }
.left-panel { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.right-panel { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 20px; box-sizing: border-box; }


/* ============================================= */
/* 键盘区域 (新布局) */
/* ============================================= */
.keyboard-controls { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 20px; position: relative; transition: opacity 0.3s, filter 0.3s; }
.keyboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.keyboard-tabs { display: flex; gap: 4px; background-color: var(--bg-primary); border-radius: 8px; padding: 4px; width: fit-content;}
.keyboard-tabs button { background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 8px 16px; cursor: pointer; border-radius: 6px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: bold; transition: background-color 0.2s, color 0.2s; }
.keyboard-tabs button.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color); /* 增加边框以统一外观 */
    border-radius: 8px;
    width: 42px;  /* 设置固定宽度 */
    height: 28px; /* 设置固定高度 */
    padding: 0;   /* 移除内边距 */
    display: flex; /* 使用flexbox来居中图标 */
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
    background-color: var(--bg-hover);
}

.keyboard-layout-wrapper {
    display: none;
    overflow: visible; 
    position: relative;
    width: 100%;
}
.keyboard-layout {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    grid-auto-rows: 42px;
    gap: 6px;
    width: 1100px;
}

.keyboard-layout-wrapper.active { display: block; }
.mouse-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.key {
    background-color: var(--key-bg);
    color: var(--text-primary);
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: var(--key-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-out;
    user-select: none;
    position: relative;
    box-sizing: border-box;
    padding: 5px;
    height: 100%;
}
.key:active:not(.default-disabled) { transform: translateY(2px); box-shadow: none; }

.key.selected {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.05);
    z-index: 10;
    animation: key-selected-glow 1.5s ease-in-out infinite;
}
.key.selected.is-editing {
    background-color: var(--t-color);
    border-color: var(--t-color);
    animation: key-editing-glow 1.5s ease-in-out infinite;
}

.key.bound { background-color: #a2bfff; color: var(--accent-color); border-color: #a2bfff; }
.key.default-disabled { background-color: var(--key-bg-disabled); color: var(--key-text-disabled); cursor: not-allowed; }
.key .key-main { font-weight: 500; }
.key .key-sub { color: var(--text-muted); font-size: 10px; }
.mouse-layout .key { grid-column: span 1; }

/* ============================================= */
/* 模式切换区域 */
/* ============================================= */
.mode-selector { display: flex; flex-wrap: wrap; gap: 4px; background-color: var(--bg-primary); border-radius: 8px; padding: 4px; width: fit-content; }
.mode-selector button { background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 8px 16px; cursor: pointer; border-radius: 6px; font-size: 14px; font-weight: bold; transition: background-color 0.2s, color 0.2s;}
.mode-selector button.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }


/* ============================================= */
/* 物品选择区域 */
/* ============================================= */
.items-container, .loadout-container, .commands-container, .custom-container { background-color: var(--bg-secondary); padding: 20px; border-radius: 10px; border: 1px solid var(--border-color); }
.items-container.disabled, .loadout-container.disabled, .commands-container.disabled, .custom-container.disabled { opacity: 0.5; pointer-events: none; }
.item-category h3 { border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; font-size: 1.1em; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 15px; }
.item-card { background-color: var(--bg-card); border-radius: 8px; padding: 10px; text-align: center; cursor: pointer; position: relative; overflow: hidden; border: 2px solid transparent; transition: all 0.2s; }
.item-card:hover { border-color: var(--accent-color); transform: translateY(-2px); }
.item-card.selected-item { border-color: var(--accent-color); transform: translateY(-2px) scale(1.03); box-shadow: 0 0 12px var(--accent-color); }
.item-card-side { position: absolute; top: 5px; left: 5px; font-size: 10px; font-weight: bold; padding: 2px 5px; border-radius: 3px; color: white; }
.item-card-side.ct { background-color: var(--ct-color); }
.item-card-side.t { background-color: var(--t-color); }
.item-card img { width: 100%; height: 60px; object-fit: contain; margin-bottom: 5px; }
.item-card .item-name { display: block; font-size: 13px; min-height: 2.4em; }
.item-card .item-price { color: var(--text-muted); font-size: 12px; }
.item-quantity {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: none; /* Hidden by default */
}

/* ============================================= */
/* 装备栏 & 指令 槽位区域 */
/* ============================================= */
.loadout-container, .commands-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}
.loadout-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.loadout-header {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
    text-align: center;
    font-size: 1.1em;
}
.loadout-box, .command-box {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.loadout-box:hover, .command-box:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}
.loadout-box.selected-item, .command-box.selected-item {
     border-color: #a2bfff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 12px #a2bfff;
}
/* Command Box Specifics */
.command-box {
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
}
.command-info {
    display: flex;
    flex-direction: column;
}
.command-label {
    font-weight: bold;
    color: var(--text-primary);
}
.command-description {
    font-size: 0.85em;
    color: var(--text-muted);
}

/* ============================================= */
/* 自定义指令区域 */
/* ============================================= */
.custom-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.custom-input-area {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
#custom-command-input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    /* CRITICAL FIXES FOR TEXTAREA */
    resize: vertical;
    min-height: 80px;
    white-space: pre-wrap; 
    overflow-wrap: break-word;
    overflow: auto;
}
#custom-command-submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: filter 0.2s, background-color 0.2s;
    align-self: flex-start;
    height: 42px; 
}
#custom-command-submit-btn:hover {
    filter: brightness(1.15);
}
.code-reference-container pre {
    background-color: var(--bg-card);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}
.code-reference-container code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--text-muted);
}


/* ============================================= */
/* 右侧绑定区域 */
/* ============================================= */
.right-panel { display: flex; flex-direction: column; }
.bind-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;}
.subtle-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; transition: color 0.2s, background-color 0.2s; }
.subtle-btn:hover:not(:disabled) { color: var(--text-primary); }
.subtle-btn:disabled { color: #555; cursor: not-allowed; text-decoration: none; }
.header-en {
    color: var(--text-muted);
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 8px;
}
.placeholder-en {
    font-size: 0.9em;
    color: var(--text-muted);
}
#toggle-view-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 500;
    text-decoration: none;
}
#toggle-view-btn:hover:not(:disabled) {
    background-color: var(--bg-hover);
}

#current-bind-display { margin-bottom: 15px; }
.bind-display-placeholder { border: 1px dashed var(--border-color); border-radius: 8px; padding: 20px; text-align: center; color: var(--text-muted); min-height: 80px; display: flex; flex-direction: column;align-items: center; justify-content: center; }
.current-bind-editor { display: flex; flex-direction: column; gap: 10px; }
.current-bind-header { font-size: 1.1em; font-weight: normal; }
.current-bind-items-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; list-style: none; min-height: 24px;}
.current-bind-items-list li { background: var(--bg-primary); color: var(--text-primary); padding: 4px 8px; border-radius: 4px; font-size: 12px; }
.current-total-price { text-align: right; font-weight: bold; font-size: 14px; margin-top: 10px;}
.current-total-price .ct-text { color: var(--ct-color); }
.current-total-price .t-text { color: var(--t-color); }
.add-to-bind-btn { width: 100%; padding: 12px; border-radius: 5px; border: none; cursor: pointer; font-size: 16px; background-color: var(--accent-color); color: white; margin-top: 10px; }
.add-to-bind-btn:disabled { background-color: #555; cursor: not-allowed; }
.current-bind-header .key-char { font-size: 1.25em; font-weight: bold; color: var(--accent-color); padding: 2px 8px; border-radius: 5px; background-color: var(--bg-primary); display: inline-block; }

.binds-list-container { position: relative; z-index: 1; } 
.right-panel-footer { padding-top: 20px; } 
.binds-list-container.code-view .bind-item-view.image-view { display: none; }
.binds-list-container.code-view .bind-item-view.code-view { display: flex; }
.bind-item { background: var(--bg-card); border-radius: 8px; margin-bottom: 10px; display: flex; align-items: stretch; transition: background-color 0.2s, box-shadow 0.3s; }
.bind-item.is-new { animation: new-glow-animation 2s ease-in-out infinite; }
.bind-item.is-editing {
    animation: orange-breath 2s ease-in-out infinite;
}
.bind-item:hover { background-color: var(--bg-hover); }
.bind-item-view { width: 100%; }

.bind-item-view.code-view { 
    display: none; 
    padding: 12px 15px;
    font-family: 'Courier New', Courier, monospace; 
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
    flex-grow: 1;
    text-align: left;
    align-items: center;
}

.bind-item-view.image-view { display: flex; padding: 10px; align-items: center; flex-grow: 1; gap: 15px; }
.bind-item-key { font-weight: bold; background: var(--bg-primary); color: var(--text-primary); padding: 5px 10px; border-radius: 5px; align-self: center; }
.bind-item-key.custom-key {
    font-size: 1.2em;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bind-item-content { flex-grow: 1; position: relative; }
.new-tag {
    position: absolute;
    top: -8px;
    right: 25px;
    background-color: var(--warning-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.bind-item-weapons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}
.bind-weapon-wrapper {
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 500;
}
.bind-weapon-wrapper::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: none;
}
.bind-weapon-wrapper.is-ct::before {
    background-color: var(--ct-color);
    display: block;
}
.bind-weapon-wrapper.is-t::before {
    background-color: var(--t-color);
    display: block;
}
.bind-item-weapons img {
    height: 32px;
    width: 100%;
    object-fit: contain;
}
.loadout-bind-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.loadout-icon {
    height: 32px;
    width: 32px;
    flex-shrink: 0;
}
.loadout-bind-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.bind-item-prices { font-size: 12px; margin-top: 8px; display: flex; gap: 15px;}
.price-tag { display: inline-flex; align-items: center; gap: 4px; }
.price-tag .team-icon { font-weight: bold; font-size: 10px; padding: 1px 4px; color: white; border-radius: 3px; }
.price-tag .team-icon.ct { background-color: var(--ct-color); }
.price-tag .team-icon.t { background-color: var(--t-color); }
.bind-item-actions { position: relative; }
.bind-item-menu-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 15px; }
.bind-item-menu { display: none; position: absolute; right: 0; top: 40px; background: #495057; border-radius: 5px; list-style: none; padding: 5px 0; margin: 0; z-index: 100; width: 100px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.bind-item-menu.active { display: block; color: white;}
.bind-item-menu li { padding: 8px 12px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px;}
.bind-item-menu li:hover { background-color: var(--accent-color); color:white; }
.bind-item-menu li i { width: 16px; text-align: center; }

.config-actions { display: flex; flex-direction: column; gap: 10px; }
.action-btn { padding: 12px; border-radius: 5px; border: 1px solid var(--border-color); cursor: pointer; font-size: 14px; font-weight: bold; width: 100%; transition: background-color 0.2s, filter 0.2s; }

.download-btn {
    background-color: var(--dark-gray);
    color: white;
    border-color: var(--dark-gray);
}
.download-btn:hover:not(:disabled) { filter: brightness(1.15); }
#copy-btn { background-color: var(--bg-card); color: var(--text-primary); }
#copy-btn:hover:not(:disabled) { background-color: var(--bg-hover); }

.reset-btn-container { text-align: center; margin-top: 15px; }
.action-btn:disabled { background-color: var(--key-bg-disabled); color: var(--key-text-disabled); border-color: var(--border-color);}
body.dark-mode .action-btn:disabled { background-color: #555; color: #888; border-color: #555;}
body.dark-mode #copy-btn:hover:not(:disabled) { background-color: var(--bg-hover); }

/* ============================================= */
/* Steam ID Finder Styles (更新) */
/* ============================================= */
.steam-finder-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}
.steam-finder-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding: 0;
    font-size: 1.2em;
    background: none;
    color: var(--text-primary);
}
.steam-finder-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
#steam-url-input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

#steam-url-input::placeholder {
    color: var(--text-muted);
}
#steam-search-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: filter 0.2s;
}
#steam-search-btn:hover {
    filter: brightness(1.15);
}
#steam-result-container {
    background-color: var(--bg-primary);
    border-radius: 6px;
    padding: 15px;
    min-height: 50px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-all;
}
.steam-result-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.steam-result-item strong {
    color: var(--text-primary);
    flex-shrink: 0;
    width: 110px;
}
.steam-result-item span {
    color: var(--text-muted);
    user-select: all;
}
.highlight-id {
    color: var(--accent-color);
    font-weight: bold;
    background-color: var(--bg-card);
    padding: 2px 4px;
    border-radius: 4px;
}
.steam-result-error {
    color: var(--warning-color);
    font-weight: bold;
}
.steam-path-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-muted);
}
.steam-path-info p {
    margin: 0 0 5px 0;
}
.steam-path-info strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}
/* ============================================= */
/* 拖动排序功能样式 (Drag & Drop Sorting Styles) */
/* ============================================= */

/* 绑定分类的容器 */
.bind-category-group {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

/* 分类标题 */
.bind-category-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--text-muted);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* 当一个分类成为有效的放置区域时的浅绿色高亮效果 */
.bind-category-group.drop-zone-active {
    background-color: rgba(144, 238, 144, 0.2); /* Light Green Highlight */
}
/* --- 样式修改：根据要求将分类边框和标题下划线变为虚线 --- */

/* 将“绑定”区域内的分类容器 和 Steam ID 查找框 的边框设置为虚线 */
.bind-category-group,
.steam-finder-box {
    border-style: dashed;
}

/* 将这些容器内标题的下划线也设置为虚线 */
.bind-category-group h3 {
    border-bottom-style: dashed;
}

/* 为 Steam ID 查找框的标题也添加虚线下划线 */
.steam-finder-box h3 {
    padding-bottom: 15px; /* 增加一些间距，使下划线效果更好看 */
    border-bottom: 1px dashed var(--border-color);
}

/* 正在被拖动的条目的样式 */
.bind-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transform: scale(1.02);
}

/* 用于指示放置位置的占位符样式 */
.drag-placeholder {
    background-color: rgba(130, 130, 130, 0.2);
    border: 2px dashed var(--text-muted);
    border-radius: 8px;
    margin-bottom: 10px;
    height: 60px; /* 您可以根据条目的平均高度调整 */
}
/* 修正：让自定义条目内容在同一行显示 */
.loadout-bind-display {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}
/* 时间戳样式，并将其推到最右侧 */
.bind-item-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto; /* 核心改动：自动左外边距 */
    padding-left: 10px; /* 增加一些间距 */
}

/* ============================================= */
/* FAQ Section & Collapsible Sections */
/* ============================================= */
.faq-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.collapsible-section, .faq-item {
    border-bottom: 1px solid var(--border-color);
}
.custom-container .collapsible-section:first-of-type {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}
.faq-container .faq-item:first-child {
    border-top: none;
}
.faq-item:last-child, .custom-container .collapsible-section:last-of-type { 
    border-bottom: none; 
}

.faq-question, .collapsible-header {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 15px 0;
    font-size: 1em;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}
.collapsible-header .collapsible-title {
    margin: 0;
    font-size: 1.1em;
}

.faq-question::after, .collapsible-header::after {
    content: '+';
    font-size: 22px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    font-weight: 300;
    padding: 0 5px;
}
.faq-question.active::after, .collapsible-header.active::after {
    transform: rotate(45deg);
}
.faq-answer, .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
.faq-answer p {
    margin: 0;
    padding: 0 0 18px 0;
    color: var(--text-muted);
    line-height: 1.6;
}
.collapsible-content .code-reference-container {
    padding-bottom: 18px;
}

/* ============================================= */
/* Links Container Styles (更新) */
/* ============================================= */
.links-container {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.link-item {
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    position: relative;
    padding-bottom: 5px;
    align-self: flex-start;
}
.link-item:hover {
    text-decoration: none;
}
.link-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-size: 20px 4px;
    background-repeat: repeat-x;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.3s, transform 0.3s;
}
.link-item:hover::after {
    opacity: 1;
    transform: translateY(0);
    animation: wave-animation 0.8s linear infinite;
}
.link-item.link-red:hover::after   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%23dc3545' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }
.link-item.link-orange:hover::after{ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%23fd7e14' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }
.link-item.link-yellow:hover::after{ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%23ffc107' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }
.link-item.link-green:hover::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%23198754' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }
.link-item.link-cyan:hover::after  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%230dcaf0' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }
.link-item.link-blue:hover::after  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%230d6efd' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }
.link-item.link-purple:hover::after{ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%236f42c1' stroke-width='2' d='M0 3.5c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3'/%3E%3C/svg%3E"); }

.link-item.link-red { color: var(--warning-color); }
.link-item.link-orange { color: var(--color-orange); }
.link-item.link-yellow { color: var(--color-yellow); }
.link-item.link-green { color: var(--success-color); }
.link-item.link-cyan { color: var(--color-cyan); }
.link-item.link-blue { color: var(--accent-color); }
.link-item.link-purple { color: var(--color-purple); }


/* ============================================= */
/* Global Tooltip & Modal */
/* ============================================= */
.tooltip { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); color: white; padding: 12px 24px; border-radius: 8px; z-index: 2000; opacity: 0; transition: opacity 0.3s, bottom 0.3s; pointer-events: none; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.tooltip.show { bottom: 30px; opacity: 1; }
.tooltip.success { background-color: var(--success-color); }
.tooltip.warning { background-color: var(--warning-color); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 3000; }
.modal-content { background-color: var(--bg-secondary); padding: 24px; border-radius: 8px; border: 1px solid var(--border-color); text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.modal-content p { margin: 0 0 20px 0; font-size: 16px; }
.modal-buttons { display: flex; gap: 10px; }
.modal-btn { padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; min-width: 80px; }
.modal-btn.confirm { background-color: var(--warning-color); color: white; }
.modal-btn.cancel { background-color: #6c757d; color: white; }
.info-box { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; }
.info-box h3 { margin-top: 0; }
.info-box p { color: var(--text-muted); line-height: 1.6; }
.info-box b { color: var(--text-primary); }
.info-box .understand-btn { background-color: var(--accent-color); border: none; color: white; padding: 10px 20px; border-radius: 5px; cursor: pointer; width: 100%; margin-top: 10px; }

/* --- Steam ID 加载动画样式 --- */
#steam-result-container.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px; /* 查询时给一个最小高度，防止塌陷 */
}

.steam-loader {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid rgba(150, 150, 150, 0.2);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: steam-spin 1s linear infinite;
}

@keyframes steam-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ============================================= */
/* 推广位样式 (Promo Space Styles) - 最终修复版 */
/* ============================================= */
.promo-container {
    display: flex;
    gap: 5px; /* 将默认的水平间距从 15px 减小到 10px */
    width: 100%;
    margin: -12px 0;
}

.promo-item {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 8px; /* 恢复一点圆角会更好看 */
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.promo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-mode .promo-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.promo-item a {
    display: block;
    line-height: 0;
}

.promo-item img {
    width: 100%;
    height: auto;
    display: block;
}
/* 在小屏幕上进一步减小广告间距 */
@media (max-width: 768px) {
    .promo-container {
        gap: 2px; /* 在手机等窄屏幕上，间距进一步缩小为 8px */
    }
}

/* ============================================= */
/* 广告开关样式 (Ad Toggle Styles) - 最终对齐版 */
/* ============================================= */

/* 右侧按钮的容器 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px; /* 稍微减小两个按钮的间距 */
}

/* 开关的容器 */
.ad-toggle-container {
    display: flex;
    align-items: center;
}

/* 新的开关主体样式 */
.ad-switch-new {
    position: relative;
    display: inline-block;
    width: 42px;  /* 宽度与颜色模式按钮保持一致 */
    height: 28px; /* 高度与颜色模式按钮保持一致 */
}

/* 隐藏原始的 checkbox */
.ad-switch-new input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* 开关的背景滑轨 */
.ad-slider-new {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #767676;
    transition: .4s;
    border-radius: 28px;
}

/* 开关的圆形滑块 */
.ad-slider-new:before {
    position: absolute;
    content: "";
    height: 22px; /* 根据新高度调整 */
    width: 22px;  /* 根据新高度调整 */
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* 开启状态下的样式 */
input:checked + .ad-slider-new {
    background-color: var(--accent-color);
}

input:checked + .ad-slider-new:before {
    transform: translateX(14px); /* 根据新宽度重新计算移动距离 */
}

/* 用于隐藏广告的控制类 (这个不变) */
.promo-container.ads-hidden {
    display: none;
}


/* 最终修复：移除主页按钮的下划线，解决黑点问题 */
.header-actions a[title="访问主页"] {
    text-decoration: none !important;
}
/* ============================================= */
/* Responsive Media Queries */
/* ============================================= */
@media (max-width: 1400px) { 
    .main-container {
        grid-template-columns: 1.5fr 1fr;
    }
}
@media (max-width: 1200px) { 
    .main-container { grid-template-columns: 1fr; } 
    .right-panel { height: auto; }
}
@media (max-width: 992px) { /* Adjusted breakpoint */
    body { padding: 10px; } 
    .main-container { gap: 10px; }
    .left-panel, .right-panel { padding: 15px; gap: 15px; }
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); } 
    .faq-question { font-size: 15px; }
}