:root {
    /* Classical Cool Palette */
    --bg-color: #0d1b2a;
    --text-color: #e0e1dd;
    --primary-color: #ffd700;
    /* Gold */
    --secondary-color: #1b263b;
    /* Deep Blue */
    --accent-color: #778da9;
    /* Muted Blue-Grey */
    --border-color: #ffd700;
    --glass-bg: rgba(13, 27, 42, 0.7);
    --glass-border: 1px solid rgba(255, 215, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(255, 215, 0, 0.2);
    --paper-texture: url('../assets/mystic_mountain_bg.png');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', 'Songti SC', serif;
    background-color: var(--bg-color);
    background-image: var(--paper-texture);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 40px auto;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* Decorative Corners - Updated to use new Gold Frame */
.corner-decoration {
    position: absolute;
    width: 150px;
    height: 150px;
    background-image: url('../assets/gold_frame_border.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
    filter: drop-shadow(0 0 2px gold);
}

.corner-tl {
    top: 0;
    left: 0;
    transform: rotate(0deg);
}

.corner-tr {
    top: 0;
    right: 0;
    transform: rotate(90deg);
}

.corner-bl {
    bottom: 0;
    left: 0;
    transform: rotate(-90deg);
}

.corner-br {
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
}

.container::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    pointer-events: none;
    border-radius: 8px;
}

.header {
    text-align: center;
    padding: 60px 0 40px;
    border-bottom: none;
    margin-bottom: 30px;
    background: transparent;
    position: relative;
    z-index: 1;
}

.header::after {
    content: '';
    display: block;
    width: 60%;
    height: 40px;
    margin: 20px auto 0;
    background-image: url('../assets/gold_cloud_divider.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

.header h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4.5em;
    background: linear-gradient(to bottom, #ffd700, #b8860b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(184, 134, 11, 0.3);
    letter-spacing: 5px;
}

.header p {
    font-size: 1.4em;
    color: var(--text-color);
    letter-spacing: 4px;
    opacity: 0.8;
    font-weight: 300;
}

.main-content {
    padding: 20px 40px;
    position: relative;
    z-index: 1;
}

.input-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 50px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    max-width: 900px;
    margin: 0 auto 50px;
    position: relative;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.input-section h2 {
    font-family: 'Ma Shan Zheng', cursive;
    color: var(--primary-color);
    margin-bottom: 40px;
    font-size: 2.2em;
    text-align: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: normal;
    color: var(--primary-color);
    font-size: 1.1em;
    font-family: 'Noto Serif SC', serif;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px 4px 0 0;
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    color: #fff;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 6px -6px var(--primary-color);
}

/* Custom Select Arrow */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='gold'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

/* Date Input Dark Mode Fix */
.form-group input[type="datetime-local"] {
    color-scheme: dark;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.btn-generate {
    background: linear-gradient(135deg, #b8860b, #ffd700, #b8860b);
    background-size: 200% 200%;
    color: #0d1b2a;
    padding: 18px 40px;
    border: 1px solid #ffd700;
    border-radius: 50px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.5s ease;
    width: 100%;
    margin-top: 30px;
    letter-spacing: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(184, 134, 11, 0.4);
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.btn-generate:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    border-color: #fff;
}

.btn-generate:active {
    transform: translateY(-1px);
}

.result-section {
    display: none;
    margin-top: 50px;
    animation: fadeInUp 0.8s ease;
}

.result-section.show {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-content {
    background: rgba(13, 27, 42, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 35px;
    max-height: 800px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    color: #ccc;
}

/* Scrollbar Styling */
.result-content::-webkit-scrollbar {
    width: 8px;
}

.result-content::-webkit-scrollbar-track {
    background: #0d1b2a;
}

.result-content::-webkit-scrollbar-thumb {
    background: #b8860b;
    border-radius: 4px;
}

.basic-info {
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.8), rgba(65, 90, 119, 0.8));
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #ffd700;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.basic-info h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 600;
    font-family: 'Ma Shan Zheng', cursive;
    letter-spacing: 2px;
}

.basic-info p {
    margin: 10px 0;
    line-height: 1.7;
    color: #e0e1dd;
    font-size: 1.05em;
}

.basic-info strong {
    color: #ffd700;
    font-weight: 600;
}

.palace-info {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
}

.palace-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.palace-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    font-family: 'Ma Shan Zheng', cursive;
}

.palace-content {
    line-height: 1.8;
    color: #ccc;
}

.palace-content p {
    margin: 8px 0;
    font-size: 1.05em;
}

.palace-content strong {
    color: #b8860b;
    font-weight: 600;
}

.copy-section {
    position: fixed;
    bottom: 2px;
    left: 2px;
    z-index: 9999;
    opacity: 0.1;
    transition: opacity 0.3s;
    margin: 0;
    padding: 0;
}

.copy-section:hover {
    opacity: 1;
}

.btn-copy {
    background: transparent;
    color: #ccc;
    padding: 0;
    border: none;
    cursor: pointer;
    font-size: 8px;
    font-weight: normal;
    transition: all 0.3s ease;
    margin: 0;
    box-shadow: none;
}

.btn-copy:hover {
    color: #999;
    text-decoration: underline;
}

.btn-ai-diagnosis {
    background: linear-gradient(45deg, var(--primary-color), #ff4d4d);
    color: white;
    padding: 15px 50px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
    font-family: 'Ma Shan Zheng', cursive;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
    animation: pulse-glow 2s infinite;
    display: block;
    margin: 30px auto;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid gold;
}

.btn-ai-diagnosis:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
    filter: brightness(1.2);
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(139, 0, 0, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(255, 69, 0, 0.8), 0 0 10px gold;
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(139, 0, 0, 0.4);
    }
}

.loading {
    text-align: center;
    padding: 50px;
    display: none;
}

.loading.show {
    display: block;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    font-size: 1.2em;
    color: #6c757d;
    margin-top: 15px;
}

.error-message {
    background: linear-gradient(135deg, #f8d7da, #ffe6e6);
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
    display: none;
    font-size: 1.1em;
    text-align: center;
}

.error-message.show {
    display: block;
}

.success-message {
    background: linear-gradient(135deg, #d4edda, #e8f5e8);
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
    display: none;
    font-size: 1.1em;
    text-align: center;
}

.success-message.show {
    display: block;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 特殊标记样式 */
.special-mark {
    color: #e74c3c;
    font-weight: bold;
}

.star-brightness {
    color: #8e44ad;
    font-weight: 600;
}

.mutagen {
    color: #d35400;
    font-weight: bold;
}

/* 测试信息显示区域 */
.test-info {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
}

.test-info h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.test-button {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    font-size: 14px;
}

/* Visual Chart Styles */
.ziwei-chart-container {
    margin-top: 50px;
    overflow-x: auto;
    padding: 20px;
}

.ziwei-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, minmax(200px, auto));
    gap: 15px;
    /* Increased gap for card look */
    background-color: transparent;
    border: none;
    margin: 0 auto;
    max-width: 1300px;
    font-family: 'Noto Serif SC', serif;
}

.palace-cell {
    background-color: rgba(13, 27, 42, 0.6);
    background-image: none;
    /* Removed paper texture for glass look */
    backdrop-filter: blur(5px);
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    /* Rounded corners */
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #e0e1dd;
}

.palace-cell:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.6);
    z-index: 10;
}

.center-cell {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    background: radial-gradient(circle, rgba(27, 38, 59, 0.9), rgba(13, 27, 42, 0.95));
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    /* Rounded center */
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.center-cell h2,
.center-cell h3,
.center-cell p {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}


/* Earthly Branch positions */
.cell-si {
    grid-area: 1 / 1 / 2 / 2;
}

/* 巳 */
.cell-wu {
    grid-area: 1 / 2 / 2 / 3;
}

/* 午 */
.cell-wei {
    grid-area: 1 / 3 / 2 / 4;
}

/* 未 */
.cell-shen {
    grid-area: 1 / 4 / 2 / 5;
}

/* 申 */

.cell-chen {
    grid-area: 2 / 1 / 3 / 2;
}

/* 辰 */
.cell-you {
    grid-area: 2 / 4 / 3 / 5;
}

/* 酉 */

.cell-mao {
    grid-area: 3 / 1 / 4 / 2;
}

/* 卯 */
.cell-xu {
    grid-area: 3 / 4 / 4 / 5;
}

/* 戌 */

.cell-yin {
    grid-area: 4 / 1 / 5 / 2;
}

/* 寅 */
.cell-chou {
    grid-area: 4 / 2 / 5 / 3;
}

/* 丑 */
.cell-zi {
    grid-area: 4 / 3 / 5 / 4;
}

/* 子 */
.cell-hai {
    grid-area: 4 / 4 / 5 / 5;
}

/* 亥 */

/* Palace Cell Layout Refactor */
.palace-cell {
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    /* padding: 8px; Removed padding to allow full edge control, will use internal padding */
    padding: 5px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    /* Prevent spillover */
}

/* Top Section: Stars */
.stars-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    /* Take up available space */
    overflow-y: auto;
    /* Scroll if absolutely too many stars, though rare */
    padding-right: 30px;
    /* Avoid overlap with top-right Stage badge */
}

.stars-major {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 2px;
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1.2;
}

/* Battle Configuration Styles */
.battle-config {
    background: rgba(253, 251, 247, 0.95);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px dashed var(--primary-color);
    animation: slideDown 0.3s ease;
}

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

.battle-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.immortal-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    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(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Section Styles (Embedded) */
.ai-section {
    margin-top: 40px;
    background: rgba(13, 27, 42, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    display: none;
    /* Hidden by default, shown when chart is generated */
    animation: fadeInUp 0.6s ease;
}

.ai-section.show {
    display: block;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.ai-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.8em;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 600px;
}

.ai-chat-window {
    flex-grow: 1;
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-controls-area {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.action-btn {
    background: rgba(27, 38, 59, 0.8);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

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

.ai-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
    transition: all 0.3s ease;
}

.ai-input-group.debate-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

/* 辩论模式下输入框和按钮 */
.ai-input-group.debate-mode .ai-input {
    min-height: 80px;
    font-size: 1em;
    flex: 1;
}

.ai-input-group.debate-mode .ai-debate-btn {
    font-size: 1.1em;
    padding: 12px 24px;
    white-space: nowrap;
    min-width: 100px;
}

.debate-bottom-config {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    overflow: hidden;
}
.debate-bottom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    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: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}
.debate-cancel-btn:hover {
    border-color: #ff5252;
    color: #ff5252;
}
.debate-bottom-body {
    padding: 12px 16px;
}
.debate-config-row {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
}
.debate-config-section {
    flex: 1;
}
.debate-bottom-input-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.debate-bottom-input-row .ai-input {
    height: 50px;
}
.debate-go-btn {
    white-space: nowrap;
    padding: 0 20px !important;
    font-size: 1em !important;
    min-width: 90px;
}

.ai-input {
    flex-grow: 1;
    padding: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-radius: 8px;
    resize: none;
    height: 60px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.ai-send-btn {
    width: 100px;
    background: var(--primary-color);
    color: #0d1b2a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    transition: background 0.3s;
}

.ai-send-btn:hover {
    background: #e6c200;
}

.ai-send-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.ai-debate-btn {
    width: 100px;
    background: linear-gradient(135deg, #8b0000, #c41e3a);
    color: #ffd700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1em;
    transition: background 0.3s, opacity 0.3s;
    position: relative;
    animation: debatePulse 2.5s ease-in-out infinite;
}

@keyframes debatePulse {
    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% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75em;
    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;
}

/* Message Styles (Reused/Adapted) */
.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 12px;
    line-height: 1.6;
    position: relative;
}

.message.user {
    align-self: flex-end;
    background: rgba(29, 53, 87, 0.8);
    border-bottom-right-radius: 2px;
    border: 1px solid rgba(119, 141, 169, 0.3);
    color: #e0e1dd;
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    /* Very slight transparency for readability */
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #e0e1dd;
}

.sender-name {
    font-size: 0.8em;
    color: var(--accent-color);
    margin-bottom: 5px;
    display: block;
}

/* Start Button overlay */
.start-ai-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--accent-color);
}

.privacy-notice {
    margin: 15px 20px;
    padding: 12px 18px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    font-size: 0.85em;
    color: #bbb;
    line-height: 1.6;
    max-width: 400px;
}

.btn-start-ai {
    margin-top: 20px;
    background: linear-gradient(135deg, #b8860b, #ffd700);
    color: #0d1b2a;
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.4);
    transition: transform 0.2s;
    font-family: inherit;
    font-weight: bold;
}

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

.start-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.start-buttons .btn-start-ai {
    margin-top: 0;
}

.btn-start-debate {
    background: linear-gradient(135deg, #8b0000, #c41e3a);
    color: #ffd700;
    padding: 15px 35px;
    font-size: 1.2em;
    border: none;
    border-radius: 50px;
    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);
}

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Noto Serif SC', serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #b8860b);
    color: #0d1b2a;
    border: none;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.6);
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: rgba(13, 27, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(10px);
}

.chat-container.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    padding: 15px;
    background: rgba(27, 38, 59, 0.9);
    color: #ffd700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary-color);
}

.chat-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    letter-spacing: 1px;
}

.chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.model-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--accent-color);
    background: rgba(13, 27, 42, 0.8);
    font-size: 12px;
    color: #e0e1dd;
    cursor: pointer;
}

.close-chat {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
}

.close-chat:hover {
    color: #fff;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: transparent;
    /* Changed from paper texture */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95em;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: rgba(27, 38, 59, 0.8);
    border: 1px solid #415a77;
    border-bottom-right-radius: 2px;
    color: #e0e1dd;
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    color: #e0e1dd;
}

.message .sender {
    font-size: 0.75em;
    color: var(--accent-color);
    margin-bottom: 4px;
    display: block;
}

.thinking-process {
    font-size: 0.9em;
    color: #ccc;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-color);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 0 4px 4px 0;
    display: none;
    /* Initially hidden or collapsed if desired */
}

.thinking-process.active {
    display: block;
    margin-top: 5px;
}

.thinking-header {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--accent-color);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.thinking-header::before {
    content: '▶';
    font-size: 0.8em;
    transition: transform 0.2s;
}

.thinking-process.expanded .thinking-header::before {
    transform: rotate(90deg);
}

.thinking-content {
    margin-top: 5px;
    white-space: pre-wrap;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85em;
    color: #aaa;
    line-height: 1.5;
}

.thinking-process.expanded .thinking-content {
    display: block;
}

.chat-input-area {
    padding: 15px;
    background: rgba(13, 27, 42, 0.95);
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    resize: none;
    height: 40px;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    transition: all 0.3s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    height: 60px;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #0d1b2a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    align-self: flex-end;
}

.send-btn:hover {
    background: #e6c200;
    transform: translateY(-2px);
}

.send-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px) {
    .chat-container {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 90px;
        height: 500px;
    }
}

