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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #0a0a1a;
    color: #ccc;
    min-height: 100vh;
}

/* 顶部栏 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    background: #12122a;
    border-bottom: 1px solid #1a1a3e;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #e94560;
    letter-spacing: 2px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-top {
    border: 2px solid #e94560;
    flex-shrink: 0;
}

.mibei-display {
    background: #1a1a3e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stamina-display {
    background: #1a1a3e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    color: #4fc3f7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stamina-icon {
    font-size: 14px;
}

.coin-icon {
    font-size: 16px;
}

.btn-signin {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a2e;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: 0.2s;
}

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

.btn-signin:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.user-name {
    color: #fff;
    font-size: 14px;
}

.user-uid {
    color: #888;
    font-size: 12px;
}

.btn-auth {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-auth:hover {
    background: #ff6b81;
}

.btn-logout {
    background: transparent;
    color: #888;
    border: 1px solid #444;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout:hover {
    color: #fff;
    border-color: #fff;
}

/* 主容器 */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-title {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    font-size: 28px;
}

/* 标签页导航 */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
    background: #12122a;
    border-radius: 12px;
    overflow: hidden;
}

.tab-nav-btn {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-nav-btn:hover {
    color: #ccc;
    background: #1a1a3e;
}

.tab-nav-btn.active {
    color: #e94560;
    border-bottom-color: #e94560;
    background: #1a1a3e;
}

/* 内联汤列表 */
.soup-list-inline {
    margin-bottom: 30px;
}

.soup-card {
    background: #1a1a3e;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid #e94560;
}

.soup-card:hover {
    background: #2a2a4e;
}

.soup-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.soup-desc {
    color: #888;
    font-size: 13px;
}

/* 汤状态标签 */
.soup-status {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: rgba(255,255,255,0.05);
}

/* 导航链接 */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.nav-links a {
    color: #888;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: 0.2s;
}

.nav-links a:hover {
    color: #e94560;
    background: #1a1a3e;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #12122a;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid #1a1a3e;
}

.game-modal {
    max-width: 800px;
    max-height: 90vh;
}

.auth-modal {
    max-width: 420px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #1a1a3e;
    position: sticky;
    top: 0;
    background: #12122a;
    z-index: 10;
}

.modal-header h2 {
    color: #e94560;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

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

/* 汤详情 */
.soup-detail-body {
    padding: 20px;
}

.soup-face-box {
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: #ddd;
    margin-bottom: 15px;
}

.hidden-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: #888;
    font-size: 14px;
}

.hidden-info span {
    background: #1a1a3e;
    padding: 5px 12px;
    border-radius: 8px;
}

.hidden-info b {
    color: #e94560;
}

.play-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-play {
    padding: 12px 40px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.btn-play.solo {
    background: linear-gradient(135deg, #e94560, #ff6b81);
    color: #fff;
}

.btn-play.solo:hover {
    transform: scale(1.05);
}

.btn-play.team {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
}

.btn-play.team:hover {
    transform: scale(1.05);
}

.stamina-cost-badge {
    font-size: 11px;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
    color: #4fc3f7;
}

/* 游戏区 */
.game-body {
    padding: 12px;
}

.game-section {
    margin-bottom: 12px;
}

.game-section h4 {
    color: #e94560;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-bar {
    height: 8px;
    background: #1a1a3e;
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
}

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

.progress-text {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-bottom: 15px;
}

/* 模式切换 */
.mode-toggle {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.mode-btn {
    padding: 4px 8px;
    border: 1px solid #444;
    background: #1a1a3e;
    color: #888;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    transition: 0.2s;
    white-space: nowrap;
}

.mode-btn.active {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
}

/* 汤底 */
.soup-base-box {
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    line-height: 1.8;
    color: #ccc;
    max-height: 280px;
    overflow-y: auto;
}

/* 汤底中隐藏/揭示词的颜色标记（精简版：仅颜色字，无背景无边框） */
.hl-core {
    color: #e94560;
    font-weight: bold;
}

.hl-important {
    color: #ff9800;
    font-weight: bold;
}

.hl-core-revealed {
    color: #e94560;
    font-weight: bold;
    border-bottom: 1px dashed #e94560;
}

.hl-important-revealed {
    color: #ff9800;
    font-weight: bold;
    border-bottom: 1px dashed #ff9800;
}

/* 汤底中隐藏词可点击 */
.hidden-click {
    cursor: pointer;
    transition: 0.2s;
}

.hidden-click:hover {
    opacity: 0.7;
}

/* 解锁弹窗（fixed定位） */
.unlock-popup {
    position: fixed;
    z-index: 9999;
    background: #1a1a2e;
    border: 1px solid #e94560;
    border-radius: 10px;
    padding: 12px 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    min-width: 180px;
    transform: translateX(-50%);
}

.unlock-popup-info {
    font-size: 13px;
    margin-bottom: 10px;
    color: #ccc;
    line-height: 1.5;
}

.unlock-popup-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-unlock-confirm {
    padding: 5px 16px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.btn-unlock-confirm:hover {
    background: #ff6b81;
}

.btn-unlock-cancel {
    padding: 5px 16px;
    background: #333;
    color: #888;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
}

.btn-unlock-cancel:hover {
    color: #fff;
}

/* 禁止复制 */
.soup-face-box, .soup-base-box {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-select: none;
    touch-action: manipulation;
}

/* 聊天区 */
.chat-area {
    margin-top: 20px;
    border: 1px solid #1a1a3e;
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    height: 220px;
    overflow-y: auto;
    padding: 10px;
    background: #0d0d1a;
}

.chat-msg {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

/* 用户消息（头像在右） */
.user-msg-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 8px;
}

.user-msg-wrap .chat-bubble {
    order: -1;
}

.user-bubble {
    background: #1a1a3e;
    color: #fff;
    padding: 6px 10px;
    border-radius: 12px 4px 12px 12px;
    max-width: 70%;
    font-size: 13px;
}

/* AI消息（头像在左） */
.ai-msg-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
}

.ai-bubble {
    background: #0d2a1a;
    color: #a5d6a7;
    padding: 6px 10px;
    border-radius: 4px 12px 12px 12px;
    max-width: 70%;
    font-size: 13px;
}

.ai-name {
    display: block;
    font-size: 10px;
    color: #e94560;
    font-weight: bold;
    margin-bottom: 3px;
}

/* 聊天气泡 */
.chat-bubble {
    word-break: break-word;
    font-size: 13px;
    line-height: 1.5;
}

/* 圆形头像 */
.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #333;
}

.error-msg {
    background: #3a0a0a;
    color: #ef9a9a;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
}

.system-msg {
    background: #1a1a0a;
    color: #ffd700;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.victory-msg {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    padding: 15px;
    border-radius: 8px;
}

.loading {
    color: #888;
    font-style: italic;
    padding: 8px 12px;
}

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 6px;
    background: #1a1a3e;
}

.chat-input-area input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.chat-input-area input:focus {
    border-color: #e94560;
}

.btn-send {
    padding: 7px 16px;
    background: #e94560;
    border: none;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-send:hover {
    background: #ff6b81;
}

/* 登录/注册表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: #888;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    outline: none;
}

.form-group input:focus {
    border-color: #e94560;
}

/* 头像选择 */
.avatar-select {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: 0.2s;
}

.avatar-option:hover {
    border-color: #444;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-option input[type="radio"]:checked + img {
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.avatar-option span {
    color: #888;
    font-size: 13px;
}

.avatar-option input[type="radio"]:checked ~ span {
    color: #e94560;
}

.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #333;
    transition: 0.2s;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e94560, #ff6b81);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: scale(1.02);
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    color: #888;
    font-size: 14px;
}

.auth-switch a {
    color: #e94560;
    text-decoration: none;
}

.auth-modal form {
    padding: 20px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a3e;
    color: #fff;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeInUp 0.3s;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 评论区 */
.comment-item {
    background: #0d0d1a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.comment-user {
    color: #e94560;
    font-size: 13px;
    font-weight: bold;
}

.comment-time {
    color: #666;
    font-size: 11px;
}

.comment-content {
    color: #ccc;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

/* 游戏信息行：剩余迷贝 | 查看汤面 | 解锁进度 */
.game-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.mibei-in-game {
    background: #1a1a3e;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    color: #ffd700;
    white-space: nowrap;
    flex-shrink: 0;
}

.stamina-in-game {
    background: #1a1a3e;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    color: #4fc3f7;
    white-space: nowrap;
    flex-shrink: 0;
}

.progress-wrap {
    flex: 1;
    min-width: 120px;
}

/* 查看汤面按钮 */
.btn-view-face {
    padding: 5px 14px;
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-view-face:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #1976d2, #2196f3);
}

/* 响应式 */
@media (max-width: 768px) {
    .tab-nav-btn {
        padding: 10px 8px;
        font-size: 13px;
    }
    .top-bar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .user-area {
        flex-wrap: wrap;
        gap: 6px;
    }
    /* 游戏弹窗占满全屏 */
    #gameModal .modal-content.game-modal {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    .game-body {
        padding: 8px;
        display: flex;
        flex-direction: column;
        height: calc(100vh - 60px);
    }
    .chat-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .chat-messages {
        flex: 1;
        height: auto;
    }
    .chat-avatar {
        width: 24px;
        height: 24px;
    }
    .user-bubble, .ai-bubble {
        max-width: 80%;
        font-size: 12px;
    }
    .chat-bubble {
        font-size: 12px;
    }
    .chat-msg {
        font-size: 12px;
    }
    .soup-base-box {
        font-size: 13px;
        padding: 10px;
        max-height: 200px;
    }
    .game-info-row {
        gap: 6px;
    }
    .mibei-in-game {
        padding: 4px 8px;
        font-size: 11px;
    }
    .stamina-in-game {
        padding: 4px 8px;
        font-size: 11px;
    }
    .btn-view-face {
        padding: 4px 10px;
        font-size: 11px;
    }
    .chat-input-area {
        padding: 6px;
        gap: 4px;
    }
    .chat-input-area input {
        padding: 6px 10px;
        font-size: 12px;
    }
    .btn-send {
        padding: 6px 12px;
        font-size: 12px;
    }
    .mode-btn {
        padding: 3px 6px;
        font-size: 10px;
    }
    .btn-view-face {
        padding: 8px 20px;
        font-size: 13px;
    }
    .game-section {
        margin-bottom: 8px;
    }
    .game-section h4 {
        font-size: 12px;
        margin-bottom: 5px;
    }
    .progress-text {
        font-size: 11px;
        margin-bottom: 8px;
    }
    .progress-bar {
        height: 6px;
    }
}