/* =========================================
   Gemini UI Mobile Styles
   ========================================= */

/* 默认隐藏移动端头部 */
.mobile-header {
    display: none;
}

/* 桌面端显示状态栏 */
.desktop-only {
    display: flex;
}

/* 移动端样式覆盖 */
@media (max-width: 768px) {

    /* 隐藏桌面端元素 */
    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: none !important;
    }

    /* 全局背景调整 - 仿Gemini极简白 */
    body {
        background: #f0f4f9 !important;
        color: #1f1f1f !important;
    }

    /* 移动端头部 */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: transparent;
    }

    .header-title {
        font-size: 1.2em;
        color: #444746;
        font-weight: 500;
    }

    .icon-btn {
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: #444746;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }

    .icon-btn:active {
        background: rgba(0, 0, 0, 0.05);
    }

    .header-profile {
        cursor: pointer;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 2px solid transparent;
        background: linear-gradient(white, white) padding-box,
            linear-gradient(45deg, #4285f4, #34a853, #fbbc05, #ea4335) border-box;
    }

    /* 主内容区调整 */
    .game-content {
        display: block;
        height: 100vh;
        padding-top: 60px;
        padding-bottom: 80px;
    }

    .main-area {
        background: transparent !important;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* 欢迎页样式 */
    .gemini-welcome {
        padding: 20px;
        margin-top: 40px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .greeting-text {
        font-size: 3em;
        font-weight: 500;
        line-height: 1.2;
        color: #c4c7c5;
        margin-bottom: 10px;
        letter-spacing: -1px;
    }

    .player-name-large {
        display: block;
        background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 600;
    }

    .sub-greeting {
        font-size: 2em;
        color: #c4c7c5;
        margin-bottom: 40px;
        font-weight: 500;
        letter-spacing: -1px;
    }

    /* 建议芯片样式 */
    .suggestion-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .chip {
        background: #ffffff;
        border: none;
        border-radius: 12px;
        padding: 12px 20px;
        font-size: 0.95em;
        color: #1f1f1f;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        transition: background 0.2s;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .chip:active {
        background: #f0f4f9;
    }

    /* 聊天容器调整 */
    .chat-container {
        padding: 15px;
        background: transparent;
    }

    /* 底部输入区 (悬浮样式) */
    .input-area-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 15px 20px 15px;
        background: #f0f4f9;
        z-index: 50;
    }

    .input-area.gemini-style {
        background: #ffffff;
        border-radius: 30px;
        padding: 8px 15px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border: 1px solid transparent;
        transition: border 0.2s;
    }

    .input-area.gemini-style:focus-within {
        border-color: #e3e3e3;
    }

    .input-area.gemini-style textarea {
        flex: 1;
        background: transparent;
        border: none;
        color: #1f1f1f;
        font-size: 1em;
        padding: 8px 0;
        resize: none;
        max-height: 100px;
        line-height: 1.5;
    }

    .input-area.gemini-style textarea::placeholder {
        color: #8e918f;
    }

    .input-area.gemini-style .send-btn {
        color: #0b57d0;
        transition: color 0.2s;
    }

    .input-area.gemini-style .send-btn:disabled {
        color: #c4c7c5;
        cursor: default;
    }

    /* 生成选项按钮 (输入框内) */
    #generate-options-btn {
        color: #444746;
        transition: all 0.3s ease;
    }

    #generate-options-btn:hover {
        background: rgba(66, 133, 244, 0.1);
    }

    #generate-options-btn svg {
        color: #444746;
    }

    #generate-options-btn:hover svg {
        stroke: #4285f4;
    }

    /* 侧边栏调整 (白色背景) */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        background: #ffffff !important;
        backdrop-filter: none !important;
        z-index: 200;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 60px;
        display: block;
    }

    .mobile-sidebar-close {
        position: absolute;
        top: 15px;
        right: 15px;
        display: none;
        z-index: 201;
    }

    .sidebar.mobile-active {
        left: 0;
    }

    .sidebar.mobile-active .mobile-sidebar-close {
        display: flex;
    }

    .sidebar h3 {
        color: #444746 !important;
        border-bottom: 1px solid #e3e3e3 !important;
    }

    /* 侧边栏内容样式覆盖 */
    .current-location {
        background: #e8f0fe !important;
        color: #1967d2 !important;
        border: 1px solid #d2e3fc !important;
        box-shadow: none !important;
    }

    .npc-item {
        background: #ffffff !important;
        color: #1f1f1f !important;
        border: 1px solid #e3e3e3 !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 8px;
    }

    .npc-item:hover {
        background: #f8f9fa !important;
        border-color: #dadce0 !important;
    }

    .npc-name {
        color: #1f1f1f !important;
        font-weight: 500;
    }

    .npc-status {
        color: #5f6368 !important;
    }

    /* Modal Overrides for Light Theme */
    .modal-content {
        background: #ffffff !important;
        color: #1f1f1f !important;
        border: none !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    }

    .modal-content h2 {
        color: #1f1f1f !important;
    }

    .location-card {
        background: #f8f9fa !important;
        border: 1px solid #e3e3e3 !important;
        color: #1f1f1f !important;
        box-shadow: none !important;
    }

    .location-card:hover {
        background: #e8f0fe !important;
        border-color: #d2e3fc !important;
        transform: none !important;
    }

    .location-card h4 {
        color: #1967d2 !important;
    }

    .location-card p {
        color: #5f6368 !important;
    }

    /* NPC Profile Card in Modal */
    .npc-profile-card {
        background: #ffffff !important;
        border: 1px solid #e3e3e3 !important;
        color: #1f1f1f !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    .npc-profile-card:hover {
        border-color: #4285f4 !important;
        box-shadow: 0 4px 8px rgba(66, 133, 244, 0.15) !important;
    }

    .npc-profile-name {
        color: #1f1f1f !important;
    }

    .npc-profile-detail {
        color: #5f6368 !important;
        border-bottom-color: #f1f3f4 !important;
    }

    .npc-profile-detail strong {
        color: #444746 !important;
    }

    /* NPC Detail View */
    .npc-detail {
        background: #f8f9fa !important;
        color: #1f1f1f !important;
    }

    .npc-info-label {
        color: #5f6368 !important;
    }

    .close-modal:hover {
        color: #1f1f1f !important;
    }

    /* 遮罩层 */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        display: none;
    }

    .input-area.gemini-style textarea {
        flex: 1;
        background: transparent;
        border: none;
        color: #1f1f1f;
        font-size: 1em;
        padding: 8px 0;
        resize: none;
        max-height: 100px;
        line-height: 1.5;
    }

    .input-area.gemini-style textarea::placeholder {
        color: #8e918f;
    }

    .input-area.gemini-style .send-btn {
        color: #0b57d0;
        transition: color 0.2s;
    }

    .input-area.gemini-style .send-btn:disabled {
        color: #c4c7c5;
        cursor: default;
    }

    /* 生成选项按钮 (输入框内) */
    #generate-options-btn {
        color: #444746;
        transition: all 0.3s ease;
    }

    #generate-options-btn:hover {
        background: rgba(66, 133, 244, 0.1);
    }

    #generate-options-btn svg {
        color: #444746;
    }

    #generate-options-btn:hover svg {
        stroke: #4285f4;
    }

    /* 侧边栏调整 (白色背景) */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        background: #ffffff !important;
        backdrop-filter: none !important;
        z-index: 200;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 60px;
        display: block;
    }

    .mobile-sidebar-close {
        position: absolute;
        top: 15px;
        right: 15px;
        display: none;
        z-index: 201;
    }

    .sidebar.mobile-active {
        left: 0;
    }

    .sidebar.mobile-active .mobile-sidebar-close {
        display: flex;
    }

    .sidebar h3 {
        color: #444746 !important;
        border-bottom: 1px solid #e3e3e3 !important;
    }

    /* 侧边栏内容样式覆盖 */
    .current-location {
        background: #e8f0fe !important;
        color: #1967d2 !important;
        border: 1px solid #d2e3fc !important;
        box-shadow: none !important;
    }

    .npc-item {
        background: #ffffff !important;
        color: #1f1f1f !important;
        border: 1px solid #e3e3e3 !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
        margin-bottom: 8px;
    }

    .npc-item:hover {
        background: #f8f9fa !important;
        border-color: #dadce0 !important;
    }

    .npc-name {
        color: #1f1f1f !important;
        font-weight: 500;
    }
}

