/**
 * 模块通用样式文件
 * 提供各模块共用的样式组件
 */

/* ===== 通用容器样式 ===== */
.module-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.module-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.module-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e6e6e6;
}

.module-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.module-content {
    padding: 20px;
}

/* ===== 通用卡片样式 ===== */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e6e6e6;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e6e6e6;
}

/* ===== 通用列表样式 ===== */
.list-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
    transition: all 0.3s ease;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: #f8f9fa;
    margin: 0 -20px;
    padding: 15px 20px;
    border-radius: 4px;
}

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.list-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.list-item-title a:hover {
    color: var(--primary-color);
}

.list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.list-item-meta span {
    background: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.list-item-desc {
    color: #999;
    font-size: 12px;
    line-height: 1.4;
}

/* ===== 通用标签样式 ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.tag-primary {
    background: #e6f7ff;
    color: var(--primary-color);
}

.tag-success {
    background: #f6ffed;
    color: #52c41a;
}

.tag-warning {
    background: #fffbe6;
    color: #faad14;
}

.tag-danger {
    background: #fff2f0;
    color: #ff4d4f;
}

.tag-info {
    background: #f0f0f0;
    color: #666;
}

/* ===== 通用按钮样式 ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}

.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
    color: #fff;
}

.btn-warning {
    background: #faad14;
    color: #fff;
    border-color: #faad14;
}

.btn-warning:hover {
    background: #ffc53d;
    border-color: #ffc53d;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
    border-color: #ff4d4f;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
    color: #fff;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== 通用表单样式 ===== */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-control.is-invalid {
    border-color: #ff4d4f;
}

.form-control.is-valid {
    border-color: #52c41a;
}

.form-text {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: #ff4d4f;
    margin-top: 4px;
}

/* ===== 通用分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover,
.pagination .active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination .disabled:hover {
    background: #f5f5f5;
    color: #ccc;
    border-color: #e6e6e6;
}

/* ===== 通用加载状态 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e6e6e6;
    border-top: 2px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* ===== 通用空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    color: #ccc;
}

/* ===== 通用消息提示 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background: #f6ffed;
    border-color: #b7eb8f;
    color: #52c41a;
}

.alert-info {
    background: #e6f7ff;
    border-color: #91d5ff;
    color: var(--primary-color);
}

.alert-warning {
    background: #fffbe6;
    border-color: #ffe58f;
    color: #faad14;
}

.alert-danger {
    background: #fff2f0;
    border-color: #ffccc7;
    color: #ff4d4f;
}

/* ===== 通用工具类 ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-success { color: #52c41a; }
.text-warning { color: #faad14; }
.text-danger { color: #ff4d4f; }
.text-muted { color: #999; }

.bg-primary { background-color: var(--primary-color); }
.bg-success { background-color: #52c41a; }
.bg-warning { background-color: #faad14; }
.bg-danger { background-color: #ff4d4f; }
.bg-light { background-color: #f8f9fa; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }

.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }

.m-1 { margin: 8px; }
.mt-1 { margin-top: 8px; }
.mr-1 { margin-right: 8px; }
.mb-1 { margin-bottom: 8px; }
.ml-1 { margin-left: 8px; }

.m-2 { margin: 16px; }
.mt-2 { margin-top: 16px; }
.mr-2 { margin-right: 16px; }
.mb-2 { margin-bottom: 16px; }
.ml-2 { margin-left: 16px; }

.m-3 { margin: 24px; }
.mt-3 { margin-top: 24px; }
.mr-3 { margin-right: 24px; }
.mb-3 { margin-bottom: 24px; }
.ml-3 { margin-left: 24px; }

.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pr-0 { padding-right: 0; }
.pb-0 { padding-bottom: 0; }
.pl-0 { padding-left: 0; }

.p-1 { padding: 8px; }
.pt-1 { padding-top: 8px; }
.pr-1 { padding-right: 8px; }
.pb-1 { padding-bottom: 8px; }
.pl-1 { padding-left: 8px; }

.p-2 { padding: 16px; }
.pt-2 { padding-top: 16px; }
.pr-2 { padding-right: 16px; }
.pb-2 { padding-bottom: 16px; }
.pl-2 { padding-left: 16px; }

.p-3 { padding: 24px; }
.pt-3 { padding-top: 24px; }
.pr-3 { padding-right: 24px; }
.pb-3 { padding-bottom: 24px; }
.pl-3 { padding-left: 24px; }

/* ===== 响应式工具类 ===== */
@media (max-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
    .d-md-flex { display: flex; }
}

@media (max-width: 480px) {
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
    .d-sm-flex { display: flex; }
}