/* CSS 变量定义 */
:root {
   --mobile-bottom-nav-height: 60px;
    --mobile-bottom-spacing: 80px; /* 底部导航高度 + 额外间距 (60px + 20px) */
}

/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #f5f7fa;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 表格样式 */
.table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #555;
}

.table tr:hover {
    background: #f8f9fa;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .modal-content {
        padding: 2px;
    }
}


/* ==========================================
   移动端通用底部间距 - 避免被底部导航栏遮挡
   适用于所有嵌入在首页 iframe 中的页面
   ========================================== */

@media screen and (max-width: 768px) {
    /* 为所有页面的 body 添加底部间距 */
    /* 适配微信内置浏览器和苹果手机返回条 */
    body {
        padding-bottom: 150px !important; /* 底部导航栏60px + 微信浏览器和苹果返回条90px */
    }
    
    /* 确保容器也有足够的底部间距 */
    .container {
        padding-bottom: 150px !important;
    }
    
    /* 页面主要内容区域 */
    .page-container,
    .content-wrapper,
    .main-wrapper,
    .page-content {
        padding-bottom: 150px !important;
    }
    
    /* 表格容器底部间距 */
    .table-container:last-child,
    .data-table-container:last-child,
    .table-wrapper:last-child {
        margin-bottom: 50px !important;
    }
    
    /* 卡片列表底部间距 */
    .card:last-child,
    .product-card:last-child {
        margin-bottom: 50px !important;
    }
    
    /* 表单底部间距 */
    form {
        padding-bottom: 50px !important;
    }
    
    /* 固定底部按钮栏的位置调整 - 在底部导航栏上方 */
    .fixed-bottom-bar,
    .fixed-bottom-btn,
    .action-bar-fixed {
        bottom: 60px !important;
        z-index: 998 !important; /* 确保在底部导航栏下方 */
    }
}
