/* 项目前端通用样式库 - 可重复使用组件 */

/* ===== 重置样式 ===== */
* {
    box-sizing: border-box;
}

.flex {
    display: flex;
}
.flex-block {flex: 1;}

.pad20 {
    padding: 20px;
}

/* ===== 表单基础样式 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-input::placeholder {
    color: #999;
    opacity: 1;
}

/* 输入框状态 */
.form-input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

.form-input.success {
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.form-input.disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 表单帮助文本 */
.form-help {
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

.form-help.default {
    color: #6c757d;
}

.form-help.error {
    color: #e74c3c;
}

.form-help.success {
    color: #2ecc71;
}

/* 表单验证状态 */
.form-valid {
    border-color: #2ecc71;
}

.form-invalid {
    border-color: #e74c3c;
}

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
    user-select: none;
    min-height: 40px;
    gap: 8px;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 按钮尺寸 */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    min-height: 48px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* 按钮颜色变体 */
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: 1px solid #2980b9;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #2573a7);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: 1px solid #7f8c8d;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(149, 165, 166, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: 1px solid #27ae60;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: 1px solid #c0392b;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #d35400);
    color: white;
    border: 1px solid #d35400;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #d35400, #ba4a00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: 1px solid #138496;
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #138496, #11707f);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.btn-light {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-light:hover:not(:disabled) {
    background: linear-gradient(135deg, #e9ecef, #dde1e6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(248, 249, 250, 0.3);
}

.btn-dark {
    background: linear-gradient(135deg, #343a40, #23272b);
    color: white;
    border: 1px solid #23272b;
}

.btn-dark:hover:not(:disabled) {
    background: linear-gradient(135deg, #23272b, #1c1f23);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 58, 64, 0.3);
}

/* 轮廓按钮 */
.btn-outline-primary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline-primary:hover:not(:disabled) {
    background: #3498db;
    color: white;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* ===== 表单布局 ===== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-col {
    flex: 1;
    padding: 0 10px;
    min-width: 0;
}

.form-col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.form-col-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.form-col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

/* ===== 选择框样式 ===== */
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* ===== 复选框和单选框 ===== */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check-input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.form-check-label {
    font-size: 14px;
    color: #333;
    user-select: none;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {

    .form-col-6,
    .form-col-4,
    .form-col-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .form-input {
        font-size: 16px;
        /* 防止iOS缩放 */
    }
}

/* ===== 工具类 ===== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}
.mar10 {margin: 10px;}
.mar20 {margin: 20px;}
.pad10 {padding: 10px;}
.pad20 {padding: 20px;}
.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 3rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-inline {
    display: inline;
}

.d-inline-block {
    display: inline-block;
}

.d-flex {
    display: flex;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

/* dialogModal 弹出层样式 */
.dialogModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    width: 350px;
    max-width: calc(100% - 40px);
    display: none;
    box-sizing: border-box;
}

/* 遮罩层样式 */
.dialog-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
}

.js_close {
    cursor: pointer;
}

/* ===== 分页样式 ===== */
.pagination {
    text-align: center;
    margin-top: 30px;
    list-style: none;
    padding: 0;
}

.pagination li {
    display: inline-block;
    margin: 0 2px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background: #1E9FFF;
    color: white;
    border-color: #1E9FFF;
}

.pagination .active span {
    background: #1E9FFF;
    color: white;
    border-color: #1E9FFF;
}

.pagination .disabled span {
    background: #f8f9fa;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
}

/* 移动端分页适配 */
@media (max-width: 768px) {
    .pagination {
        margin-top: 20px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .pagination li {
        margin: 0 1px;
    }
}