/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 容器布局 */
.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    background: #f8f9fa;
}


/* 主内容区 */
.main {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* 按钮基础样式 */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-size: 16px;
}

/* 状态消息 */
.status-message {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
    font-weight: 500;
}

.status-message.active {
    display: flex;
}

/* 加载动画 */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 脉冲动画 */
.pulse {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* 结果区域 */
.result-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

/* 控制区域布局 */
.control-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 状态控制区域 */
.status-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 紧凑状态消息 */
.status-message.compact {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
}

/* 紧凑按钮样式 */
.btn-primary.compact, .btn-secondary.compact {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 100px;
}

/* 紧凑动画元素 */
.status-message.compact .spinner {
    width: 14px;
    height: 14px;
}

.status-message.compact .pulse {
    width: 10px;
    height: 10px;
}

.btn-primary.compact .btn-icon, .btn-secondary.compact .btn-icon {
    font-size: 16px;
}

.btn-primary.compact .btn-text, .btn-secondary.compact .btn-text {
    font-size: 14px;
}

.end-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    font-size: 12px;
    color: #6c757d;
}



.chat-container {
    flex: 1;
    min-height: 200px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease;
    margin-left: 0;
    width: calc(100% - 40px);
}

.chat-message:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* AI消息样式 */
.chat-message.ai-message {
    background: #f8f9ff;
    border: 1px solid #e3e8ff;
    margin-left: 0;
    width: calc(100% - 40px);
}

.chat-message.ai-message:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.chat-content {
    width: 100%;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-text {
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    word-wrap: break-word;
    margin-bottom: 8px;
}

.chat-timestamp {
    font-size: 12px;
    color: #6c757d;
    opacity: 0.7;
}

.ai-assist-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
    margin-left: 8px;
    flex-shrink: 0;
}

.ai-assist-btn:hover {
    background: #0056b3;
    opacity: 1;
    transform: translateY(-1px);
}

.placeholder {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }

    .main {
        padding: 15px;
        gap: 15px;
    }

    .control-section {
        padding: 20px 15px;
    }

    .btn-primary, .btn-secondary {
        padding: 14px 28px;
        min-width: 160px;
        font-size: 15px;
    }

    .btn-icon {
        font-size: 18px;
    }

    .btn-text {
        font-size: 15px;
    }

    .result-content {
        min-height: 150px;
        font-size: 15px;
    }

    .result-header h2 {
        font-size: 16px;
    }

  }

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }

    .main {
        padding: 10px;
        gap: 10px;
    }

    .control-section {
        padding: 15px 10px;
    }

    .btn-primary, .btn-secondary {
        padding: 12px 24px;
        min-width: 140px;
        font-size: 14px;
    }

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

    .btn-text {
        font-size: 14px;
    }

    .result-content {
        min-height: 120px;
        font-size: 14px;
        padding: 12px;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

  }

/* 隐藏元素 */
.display-none, .end-btn {
    display: none;
}

/* 确保按钮可以正常点击 */
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 滚动条样式 */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.resume-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

.resume-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 打字指示器样式 */
.typing-indicator {
    color: #6c757d;
    font-style: italic;
}

.typing-dots {
    display: inline-block;
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 1;
    }
    30% {
        opacity: 0.3;
    }
}

/* 错误消息样式 */
.error-message {
    color: #dc3545;
    font-weight: 500;
}

/* AI辅助按钮禁用状态 */
.ai-assist-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #6c757d;
}

.ai-assist-btn:disabled:hover {
    background: #6c757d;
    transform: none;
}