/* DS随心转 AI聊天页面 - 移动端适配样式 */

/* 响应式设计: max-width: 1200px */
@media (max-width: 1200px) {
    .chat-sidebar.expanded {
        width: 16vw;
        min-width: 250px;
        max-width: 300px;
    }

    .editor-panel {
        min-width: 350px;
    }

    .chat-main {
        min-width: 320px;
    }
}

/* 响应式设计: max-width: 1024px */
@media (max-width: 1024px) {
    .chat-sidebar.expanded {
        width: 18vw;
        min-width: 240px;
        max-width: 280px;
    }

    .chat-sidebar.collapsed {
        width: 50px;
        min-width: 50px;
    }

    .editor-panel {
        min-width: 320px;
    }

    .chat-main {
        min-width: 280px;
    }
}

/* 响应式设计: max-width: 768px (Mobile Tablet) */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100%;
        min-width: 100vw;
        height: auto;
        position: relative;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .chat-sidebar.mobile-hidden {
        display: none;
    }

    .chat-user-profile {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 10px 20px;
    }

    .chat-session-area {
        padding-bottom: 20px;
    }

    .chat-main {
        flex: 1;
        min-width: 100vw;
        height: 60vh;
        /* Approximate */
    }

    /* Editor Panel Mobile */
    .editor-panel {
        width: 100vw;
        min-width: 100vw;
        height: 40vh;
        border-left: none;
        border-top: 1px solid #e8e8e8;
    }

    .sidebar-toggle-btn {
        display: none;
    }

    /* Input Area Mobile */
    .chat-input-backdrop {
        left: 0;
        position: fixed;
        bottom: 0;
        background: white;
    }

    .chat-input-container.bottom-fixed {
        width: 90%;
        left: 5%;
    }

    /* Welcome & Message Mobile */
    .welcome-content h1 {
        font-size: 24px;
    }

    .welcome-content p {
        font-size: 14px;
    }

    .message-content {
        max-width: 85%;
    }

    .command-timeline-status {
        max-width: 100%;
        margin: 12px auto 6px;
        padding: 0 10px 0 46px;
    }

    .command-timeline {
        --timeline-axis-x: 22px;
        --timeline-content-offset: 46px;
        padding: 12px 10px 150px var(--timeline-content-offset);
        max-width: 100%;
        border-radius: 14px;
    }

    .command-card {
        padding: 12px 14px;
    }

    .command-card::before {
        top: 18px;
    }

    .command-card::after {
        top: 20px;
    }

    /* Command Card Actions Mobile */
    .command-card-actions {
        display: flex !important;
        opacity: 0.8;
    }

    .command-card:hover .command-card-actions {
        opacity: 1;
    }

    /* AI Logo Mobile */
    .ai-message-logo {
        width: 28px;
        height: 28px;
        top: -1px;
        left: -1px;
    }

    .ai-message-logo img {
        width: 20px;
        height: 20px;
    }

    .message.ai-message .message-content {
        padding-left: 36px;
    }

    /* Tool Buttons Mobile */
    .message-tools {
        flex-wrap: wrap;
        gap: 6px;
    }

    .message-tools .tool-btn {
        font-size: 11px;
        padding: 5px 8px;
        min-width: 70px;
    }

    /* Reasoning Header Mobile */
    .reasoning-header {
        padding: 10px 12px !important;
    }

    /* Restore Editor Modal Mobile */
    #restoreEditorModal .restore-editor-modal-content {
        width: 95%;
        max-width: 400px;
        border-radius: 14px;
    }

    .restore-editor-modal-header {
        padding: 18px 16px 14px;
        gap: 12px;
    }

    .restore-editor-modal-title-group {
        gap: 6px;
    }

    .restore-editor-modal-header h3 {
        font-size: 20px;
    }

    .restore-editor-modal-title-icon {
        font-size: 19px;
    }

    .restore-editor-modal-body {
        padding: 20px 16px 18px;
    }

    .restore-editor-icon {
        width: 62px;
        height: 62px;
        border-radius: 14px;
        margin-bottom: 14px;
    }

    .restore-editor-icon .layui-icon {
        font-size: 32px !important;
    }

    .restore-editor-message {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .restore-editor-submessage {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .restore-editor-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .restore-editor-btn {
        width: 100%;
        min-width: auto;
        padding: 11px 18px;
        font-size: 14px;
    }

    #chatInputExpandModal .chat-input-expand-modal-content {
        width: 94vw;
        margin-top: 4vh;
        border-radius: 12px;
    }

    #chatInputExpandModal .chat-input-expand-header {
        padding: 14px 14px;
    }

    #chatInputExpandModal .chat-input-expand-body {
        padding: 12px 14px 8px;
    }

    #chatInputExpandModal .chat-input-expand-textarea {
        height: 52vh;
    }

    #chatInputExpandModal .chat-input-expand-actions {
        padding: 10px 14px 14px;
        gap: 8px;
    }
}

/* 响应式设计: max-width: 480px (Phone) */
@media (max-width: 480px) {
    .chat-nav {
        padding: 15px;
    }

    .new-chat-btn {
        margin: 15px;
        padding: 10px 14px;
    }

    .session-list {
        padding: 0 15px 15px;
    }

    .chat-messages {
        margin: 15px;
        margin-bottom: 0;
        padding: 15px;
    }

    .input-actions {
        padding: 12px;
    }

    .chat-input-container.bottom-fixed .input-actions {
        padding: 12px 15px;
    }

    .message-avatar img {
        width: 32px;
        height: 32px;
    }

    .message-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Login Modal Mobile */
    .login-modal-content {
        width: 95%;
        margin: 20px;
    }

    .login-modal-header,
    .login-modal-body {
        padding: 20px;
    }

    .verify-code-group {
        flex-direction: column;
        gap: 12px;
    }

    .send-code-btn {
        min-width: auto;
    }

    .password-input-group .form-input {
        padding-right: 45px;
    }

    .password-toggle-btn {
        right: 8px;
        padding: 6px;
    }

    .password-toggle-btn i {
        font-size: 14px;
    }

    /* Promo Modal Mobile */
    #double11PromoModal {
        padding: 20px !important;
    }

    .double11-promo-content {
        width: 95% !important;
        max-width: 380px !important;
        margin: 0 !important;
    }

    .double11-promo-close {
        width: 32px !important;
        height: 32px !important;
        top: 12px !important;
        right: 12px !important;
    }

    .double11-promo-close .layui-icon {
        font-size: 16px !important;
    }
}

/* 响应式设计: max-width: 360px */
@media (max-width: 360px) {
    .double11-promo-content {
        width: 98% !important;
    }
}
