/* style.css */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a2e; /* 深色背景 */
    color: #e0e0e0; /* 浅色文字 */
    overflow-x: hidden; /* 防止水平滚动条 */
}

.app-container {
    display: flex; /* 使用 Flexbox 布局 */
    min-height: 100vh; /* 确保容器至少占满视口高度 */
}

/* 侧边栏样式 */
.sidebar {
    width: 60px; /* 初始折叠宽度 */
    background-color: #2b2b40; /* 侧边栏深色背景 */
    color: #fff;
    transition: width 0.3s ease; /* 平滑过渡动画 */
    flex-shrink: 0; /* 防止侧边栏被压缩 */
    overflow: hidden; /* 隐藏超出宽度的内容，包括文本 */
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
}

.sidebar.active {
    width: 200px; /* 展开后的宽度 */
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 15px;
    margin-bottom: 20px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2em;
    white-space: nowrap; /* 防止文本换行 */
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.3s ease;
}

.sidebar.active .sidebar-header h3 {
    opacity: 1; /* 展开时显示 */
    margin-left: 10px; /* 展开时与按钮的间距 */
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

/* 导航样式 */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: flex; /* 使用 flex 让图标和文字对齐 */
    align-items: center;
    color: #e0e0e0;
    text-decoration: none;
    padding: 10px 15px;
    white-space: nowrap; /* 防止文本换行 */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: #4a4a6e;
    color: #fff;
}

/* 图标样式 */
.sidebar-nav a i {
    margin-right: 0; /* 折叠时图标不显示右边距 */
    font-size: 1.2em;
    width: 30px; /* 固定图标宽度，保持对齐 */
    text-align: center;
    transition: margin-right 0.3s ease;
}

/* 文本样式 (默认隐藏，展开时显示) */
.sidebar-nav a span {
    opacity: 0; /* 默认隐藏文本 */
    transition: opacity 0.3s ease;
}

/* 侧边栏展开时 */
.sidebar.active .sidebar-nav a i {
    margin-right: 15px; /* 展开时图标和文字的间距 */
}

.sidebar.active .sidebar-nav a span {
    opacity: 1; /* 展开时显示文本 */
}

/* 主内容区域样式 */
.content-area {
    flex-grow: 1; /* 占据剩余空间 */
    padding: 20px;
    transition: margin-left 0.3s ease; /* 配合侧边栏折叠/展开 */
}

/* ====== 密码门样式 ====== */
.password-gate-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: #2b2b40;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.password-gate-container h2 {
    color: #8be9fd; /* 标题颜色 */
    margin-bottom: 30px;
    font-size: 1.8em;
}

.password-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #3a3a5e;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #6272a4; /* 边框颜色 */
}

.location-name {
    font-weight: bold;
    color: #f1fa8c; /* 地点名称颜色 */
    font-size: 1.1em;
}

.password-text {
    font-family: 'Consolas', 'Monaco', monospace; /* 等宽字体 */
    color: #50fa7b; /* 密码文字颜色 */
    font-size: 1.1em;
    word-break: break-all; /* 防止长密码溢出 */
}

.error-message {
    color: #ff5555; /* 错误信息颜色 */
    background-color: #4a3a3a;
    padding: 10px;
    border-radius: 5px;
    margin-top: 20px;
    font-size: 0.9em;
}

.refresh-btn {
    background-color: #ff79c6; /* 刷新按钮颜色 */
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 30px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.refresh-btn:hover {
    background-color: #bd4398;
    transform: translateY(-2px);
}

/* ====== 随机生成器页面容器 ====== */
.random-generator-container {
    max-width: 900px; /* 稍微增加最大宽度 */
    margin: 40px auto;
    padding: 40px; /* 增加内边距 */
    background-color: #1f2a38; /* 更深的背景色，与侧边栏区分 */
    border-radius: 12px; /* 稍微圆润的边角 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6); /* 更明显、更深邃的阴影 */
    text-align: center;
    border: 1px solid #3d4a5c; /* 增加一个细边框 */
}

.random-generator-container h2 {
    color: #00e6e6; /* 更亮的青色，突出标题 */
    margin-bottom: 15px;
    font-size: 2.2em; /* 标题更大 */
    text-shadow: 0 0 8px rgba(0, 230, 230, 0.5); /* 标题发光效果 */
}

.random-generator-container p {
    color: #b0c4de; /* 柔和的浅蓝色，更易读 */
    margin-bottom: 40px; /* 增加段落与内容区域的间距 */
    font-size: 1.1em;
}

/* ====== 生成器网格布局 ====== */
.generator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* 调整列宽以适应更宽的布局 */
    gap: 25px; /* 增加网格间距 */
    margin-bottom: 40px;
}

