﻿/* 证书管理系统 - 全局样式 */

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, sans-serif;
    background-color: #f5f7fa;
}

/* === 导航栏 === */
.nav-custom {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.nav-custom .navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}
.nav-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s ease;
    border-radius: 6px;
}
.nav-custom .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}

/* === 统计卡片 === */
.stats-card {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}
.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}
.stats-card h3 {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.stats-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

/* === 搜索面板 === */
.search-panel {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f1b7bb;
}

/* === 按钮样式 === */
.btn-custom {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}
.btn-custom:hover {
    background: linear-gradient(135deg, #c82333 0%, #a11e2b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    color: white;
}
.btn-custom:active {
    transform: translateY(0);
}

/* === 表格样式（核心美化）=== */
.cert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
}
.cert-table th,
.cert-table td {
    padding: 4px 8px;
    line-height: 22px;
    text-align: left;
    vertical-align: middle;
    border: 1px solid #dee2e6;
    word-break: break-all;
}
.cert-table thead th {
    background-color: #f8f9fa;
    color: #212529;
    font-weight: 600;
    border-color: #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1;
}
.cert-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}
.cert-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}
.cert-table tbody tr:hover td {
    background-color: #f8d7da !important;
}
.cert-table tbody tr.row-selected td {
    background-color: #f5c6cb !important;
}
.cert-table tbody tr.row-selected:hover td {
    background-color: #f1b7bb !important;
}
.cert-table .col-checkbox {
    width: 40px;
    text-align: center;
}
.cert-table .col-order {
    width: 130px;
}
.cert-table .col-name {
    width: 100px;
}
.cert-table .col-manu {
    width: 80px;
}
.cert-table .col-model {
    width: 90px;
}
.cert-table .col-serial {
    width: 90px;
}
.cert-table .col-number {
    width: 80px;
}
.cert-table .col-date {
    width: 100px;
}
.cert-table .col-status {
    width: 70px;
}
.cert-table .col-download {
    width: 80px;
}
.cert-table .col-action {
    width: 120px;
}
.cert-table .table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* GridView 专用样式（.NET WebForms）*/
.gridview-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    width: 100%;
    max-height: 70vh;
}
.gridview-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
}
.gridview-wrapper th,
.gridview-wrapper td {
    padding: 4px 8px !important;
    line-height: 22px !important;
    text-align: left !important;
    vertical-align: middle !important;
    border: 1px solid #dee2e6 !important;
    word-break: break-all;
}
.gridview-wrapper th {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    font-weight: 600 !important;
    position: sticky;
    top: 0;
    z-index: 2;
}
.gridview-wrapper tr:nth-child(even) td {
    background-color: #f8f9fa !important;
}
.gridview-wrapper tr:nth-child(odd) td {
    background-color: #ffffff !important;
}
.gridview-wrapper tr:hover td {
    background-color: #f8d7da !important;
}
.gridview-wrapper tr.row-selected td {
    background-color: #f5c6cb !important;
}
.gridview-wrapper tr.row-selected:hover td {
    background-color: #f1b7bb !important;
}
.gridview-wrapper::-webkit-scrollbar {
    width: 10px;
}
.gridview-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}
.gridview-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}
.gridview-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* === 徽章/标签样式 === */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}
.bg-success {
    background-color: #28a745 !important;
}
.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}
.bg-danger {
    background-color: #dc3545 !important;
}

/* === 状态标签颜色 === */
.status-valid {
    color: #28a745;
    font-weight: 600;
}
.status-warning {
    color: #ffc107;
    font-weight: 600;
}
.status-expired {
    color: #dc3545;
    font-weight: 600;
}

/* === 卡片样式 === */
.card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #212529;
}

/* === 证书卡片样式 === */
.certificate-card {
    transition: all 0.3s ease;
    border-left: 4px solid #dc3545;
    background: white;
}
.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.15);
}
.certificate-card.status-valid {
    border-left-color: #28a745;
}
.certificate-card.status-warning {
    border-left-color: #ffc107;
}
.certificate-card.status-expired {
    border-left-color: #dc3545;
}

/* === 表单控件美化 === */
.form-control,
.form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    max-width: none;
}
.form-control:focus,
.form-select:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    outline: none;
}

/* === 动画效果 === */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.hover-lift {
    transition: all 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* === 页脚样式 === */
.footer-classic {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}
.footer-classic h3,
.footer-classic h4,
.footer-classic h5 {
    color: white;
}
.footer-classic .text-light {
    color: rgba(255, 255, 255, 0.9) !important;
}
.footer-classic a:hover {
    color: white !important;
    text-decoration: underline;
}
.footer-classic .border-danger {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* === 分页控件 === */
.pagination {
    justify-content: center;
    margin-top: 15px;
}
.pagination li a,
.pagination li span {
    color: #dc3545;
    border: 1px solid #dee2e6;
    margin: 0 2px;
    border-radius: 4px;
    padding: 6px 12px;
}
.pagination li.active span {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}
.pagination li:hover a {
    background-color: #f8d7da;
    border-color: #dc3545;
}

/* === 模态框美化 === */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 16px 20px;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 16px 20px;
}

/* === 左右分栏布局 === */
.split-layout {
    display: flex;
    gap: 20px;
}
.split-layout .left-panel {
    flex: 0 0 40%;
    max-width: 40%;
}
.split-layout .right-panel {
    flex: 0 0 60%;
    max-width: 60%;
}
@media (max-width: 992px) {
    .split-layout {
        flex-direction: column;
    }
    .split-layout .left-panel,
    .split-layout .right-panel {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* === 提示消息样式 === */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* === 工具类 === */
.text-muted-custom {
    color: #6c757d !important;
}
.required-field::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* === 响应式优化 === */
@media (max-width: 768px) {
    .stats-card h3 {
        font-size: 1.5rem;
    }
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}