.star-major {
    color: #ff4d4d;
    /* Red for major stars to pop */
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255, 77, 77, 0.5);
}

.stars-minor {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.85em;
    color: #ccc;
    line-height: 1.2;
}

.brightness {
    font-size: 0.7em;
    color: var(--primary-color);
    margin-left: 1px;
    vertical-align: super;
}

.mutagen-label {
    background-color: var(--primary-color);
    color: #0d1b2a;
    border-radius: 2px;
    padding: 0 2px;
    font-size: 0.7em;
    margin-left: 1px;
    vertical-align: middle;
    font-weight: bold;
}

/* Bottom Section: Info Grid */
.palace-bottom-info {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "gods gods gods"
        "stem spacer name";
    align-items: end;
    margin-top: 5px;
    min-height: 40px;
    /* Ensure space for bottom elements */
}

/* 12 Gods Row */
.gods-row {
    grid-area: gods;
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.9);
    /* Brightened for dark background */
    border-top: 1px dashed rgba(255, 215, 0, 0.3);
    padding-top: 2px;
    margin-bottom: 2px;
}

.gods-item {
    margin-right: 4px;
}

/* Stem/Branch (Bottom Left) */
.palace-stem-branch {
    grid-area: stem;
    font-size: 1.2em;
    font-weight: bold;
    color: #e0e1dd;
    font-family: 'Ma Shan Zheng', cursive;
    line-height: 1;
}

/* Palace Name (Bottom Right) */
.palace-name {
    grid-area: name;
    background-color: var(--primary-color);
    color: #0d1b2a;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1em;
    writing-mode: vertical-rl;
    text-orientation: upright;
    margin-left: auto;
    /* Push to right */
    box-shadow: 0 0 5px var(--primary-color);
}

