* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Microsoft YaHei', 'SimHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    background: #f0f4f8;
    min-height: 100vh;
    color: #1a202c;
    line-height: 1.6;
}

/* Header Styles */
.header { 
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%); 
    padding: 16px 32px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.header h1 { 
    font-size: 18px; 
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 1.5px;
}
.nav { display: flex; gap: 6px; }
.nav a { 
    color: #e2e8f0; 
    text-decoration: none; 
    padding: 10px 20px; 
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 500;
}
.nav a:hover { 
    background: rgba(255, 255, 255, 0.12); 
    color: #ffffff;
    transform: translateY(-1px);
}
.nav a.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-info {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}
.logout-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Content Layout */
.content { padding: 28px; max-width: 100%; margin: 0 auto; }
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}
/* Search Styles */
.search-section {
    background: #ffffff;
    padding: 24px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.search-box {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-start;
}
.search-wrapper {
    flex: 1;
    min-width: 400px;
    max-width: 700px;
    width: 700px;
    position: relative;
}
.search-wrapper::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}
.search-box input {
    width: 100%;
    height: 48px;
    padding: 0 20px 0 48px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1e293b;
}
.search-box input::placeholder {
    color: #94a3b8;
}
.search-box input:hover {
    border-color: #94a3b8;
}
.search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-select {
    height: 48px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #334155;
    min-width: 140px;
}
.search-select:hover {
    border-color: #94a3b8;
}
.search-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-date {
    height: 48px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #334155;
    min-width: 150px;
}
.search-date:hover {
    border-color: #94a3b8;
}
.search-date:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.native-date-input {
    height: 48px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #334155;
    min-width: 150px;
}
.native-date-input:hover {
    border-color: #94a3b8;
}
.native-date-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.native-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(0.4);
    padding: 4px;
}
.native-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
.date-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}
.date-input-field {
    height: 48px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    color: #334155;
    min-width: 150px;
    cursor: pointer;
}
.date-input-field:hover {
    background: #f8fafc;
}
.date-input-field:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tab Styles */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { 
    padding: 10px 22px; 
    background: #f1f5f9; 
    border: 1px solid #cbd5e1;
    border-radius: 8px; 
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.25s ease;
}
.tab.active { 
    background: #2563eb; 
    color: white;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Button Styles */
.btn { 
    padding: 11px 22px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    min-width: 80px;
    white-space: nowrap;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.3s ease;
}
.btn:hover::before {
    left: 100%;
}

.btn-primary { 
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); 
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.btn-warning { 
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); 
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn-warning:hover { 
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.btn-success { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); 
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-success:hover { 
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger { 
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); 
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { 
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.btn-info { 
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); 
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-info:hover { 
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.btn-cancel:hover { 
    background: #e2e8f0; 
    transform: translateY(-2px);
}

.btn-sm { 
    padding: 7px 14px; 
    font-size: 12px;
    min-width: 60px;
}
.btn-sm:hover {
    transform: translateY(-1px);
}
.btn-xs { 
    padding: 4px 8px; 
    font-size: 11px;
    min-width: 28px;
    height: 28px;
    line-height: 1;
}
.btn-xs:hover {
    transform: translateY(-1px);
}

/* Table Styles */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; table-layout: auto; white-space: nowrap; }
th { 
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%); 
    padding: 12px 10px; 
    text-align: left; 
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
td { 
    padding: 10px 10px; 
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    vertical-align: middle;
    line-height: 1.4;
}
tbody tr {
    transition: background-color 0.2s ease;
}
tbody tr:hover {
    background-color: #fafafa;
}
td.data-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    min-width: 80px;
    padding-right: 8px;
    vertical-align: middle;
}
td.action-cell {
    white-space: nowrap;
    overflow: visible;
    max-width: none;
    width: 120px;
    padding: 6px 6px;
    text-align: center;
    vertical-align: middle;
}
tr {
    transition: all 0.2s ease;
}
tr:hover { 
    background: #f8fafc; 
}
tr:last-child td {
    border-bottom: none;
}

/* Badge Styles */
.status-badge, .type-badge, .risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.status-0 { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); 
    color: #dc2626; 
}
.status-1 { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); 
    color: #d97706; 
}
.status-2 { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); 
    color: #059669; 
}

.type-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

.risk-1 { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); 
    color: #059669; 
}
.risk-2 { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); 
    color: #d97706; 
}
.risk-3 { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); 
    color: #dc2626; 
}
.risk-4 { 
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%); 
    color: #b91c1c; 
}

/* Modal Styles */
.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    justify-content: center; 
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal-content { 
    background: #ffffff; 
    padding: 32px; 
    border-radius: 16px; 
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-content h3 {
    font-size: 20px;
    color: #1e293b;
    margin-bottom: 24px;
    font-weight: 600;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.25s ease;
    outline: none;
    background: #fafafa;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}
.form-row.col2 { grid-template-columns: 1fr 1fr; }
.form-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row .form-group { margin-bottom: 0; }
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}
.modal-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 12px 24px;
}

/* Association Section Styles */
.association-section {
    background: #fafafa;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}
.association-section h4 {
    font-size: 14px;
    color: #475569;
    margin-bottom: 12px;
    font-weight: 600;
}
.association-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.association-tab {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.25s ease;
}
.association-tab:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.association-tab.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.association-section input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
}
.association-section select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}
.action-buttons .btn-xs {
    flex-shrink: 0;
    flex-grow: 0;
    margin: 0;
}

/* Stats Cards */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px; 
    margin-bottom: 28px;
}
.stat-card { 
    background: #ffffff; 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #2563eb;
    transition: all 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.stat-icon {
    width: 44px;
    height: 44px;
    background: #e0f2fe;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #1d4ed8;
}
.stat-label { color: #64748b; font-size: 13px; }
.stat-value { 
    font-size: 36px; 
    font-weight: 700; 
    color: #1e293b; 
    margin-bottom: 4px;
}
.stat-change { font-size: 12px; color: #059669; }
.stat-change.negative { color: #dc2626; }

/* Chart Container */
.chart-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 28px;
}
.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

/* Association Section */
.association-section {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    background: #fafafa;
}
/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.empty-state p {
    font-size: 14px;
}

/* Detail Modal Styles */
.detail-card {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}
.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    width: 90px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}
.detail-value {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
    word-break: break-word;
}
.detail-section {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.section-title {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 10px;
}
.section-content {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.6;
    padding: 12px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Search Input */
.search-input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
    background: #fafafa;
    flex: 1;
}
.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}
.search-wrapper .search-input {
    width: 100%;
    border: none;
    padding: 12px 0;
    background: transparent;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
}
.pagination .btn {
    margin: 0;
}
.pagination .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination .btn.active {
    background: #2563eb;
    color: white;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    .content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-wrap: wrap;
    }
}