/* (保留你之前的所有样式) */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* --- Modal Styles --- */
#setup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #2a2a2a;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

h2 {
    margin-top: 0;
    color: #bb86fc;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
    box-sizing: border-box;
}

#character-options {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #444;
    padding: 1rem;
    border-radius: 4px;
}

#character-options label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-weight: normal;
}

#character-options input[type="radio"] {
    margin-right: 0.5rem;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: #bb86fc;
    color: #121212;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #9e6ae6;
}
button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* --- Chat Container Styles --- */
.hidden {
    display: none !important;
}

.chat-container {
    width: 95%;
    max-width: 800px;
    height: 95vh;
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem;
    background-color: #2a2a2a;
    border-bottom: 1px solid #333;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.status-bar {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 0.25rem;
}

.status-bar span {
    margin-right: 1rem;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    background-color: #bb86fc;
    color: #121212;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background-color: #333;
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

#chat-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #333;
}

#chat-form input {
    flex-grow: 1;
    margin-right: 1rem;
}

/* --- 新增样式 --- */
#stop-game-btn {
    background-color: #cf6679;
    color: #121212;
}
#stop-game-btn:hover {
    background-color: #b0495a;
}

#stats-panel {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1rem;
    background-color: #252525;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
}

.stat-item {
    text-align: center;
    color: #c0c0c0;
}

.stat-item span:first-child {
    margin-right: 0.5em;
    font-weight: bold;
}

#score-display { color: #f0e68c; }
#shock-intensity-display { color: #ff7f7f; }
#shock-duration-display { color: #87ceeb; }

/* 闪烁动画 */
#shock-info.flashing {
    animation: flash-effect 0.5s infinite alternate;
}

@keyframes flash-effect {
    from {
        background-color: #5e3030;
        border-radius: 5px;
        transform: scale(1.05);
    }
    to {
        background-color: transparent;
        transform: scale(1);
    }
}

/* (保留你之前的打字指示器等样式) */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}
.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #888;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }
.max-intensity-display span {
    color: #a9a9a9;
}
#max-a-display, #max-b-display {
    color: #f0e68c; /* 金色 */
    font-weight: bold;
    margin: 0 0.25em;
}

#shock-pattern-display {
    color: #87ceeb; /* 天蓝色 */
}