.generator-item {
    background-color: #2a3a4c; /* 项目背景色 */
    padding: 20px 25px; /* 增加内边距 */
    border-radius: 8px;
    border: 1px solid #4a6a8a; /* 边框更明显 */
    text-align: left;
    display: flex;
    flex-direction: column; /* 标签和值垂直排列 */
    justify-content: center; /* 垂直居中 */
    align-items: flex-start; /* 左对齐 */
    min-height: 80px; /* 确保高度一致且足够 */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; /* 添加悬停动画 */
    position: relative; /* 用于伪元素或额外装饰 */
    overflow: hidden; /* 隐藏超出边界的内容 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* 项目阴影 */
}

.generator-item:hover {
    transform: translateY(-5px); /* 悬停时上浮 */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); /* 悬停时阴影更深 */
    border-color: #00e6e6; /* 悬停时边框变亮 */
}

.generator-item.full-width {
    grid-column: 1 / -1; /* 秘密任务占据整行 */
    min-height: 100px; /* 秘密任务可以更高一些 */
}

.category-label {
    font-weight: bold;
    color: #90ee90; /* 标签使用亮的绿色 */
    margin-bottom: 8px; /* 标签与值之间的间距 */
    font-size: 1.1em;
    text-transform: uppercase; /* 标签大写 */
    letter-spacing: 1px; /* 增加字母间距 */
}

.generated-value {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #e0f2f7; /* 值使用更亮的浅蓝色 */
    font-size: 1.6em; /* 值更大 */
    flex-grow: 1;
    word-break: break-all;
    display: block; /* 确保值独占一行 */
    line-height: 1.2;
}

/* ====== 强调核心项目样式 (干员，头盔，护甲，武器) ====== */
/* 可以通过在 HTML 中添加一个特定类来更精确控制，例如 <div class="generator-item highlight-item"> */
/* 这里我们根据内容进行选择，但更推荐使用类 */

/* 干员 */
.generator-item:has(.category-label:contains("干员")) {
    border-color: #00e6e6; /* 亮青色边框 */
    box-shadow: 0 0 15px rgba(0, 230, 230, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3); /* 发光效果 */
    background-color: #263a4a; /* 稍亮的背景 */
}
.generator-item:has(.category-label:contains("干员")) .category-label {
    color: #00e6e6; /* 标签颜色也变亮 */
}
.generator-item:has(.category-label:contains("干员")) .generated-value {
    font-size: 1.8em; /* 字体更大 */
    color: #ffffff; /* 纯白色 */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7); /* 轻微发光 */
}