.npc-profile-name {
    color: #1f1f1f !important;
}

.npc-profile-detail {
    color: #5f6368 !important;
    border-bottom-color: #f1f3f4 !important;
}

.npc-profile-detail strong {
    color: #444746 !important;
}

/* NPC Detail View */
.npc-detail {
    background: #f8f9fa !important;
    color: #1f1f1f !important;
}

.npc-info-label {
    color: #5f6368 !important;
}

.close-modal:hover {
    color: #1f1f1f !important;
}

/* 遮罩层 */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
}

.option-generating {
    background: #f0f4f9 !important;
    border: 1px solid #e3e3e3 !important;
    color: #0b57d0 !important;
}

/* 选项按钮覆盖样式 */
.option-btn {
    background: #ffffff !important;
    color: #1f1f1f !important;
    border: 1px solid #e3e3e3 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    /* 允许文字换行 */
    height: auto !important;
}

.option-btn:hover {
    background: #f8f9fa !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

/* 不同类型选项的颜色微调 */
.option-btn.平常 {
    border-left: 4px solid #4285f4 !important;
}

.option-btn.激进 {
    border-left: 44px solid #ea4335 !important;
}

.option-btn.调皮 {
    border-left: 4px solid #fbbc05 !important;
}

.option-text {
    color: #1f1f1f !important;
    font-size: 0.95em !important;
}

.option-type {
    background: #f1f3f4 !important;
    color: #5f6368 !important;
    font-size: 0.8em !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
}

/* 选项容器调整 */
.options-container {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    padding: 10px 15px;
    margin-bottom: 80px;
    /* 为底部输入框留出空间 */
    max-height: none !important;
    /* 允许完整显示 */
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* 收起状态 */
.options-container.collapsed {
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden !important;
    transform: translateY(20px);
    pointer-events: none;
}

/* 选项切换按钮 */
.options-toggle-btn {
    position: absolute;
    right: 10px;
    top: -40px;
    /* 位于选项上方 */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e3e3e3;
    color: #ef4444;
    /* 红色箭头 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.options-toggle-btn:hover {
    background: #fef2f2;
    transform: scale(1.1);
}

/* 收起时的按钮状态 - 箭头翻转 */
.options-toggle-btn.collapsed svg {
    transform: rotate(180deg);
}

/* 按钮内的SVG动画 */
.options-toggle-btn svg {
    transition: transform 0.3s ease;
}

.loading-options {
    color: #5f6368 !important;
}

.loading-options small {
    color: #8e918f !important;
}

/* 隐藏旧的输入区 */
.input-area:not(.gemini-style) {
    display: none;
}

/* 消息样式覆盖 - 确保文字黑色 */
.message.player {
    color: #1f1f1f !important;
    background: #e8f0fe !important;
    border: none !important;
}

.message.ai {
    color: #1f1f1f !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.message-header {
    color: #444746 !important;
}
}