/* common.css - 公共样式 */

@font-face {
    font-family: 'MiSans';
    src: url('../fonts/MiSans-subset.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 基础样式 */
html {
    overflow: hidden; /* 防止在弹窗出现时页面出现滚动条 */
    height: 100%;
    width: 100%;
}

body {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    font-family: 'MiSans', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden; /* 禁用页面滚动条 */
}

/* 保持弹窗内容可滚动 */
.el-dialog__body {
    overflow-y: auto !important;
    max-height: 70vh !important; /* 限制最大高度确保滚动 */
}

/* Vue克隆 */
[v-cloak] {
    display: none;
}

/* 容器样式 */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 加载样式 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.loading-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}

.loading-text {
    color: #409EFF;
    font-size: 16px;
    font-family: 'MiSans', Arial, sans-serif;
}

/* 卡片样式 */
.el-card {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.el-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.el-card__header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7ed 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #EBEEF5;
}

.el-card__header h2 {
    margin: 0;
    font-size: 20px;
    color: #303133;
    display: flex;
    align-items: center;
}

.bind-card {
    width: 100%;
}

/* 机器人头像样式 */
.robot-avatar {
    margin-right: 10px;
}

.title-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 输入框样式 */
.custom-input {
    width: 100%;
}

.input-field {
    width: 100%;
    height: 45px;
    padding: 0 15px;
    border: 2px solid rgba(220, 223, 230, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'MiSans', Arial, sans-serif;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    outline: none;
    box-sizing: border-box;
}

.input-field:hover {
    border-color: rgba(64, 158, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.input-field:focus {
    border-color: #409EFF;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.2);
}

.input-field:disabled {
    background: rgba(245, 247, 250, 0.9);
    cursor: not-allowed;
    border-color: rgba(220, 223, 230, 0.3);
}

/* 按钮样式 */
.el-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.el-button--primary {
    background: linear-gradient(135deg, #409EFF 0%, #3a8ee6 100%);
    border: none;
    box-shadow: 0 2px 6px rgba(64, 158, 255, 0.3);
}

.el-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}

.el-button--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
}

/* 移动端通知样式 */
.mobile-notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}
        
.custom-notification {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 弹窗样式 */
.result-dialog .el-dialog__body {
    padding: 20px;
}

.result-container {
    text-align: center;
    padding: 10px;
}

.success-message, .error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #67C23A;
    animation: scaleIn 0.5s ease;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #F56C6C;
    animation: scaleIn 0.5s ease;
}

/* 注意事项列表样式 */
.notice-list {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.notice-item {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.notice-item:last-child {
    margin-bottom: 0;
}

.notice-item::before {
    content: "•";
    position: absolute;
    left: 5px;
    color: #409EFF;
}

.notice-highlight {
    color: #f56c6c;
    font-weight: 500;
}

/* 高亮样式 */
.highlight {
    color: #409EFF;
    font-weight: bold;
    font-size: 18px;
}

/* 引导弹窗样式 */
.guide-dialog .el-dialog__body {
    padding: 0;
}

.guide-container {
    padding: 20px;
}

.guide-steps {
    margin-bottom: 20px;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    background-color: #f5f7fa;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #409EFF 0%, #3a8ee6 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #303133;
}

.step-description {
    font-size: 14px;
    color: #606266;
    line-height: 1.5;
}

.guide-qrcode {
    text-align: center;
    margin: 20px 0;
}

.qrcode-image {
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.guide-button {
    width: 100%;
}

/* 图片放大弹窗样式 */
.image-dialog .el-dialog__body {
    padding: 0;
    text-align: center;
}

.image-container {
    position: relative;
    display: inline-block;
    padding-bottom: 100px;
}

.enlarged-image {
    max-width: 100%;
    max-height: calc(80vh - 100px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.image-action-button {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 20px;
    border-radius: 8px;
    background: #f5f7fa;
}

.image-action-button:hover {
    background: #ecf5ff;
    transform: translateY(-2px);
}

.image-action-emoji {
    font-size: 20px;
    margin-right: 8px;
}

.image-action-text {
    color: #606266;
    font-size: 14px;
}

/* 重要提示样式 */
.important-tip {
    margin: 15px 0;
    padding: 15px;
    background: #fff4f4;
    border-left: 4px solid #ff4d4f;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.important-tip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 77, 79, 0.1), transparent);
    pointer-events: none;
}

.important-tip-icon {
    font-size: 20px;
    margin-right: 12px;
    color: #ff4d4f;
    position: relative;
    z-index: 1;
}

.important-tip-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.important-tip-title {
    font-size: 15px;
    font-weight: bold;
    color: #ff4d4f;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.important-tip-text {
    font-size: 14px;
    line-height: 1.6;
    color: #606266;
}

/* 机器人列表样式 */
.robot-list {
    margin-top: 15px;
}

.robot-item {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.robot-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.robot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(64, 158, 255, 0.2);
    margin-right: 10px;
}

.robot-avatar img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.robot-details {
    flex: 1;
}

.robot-id {
    font-size: 18px;
    font-weight: 500;
    color: #409EFF;
    margin-bottom: 5px;
    cursor: pointer;
}

.robot-status {
    font-size: 12px;
    color: #67C23A;
    display: flex;
    align-items: center;
}

.robot-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #67C23A;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 1.5s infinite;
}

.robot-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'MiSans', Arial, sans-serif;
}

.add-btn {
    background-color: #409EFF;
    color: white;
}

.add-btn:hover {
    background-color: #337ecc;
}

.copy-btn {
    background-color: #f0f7ff;
    color: #409EFF;
}

.copy-btn:hover {
    background-color: #e0f0ff;
}

.btn-icon {
    margin-right: 5px;
}

/* 示例框和帮助样式 */
.feature-section {
    margin: 20px 0;
}

.example-box {
    background: #f5f7fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.command-text {
    color: #606266;
    font-size: 14px;
    line-height: 1.6;
}

.notice-section {
    color: #909399;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 15px;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .el-card {
        margin: 0;
    }
    
    .image-container {
        padding-bottom: 80px;
    }
    
    .enlarged-image {
        max-height: calc(80vh - 80px);
        margin-bottom: 15px;
    }
    
    .image-actions {
        gap: 20px;
        padding: 15px;
    }
    
    .image-action-button {
        padding: 6px 15px;
    }
    
    .image-action-emoji {
        font-size: 18px;
        margin-right: 6px;
    }
    
    .image-action-text {
        font-size: 13px;
    }
    
    .important-tip {
        padding: 12px;
        margin: 12px 0;
    }
    
    .important-tip-icon {
        font-size: 18px;
        margin-right: 10px;
    }
    
    .important-tip-title {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .important-tip-text {
        font-size: 13px;
    }
    
    .result-dialog {
        width: 90% !important;
    }
    
    .success-icon, .error-icon {
        font-size: 40px;
    }
    
    .robot-actions {
        flex-direction: column;
    }
}

/* 修复弹窗显示导致的布局偏移问题 */
.el-overlay {
    overflow: hidden;
    padding-right: 0 !important; /* 防止弹窗添加右侧padding */
}

/* 修正弹窗出现时body的样式 */
body.el-popup-parent--hidden {
    padding-right: 0 !important; /* 覆盖Element Plus默认行为 */
    overflow: hidden !important;
    box-sizing: border-box;
    width: 100% !important;
}

/* 确保滚动条宽度一致 */
:root {
    --el-scrollbar-width: 0px !important; /* 设置为0以匹配隐藏的滚动条 */
}

/* 保持弹窗内容可滚动，但外部不可滚动 */
.el-dialog {
    margin: 0 auto !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.el-dialog__body {
    overflow-y: auto !important;
    flex: 1 !important;
} 