/* Top Right Badge: Stage/Limit */
.palace-stage {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8em;
    color: #fff;
    background: var(--secondary-color);
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 10;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Center Cell Styles */
.chart-logo {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    text-align: left;
    font-size: 0.95em;
}

.user-info-label {
    color: var(--primary-color);
    font-weight: bold;
    text-align: right;
    white-space: nowrap;
}

/* Minimal Footer Attribution */
.footer-attribution {
    position: fixed;
    bottom: 5px;
    right: 10px;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    /* Let clicks pass through */
}

.header h1 {
    margin-bottom: 5px;
}

.header p {
    font-size: 0.8em;
    opacity: 0.6;
    margin: 0;
    display: none;
    /* Hide original header attribution */
}

.copy-btn-container {
    margin-top: 15px;
}

/* Responsive adjustments */
/* Battle Mode Layout */
.battle-row {
    display: grid;
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
    align-items: start;
}

.battle-col {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    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: 8px;
    margin-bottom: 10px;
    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: 10px;
}

/* ===== 众仙争论 (Debate Mode) Styles ===== */

/* 轮次标题 */
.debate-round-header {
    text-align: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4em;
    color: var(--primary-color);
    padding: 12px 0;
    margin: 20px 0 10px 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: 6px;
    letter-spacing: 4px;
}

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

/* 裁决区域 */
.debate-verdict {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #ffd700;
    border-radius: 12px;
    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: 15px;
    padding-bottom: 10px;
    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: 1em;
    line-height: 1.8;
    color: #ddd;
}

.debate-verdict .thinking-process {
    margin-bottom: 10px;
}

/* 争论进度指示 */
.debate-progress {
    text-align: center;
    padding: 8px;
    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; }
}
.settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: var(--primary-color);
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.settings-btn:hover {
    transform: rotate(45deg);
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.settings-content {
    background: rgba(13, 27, 42, 0.95);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    position: relative;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 10px;
}

.settings-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5em;
    color: var(--primary-color);
}

.close-settings {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--accent-color);
}

.close-settings:hover {
    color: #fff;
}

.settings-group {
    margin-bottom: 15px;
}

.settings-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: var(--primary-color);
}

.settings-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.settings-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-save-settings {
    background: var(--primary-color);
    color: #0d1b2a;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* ===== Inline Debate Styles ===== */

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

.debate-inline-config.collapsed {
    padding: 12px 20px;
}

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

.debate-inline-config.collapsed .debate-inline-config-header {
    margin-bottom: 5px;
    font-size: 1.1em;
}

.debate-inline-config-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: var(--accent-color);
    text-align: center;
}

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

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

.debate-config-title .judge-hint {
    font-family: inherit;
    font-size: 0.75em;
    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: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.debate-cost-estimate {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    font-size: 0.85em;
    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: 15px;
    align-items: stretch;
}

.debate-question-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border-radius: 8px;
    resize: none;
    height: 50px;
    font-family: inherit;
    font-size: 1em;
}

.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: 12px 30px;
    border-radius: 8px;
    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: 15px;
    border-left: 3px solid var(--primary-color);
    padding-left: 12px;
    margin: 10px 0;
}

/* 辩论现场折叠区域 */
.debate-scene-toggle {
    cursor: pointer;
    padding: 12px 18px;
    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: 8px;
    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: 8px;
}

.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: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.debate-inline-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    margin-top: 10px;
}

.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: 8px 16px;
    border-radius: 6px;
    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: 8px;
}

.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: 0.85em;
    color: var(--accent-color);
    margin-top: 4px;
}

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

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

/* 历史辩论按钮 */
.debate-history-btn {
    background: rgba(119, 141, 169, 0.15) !important;
    color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

.debate-history-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: 16px;
    width: 600px;
    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: 16px 20px;
    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: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7em;
    transition: all 0.2s;
}

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

.debate-history-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.debate-history-note {
    padding: 10px 16px;
    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: 40px;
    font-size: 1em;
}

.debate-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debate-history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    padding: 14px 16px;
    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: 1em;
    margin-bottom: 8px;
    line-height: 1.4;
}

.debate-history-item-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8em;
    color: #999;
}

.debate-history-item-action {
    margin-top: 8px;
    font-size: 0.85em;
    color: #ffd700;
    opacity: 0;
    transition: opacity 0.2s;
}

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

/* ===== Tablet Responsive (≤1024px) ===== */
@media (max-width: 1024px) {
    .container {
        margin: 20px auto;
        padding: 15px;
    }

    .ziwei-grid {
        gap: 6px;
        max-width: 100%;
    }

    .palace-cell {
        padding: 6px;
    }

    .stars-major {
        font-size: 1em;
    }

    .center-cell {
        padding: 12px;
    }

    .chart-logo {
        font-size: 1.6em;
    }

    .user-info-grid {
        font-size: 0.85em;
        gap: 4px 8px;
    }

    .battle-row {
        gap: 10px;
    }
}

