/* ============================================================
   Debate (辩论) Module Styles
   Extracted from style.css and consolidated
   ============================================================ */

/* ===== 1. Battle Configuration (仙人选择) ===== */

.battle-config {
    background: rgba(253, 251, 247, 0.95);
    padding: var(--spacing-md);
    border-radius: 0.5rem;
    margin-bottom: var(--spacing-lg);
    border: 2px dashed var(--primary-color);
    animation: slideDown 0.3s ease;
}

.battle-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1em;
}

.battle-checkboxes {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.immortal-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    background: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.immortal-option:hover {
    border-color: var(--primary-color);
    background: #fffdf5;
}

.immortal-option input:checked + .immortal-name {
    color: var(--primary-color);
    font-weight: bold;
}

/* 神级强者 special styling */
.immortal-option.god-of-gods {
    background: linear-gradient(135deg, #fff8e1, #ffe082);
    border: 2px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    position: relative;
}

.immortal-option.god-of-gods:hover {
    background: linear-gradient(135deg, #ffe082, #ffd54f);
    border-color: #ffab00;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.immortal-option.god-of-gods .immortal-name {
    font-weight: bold;
    color: #b8860b;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-0.625rem); }
    to { opacity: 1; transform: translateY(0); }
}


/* ===== 2. Battle Layout (辩论列布局) ===== */

.battle-row {
    display: grid;
    gap: var(--spacing-md);
    width: 100%;
    margin-bottom: var(--spacing-lg);
    align-items: start;
}

.battle-col {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 0.625rem;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 0;
    height: fit-content;
}

.battle-col-header {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    color: var(--primary-color);
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px 4px 0 0;
}

.battle-col .content-text {
    font-size: 0.95em;
    line-height: 1.6;
    color: #ccc;
}

.battle-col .thinking-process {
    margin-bottom: var(--spacing-sm);
}


/* ===== 3. Debate Mode (众仙争论) ===== */

/* 轮次标题 */
.debate-round-header {
    text-align: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4em;
    color: var(--primary-color);
    padding: var(--spacing-md) 0;
    margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.375rem;
    letter-spacing: 4px;
}

.debate-round-header .round-subtitle {
    font-size: 0.6em;
    color: #999;
    letter-spacing: 1px;
    display: block;
    margin-top: var(--spacing-xs);
    font-family: 'Noto Serif SC', serif;
}

/* 裁决区域 */
.debate-verdict {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    border: 2px solid #ffd700;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.15), rgba(0, 0, 0, 0.4));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.debate-verdict-header {
    text-align: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.6em;
    color: #ffd700;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
    letter-spacing: 6px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.debate-verdict .content-text {
    font-size: var(--font-base);
    line-height: 1.8;
    color: #ddd;
}

.debate-verdict .thinking-process {
    margin-bottom: var(--spacing-sm);
}

/* 争论进度指示 */
.debate-progress {
    text-align: center;
    padding: var(--spacing-sm);
    color: #ffd700;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1em;
    animation: debatePulse 1.5s ease-in-out infinite;
}

@keyframes debatePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}


/* ===== 4. Debate Bottom Config (底部辩论配置面板) ===== */

.ai-input-group.debate-mode {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.ai-input-group.debate-mode .debate-bottom-config {
    width: 100%;
    flex-basis: 100%;
}

.ai-input-group.debate-mode .ai-input {
    min-height: 5rem;
    font-size: var(--font-base);
    flex: 1;
}

.ai-input-group.debate-mode .ai-debate-btn {
    font-size: 1.1em;
    padding: var(--spacing-md) var(--spacing-xl);
    white-space: nowrap;
    min-width: 6.25rem;
}

.debate-bottom-config {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 0.625rem;
    overflow: hidden;
}

.debate-bottom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 215, 0, 0.08);
    font-size: 0.95em;
    color: #ffd700;
    font-weight: 500;
}

.debate-cancel-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: var(--font-sm);
    transition: all 0.2s;
}

.debate-cancel-btn:hover {
    border-color: #ff5252;
    color: #ff5252;
}

.debate-bottom-body {
    padding: var(--spacing-md);
}

.debate-config-row {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.debate-config-section {
    flex: 1;
}

.debate-bottom-input-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.debate-bottom-input-row .ai-input {
    height: 3.125rem;
}

.debate-go-btn {
    white-space: nowrap;
    /* 保留 !important：被 .ai-send-btn 等通用按钮样式覆盖 */
    padding: 0 var(--spacing-lg) !important;
    font-size: var(--font-base) !important;
    min-width: 5.625rem;
}

/* 辩论按钮 */
.ai-debate-btn {
    width: 6.25rem;
    background: linear-gradient(135deg, #8b0000, #c41e3a);
    color: #ffd700;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1em;
    transition: background 0.3s, opacity 0.3s;
    position: relative;
    animation: debateBtnPulse 2.5s ease-in-out infinite;
}

@keyframes debateBtnPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.5), 0 0 4px rgba(196, 30, 58, 0.6); }
}