/* 头盔 */
.generator-item:has(.category-label:contains("头盔")) {
    border-color: #ffcc00; /* 亮黄色边框 */
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
    background-color: #3b3a2a; /* 稍亮的背景 */
}
.generator-item:has(.category-label:contains("头盔")) .category-label {
    color: #ffcc00;
}
.generator-item:has(.category-label:contains("头盔")) .generated-value {
    font-size: 1.8em;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

/* 护甲 */
.generator-item:has(.category-label:contains("护甲")) {
    border-color: #ff6600; /* 亮橙色边框 */
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
    background-color: #4a3a2a; /* 稍亮的背景 */
}
.generator-item:has(.category-label:contains("护甲")) .category-label {
    color: #ff6600;
}
.generator-item:has(.category-label:contains("护甲")) .generated-value {
    font-size: 1.8em;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

/* 武器 */
.generator-item:has(.category-label:contains("武器")) {
    border-color: #ff00ff; /* 亮品红色边框 */
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.3);
    background-color: #4a2a4a; /* 稍亮的背景 */
}
.generator-item:has(.category-label:contains("武器")) .category-label {
    color: #ff00ff;
}
.generator-item:has(.category-label:contains("武器")) .generated-value {
    font-size: 1.8em;
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}


/* ====== 随机生成按钮 ====== */
.generate-btn {
    background: linear-gradient(45deg, #ff79c6, #ff5555); /* 渐变色按钮 */
    color: #fff;
    border: none;
    padding: 15px 35px; /* 按钮更大 */
    border-radius: 30px; /* 更圆润的按钮 */
    font-size: 1.2em; /* 按钮文字更大 */
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease; /* 更平滑的动画 */
    box-shadow: 0 5px 15px rgba(255, 121, 198, 0.4); /* 按钮阴影 */
    letter-spacing: 1px;
    text-transform: uppercase;
}

.generate-btn:hover {
    background: linear-gradient(45deg, #ff5555, #ff79c6); /* 悬停时渐变方向反转 */
    transform: translateY(-3px) scale(1.02); /* 悬停时上浮并轻微放大 */
    box-shadow: 0 8px 20px rgba(255, 121, 198, 0.6); /* 悬停时阴影更明显 */
}

/* ====== 随机武器干员重构页 ====== */
.loadout-page {
    max-width: 1380px;
    margin: 0 auto;
    padding: 18px 0 36px;
    color: #eff6ff;
}

.loadout-hero,
.control-card,
.loadout-results {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(124, 151, 185, 0.22);
    background:
        radial-gradient(circle at top right, rgba(65, 184, 213, 0.15), transparent 30%),
        linear-gradient(145deg, rgba(15, 26, 42, 0.96), rgba(10, 18, 32, 0.94));
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.loadout-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 28px 30px;
    border-radius: 28px;
}

.loadout-hero::after,
.control-card::after,
.loadout-results::after {
    content: "";
    position: absolute;
    inset: auto -15% -45% auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 122, 34, 0.2), transparent 65%);
    pointer-events: none;
}

.eyebrow,
.section-kicker {
    margin: 0 0 10px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #6dc7d7;
}

.loadout-page h2,
.loadout-page h3 {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.loadout-page h2 {
    font-size: clamp(2rem, 2.8vw, 3.2rem);
    line-height: 1.04;
}

.hero-copy {
    max-width: 740px;
    margin: 16px 0 0;
    color: #b8cadc;
    font-size: 1rem;
    line-height: 1.75;
}

.hero-aside {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-self: center;
}

.hero-badge,
.summary-pill,
.selection-meta,
.shared-item-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(128, 168, 205, 0.22);
    background: rgba(9, 17, 30, 0.56);
    backdrop-filter: blur(10px);
}

.hero-badge {
    padding: 10px 14px;
    border-radius: 999px;
    color: #ffd07f;
    font-size: 0.9rem;
}

.loadout-workbench {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: start;
}

.selection-card {
    grid-column: 1 / -1;
}

.control-card,
.loadout-results {
    border-radius: 24px;
    padding: 24px;
}

.section-head,
.results-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.section-head h3,
.results-toolbar h3 {
    font-size: 1.35rem;
}

.section-note {
    max-width: 480px;
    margin: 0;
    color: #90a8c2;
    font-size: 0.92rem;
    line-height: 1.6;
}

.team-size-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.team-size-btn,
.ghost-btn,
.generate-btn,
.selection-chip,
.clear-selection-btn {
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.team-size-btn {
    min-width: 110px;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid rgba(125, 160, 197, 0.22);
    background: rgba(10, 18, 31, 0.72);
    color: #dbe7f5;
    font-size: 0.98rem;
    font-weight: 600;
}

.team-size-btn.active {
    background: linear-gradient(135deg, #ff8c3b, #ff5d45);
    color: #fff;
    box-shadow: 0 14px 30px rgba(255, 106, 61, 0.28);
}

.budget-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.budget-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #c9d6e5;
    font-size: 0.92rem;
}

.budget-field select,
.budget-field input {
    width: 100%;
    border: 1px solid rgba(122, 156, 191, 0.24);
    border-radius: 14px;
    background: rgba(9, 16, 27, 0.8);
    color: #eff6ff;
    padding: 12px 14px;
    font-size: 0.98rem;
}

.budget-field select:focus,
.budget-field input:focus {
    outline: none;
    border-color: rgba(109, 199, 215, 0.8);
    box-shadow: 0 0 0 3px rgba(109, 199, 215, 0.15);
}

.budget-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.summary-pill {
    padding: 12px 14px;
    border-radius: 18px;
    min-width: 180px;
    justify-content: space-between;
    color: #d8e5f2;
}

.summary-pill strong {
    color: #ffd58e;
    font-size: 1.08rem;
}

.selection-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.selection-group {
    border: 1px solid rgba(123, 157, 189, 0.16);
    border-radius: 20px;
    padding: 18px;
    background: rgba(9, 17, 29, 0.72);
}

.selection-group-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.selection-group-title {
    margin: 0;
    font-size: 1.04rem;
}

.selection-group-desc {
    margin: 8px 0 0;
    color: #8da6bf;
    font-size: 0.86rem;
    line-height: 1.6;
}

.clear-selection-btn {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #d5e1ee;
    font-size: 0.8rem;
}

.selection-meta {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #dce7f3;
    font-size: 0.85rem;
}

.selection-meta.invalid {
    border-color: rgba(255, 106, 61, 0.5);
    color: #ffb29b;
}

.selection-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    max-height: 236px;
    overflow-y: auto;
    padding-right: 4px;
}

.selection-chip-list::-webkit-scrollbar {
    width: 8px;
}

.selection-chip-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(121, 154, 188, 0.32);
}

.selection-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(124, 160, 193, 0.18);
    background: rgba(14, 25, 40, 0.85);
    color: #dce8f4;
    text-align: left;
}

.selection-chip:hover,
.team-size-btn:hover,
.ghost-btn:hover,
.generate-btn:hover,
.clear-selection-btn:hover {
    transform: translateY(-1px);
}

.selection-chip.active {
    border-color: rgba(255, 144, 88, 0.78);
    background: linear-gradient(135deg, rgba(255, 104, 76, 0.24), rgba(255, 160, 69, 0.16));
    box-shadow: 0 10px 22px rgba(255, 102, 57, 0.16);
}

.selection-chip-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.selection-chip-subtitle {
    color: #8eabc4;
    font-size: 0.74rem;
    line-height: 1.5;
}

.selection-empty {
    margin-top: 16px;
    color: #86a1bc;
    font-size: 0.88rem;
}

.loadout-results {
    margin-top: 24px;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ghost-btn,
.generate-btn {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
}

.ghost-btn {
    border: 1px solid rgba(124, 160, 193, 0.24);
    background: rgba(9, 16, 27, 0.74);
    color: #dce8f4;
}

.generate-btn {
    margin-top: 0;
    background: linear-gradient(135deg, #ff8c3b, #ff5d45);
    box-shadow: 0 16px 30px rgba(255, 106, 61, 0.26);
}

.shared-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.shared-result-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(8, 15, 25, 0.72);
    border: 1px solid rgba(125, 158, 190, 0.16);
}

.shared-result-card-wide {
    grid-column: span 2;
}

.shared-label {
    display: block;
    color: #8da6bf;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shared-value {
    display: block;
    margin-top: 12px;
    font-size: 1.46rem;
    color: #f6fbff;
}

.shared-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.shared-item-tag {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 16px;
    color: #f5f9ff;
}

.shared-item-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.shared-item-subtitle {
    color: #8da6bf;
    font-size: 0.76rem;
    line-height: 1.5;
}

.loadout-feedback {
    display: none;
    margin-top: 18px;
    padding: 13px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 0.92rem;
}

.loadout-feedback.info {
    display: block;
    background: rgba(31, 54, 76, 0.45);
    border-color: rgba(109, 199, 215, 0.18);
    color: #cdebf2;
}

.loadout-feedback.error {
    display: block;
    background: rgba(86, 31, 27, 0.42);
    border-color: rgba(255, 106, 61, 0.28);
    color: #ffc3b2;
}

.member-loadout-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.member-card {
    border-radius: 22px;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(18, 29, 44, 0.96), rgba(10, 18, 31, 0.92));
    border: 1px solid rgba(123, 157, 189, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.member-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(125, 158, 190, 0.12);
}

.member-card-index {
    font-size: 1.18rem;
    font-weight: 700;
    color: #f8fbff;
}

.member-card-tag {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 142, 77, 0.14);
    color: #ffc689;
    font-size: 0.78rem;
}

.member-field-list {
    display: grid;
    gap: 12px;
}