/* ===== Mobile Responsive (≤768px) ===== */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        margin: 10px auto;
        padding: 10px;
        border-radius: 8px;
    }

    .corner-decoration {
        width: 60px;
        height: 60px;
    }

    .container::before {
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
    }

    /* Header */
    .header {
        padding: 30px 10px 20px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.6em;
        letter-spacing: 2px;
    }

    .header h1 img {
        height: 0.9em !important;
        margin-right: 8px !important;
    }

    .header p {
        font-size: 0.9em;
        letter-spacing: 1px;
    }

    .header::after {
        width: 80%;
        height: 25px;
        margin-top: 10px;
    }

    /* Form */
    .main-content {
        padding: 10px;
    }

    .input-section {
        padding: 15px;
    }

    .input-section h2 {
        font-size: 1.2em;
    }

    .form-group label {
        font-size: 0.9em;
    }

    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevent iOS zoom on focus */
        padding: 8px;
    }

    .btn-generate {
        font-size: 1.1em;
        padding: 12px;
    }

    /* Ziwei Chart Grid — horizontal scroll on mobile */
    .ziwei-chart-container {
        padding: 5px;
        margin-top: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .ziwei-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, minmax(120px, auto));
        gap: 3px;
        font-size: 0.65em;
        min-width: 520px; /* Wider for better readability */
    }

    .palace-cell {
        padding: 4px;
        min-width: 0;
        overflow: hidden;
    }

    .stars-major {
        font-size: 1em;
        gap: 2px;
    }

    .stars-minor {
        font-size: 0.8em;
        gap: 1px;
    }

    .stars-container {
        padding-right: 20px;
    }

    .center-cell {
        padding: 10px;
    }

    .chart-logo {
        font-size: 1.5em;
        margin-bottom: 8px;
    }

    .user-info-grid {
        font-size: 0.85em;
        gap: 3px 6px;
    }

    .user-info-label {
        font-size: 0.85em;
    }

    .copy-btn-container {
        margin-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }

    .btn-copy,
    .btn-ai-diagnosis {
        font-size: 0.85em;
        padding: 6px 12px;
    }

    .palace-name {
        font-size: 0.95em;
        padding: 1px 4px;
    }

    .palace-stem-branch {
        font-size: 1em;
    }

    .palace-stage {
        font-size: 0.7em;
    }

    .gods-row {
        font-size: 0.7em;
    }

    /* 提示滚动 */
    .ziwei-chart-container::after {
        content: '← 左右滑动查看完整命盘 →';
        display: block;
        text-align: center;
        font-size: 0.8em;
        color: rgba(255, 215, 0, 0.5);
        padding: 8px 0 2px;
        font-family: 'Noto Serif SC', serif;
    }

    /* AI Section */
    .ai-section {
        padding: 10px;
        margin-top: 20px;
    }

    .ai-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .ai-title {
        font-size: 1.3em;
    }

    .model-controls {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .model-select {
        width: 100%;
        font-size: 0.9em;
    }

    .battle-switch {
        font-size: 0.85em;
    }

    .battle-switch .label-text {
        font-size: 0.85em;
    }

    /* Battle Config */
    .battle-config {
        padding: 10px;
    }

    .battle-checkboxes {
        gap: 6px;
    }

    .immortal-option {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    /* AI Chat Container */
    .ai-container {
        height: auto;
        min-height: 400px;
    }

    .ai-chat-window {
        padding: 10px;
        min-height: 300px;
        max-height: 60vh;
    }

    .ai-controls-area {
        padding: 10px;
    }

    .quick-actions {
        gap: 6px;
        margin-bottom: 10px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    /* Input Group */
    .ai-input-group {
        gap: 8px;
        flex-direction: column;
    }

    .ai-input {
        padding: 10px;
        min-height: 50px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    .ai-btn-group {
        flex-direction: row !important;
        width: 100%;
    }

    .ai-send-btn {
        flex: 1;
        font-size: 0.85em;
        padding: 10px 8px;
    }

    .ai-debate-btn {
        flex: 1;
        font-size: 0.8em;
        padding: 10px 8px;
    }

    .ai-oneclick-btn {
        flex: 1;
        font-size: 0.8em;
        padding: 10px 8px;
    }

    /* Debate Bottom Config - Mobile */
    .debate-config-row {
        flex-direction: column;
        gap: 10px;
    }

    .debate-bottom-header {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .debate-bottom-body {
        padding: 10px 12px;
    }

    .debate-config-title {
        font-size: 0.85em;
    }

    .judge-hint {
        display: block;
        font-size: 0.85em;
        margin-top: 2px;
    }

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

    .debate-cost-estimate {
        font-size: 0.8em;
        padding: 8px 10px;
    }

    .debate-bottom-input-row {
        flex-direction: column;
        gap: 8px;
    }

    .debate-bottom-input-row .ai-input {
        height: 45px;
        font-size: 16px;
    }

    .debate-go-btn {
        width: 100% !important;
        min-width: unset;
        padding: 10px !important;
    }

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

    /* Start Overlay */
    .start-ai-overlay p {
        font-size: 0.9em;
        padding: 0 10px;
    }

    .start-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn-start-ai,
    .btn-start-debate {
        padding: 12px 30px;
        font-size: 1em;
    }

    /* Messages */
    .message {
        max-width: 95%;
        padding: 10px 12px;
        font-size: 0.9em;
    }

    .message .content-text {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .message .content-text pre {
        overflow-x: auto;
        max-width: 100%;
        font-size: 0.85em;
    }

    .message .content-text table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
    }

    /* Battle Row */
    .battle-row {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .battle-col {
        padding: 10px;
    }

    .battle-col-header {
        font-size: 1em;
    }

    .battle-col .content-text {
        font-size: 0.85em;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Debate Inline Config */
    .debate-inline-config {
        padding: 12px;
    }

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

    .debate-config-checkboxes {
        gap: 6px;
    }

    .debate-question-area {
        flex-direction: column;
        gap: 10px;
    }

    .debate-question-input {
        height: 60px;
    }

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

    .debate-inline-config-summary {
        font-size: 0.85em;
    }

    .debate-inline-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

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

    /* 辩论现场折叠 - 手机端 */
    .debate-scene-toggle {
        font-size: 1em;
        padding: 10px 14px;
        letter-spacing: 1px;
    }

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

    /* Settings Modal */
    .settings-content {
        width: 95%;
        padding: 15px;
    }

    .settings-title {
        font-size: 1.2em;
    }

    /* Thinking Process */
    .thinking-process {
        font-size: 0.85em;
    }

    .thinking-content {
        max-height: 200px;
        overflow-y: auto;
    }
}

/* ===== Small Phone (≤480px) ===== */
@media (max-width: 480px) {
    body {
        padding: 4px;
    }

    .container {
        margin: 5px auto;
        padding: 6px;
    }

    .corner-decoration {
        width: 40px;
        height: 40px;
    }

    .header h1 {
        font-size: 1.3em;
        letter-spacing: 1px;
    }

    .header h1 img {
        height: 0.8em !important;
        margin-right: 5px !important;
    }

    .input-section {
        padding: 10px;
    }

    .input-section h2 {
        font-size: 1em;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    /* ===== Chart: 手机端重排为可滚动但更大的格子 ===== */
    .ziwei-chart-container {
        padding: 2px;
        margin-top: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ziwei-grid {
        font-size: 0.7em;
        gap: 2px;
        min-width: 560px;
        grid-template-rows: repeat(4, minmax(120px, auto));
    }

    .palace-cell {
        padding: 4px;
    }

    .stars-major {
        font-size: 1em;
        gap: 2px;
    }

    .stars-minor {
        font-size: 0.8em;
        gap: 1px;
    }

    .stars-container {
        padding-right: 22px;
    }

    .center-cell {
        padding: 8px;
    }

    .chart-logo {
        font-size: 1.3em;
        margin-bottom: 5px;
    }

    .user-info-grid {
        font-size: 0.75em;
        gap: 1px 4px;
    }

    .copy-btn-container {
        margin-top: 5px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }

    .btn-copy,
    .btn-ai-diagnosis {
        font-size: 0.8em;
        padding: 5px 10px;
    }

    .palace-name {
        font-size: 0.9em;
        padding: 1px 3px;
    }

    .palace-stem-branch {
        font-size: 1em;
    }

    .palace-stage {
        font-size: 0.7em;
    }

    .gods-row {
        font-size: 0.7em;
    }

    /* AI */
    .ai-title {
        font-size: 1.1em;
    }

    .ai-container {
        min-height: 350px;
    }

    .ai-chat-window {
        min-height: 250px;
        max-height: 50vh;
        padding: 8px;
    }

    .ai-send-btn,
    .ai-debate-btn,
    .ai-oneclick-btn {
        font-size: 0.75em;
        padding: 8px 6px;
    }

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

    .btn-cost {
        display: none;
    }

    .debate-bottom-header span {
        font-size: 0.85em;
    }

    .debate-bottom-body {
        padding: 8px 10px;
    }

    .debate-config-title {
        font-size: 0.8em;
        margin-bottom: 4px;
    }

    .debate-cost-estimate {
        font-size: 0.75em;
        padding: 6px 8px;
        line-height: 1.5;
    }

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

    .action-btn {
        padding: 5px 8px;
        font-size: 0.75em;
    }

    /* 仙人选择项：手机上两列排列 */
    .battle-checkboxes,
    .debate-config-checkboxes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .immortal-option {
        padding: 5px 8px;
        font-size: 0.8em;
        justify-content: flex-start;
    }

    .battle-col {
        padding: 8px;
    }

    .debate-inline-config {
        padding: 8px;
    }

    .debate-inline-config-header {
        font-size: 1em;
        letter-spacing: 2px;
    }

    .message {
        max-width: 98%;
        padding: 8px 10px;
        font-size: 0.85em;
    }

    .chat-container {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        height: 450px;
    }

}

/* ===== Very Small Phone (≤380px) ===== */
@media (max-width: 380px) {
    .header h1 {
        font-size: 1.1em;
    }

    .ziwei-grid {
        font-size: 0.5em;
        min-width: 380px;
    }

    .ai-send-btn,
    .ai-debate-btn {
        width: 45px;
        font-size: 0.8em;
    }

    .debate-config-checkboxes {
        grid-template-columns: 1fr !important;
    }

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

    .btn-generate {
        font-size: 1em;
        padding: 10px;
    }
}
/* 通知铃铛动画 */
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(12deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}
#notifBell.has-unread {
    animation: bellShake 0.8s ease-in-out;
    animation-iteration-count: 3;
}

/* 书记员配置区域 */
#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 {
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: #4CAF50 !important;
}

/* 移动端辩论配置优化 */
@media (max-width: 768px) {
    .debate-config-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .debate-config-section {
        width: 100% !important;
    }
    .debate-config-checkboxes {
        gap: 4px !important;
    }
    .debate-config-checkboxes label {
        font-size: 0.8em !important;
        padding: 4px 8px !important;
    }
    #userInfoBar {
        padding: 6px 10px !important;
        gap: 8px !important;
        font-size: 12px !important;
        right: 8px !important;
        top: 8px !important;
    }
    .debate-inline-footer {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .debate-export-btn {
        font-size: 0.8em !important;
        padding: 6px 10px !important;
    }
}

/* 快捷按钮滚动 */
.quick-actions {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.quick-actions::-webkit-scrollbar {
    display: none;
}

/* 分段式进度导航 */
.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: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}
.debate-stepper-warning {
    text-align: center;
    color: #ff6b6b;
    font-size: 0.75em;
    margin-bottom: 8px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.debate-stepper-stages {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.debate-stepper-stages::-webkit-scrollbar { display: none; }
.debate-stage {
    flex: 1;
    min-width: 80px;
    padding: 8px 6px;
    border-radius: 8px;
    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-time {
    text-align: center;
    font-size: 0.7em;
    color: #888;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .debate-stage {
        min-width: 65px;
        padding: 6px 4px;
    }
    .stage-label { font-size: 0.7em; }
    .stage-hint { font-size: 0.55em; }
}


/* 价值主张区域 */
.start-value-prop {
    text-align: center;
    margin-bottom: 15px;
}
.value-prop-title {
    font-size: 1.3em;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 8px;
}
.value-prop-desc {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 10px;
}
.value-prop-features {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8em;
    color: #aaa;
}

/* 按钮组 */
.ai-btn-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}
.ai-oneclick-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    white-space: nowrap;
}
.ai-oneclick-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}
.btn-cost {
    font-size: 0.75em;
    opacity: 0.7;
    font-weight: normal;
}

/* 辩论模式下按钮组调整 */
.ai-input-group.debate-mode .ai-btn-group {
    flex-direction: row;
}

@media (max-width: 768px) {
    .ai-btn-group {
        min-width: 100px;
    }
    .ai-oneclick-btn {
        font-size: 0.8em;
        padding: 8px 12px;
    }
}

/* 移动端价值主张和用户栏优化 */
@media (max-width: 480px) {
    .value-prop-title {
        font-size: 1.1em;
    }
    .value-prop-desc {
        font-size: 0.8em;
    }
    .value-prop-features {
        font-size: 0.7em;
    }
    .privacy-notice {
        font-size: 0.75em !important;
    }
    .start-buttons {
        gap: 8px !important;
    }
    .btn-start-ai,
    .btn-start-debate {
        padding: 10px 20px !important;
        font-size: 0.9em !important;
    }
    #userInfoBar {
        padding: 4px 8px !important;
        gap: 6px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        max-width: calc(100vw - 16px) !important;
        flex-wrap: wrap !important;
    }
}

/* ===== 用户引导样式 ===== */

/* 开始页 - 使用方式卡片 */
.start-how-it-works {
    margin: 15px 0;
}
.how-title {
    color: #ffd700;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}
.how-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    transition: all 0.3s;
}
.how-card.recommended {
    border-color: rgba(255,215,0,0.4);
    background: rgba(255,215,0,0.05);
    box-shadow: 0 0 15px rgba(255,215,0,0.1);
}
.how-card-header {
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
}
.recommend-badge {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: bold;
}
.how-card-body {
    color: #bbb;
    font-size: 0.85em;
    line-height: 1.6;
}
.how-card-body p {
    margin: 4px 0;
}
.how-card-body ul {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}
.how-card-body ul li {
    padding: 2px 0;
}
.how-note {
    color: #999;
    font-size: 0.85em;
    font-style: italic;
}

/* 使用步骤 */
.start-steps {
    margin: 12px 0;
    text-align: left;
}
.steps-title {
    color: #ffd700;
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 0.85em;
    padding: 5px 0;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-weight: bold;
    font-size: 0.8em;
    flex-shrink: 0;
}

/* 底部提示 */
.start-tip {
    color: #888;
    font-size: 0.8em;
    margin-top: 10px;
    text-align: center;
}

/* 快捷话题提示 */
.quick-actions-hint {
    color: #999;
    font-size: 0.8em;
    text-align: center;
    margin-bottom: 6px;
    width: 100%;
}
.quick-actions-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* 输入框提示 */
.input-hint {
    color: #999;
    font-size: 0.78em;
    padding: 4px 8px;
    background: rgba(255,215,0,0.08);
    border-radius: 6px;
    text-align: center;
    width: 100%;
    animation: hintPulse 3s ease-in-out infinite;
}
@keyframes hintPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 浮动帮助按钮 */
.floating-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    z-index: 1000;
    transition: all 0.3s;
}
.floating-help:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102,126,234,0.6);
}

/* 帮助弹窗 */
.help-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}
.help-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #ddd;
}
.help-modal h3 {
    color: #ffd700;
    margin: 0 0 15px 0;
    text-align: center;
}
.help-modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    color: #888;
    cursor: pointer;
    font-size: 18px;
}
.help-modal-close:hover {
    color: #fff;
}
.help-section {
    margin-bottom: 15px;
}
.help-section h4 {
    color: #ffd700;
    font-size: 0.95em;
    margin: 0 0 6px 0;
}
.help-section p {
    font-size: 0.85em;
    line-height: 1.5;
    margin: 4px 0;
    color: #bbb;
}
.help-section ul {
    padding-left: 18px;
    margin: 6px 0;
}
.help-section ul li {
    font-size: 0.85em;
    color: #bbb;
    padding: 2px 0;
}