.ai-debate-btn::after {
    content: '真理越辩越明，更准确 ✨';
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #ffd700;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: var(--font-xs);
    font-family: -apple-system, 'Microsoft YaHei', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.ai-debate-btn:hover::after {
    opacity: 1;
}

.ai-debate-btn:hover {
    background: linear-gradient(135deg, #a00000, #d42e4a);
    animation: none;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

.ai-debate-btn:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    animation: none;
    box-shadow: none;
}

.ai-debate-btn:disabled::after {
    display: none;
}

/* 开始辩论按钮（欢迎页） */
.btn-start-debate {
    background: linear-gradient(135deg, #8b0000, #c41e3a);
    color: #ffd700;
    padding: var(--spacing-md) 2.1875rem;
    font-size: 1.2em;
    border: none;
    border-radius: 3.125rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.4);
    transition: transform 0.2s;
    font-family: inherit;
    font-weight: bold;
}

.btn-start-debate:hover {
    transform: scale(1.05);
}

/* 书记员配置区域 */
#clerkSection .debate-config-checkboxes label {
    border-color: rgba(100, 200, 255, 0.3);
}

#clerkSection .debate-config-checkboxes input:checked + span {
    color: #64c8ff;
}

/* 复制按钮成功状态 */
.debate-export-btn.copied {
    /* 保留 !important：需要覆盖 hover 状态的背景色 */
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: #4CAF50 !important;
}


/* ===== 5. Inline Debate Styles (内联辩论) ===== */

.debate-inline-config {
    background: rgba(13, 27, 42, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 0.75rem;
    padding: var(--spacing-lg);
    width: 100%;
    animation: slideDown 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.debate-inline-config.collapsed {
    padding: var(--spacing-md) var(--spacing-lg);
}

.debate-inline-config-header {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-md);
    letter-spacing: 4px;
}

.debate-inline-config.collapsed .debate-inline-config-header {
    margin-bottom: var(--spacing-xs);
    font-size: 1.1em;
}

.debate-inline-config-summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: var(--font-sm);
    color: var(--accent-color);
    text-align: center;
}

.debate-config-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1em;
}

.debate-config-title.judge-title,
.debate-config-title.clerk-title {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.debate-config-title .judge-hint {
    font-family: inherit;
    font-size: var(--font-xs);
    color: rgba(255, 215, 0, 0.6);
    font-weight: normal;
}

.judge-checkboxes .immortal-option {
    border-color: rgba(138, 43, 226, 0.3);
}

.judge-checkboxes .immortal-option input:checked + .immortal-name {
    color: #dda0ff;
}

.debate-config-checkboxes {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.debate-cost-estimate {
    margin: var(--spacing-sm) 0;
    padding: var(--spacing-sm) 0.875rem;
    border-radius: 0.5rem;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    font-size: var(--font-sm);
    line-height: 1.6;
    color: #ccc;
}

.debate-cost-estimate .cost-summary strong {
    color: #ffd700;
}

.debate-cost-estimate .cost-balance {
    color: #8bc34a;
    font-size: 0.9em;
}

.debate-cost-estimate .cost-insufficient {
    border-color: rgba(255, 80, 80, 0.4);
    background: rgba(255, 80, 80, 0.08);
}

.debate-cost-estimate .cost-insufficient .cost-balance {
    color: #ff5252;
    font-weight: bold;
}

.debate-question-area {
    display: flex;
    gap: var(--spacing-md);
    align-items: stretch;
}

.debate-question-input {
    flex-grow: 1;
    padding: var(--spacing-md);
    border: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-radius: 0.5rem;
    resize: none;
    height: 3.125rem;
    font-family: inherit;
    font-size: var(--font-base);
}

.debate-question-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.debate-start-btn {
    background: linear-gradient(135deg, #8b0000, #cc3300);
    color: #ffd700;
    border: 1px solid #ffd700;
    padding: var(--spacing-md) 1.875rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    white-space: nowrap;
    transition: all 0.3s;
}

.debate-start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #a00000, #e63900);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.debate-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.debate-inline-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    border-left: 3px solid var(--primary-color);
    padding-left: var(--spacing-md);
    margin: var(--spacing-sm) 0;
}

/* 辩论现场折叠区域 */
.debate-scene-toggle {
    cursor: pointer;
    padding: var(--spacing-md) 1.125rem;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.15), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0.5rem;
    color: #ffd700;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.15em;
    letter-spacing: 2px;
    transition: all 0.3s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.debate-scene-toggle:hover {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.scene-toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s;
}

.scene-toggle-hint {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.65em;
    color: #999;
    letter-spacing: 0;
}

.debate-scene {
    transition: max-height 0.5s ease, opacity 0.3s ease;
    overflow: hidden;
}

.debate-scene.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.debate-inline-progress {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.375rem;
}

.debate-inline-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0.5rem;
    margin-top: var(--spacing-sm);
}

.debate-inline-footer-text {
    color: var(--accent-color);
    font-size: 0.9em;
}

.debate-export-btn {
    background: rgba(255, 215, 0, 0.15);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 0.375rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.debate-export-btn:hover {
    background: var(--primary-color);
    color: #0d1b2a;
}

/* 辩论进度条 */
.debate-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.debate-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff8c00, #ffd700);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.5s ease;
    animation: progressShimmer 2s linear infinite;
    border-radius: 3px;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.debate-progress-text {
    text-align: center;
    font-size: 0.95em;
    color: #ffd700;
    font-family: 'Ma Shan Zheng', cursive;
    letter-spacing: 2px;
}

.debate-time-estimate {
    text-align: center;
    font-size: var(--font-sm);
    color: var(--accent-color);
    margin-top: var(--spacing-xs);
}

.debate-warning {
    text-align: center;
    font-size: var(--font-sm);
    color: #ff8c00;
    margin-top: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 0.375rem;
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 历史辩论按钮 */
.debate-history-btn {
    /* 保留 !important：需要覆盖通用 .action-btn 样式 */
    background: rgba(119, 141, 169, 0.15) !important;
    color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

.debate-history-btn:hover {
    /* 保留 !important：同上，覆盖 .action-btn:hover */
    background: var(--accent-color) !important;
    color: #0d1b2a !important;
}

/* 历史辩论弹窗 */
.debate-history-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.debate-history-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #ffd700;
    border-radius: var(--spacing-md);
    width: 37.5rem;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.debate-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.3em;
}

.debate-history-header button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.7em;
    transition: all 0.2s;
}

.debate-history-header button:hover {
    border-color: #ff5252;
    color: #ff5252;
}

.debate-history-body {
    padding: var(--spacing-md);
    overflow-y: auto;
    flex: 1;
}

.debate-history-note {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 215, 0, 0.06);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    font-size: 0.8em;
    color: #999;
    line-height: 1.6;
}

.debate-history-loading,
.debate-history-empty {
    text-align: center;
    color: #999;
    padding: var(--spacing-2xl);
    font-size: var(--font-base);
}

.debate-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.debate-history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 0.625rem;
    padding: 0.875rem var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s;
}

