/* ERP H5 公共样式 */

/* ==================== 基础样式重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 页面容器 ==================== */
#app {
    min-height: 100%;
    position: relative;
}

#page-container {
    min-height: calc(100vh - 50px);
    padding-bottom: 60px;
}

.page {
    min-height: calc(100vh - 50px);
}

.page-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f56c6c;
    color: #fff;
    font-size: 40px;
    line-height: 80px;
    margin-bottom: 20px;
}

.error-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.error-detail {
    font-size: 14px;
    color: #999;
    margin-bottom: 30px;
}

.error-btn {
    padding: 10px 30px;
    background-color: #1890ff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

/* ==================== TabBar ==================== */
#tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    z-index: 1000;
    display: none;
}

.tabbar {
    display: flex;
    height: 50px;
    border-top: 1px solid #e5e5e5;
}

.tabbar.tabbar-black {
    border-top-color: #333;
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    font-size: 12px;
}

.tabbar-item.active {
    color: #1890ff;
}

.tabbar-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 2px;
}

.tabbar-text {
    line-height: 1.2;
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 15px 25px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.toast-icon.success-icon {
    background-color: #67c23a;
}

.toast-icon.error-icon {
    background-color: #f56c6c;
}

.toast-icon.loading-icon {
    background-color: transparent;
    border: 2px solid #fff;
    border-top-color: transparent;
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.toast-text {
    max-width: 200px;
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 280px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.modal-body {
    padding: 20px 15px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.modal-message {
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    border-top: 1px solid #e5e5e5;
}

.modal-btn {
    flex: 1;
    height: 44px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
}

.modal-btn:first-child {
    border-right: 1px solid #e5e5e5;
}

.modal-btn-default {
    color: #666;
}

.modal-btn-primary {
    color: #1890ff;
}

/* ==================== Loading ==================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-text {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* ==================== ActionSheet ==================== */
.actionsheet-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.actionsheet-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    z-index: 9999;
}

.actionsheet-item {
    height: 48px;
    line-height: 48px;
    text-align: center;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
}

.actionsheet-item:active {
    background-color: #f5f5f5;
}

.actionsheet-cancel {
    height: 48px;
    line-height: 48px;
    text-align: center;
    font-size: 16px;
    color: #666;
    border-top: 8px solid #f5f5f5;
    cursor: pointer;
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-track {
    background-color: #f5f5f5;
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-red { color: #f56c6c; }
.text-green { color: #67c23a; }
.text-gray { color: #999; }
.text-blue { color: #1890ff; }

.bg-white { background-color: #fff; }
.bg-gray { background-color: #f5f5f5; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }
