/* 组件样式文件 - 专用于各种页面组件 */

/* ========== 卡片组件 ========== */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #DC143C;
}

.card-header {
    background: linear-gradient(135deg, #DC143C, #B91C3C);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 18px;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #FFD700, transparent);
}

.card-body {
    padding: 25px;
}

.card-footer {
    background: #f8f9fa;
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ========== 网格系统 ========== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (max-width: 768px) {
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-6 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-4 { flex: 0 0 100%; max-width: 100%; }
}

/* ========== 表格组件 ========== */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background: linear-gradient(135deg, #DC143C, #B91C3C);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.3s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== 状态徽章 ========== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-radius: 20px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: #DC143C; color: white; }
.badge-secondary { background: #6c757d; color: white; }
.badge-success { background: #28a745; color: white; }
.badge-info { background: #17a2b8; color: white; }
.badge-warning { background: #ffc107; color: #212529; }
.badge-danger { background: #dc3545; color: white; }
.badge-light { background: #f8f9fa; color: #495057; border: 1px solid #dee2e6; }
.badge-dark { background: #343a40; color: white; }

/* ========== 模态框组件 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideInUp 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #DC143C, #B91C3C);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    background: #f8f9fa;
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 分页器组件 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 30px 0;
    list-style: none;
    padding: 0;
}

.pagination li {
    margin: 0;
}

.pagination a,
.pagination span {
    display: block;
    padding: 10px 15px;
    color: #6c757d;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

.pagination a:hover {
    background: #DC143C;
    color: white;
    border-color: #DC143C;
    transform: translateY(-2px);
}

.pagination .active span {
    background: #DC143C;
    color: white;
    border-color: #DC143C;
}

.pagination .disabled span {
    color: #adb5bd;
    background: #f8f9fa;
    cursor: not-allowed;
}

/* ========== 搜索和过滤器 ========== */
.search-filter-bar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.search-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    min-width: 150px;
}

.search-btn {
    white-space: nowrap;
}

/* ========== 面包屑增强 ========== */
.breadcrumb-enhanced {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.breadcrumb-enhanced .container {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.breadcrumb-enhanced a {
    color: #DC143C;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.breadcrumb-enhanced a:hover {
    color: #B91C3C;
    text-decoration: underline;
}

.breadcrumb-enhanced .separator {
    margin: 0 10px;
    color: #6c757d;
}

.breadcrumb-enhanced .current {
    color: #495057;
    font-weight: 600;
}

/* ========== 标签页组件 ========== */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
    list-style: none;
    padding: 0;
    background: white;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.nav-tabs li {
    margin: 0;
}

.nav-tabs a {
    display: block;
    padding: 15px 25px;
    color: #6c757d;
    text-decoration: none;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.nav-tabs a:hover {
    color: #DC143C;
    background: rgba(220, 20, 60, 0.05);
}

.nav-tabs a.active {
    color: #DC143C;
    border-bottom-color: #DC143C;
    background: rgba(220, 20, 60, 0.1);
}

.tab-content {
    background: white;
    padding: 25px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* ========== 提示框组件 ========== */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    position: relative;
    padding-left: 50px;
}

.alert::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-success::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%23155724" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.061L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/></svg>');
}

.alert-info {
    background: #cce7ff;
    border-color: #b3d9ff;
    color: #004085;
}

.alert-info::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%23004085" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/></svg>');
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-warning::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%23856404" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>');
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-danger::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%23721c24" viewBox="0 0 16 16"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg>');
}

.alert-dismissible {
    padding-right: 50px;
}

.alert-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.alert-close:hover {
    opacity: 1;
}

/* ========== 进度条组件 ========== */
.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #DC143C, #B91C3C);
    transition: width 0.6s ease;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* ========== 评分星级组件 ========== */
.rating {
    display: inline-flex;
    gap: 2px;
    font-size: 20px;
}

.rating .star {
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s;
}

.rating .star.active,
.rating .star:hover {
    color: #ffc107;
}

.rating-readonly .star {
    cursor: default;
}

/* ========== 时间轴组件 ========== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 21px;
    top: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #DC143C;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #e9ecef;
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

.timeline-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 3px solid #DC143C;
}

.timeline-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.timeline-text {
    color: #6c757d;
    line-height: 1.6;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
    .search-group {
        flex-direction: column;
    }
    
    .search-input,
    .filter-select {
        min-width: 100%;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 10px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item::before {
        left: 11px;
    }
    
    .timeline-date {
        width: 40px;
    }
} 