.debate-history-item:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.05);
    transform: translateY(-1px);
}

.debate-history-item-q {
    color: #e0e1dd;
    font-size: var(--font-base);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.debate-history-item-meta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-size: 0.8em;
    color: #999;
}

.debate-history-item-action {
    margin-top: var(--spacing-sm);
    font-size: var(--font-sm);
    color: #ffd700;
    opacity: 0;
    transition: opacity 0.2s;
}

.debate-history-item:hover .debate-history-item-action {
    opacity: 1;
}


/* ===== 6. Debate Stepper (分段式进度导航) ===== */

.debate-stepper {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(13, 13, 26, 0.97);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 0.625rem;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
}

.debate-stepper-stages {
    display: flex;
    gap: var(--spacing-xs);
    overflow-x: auto;
    scrollbar-width: none;
}

.debate-stepper-stages::-webkit-scrollbar { display: none; }

.debate-stage {
    flex: 1;
    min-width: 5rem;
    padding: var(--spacing-sm) 0.375rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.debate-stage:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.3);
}

.debate-stage.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    animation: stageGlow 1.5s infinite;
}

@keyframes stageGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
}

.debate-stage.done {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.4);
}

.stage-label {
    font-size: 0.8em;
    font-weight: bold;
    color: #ddd;
    margin-bottom: 2px;
}