/* 空输入确认弹窗 */
.empty-input-confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}
.empty-input-confirm {
    background: #1a1a2e;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 15px;
    padding: 25px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.eic-title {
    color: #ffd700;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 12px;
}
.eic-body {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.6;
    text-align: left;
}
.eic-body p {
    margin: 6px 0;
}
.eic-default-q {
    background: rgba(255,215,0,0.1);
    border-left: 3px solid #ffd700;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
    color: #eee;
    font-size: 0.9em;
}
.eic-hint {
    color: #999;
    font-size: 0.85em;
}
.eic-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}
.eic-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}
.eic-btn-confirm {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
}
.eic-btn-confirm:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255,215,0,0.4);
}
.eic-btn-cancel {
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.2);
}
.eic-btn-cancel:hover {
    background: rgba(255,255,255,0.15);
}

/* 移动端帮助弹窗 */
@media (max-width: 480px) {
    .help-modal {
        padding: 18px;
        max-height: 85vh;
    }
    .how-card {
        padding: 10px 12px;
    }
    .how-card-body {
        font-size: 0.8em;
    }
    .start-steps {
        margin: 8px 0;
    }
    .step-item {
        font-size: 0.8em;
    }
    .floating-help {
        width: 38px;
        height: 38px;
        font-size: 17px;
        bottom: 15px;
        right: 15px;
    }
    .empty-input-confirm {
        padding: 18px;
    }
}

/* 辩论配置引导提示 */
.debate-guide-hint {
    color: #999;
    font-size: 0.8em;
    padding: 6px 12px;
    background: rgba(255,215,0,0.06);
    border-radius: 6px;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 引导提示条 */
.guide-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255,215,0,0.4);
    color: #ffd700;
    padding: 12px 24px;
    border-radius: 12px;
    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);
}

/* ===== 小贴士系统样式 ===== */

/* 表单下方提示 */
.form-tip {
    color: #888;
    font-size: 0.8em;
    text-align: center;
    margin-top: 10px;
    padding: 6px;
}

/* AI区域欢迎提示 */
.ai-welcome-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,140,0,0.05));
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    animation: tipFadeIn 0.5s ease;
}
.welcome-tip-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    animation: bounceDown 1.5s ease infinite;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}
.welcome-tip-text {
    color: #ccc;
    font-size: 0.85em;
    line-height: 1.6;
}
.welcome-tip-text b {
    color: #ffd700;
}

/* 聊天区域内的贴士气泡 */
.chat-tip-bubble {
    background: rgba(255,215,0,0.08);
    border-left: 3px solid rgba(255,215,0,0.4);
    color: #999;
    font-size: 0.8em;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 0 8px 8px 0;
    animation: tipFadeIn 0.5s ease;
    transition: opacity 0.5s ease;
}

@keyframes tipFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 辩论完成后的内联贴士 */
.context-tip-inline {
    display: flex;
    gap: 10px;
    background: rgba(255,215,0,0.06);
    border: 1px dashed rgba(255,215,0,0.2);
    border-radius: 10px;
    padding: 12px 15px;
    margin-top: 10px;
    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: 4px 0 0 0;
}
.context-tip-inline .tip-content ul li {
    padding: 2px 0;
}
.context-tip-inline .tip-content ul li::before {
    content: '→ ';
    color: #ffd700;
}

/* 辩论进度条小贴士 */
.debate-stepper-tip {
    color: #999;
    font-size: 0.78em;
    text-align: center;
    padding: 4px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    margin-top: 4px;
    transition: all 0.3s ease;
}
.debate-stepper-click-hint {
    text-align: center;
    font-size: 0.65em;
    color: #777;
    margin-top: 6px;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .ai-welcome-tip {
        padding: 10px 12px;
        gap: 8px;
    }
    .welcome-tip-text {
        font-size: 0.78em;
    }
    .context-tip-inline {
        padding: 10px 12px;
    }
    .context-tip-inline .tip-content {
        font-size: 0.78em;
    }
}

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

/* ===== 问题选择引导弹窗 ===== */
.qp-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 15px;
}
.qp-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 16px;
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    color: #ddd;
}
.qp-close {
    position: absolute;
    top: 12px; right: 16px;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    z-index: 1;
}
.qp-close:hover { color: #fff; }

.qp-header {
    text-align: center;
    margin-bottom: 18px;
}
.qp-title {
    color: #ffd700;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 4px;
}
.qp-subtitle {
    color: #999;
    font-size: 0.85em;
}

.qp-section {
    margin-bottom: 16px;
}
.qp-section-title {
    color: #ffd700;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 8px;
}
.qp-section-hint {
    color: #888;
    font-size: 0.8em;
    font-weight: normal;
}

/* 模型选择列表 */
.qp-model-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.qp-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.qp-model-item:hover {
    background: rgba(255,215,0,0.06);
    border-color: rgba(255,215,0,0.2);
}
.qp-model-item.selected {
    background: rgba(255,215,0,0.1);
    border-color: rgba(255,215,0,0.4);
    box-shadow: 0 0 10px rgba(255,215,0,0.1);
}
.qp-model-info {
    flex: 1;
}
.qp-model-name {
    color: #eee;
    font-size: 0.9em;
    font-weight: bold;
}
.qp-model-desc {
    color: #888;
    font-size: 0.75em;
    margin-top: 2px;
}
.qp-model-cost {
    color: #ffd700;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
    margin-left: 10px;
    padding: 3px 8px;
    background: rgba(255,215,0,0.1);
    border-radius: 6px;
}

/* 问题列表 */
.qp-question-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.qp-question-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #ccc;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}
.qp-question-btn:hover {
    background: rgba(255,215,0,0.08);
    border-color: rgba(255,215,0,0.3);
    color: #fff;
    transform: translateX(4px);
}
.qp-q-emoji {
    font-size: 1.2em;
    flex-shrink: 0;
}

/* 分割线 */
.qp-divider {
    text-align: center;
    color: #555;
    font-size: 0.8em;
    margin: 12px 0;
    position: relative;
}
.qp-divider::before,
.qp-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: rgba(255,255,255,0.1);
}
.qp-divider::before { left: 0; }
.qp-divider::after { right: 0; }