.member-field {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.member-field dt {
    color: #89a4bf;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.member-field dd {
    margin: 8px 0 0;
    color: #f6fbff;
    font-size: 1rem;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .loadout-workbench,
    .selection-groups,
    .member-loadout-grid,
    .shared-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shared-result-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 860px) {
    .content-area {
        padding: 14px;
    }

    .loadout-hero,
    .section-head,
    .results-toolbar,
    .hero-aside {
        flex-direction: column;
    }

    .loadout-workbench,
    .budget-controls,
    .selection-groups,
    .member-loadout-grid,
    .shared-results-grid {
        grid-template-columns: 1fr;
    }

    .loadout-hero,
    .control-card,
    .loadout-results {
        padding: 20px;
    }

    .hero-aside {
        justify-content: flex-start;
    }

    .shared-result-card-wide {
        grid-column: auto;
    }

    .toolbar-actions {
        width: 100%;
    }

    .toolbar-actions .ghost-btn,
    .toolbar-actions .generate-btn {
        flex: 1 1 180px;
    }
}

/* ====== 结果区优先布局 ====== */
.loadout-workbench {
    gap: 14px;
    margin-bottom: 16px;
}

.control-card {
    padding: 18px;
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.selection-card {
    max-height: 480px;
}

.selection-card .section-head {
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.selection-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.selection-card-body {
    margin-top: 12px;
}

.selection-card.is-collapsed {
    max-height: none;
}

.selection-card.is-collapsed .section-head {
    margin-bottom: 0;
}

.collapse-btn {
    border: 1px solid rgba(113, 175, 216, 0.35);
    background: rgba(12, 27, 43, 0.58);
    color: #cfe8ff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.collapse-btn:hover {
    background: rgba(29, 60, 89, 0.78);
    border-color: rgba(113, 175, 216, 0.58);
    transform: translateY(-1px);
}

.section-note {
    font-size: 0.84rem;
    line-height: 1.45;
}

.budget-controls {
    gap: 12px;
    margin-top: 14px;
}

.budget-field select,
.budget-field input {
    padding: 10px 12px;
    font-size: 0.92rem;
}

.budget-summary {
    margin-top: 14px;
}

.summary-pill {
    min-width: 150px;
    padding: 10px 12px;
}

.selection-groups {
    gap: 12px;
    margin-top: 12px;
}

.selection-group {
    padding: 14px;
    border-radius: 18px;
}

.selection-group-desc {
    font-size: 0.8rem;
}

.selection-meta {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 0.8rem;
}

.selection-chip-list {
    gap: 8px;
    margin-top: 12px;
    max-height: 148px;
}

.selection-chip {
    padding: 8px 10px;
    border-radius: 14px;
}

.selection-chip-title {
    font-size: 0.84rem;
}

.selection-chip-subtitle {
    font-size: 0.7rem;
}

#loadout-results-panel {
    scroll-margin-top: 28px;
}

.loadout-results {
    margin-top: 12px;
    padding: 32px;
    border-radius: 28px;
    border-color: rgba(104, 202, 225, 0.28);
    background:
        radial-gradient(circle at top right, rgba(74, 193, 224, 0.2), transparent 28%),
        radial-gradient(circle at bottom left, rgba(255, 124, 72, 0.12), transparent 30%),
        linear-gradient(160deg, rgba(14, 25, 40, 0.98), rgba(9, 17, 29, 0.98));
    box-shadow: 0 26px 70px rgba(2, 7, 20, 0.42);
}

.results-toolbar h3 {
    font-size: 2rem;
}

.shared-results-grid {
    gap: 20px;
    margin-top: 26px;
}

.shared-result-card {
    padding: 24px;
    border-radius: 24px;
    background: rgba(7, 14, 24, 0.84);
}

.shared-value {
    margin-top: 14px;
    font-size: clamp(1.8rem, 2.5vw, 2.6rem);
    line-height: 1.05;
}

.shared-list {
    gap: 12px;
    margin-top: 14px;
}

.shared-item-tag {
    padding: 12px 14px;
    border-radius: 18px;
}

.loadout-feedback {
    margin-top: 22px;
    padding: 15px 18px;
    font-size: 0.98rem;
}

.member-loadout-grid {
    gap: 22px;
    margin-top: 24px;
}

.member-card {
    padding: 24px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(78, 198, 230, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(18, 29, 44, 0.98), rgba(10, 18, 31, 0.96));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

.member-card-index {
    font-size: 1.42rem;
}

.member-card-tag {
    padding: 8px 12px;
    font-size: 0.84rem;
}

.member-field {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
}

.member-field dt {
    font-size: 0.8rem;
}

.member-field dd {
    font-size: 1.08rem;
    line-height: 1.55;
}

@media (max-width: 1180px) {
    .selection-card {
        max-height: none;
    }

    .selection-chip-list {
        max-height: 180px;
    }
}

@media (max-width: 860px) {
    .control-card {
        padding: 16px;
    }

    .loadout-results {
        padding: 22px;
    }

    .results-toolbar h3 {
        font-size: 1.56rem;
    }

    .shared-value {
        font-size: 1.9rem;
    }

    .member-card {
        padding: 18px;
    }
}
