/* 风险管控系统样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 导航栏样式 */
.navbar {
    background-color: #343a40;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar li {
    margin: 0;
}

.navbar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.navbar a:hover,
.navbar a.active {
    background-color: #495057;
    border-bottom-color: #007bff;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.card-header h3 {
    color: #495057;
    font-size: 1.4rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* 统计网格样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: #f6f7f8;
    font-weight: 500;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 风险等级徽章 */
.risk-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.risk-low { background-color: #28a745; color: white; }
.risk-medium { background-color: #ffc107; color: #212529; }
.risk-high { background-color: #fd7e14; color: white; }
.risk-critical { background-color: #dc3545; color: white; }

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* 警告框样式 */
.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* 网格布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col-2 {
    flex: 0 0 16.666667%;
    padding: 0.75rem;
}

.col-3 {
    flex: 0 0 25%;
    padding: 0.75rem;
}

.col-4 {
    flex: 0 0 33.333333%;
    padding: 0.75rem;
}

.col-6 {
    flex: 0 0 50%;
    padding: 0.75rem;
}

.col-9 {
    flex: 0 0 75%;
    padding: 0.75rem;
}

.col-12 {
    flex: 0 0 100%;
    padding: 0.75rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-select {
    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='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* 筛选器样式 */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-decoration: none;
    color: #007bff;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #e9ecef;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 移动端汉堡菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1001;
}

/* 移动端模态框样式 */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.mobile-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.mobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.mobile-modal-header h5 {
    margin: 0;
    font-size: 1.125rem;
}

.mobile-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-modal-body {
    padding: 1rem;
}

.mobile-modal-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* 移动端Toast通知 */
.mobile-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    z-index: 2001;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.mobile-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mobile-toast-success {
    background: #28a745;
}

.mobile-toast-warning {
    background: #ffc107;
    color: #212529;
}

.mobile-toast-error {
    background: #dc3545;
}

/* 移动端加载指示器 */
.mobile-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.mobile-loading-content {
    text-align: center;
}

.mobile-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.mobile-loading-text {
    color: #6c757d;
    font-size: 0.875rem;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .header {
        position: relative;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-left: 3rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
        margin-left: 3rem;
    }
    
    .navbar {
        transition: transform 0.3s ease;
    }
    
    .navbar ul {
        flex-direction: row;
        justify-content: space-around;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .navbar ul::-webkit-scrollbar {
        display: none;
    }
    
    .navbar a {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
        min-width: 60px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem 0.75rem;
        min-height: 80px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .col-2 {
        flex: 0 0 50%;
    }
    
    .col-3,
    .col-4,
    .col-6,
    .col-9 {
        flex: 0 0 100%;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 0.5rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 打印样式 */
@media print {
    .navbar,
    .btn,
    .search-container {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    body {
        background: white;
    }
}

/* 桌面端和移动端显示控制 */
.desktop-only {
    display: block !important;
}

.mobile-only,
.mobile-info-cards {
    display: none !important;
}

/* 移动端卡片样式 */
.mobile-info-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.mobile-info-item:last-child {
    border-bottom: none;
}

.mobile-info-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    flex: 0 0 auto;
    margin-right: 1rem;
}

.mobile-info-value {
    font-weight: 500;
    color: #212529;
    text-align: right;
    flex: 1;
    font-size: 0.9rem;
}

/* 移动端底部导航样式 */
.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-around;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-bottom-nav .nav-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    margin: 0 0.5rem;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.mobile-bottom-nav .nav-btn:hover,
.mobile-bottom-nav .nav-btn:active {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4);
    color: white;
    text-decoration: none;
}

/* 移动端媒体查询 - 确保优先级正确 */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only,
    .mobile-info-cards {
        display: block !important;
    }
    
    /* 为移动端底部导航留出空间 */
    body {
        padding-bottom: 80px;
    }
}

/* 桌面端隐藏移动端底部导航 */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}