/* 自定义输入 */
.qp-custom {
    margin-top: 4px;
}
.qp-custom-hint {
    color: #999;
    font-size: 0.82em;
    margin-bottom: 6px;
}
.qp-custom-row {
    display: flex;
    gap: 8px;
}
.qp-custom-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.3s;
}
.qp-custom-input:focus {
    border-color: rgba(255,215,0,0.4);
}
.qp-custom-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    white-space: nowrap;
}
.qp-custom-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 12px rgba(255,215,0,0.4);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .qp-modal {
        padding: 16px;
        max-height: 90vh;
    }
    .qp-model-item {
        padding: 8px 10px;
    }
    .qp-model-name {
        font-size: 0.82em;
    }
    .qp-model-cost {
        font-size: 0.72em;
    }
    .qp-question-btn {
        padding: 8px 10px;
        font-size: 0.8em;
    }
}

/* 模型多选复选框 */
.qp-model-check {
    font-size: 1.1em;
    color: #ffd700;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

/* 模型选择费用汇总 */
.qp-cost-total {
    color: #999;
    font-size: 0.82em;
    text-align: center;
    padding: 8px;
    margin-top: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.qp-cost-total b {
    color: #ffd700;
}

/* 多模型同时回答 */
.multi-model-hint {
    color: #999;
    font-size: 0.82em;
    text-align: center;
    padding: 8px;
    margin: 8px 0;
}
.multi-model-answer {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    margin: 8px 0;
    overflow: hidden;
}
.multi-model-header {
    background: rgba(255,215,0,0.08);
    color: #ffd700;
    font-size: 0.85em;
    font-weight: bold;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.multi-model-content {
    padding: 12px 14px;
    color: #ddd;
    font-size: 0.9em;
    line-height: 1.7;
}
.multi-model-content .typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.multi-model-content .typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd700;
    animation: typingBounce 1.4s infinite;
}
.multi-model-content .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.multi-model-content .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== 一页式向导 ===== */
.ai-wizard {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* 步骤标题 */
.wizard-step {
    margin-bottom: 16px;
}
.wizard-step-title {
    color: #ffd700;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-weight: bold;
    font-size: 0.85em;
    flex-shrink: 0;
}

/* 问题输入 */
.wizard-question-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95em;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}
.wizard-question-input:focus {
    border-color: rgba(255,215,0,0.5);
}

/* 预设问题 */
.wizard-presets {
    margin-top: 10px;
}
.wizard-presets-label {
    color: #999;
    font-size: 0.82em;
    margin-bottom: 6px;
}
.wizard-presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wizard-preset-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    color: #bbb;
    font-size: 0.82em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.wizard-preset-btn:hover {
    background: rgba(255,215,0,0.1);
    border-color: rgba(255,215,0,0.3);
    color: #fff;
}
.wizard-preset-btn.active {
    background: rgba(255,215,0,0.15);
    border-color: rgba(255,215,0,0.5);
    color: #ffd700;
}

/* 模式选择卡片 */
.wizard-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}
.wizard-mode-card {
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.wizard-mode-card:hover {
    border-color: rgba(255,215,0,0.3);
    background: rgba(255,215,0,0.03);
}
.wizard-mode-card.selected {
    border-color: rgba(255,215,0,0.6);
    background: rgba(255,215,0,0.06);
    box-shadow: 0 0 20px rgba(255,215,0,0.1);
}
.wizard-mode-header {
    font-size: 1.05em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}
.wizard-mode-desc {
    color: #aaa;
    font-size: 0.82em;
    line-height: 1.6;
}
.wizard-mode-desc p {
    margin: 4px 0;
}
.wizard-mode-desc ul {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}
.wizard-mode-desc ul li {
    padding: 2px 0;
}
.wizard-mode-auto {
    color: #888;
    font-size: 0.85em;
    margin-top: 6px;
    font-style: italic;
}
.wizard-debate-info {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    color: #888;
    font-size: 0.8em;
}

/* 模型选择（普通模式内嵌） */
.wizard-model-picker {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.wizard-model-title {
    color: #ccc;
    font-size: 0.82em;
    font-weight: bold;
    margin-bottom: 6px;
}
.wizard-model-hint {
    color: #888;
    font-weight: normal;
    font-size: 0.9em;
}
.wizard-model-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wz-model-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.wz-model-item:hover {
    background: rgba(255,215,0,0.05);
}
.wz-model-item.selected {
    background: rgba(255,215,0,0.08);
    border-color: rgba(255,215,0,0.3);
}
.wz-model-check {
    color: #ffd700;
    font-size: 1em;
    flex-shrink: 0;
}
.wz-model-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.wz-model-name {
    color: #ddd;
    font-size: 0.82em;
    font-weight: bold;
}
.wz-model-desc {
    color: #777;
    font-size: 0.72em;
}
.wz-model-cost {
    color: #ffd700;
    font-size: 0.75em;
    font-weight: bold;
    white-space: nowrap;
}
.wizard-model-cost {
    color: #999;
    font-size: 0.78em;
    text-align: center;
    margin-top: 6px;
}
.wizard-model-cost b {
    color: #ffd700;
}

/* 开始按钮 */
.wizard-start-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 16px;
}
.wizard-start-btn:hover {
    transform: scale(1.01);
    box-shadow: 0 0 25px rgba(255,215,0,0.4);
}

/* 向导底部 */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
}
.wizard-privacy {
    color: #666;
    font-size: 0.78em;
}
.wizard-help-link {
    color: #888;
    font-size: 0.78em;
    cursor: pointer;
    transition: color 0.2s;
}
.wizard-help-link:hover {
    color: #ffd700;
}

/* 简化的底部输入区 */
.ai-input-simple {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-input-top-actions {
    display: flex;
    justify-content: flex-end;
}
.ai-input-simple .ai-input {
    width: 100%;
    box-sizing: border-box;
}
.ai-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.ai-new-btn {
    padding: 6px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #999;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.ai-new-btn:hover {
    background: rgba(255,215,0,0.1);
    border-color: rgba(255,215,0,0.3);
    color: #ffd700;
}

/* 移动端向导适配 */
@media (max-width: 768px) {
    .wizard-mode-cards {
        grid-template-columns: 1fr;
    }
    .ai-wizard {
        padding: 15px;
    }
}
@media (max-width: 480px) {
    .wizard-mode-card {
        padding: 12px;
    }
    .wizard-mode-header {
        font-size: 0.95em;
    }
    .wizard-mode-desc {
        font-size: 0.78em;
    }
    .wizard-start-btn {
        font-size: 1em;
        padding: 12px;
    }
    .wizard-presets-list {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .wizard-preset-btn {
        flex-shrink: 0;
    }
    .ai-wizard {
        padding: 12px;
    }
    .wizard-mode-card {
        padding: 10px;
    }
    .wizard-mode-header {
        font-size: 0.95em;
    }
    .wizard-mode-desc {
        font-size: 0.78em;
    }
    .wizard-mode-desc ul {
        margin: 3px 0;
    }
    .wizard-mode-desc ul li {
        padding: 1px 0;
    }
    .wizard-start-btn {
        font-size: 1em;
        padding: 12px;
        margin-top: 12px;
    }
    .wizard-question-input {
        font-size: 16px; /* prevent iOS zoom */
    }
}

/* 移动端底部输入区 */
@media (max-width: 480px) {
    .ai-input-simple {
        flex-direction: column;
    }
    .ai-input-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    .ai-input-actions .ai-send-btn {
        flex: 0;
    }
}

/* 默认问题确认弹窗 */
.default-q-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.dq-title {
    color: #ffd700;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 12px;
}
.dq-body {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.6;
    text-align: left;
}
.dq-body p { margin: 6px 0; }
.dq-default-q {
    background: rgba(255,215,0,0.1);
    border-left: 3px solid #ffd700;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
    color: #eee;
    font-size: 0.9em;
}
.dq-hint {
    color: #888;
    font-size: 0.82em;
}
.dq-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}
.dq-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}
.dq-btn-yes {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
}
.dq-btn-yes:hover {
    box-shadow: 0 0 15px rgba(255,215,0,0.4);
}
.dq-btn-no {
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.2);
}
.dq-btn-no:hover {
    background: rgba(255,255,255,0.15);
}

/* 多模型回答标签 */
.multi-model-tag {
    background: rgba(255,215,0,0.1);
    color: #ffd700;
    font-size: 0.78em;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 6px;
    display: inline-block;
}

/* 追问模型选择器 */
.followup-model-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}
.fp-model {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75em;
    color: #888;
    user-select: none;
}
.fp-model.selected {
    border-color: rgba(255,215,0,0.4);
    background: rgba(255,215,0,0.08);
    color: #ffd700;
}
.fp-model:hover {
    border-color: rgba(255,215,0,0.3);
}
.fp-model-name { white-space: nowrap; }
.fp-model-cost { font-size: 0.9em; opacity: 0.7; }
.followup-cost {
    font-size: 0.75em;
    color: #ffd700;
    white-space: nowrap;
    align-self: center;
}