.debate-stage.active .stage-label { color: #ffd700; }
.debate-stage.done .stage-label { color: #4CAF50; }

.stage-hint {
    font-size: 0.6em;
    color: #888;
    line-height: 1.3;
}

.stage-status {
    font-size: 0.65em;
    color: #666;
    margin-top: 3px;
}

.debate-stage.active .stage-status { color: #ffd700; }
.debate-stage.done .stage-status { color: #4CAF50; }

.debate-stepper-info {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 0.4em;
    white-space: normal;
}


/* ===== 7. 辩论进度条统一到顶部栏 ===== */

/* 顶部栏内嵌完整进度条 */
.debate-stepper.topbar-stepper {
    position: relative;
    top: auto;
    width: 100%;
    margin-bottom: 0;
    border: none;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    backdrop-filter: none;
}

/* 旧版顶部紧凑进度条（已弃用） */
.topbar-debate-progress {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid rgba(255, 215, 0, 0.15);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.topbar-debate-progress::-webkit-scrollbar { display: none; }

.topbar-stage {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 0.375rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s;
}

.topbar-stage.active {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    animation: stageGlow 1.5s infinite;
}

.topbar-stage.done {
    color: #4CAF50;
}

.topbar-stage .stage-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
}

.topbar-stage.active .stage-dot {
    background: #ffd700;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
}

.topbar-stage.done .stage-dot {
    background: #4CAF50;
}

.topbar-debate-elapsed {
    color: #aaa;
    font-size: 0.625rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.topbar-debate-warning {
    color: #ff6b6b;
    font-size: 0.625rem;
    white-space: nowrap;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

/* 辩论进度条独立悬浮容器 */
.debate-progress-float {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 990;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}


/* ===== 8. 辩论引导与提示 ===== */

.debate-guide-hint {
    color: #999;
    font-size: 0.8em;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 215, 0, 0.06);
    border-radius: 0.375rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.guide-toast {
    position: fixed;
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%) translateY(-1.25rem);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #ffd700;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 0.75rem;
    font-size: 0.9em;
    z-index: 10002;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.guide-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 辩论完成后的内联贴士 */
.context-tip-inline {
    display: flex;
    gap: var(--spacing-sm);
    background: rgba(255, 215, 0, 0.06);
    border: 1px dashed rgba(255, 215, 0, 0.2);
    border-radius: 0.625rem;
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    animation: tipFadeIn 0.5s ease;
}

.context-tip-inline .tip-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.context-tip-inline .tip-content {
    color: #bbb;
    font-size: 0.82em;
    line-height: 1.6;
}

.context-tip-inline .tip-content b {
    color: #ffd700;
}

.context-tip-inline .tip-content ul {
    list-style: none;
    padding: 0;
    margin: var(--spacing-xs) 0 0 0;
}

.context-tip-inline .tip-content ul li {
    padding: 2px 0;
}

.context-tip-inline .tip-content ul li::before {
    content: '→ ';
    color: #ffd700;
}

/* 旋转小贴士栏 */
.rotating-tip-bar {
    color: #888;
    font-size: 0.78em;
    text-align: center;
    padding: 0.375rem 0.75rem;
    min-height: 1.5em;
    transition: opacity 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: var(--spacing-xs);
}


/* ===== 9. 云端辩论历史 ===== */

.cloud-status {
    font-weight: bold;
    font-size: var(--font-sm);
}

.status-running {
    color: #4fc3f7;
    animation: statusPulse 1.5s ease-in-out infinite;
}

.status-completed {
    color: #4ecdc4;
}

.status-failed {
    color: #ff5252;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.cloud-progress-text {
    color: #4fc3f7;
    font-weight: bold;
}

.cloud-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: var(--spacing-sm);
    overflow: hidden;
}

.cloud-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #ffd700);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.cloud-download-btn {
    background: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: var(--font-base);
    transition: all 0.2s;
    flex-shrink: 0;
}

.cloud-download-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.cloud-delete-btn {
    background: none;
    border: 1px solid rgba(255, 80, 80, 0.3);
    color: #ff6b6b;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: var(--font-base);
    transition: all 0.2s;
    flex-shrink: 0;
}

.cloud-delete-btn:hover {
    border-color: #ff5252;
    background: rgba(255, 80, 80, 0.15);
}

.cloud-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    font-size: var(--font-sm);
    color: #aaa;
}

.cloud-pagination button {
    background: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.cloud-pagination button:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
}

.cloud-result-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    margin-bottom: var(--spacing-md);
}

.cloud-result-actions button {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: var(--font-sm);
    transition: all 0.2s;
}

.cloud-result-actions button:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
}

.cloud-result-html {
    color: #e0e1dd;
    line-height: 1.7;
    font-size: 0.95em;
    overflow-wrap: break-word;
}

.cloud-result-html h1,
.cloud-result-html h2,
.cloud-result-html h3 {
    color: #ffd700;
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.cloud-result-html blockquote {
    border-left: 3px solid #ffd700;
    padding-left: var(--spacing-md);
    color: #bbb;
    margin: var(--spacing-sm) 0;
}

.cloud-progress-detail {
    padding: var(--spacing-sm) 0;
}

.cloud-progress-bar-lg {
    height: 1.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    overflow: hidden;
    position: relative;
}

.cloud-progress-fill-lg {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #ffd700);
    border-radius: 0.875rem;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    color: #000;
    min-width: 2.5rem;
}

.cloud-progress-log {
    max-height: 18.75rem;
    overflow-y: auto;
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
}

.cloud-log-line {
    color: #aaa;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cloud-view-result-btn {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    color: #000;
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: var(--font-base);
    font-weight: bold;
    transition: transform 0.2s;
}

.cloud-view-result-btn:hover {
    transform: scale(1.05);
}

/* 云端辩论通知 */
.cloud-debate-notice {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.cloud-debate-notice-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: var(--spacing-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 26.25rem;
}

.cloud-debate-notice-icon {
    font-size: 1.5em;
}

.cloud-debate-notice-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #e2e8f0;
}

.cloud-debate-notice-desc {
    font-size: 0.78em;
    color: #94a3b8;
    margin-top: 2px;
}

.cloud-debate-notice-btn {
    padding: 0.375rem 0.875rem;
    background: #b8860b;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.82em;
    white-space: nowrap;
}

.cloud-debate-notice-btn:hover {
    background: #d4a017;
}

.cloud-debate-notice-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.1em;
    padding: var(--spacing-xs);
}

.cloud-debate-notice-close:hover {
    color: #e2e8f0;
}

/* 云端辩论取消按钮 */
.cloud-debate-cancel-btn {
    float: right;
    background: rgba(255, 80, 80, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 80, 80, 0.3);
    border-radius: 0.375rem;
    padding: 2px 0.625rem;
    font-size: 0.82em;
    cursor: pointer;
    margin-left: var(--spacing-md);
}

.cloud-debate-cancel-btn:hover {
    background: rgba(255, 80, 80, 0.3);
    color: #fff;
}


/* ===== 10. Responsive: ≤1024px ===== */

@media (max-width: 1024px) {
    .battle-row {
        gap: var(--spacing-sm);
    }
}


/* ===== 11. Responsive: ≤768px ===== */

@media (max-width: 768px) {
    /* 辩论内容全宽显示 */
    .debate-inline-wrapper {
        border-left: none;
        padding-left: 0;
        margin: 0;
    }

    .battle-col {
        padding: var(--spacing-xs);
        border-radius: 0.375rem;
    }

    .battle-col .content-text {
        font-size: var(--font-sm);
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .battle-config {
        padding: var(--spacing-sm);
    }

    .battle-checkboxes {
        gap: 0.375rem;
    }

    .immortal-option {
        padding: 0.375rem 0.625rem;
        font-size: var(--font-sm);
    }

    .ai-debate-btn {
        flex: 1;
        font-size: 0.8em;
        padding: var(--spacing-sm);
    }

    /* Debate Bottom Config */
    .debate-config-row {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .debate-bottom-header {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9em;
    }

    .debate-bottom-body {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .debate-config-title {
        font-size: var(--font-sm);
    }

    .judge-hint {
        display: block;
        font-size: var(--font-sm);
        margin-top: 2px;
    }

    .debate-config-checkboxes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.375rem;
    }

    .debate-cost-estimate {
        font-size: 0.8em;
        padding: var(--spacing-sm);
    }

    .debate-bottom-input-row {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .debate-bottom-input-row .ai-input {
        height: 2.8125rem;
        font-size: 16px; /* Prevent iOS zoom */
    }

    .debate-go-btn {
        /* 保留 !important：覆盖桌面端的 !important 声明 */
        width: 100% !important;
        min-width: unset;
        padding: var(--spacing-sm) !important;
    }

    .ai-debate-btn::after {
        display: none;
    }

    .btn-start-debate {
        padding: var(--spacing-md) 1.875rem;
        font-size: var(--font-base);
    }

    /* Battle Row */
    .battle-row {
        /* 保留 !important：覆盖 JS 动态设置的 grid-template-columns */
        grid-template-columns: 1fr !important;
        gap: var(--spacing-sm);
    }

    .battle-col-header {
        font-size: var(--font-base);
    }

    /* Debate Inline Config */
    .debate-inline-config {
        padding: var(--spacing-md);
    }

    .debate-inline-config-header {
        font-size: 1.1em;
    }

    .debate-config-checkboxes {
        gap: 0.375rem;
    }

    .debate-question-area {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .debate-question-input {
        height: 3.75rem;
    }

    .debate-start-btn {
        width: 100%;
    }

    .debate-inline-config-summary {
        font-size: var(--font-sm);
    }

    .debate-inline-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .debate-round-header {
        font-size: 1.1em;
        letter-spacing: 2px;
    }

    /* 辩论现场折叠 */
    .debate-scene-toggle {
        font-size: var(--font-base);
        padding: var(--spacing-sm) 0.875rem;
        letter-spacing: 1px;
    }

    .scene-toggle-hint {
        font-size: 0.7em;
    }

    /* 辩论进度条 */
    .debate-stepper:not(.debate-progress-float .debate-stepper) {
        /* 保留 !important：确保移动端不 sticky，覆盖基础样式 */
        position: relative !important;
        top: auto !important;
    }

    .debate-progress-float {
        /* 保留 !important：确保悬浮容器始终固定 */
        position: fixed !important;
        top: 0 !important;
    }

    .debate-progress-float .debate-stepper {
        /* 保留 !important：悬浮容器内不需要 sticky */
        position: static !important;
    }

    /* 辩论配置优化 */
    .debate-config-row {
        /* 保留 !important：确保移动端始终纵向排列 */
        flex-direction: column !important;
        gap: var(--spacing-sm) !important;
    }

    .debate-config-section {
        /* 保留 !important：确保移动端全宽 */
        width: 100% !important;
    }

    .debate-config-checkboxes {
        /* 保留 !important：确保移动端紧凑间距 */
        gap: var(--spacing-xs) !important;
    }

    .debate-config-checkboxes label {
        /* 保留 !important：确保移动端紧凑 */
        font-size: 0.8em !important;
        padding: var(--spacing-xs) var(--spacing-sm) !important;
    }

    .debate-inline-footer {
        flex-wrap: wrap;
        /* 保留 !important：确保移动端紧凑间距 */
        gap: 0.375rem !important;
    }

    .debate-export-btn {
        /* 保留 !important：确保移动端紧凑 */
        font-size: 0.8em !important;
        padding: 0.375rem 0.625rem !important;
    }
}


/* ===== 12. Responsive: ≤480px ===== */

@media (max-width: 480px) {
    .ai-debate-btn {
        font-size: var(--font-xs);
        padding: var(--spacing-sm) 0.375rem;
    }

    .ai-debate-btn::after {
        display: none;
    }

    .debate-bottom-header span {
        font-size: var(--font-sm);
    }

    .debate-bottom-body {
        padding: var(--spacing-sm);
    }

    .debate-config-title {
        font-size: 0.8em;
        margin-bottom: var(--spacing-xs);
    }

    .debate-cost-estimate {
        font-size: var(--font-xs);
        padding: 0.375rem var(--spacing-sm);
        line-height: 1.5;
    }

    .debate-cancel-btn {
        font-size: 0.8em;
        padding: 3px 0.625rem;
    }

    .battle-checkboxes,
    .debate-config-checkboxes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.375rem;
    }

    .immortal-option {
        padding: 0.3125rem var(--spacing-sm);
        font-size: 0.8em;
        justify-content: flex-start;
    }

    .battle-col {
        padding: var(--spacing-sm);
    }

    .debate-inline-config {
        padding: var(--spacing-sm);
    }

    .debate-inline-config-header {
        font-size: var(--font-base);
        letter-spacing: 2px;
    }

    .debate-stage {
        min-width: 4.0625rem;
        padding: 0.375rem var(--spacing-xs);
    }

    .stage-label { font-size: 0.7em; }
    .stage-hint { font-size: 0.55em; }

    .btn-start-debate {
        /* 保留 !important：覆盖桌面端内联样式 */
        padding: var(--spacing-sm) var(--spacing-lg) !important;
        font-size: 0.9em !important;
    }

    .context-tip-inline {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .context-tip-inline .tip-content {
        font-size: 0.78em;
    }
}


/* ===== 13. Responsive: ≤380px ===== */

@media (max-width: 380px) {
    .ai-debate-btn {
        width: 2.8125rem;
        font-size: 0.8em;
    }

    .debate-config-checkboxes {
        /* 保留 !important：极小屏幕强制单列 */
        grid-template-columns: 1fr !important;
    }

    .debate-bottom-config {
        font-size: 0.9em;
    }
}


/* ===== 14. Responsive: 横屏 ===== */

@media (max-height: 500px) and (orientation: landscape) {
    .debate-stepper {
        /* 保留 !important：横屏时绝对不能 sticky */
        position: relative !important;
        top: auto !important;
    }

    .topbar-debate-progress {
        margin-top: 3px;
        padding-top: 3px;
    }

    .topbar-stage {
        font-size: 0.625rem;
        padding: 1px var(--spacing-xs);
    }
}