.ai-typing-indicator {
    color: #888;
    font-size: 0.9em;
    animation: typingPulse 1.5s ease-in-out infinite;
}
.typing-dots {
    animation: typingDots 1.2s steps(4, end) infinite;
}
@keyframes typingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
@keyframes typingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

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

/* 顶部栏内嵌完整进度条 */
.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: 8px 12px;
    background: transparent;
    backdrop-filter: none;
}

/* 旧版顶部紧凑进度条（已弃用） */
.topbar-debate-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding-top: 6px;
    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 6px;
    border-radius: 4px;
    font-size: 11px;
    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: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}
.topbar-debate-warning {
    color: #ff6b6b;
    font-size: 10px;
    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: 8px 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* 移动端：辩论时 debate-stepper 不再 sticky（但悬浮容器内的除外） */
@media (max-width: 768px) {
    .debate-stepper:not(.debate-progress-float .debate-stepper) {
        position: relative !important;
        top: auto !important;
    }
    .debate-progress-float {
        position: fixed !important;
        top: 0 !important;
    }
    .debate-progress-float .debate-stepper {
        position: static !important;
    }
}

/* ===== 命盘输入区手机端间距收紧 ===== */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 12px;
    }
    .form-group label {
        margin-bottom: 4px;
    }
    .input-section h2 {
        margin-bottom: 15px;
        padding-bottom: 8px;
        font-size: 1.15em;
    }
    .form-row {
        gap: 0 !important;
    }
    .input-section {
        margin-bottom: 20px;
    }
    .btn-generate {
        margin-top: 5px;
    }
    .form-tip {
        margin-top: 6px;
        font-size: 0.75em;
    }
}
@media (max-width: 480px) {
    .form-group {
        margin-bottom: 8px;
    }
    .form-group label {
        margin-bottom: 2px;
        font-size: 0.85em;
    }
    .form-group input,
    .form-group select {
        padding: 6px 8px;
    }
    .input-section {
        padding: 8px;
        margin-bottom: 15px;
    }
    .input-section h2 {
        margin-bottom: 10px;
        padding-bottom: 6px;
        font-size: 1em;
    }
    .btn-generate {
        padding: 10px;
        font-size: 1em;
    }
    .form-tip {
        margin-top: 4px;
        padding: 3px;
        font-size: 0.72em;
    }
}

/* ===== 横屏优化 ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 10px 10px 8px;
        margin-bottom: 8px;
    }
    .header h1 {
        font-size: 1.2em;
    }
    .header p {
        font-size: 0.75em;
        margin-top: 2px;
    }
    .header::after {
        height: 15px;
        margin-top: 5px;
    }
    .input-section {
        padding: 8px;
        margin-bottom: 10px;
    }
    .input-section h2 {
        font-size: 0.95em;
        margin-bottom: 8px;
        padding-bottom: 4px;
    }
    .form-group {
        margin-bottom: 6px;
    }
    .form-group label {
        margin-bottom: 2px;
        font-size: 0.8em;
    }
    .form-group input,
    .form-group select {
        padding: 5px 8px;
        font-size: 14px;
    }
    .form-row {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
    }
    .btn-generate {
        padding: 8px;
        font-size: 0.95em;
    }
    /* 横屏时 debate-stepper 绝对不能 sticky */
    .debate-stepper {
        position: relative !important;
        top: auto !important;
    }
    /* 横屏时快捷按钮更紧凑 */
    .quick-actions-btns {
        gap: 4px;
    }
    .action-btn {
        padding: 4px 8px;
        font-size: 0.75em;
    }
    .quick-actions-hint {
        font-size: 0.7em;
        margin-bottom: 3px;
    }
    /* 横屏时 AI 区域更紧凑 */
    .ai-controls-area {
        padding: 8px;
    }
    .ai-chat-window {
        max-height: 50vh;
    }
    /* 横屏时 userInfoBar 更紧凑 */
    #userInfoBar {
        padding: 3px 8px !important;
        gap: 6px !important;
        font-size: 11px !important;
    }
    .topbar-debate-progress {
        margin-top: 3px;
        padding-top: 3px;
    }
    .topbar-stage {
        font-size: 10px;
        padding: 1px 4px;
    }
    /* 横屏时浮动帮助按钮更小 */
    .floating-help {
        width: 32px;
        height: 32px;
        font-size: 14px;
        bottom: 8px;
        right: 8px;
    }
    body {
        padding: 4px;
    }
    .container {
        padding: 6px;
        margin: 4px auto;
    }
}

/* ===== 移动端快捷按钮优化 ===== */
@media (max-width: 480px) {
    .quick-actions-btns {
        gap: 5px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .quick-actions-btns::-webkit-scrollbar { display: none; }
    .action-btn {
        flex-shrink: 0;
        padding: 5px 10px;
        font-size: 0.78em;
    }
    .quick-actions-hint {
        font-size: 0.72em;
        margin-bottom: 4px;
    }
    .rotating-tip-bar {
        font-size: 0.72em;
        padding: 4px 8px;
    }
}

/* ===== 命盘手机端优化 - 完整显示无需横向滚动 ===== */

/* 平板及手机 (≤768px) - 命盘自适应 */
@media (max-width: 768px) {
    /* 命盘结果区减少内边距，给命盘更多空间 */
    .result-section .result-content {
        padding: 8px !important;
    }

    /* 命盘容器：禁止横向滚动 */
    .ziwei-chart-container {
        overflow-x: hidden !important;
        overflow-y: visible !important;
        padding: 0 !important;
        margin-top: 15px !important;
    }

    /* 移除"左右滑动查看完整命盘"提示 */
    .ziwei-chart-container::after {
        display: none !important;
    }

    /* 命盘网格：移除最小宽度，完全自适应屏幕 */
    .ziwei-chart-container .ziwei-grid {
        min-width: unset !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 2px !important;
        grid-template-rows: repeat(4, minmax(90px, auto)) !important;
        font-size: 0.58em !important;
    }

    /* 宫位单元格紧凑化 */
    .ziwei-chart-container .palace-cell {
        padding: 3px !important;
        overflow: hidden !important;
    }

    .ziwei-chart-container .stars-container {
        padding-right: 16px !important;
        overflow: hidden !important;
    }

    .ziwei-chart-container .stars-major {
        gap: 1px !important;
        margin-bottom: 1px !important;
        font-size: 1em !important;
    }

    .ziwei-chart-container .stars-minor {
        gap: 1px !important;
        font-size: 0.8em !important;
    }

    /* 中宫紧凑化 */
    .ziwei-chart-container .center-cell {
        padding: 6px !important;
    }

    .ziwei-chart-container .chart-logo {
        font-size: 1.4em !important;
        margin-bottom: 4px !important;
        padding-bottom: 3px !important;
    }

    .ziwei-chart-container .user-info-grid {
        font-size: 0.85em !important;
        gap: 2px 4px !important;
    }

    .ziwei-chart-container .copy-btn-container {
        margin-top: 4px !important;
    }

    .ziwei-chart-container .btn-copy,
    .ziwei-chart-container .btn-ai-diagnosis {
        font-size: 0.8em !important;
        padding: 4px 8px !important;
    }

    /* 底部信息紧凑化 */
    .ziwei-chart-container .palace-bottom-info {
        margin-top: 2px !important;
        min-height: 26px !important;
    }

    .ziwei-chart-container .gods-row {
        font-size: 0.7em !important;
    }

    .ziwei-chart-container .palace-stem-branch {
        font-size: 0.95em !important;
    }

    .ziwei-chart-container .palace-name {
        font-size: 0.85em !important;
        padding: 1px 2px !important;
    }

    .ziwei-chart-container .palace-stage {
        font-size: 0.65em !important;
        padding: 1px 2px !important;
    }

    .ziwei-chart-container .brightness {
        font-size: 0.65em !important;
    }

    .ziwei-chart-container .mutagen-label {
        font-size: 0.6em !important;
        padding: 0 1px !important;
    }
}

/* 手机竖屏 (≤480px) - 命盘进一步紧凑 */
@media (max-width: 480px) {
    .result-section .result-content {
        padding: 4px !important;
    }

    .ziwei-chart-container {
        margin-top: 10px !important;
    }

    .ziwei-chart-container .ziwei-grid {
        min-width: unset !important;
        width: 100% !important;
        gap: 1px !important;
        grid-template-rows: repeat(4, minmax(78px, auto)) !important;
        font-size: 0.52em !important;
    }

    .ziwei-chart-container .palace-cell {
        padding: 2px !important;
    }

    .ziwei-chart-container .stars-container {
        padding-right: 14px !important;
    }

    .ziwei-chart-container .center-cell {
        padding: 4px !important;
    }

    .ziwei-chart-container .chart-logo {
        font-size: 1.2em !important;
        margin-bottom: 2px !important;
    }

    .ziwei-chart-container .user-info-grid {
        font-size: 0.78em !important;
        gap: 1px 3px !important;
    }

    .ziwei-chart-container .palace-name {
        font-size: 0.8em !important;
        padding: 1px 2px !important;
    }

    .ziwei-chart-container .palace-stem-branch {
        font-size: 0.85em !important;
    }

    .ziwei-chart-container .gods-row {
        font-size: 0.62em !important;
    }

    .ziwei-chart-container .palace-stage {
        font-size: 0.58em !important;
    }

    .ziwei-chart-container .btn-ai-diagnosis {
        font-size: 0.75em !important;
        padding: 3px 6px !important;
    }
}

/* 超小屏手机 (≤360px) - 命盘极致紧凑 */
@media (max-width: 360px) {
    .ziwei-chart-container .ziwei-grid {
        min-width: unset !important;
        font-size: 0.46em !important;
        gap: 1px !important;
        grid-template-rows: repeat(4, minmax(68px, auto)) !important;
    }

    .ziwei-chart-container .stars-container {
        padding-right: 12px !important;
    }

    .ziwei-chart-container .center-cell {
        padding: 3px !important;
    }

    .ziwei-chart-container .chart-logo {
        font-size: 1em !important;
    }

    .ziwei-chart-container .user-info-grid {
        font-size: 0.7em !important;
    }

    .ziwei-chart-container .palace-name {
        font-size: 0.75em !important;
    }
}

/* ===== 云端辩论历史 ===== */
.cloud-status {
    font-weight: bold;
    font-size: 0.85em;
}
.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: 8px;
    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: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cloud-download-btn:hover {
    border-color: #ffd700;
    background: rgba(255,215,0,0.1);
}
.cloud-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.85em;
    color: #aaa;
}
.cloud-pagination button {
    background: none;
    border: 1px solid rgba(255,215,0,0.3);
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 6px;
    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: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,215,0,0.15);
    margin-bottom: 12px;
}
.cloud-result-actions button {
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    color: #ffd700;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    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: 16px 0 8px;
}
.cloud-result-html blockquote {
    border-left: 3px solid #ffd700;
    padding-left: 12px;
    color: #bbb;
    margin: 10px 0;
}
.cloud-progress-detail {
    padding: 8px 0;
}
.cloud-progress-bar-lg {
    height: 28px;
    background: rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.cloud-progress-fill-lg {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #ffd700);
    border-radius: 14px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    color: #000;
    min-width: 40px;
}
.cloud-progress-log {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    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: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: transform 0.2s;
}
.cloud-view-result-btn:hover {
    transform: scale(1.05);
}

/* 云端辩论通知 */
.cloud-debate-notice {
    position: fixed;
    top: 16px;
    right: 16px;
    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: 12px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    max-width: 420px;
}
.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: 6px 14px;
    background: #b8860b;
    color: white;
    border: none;
    border-radius: 8px;
    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: 4px;
}
.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: 6px;
    padding: 2px 10px;
    font-size: 0.82em;
    cursor: pointer;
    margin-left: 12px;
}
.cloud-debate-cancel-btn:hover {
    background: rgba(255,80,80,0.3);
    color: #fff;
}

/* ===== Tab 页面系统 ===== */
.tab-page {
    display: none;
    width: 100%;
    min-height: calc(100vh - 60px);
    padding-bottom: 70px;
}
.tab-page.active {
    display: block;
}
.tab-page-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Tab 2 命盘页面内的 result-section 不需要额外上边距 */
#tabChart .result-section {
    margin-top: 0;
}
#tabChart .result-content {
    max-height: none;
}

/* 争论和回答tab内的 ai-section 不需要额外上边距 */
#tabDebate .ai-section,
#tabChat .ai-section {
    margin-top: 0;
}
/* AI container 在 tab 模式下自适应高度 */
#tabDebate .ai-container,
#tabChat .ai-container {
    height: auto;
    min-height: calc(100vh - 160px);
}
#tabDebate .ai-chat-window,
#tabChat .ai-chat-window {
    min-height: calc(100vh - 220px);
    max-height: none;
    flex-grow: 1;
}

/* 占位提示（未排盘时） */
.tab-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    color: #666;
}
.tab-placeholder .placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}
.tab-placeholder .placeholder-text {
    font-size: 1.5em;
    color: #888;
    font-family: 'Ma Shan Zheng', cursive;
    margin-bottom: 10px;
}
.tab-placeholder .placeholder-hint {
    font-size: 0.9em;
    color: #666;
}

/* 辩论tab输入区域 */
.debate-input-area {
    padding: 10px 15px;
    border-top: 1px solid rgba(255,215,0,0.15);
    background: rgba(0,0,0,0.2);
}
.debate-input-area .ai-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.debate-cost-hint {
    font-size: 0.8em;
    color: #999;
}
.debate-start-btn {
    background: linear-gradient(135deg, #ff6b35, #ff4500) !important;
    min-width: 100px;
}

/* ===== 底部 Tab 导航栏 ===== */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(13, 13, 30, 0.98);
    border-top: 1px solid rgba(255, 215, 0, 0.25);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.5);
}
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    cursor: pointer;
    color: #777;
    transition: all 0.25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.tab-item .tab-icon {
    font-size: 1.4em;
    line-height: 1;
    margin-bottom: 2px;
    transition: transform 0.25s ease;
}
.tab-item .tab-label {
    font-size: 0.72em;
    letter-spacing: 1px;
    font-family: 'Noto Serif SC', serif;
}
.tab-item.active {
    color: #ffd700;
}
.tab-item.active .tab-icon {
    transform: scale(1.15);
}
.tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #ffd700;
    border-radius: 0 0 2px 2px;
}
.tab-item:active {
    opacity: 0.7;
}

/* 浮动帮助按钮上移，避免被 tab bar 遮挡 */
.floating-help {
    bottom: 75px !important;
}

/* footer attribution 上移 */
.footer-attribution {
    bottom: 65px !important;
}

/* 移动端底部 tab 适配 */
@media (max-width: 480px) {
    .bottom-tab-bar {
        height: 55px;
    }
    .tab-item .tab-icon {
        font-size: 1.2em;
    }
    .tab-item .tab-label {
        font-size: 0.65em;
    }
    .tab-page {
        padding-bottom: 60px;
    }
    .floating-help {
        bottom: 65px !important;
    }
}

/* ===== 个人中心 Tab 页样式 ===== */
.profile-container {
    padding: 16px 12px;
    padding-bottom: 80px;
    max-width: 600px;
    margin: 0 auto;
}
.profile-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.profile-avatar { font-size: 56px; margin-bottom: 12px; filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.3)); }
.profile-name { color: #fff; font-size: 22px; font-weight: 700; font-family: 'Noto Serif SC', serif; margin-bottom: 8px; }
.profile-credits { color: #ffd700; font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.profile-logout-btn {
    background: rgba(255, 68, 68, 0.15); border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff6b6b; padding: 8px 24px; border-radius: 20px; font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.profile-logout-btn:hover { background: rgba(255, 68, 68, 0.3); }
.profile-section {
    background: rgba(26, 26, 46, 0.8); border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.profile-section h3 {
    color: #ffd700; font-size: 16px; font-family: 'Noto Serif SC', serif;
    margin: 0 0 12px 0; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}
.profile-debate-item {
    background: rgba(13, 27, 42, 0.6); border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.profile-debate-item:hover { background: rgba(255, 215, 0, 0.08); border-color: rgba(255, 215, 0, 0.3); }
.profile-debate-question { color: #fff; font-size: 15px; margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-debate-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #888; flex-wrap: wrap; }
.profile-debate-meta .status-completed { color: #4ecdc4; }
.profile-debate-meta .status-running { color: #ffd700; }
.profile-debate-meta .status-failed { color: #ff5252; }
.profile-debate-actions { display: flex; gap: 8px; margin-top: 8px; }
.profile-debate-actions button {
    background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.25);
    color: #ffd700; padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.profile-debate-actions button:hover { background: rgba(255, 215, 0, 0.25); }
.profile-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: #aaa; }
.profile-pagination button {
    background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.25);
    color: #ffd700; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.profile-empty { text-align: center; color: #666; padding: 20px; font-size: 14px; }
.profile-refresh-btn {
    display: block; margin: 12px auto 0; background: none; border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.profile-local-item {
    background: rgba(13, 27, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px; padding: 12px; margin-bottom: 8px;
}
.profile-local-item .local-q { color: #ddd; font-size: 14px; margin-bottom: 4px; }
.profile-local-item .local-meta { color: #666; font-size: 12px; }

/* 有"我的"Tab后，隐藏右上角悬浮用户信息栏 */
#userInfoBar { display: none !important; }
