/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

header nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.logout-btn {
    background-color: rgba(231, 76, 60, 0.2);
    margin-left: 0.5rem;
}

.logout-btn:hover {
    background-color: rgba(231, 76, 60, 0.4);
}

/* Main Container */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-content h2 {
    margin: 0;
}

.audit-actions {
    display: flex;
    gap: 0.75rem;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.back-link:hover {
    text-decoration: underline;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table thead {
    background-color: #34495e;
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

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

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

.data-table.clickable-rows tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.data-table.clickable-rows tbody tr:hover {
    background-color: #f0f8ff;
}

.data-table.clickable-rows tbody tr.active-row {
    background-color: #cce5ff;
    border-left: 4px solid #2196f3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
}

.data-table.clickable-rows tbody tr.active-row:hover {
    background-color: #cce5ff;
}

.url-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

.url-link:hover {
    text-decoration: underline;
}

.job-name {
    font-weight: 500;
    color: #2c3e50;
}

.action-cell {
    white-space: nowrap;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Drawer */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    pointer-events: none;
}

.drawer.open {
    pointer-events: all;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer.open .drawer-overlay {
    opacity: 1;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 500px;
    max-width: 90vw;
    background-color: white;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* 左右分栏布局 */
.drawer-content.drawer-split {
    width: 95vw;
    max-width: none;
    flex-direction: row;
    overflow: hidden;
    transition: width 0.3s ease;
}

.drawer-content.drawer-split.panel-collapsed {
    width: 460px;
}

.drawer-left {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ecf0f1;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.drawer-left .drawer-header-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drawer-left .drawer-header-title h3 {
    margin: 0;
}

.source-details-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #7f8c8d;
}

.source-details-inline .source-detail-item a {
    color: #3498db;
    text-decoration: none;
}

.source-details-inline .source-detail-item a:hover {
    text-decoration: underline;
}

.drawer-left .drawer-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.drawer-left.collapsed {
    flex: 0;
    width: 40px;
    min-width: 40px;
}

.drawer-left.collapsed .iframe-container {
    display: none;
}

.drawer-left.collapsed .drawer-header {
    padding: 0.5rem;
}

.drawer-left.collapsed .drawer-header-title {
    display: none;
}

.drawer-left.collapsed .drawer-header-actions {
    flex-direction: column;
}

.drawer-left.collapsed #iframe-open-link {
    display: none;
}

.drawer-right {
    width: 420px;
    flex-shrink: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.iframe-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.drawer.open .drawer-content {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
    background-color: #f8f9fa;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-icon {
    font-size: 1.1rem;
    font-weight: bold;
}

.btn-approve {
    background-color: #27ae60;
    color: white;
}

.btn-approve:hover {
    background-color: #229954;
}

.btn-crawl {
    background-color: #3498db;
    color: white;
}

.btn-crawl:hover {
    background-color: #2980b9;
}

.btn-reject {
    background-color: #e74c3c;
    color: white;
}

.btn-reject:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #16a085;
    color: white;
}

.btn-warning:hover {
    background-color: #138d75;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-unusable {
    background-color: #f39c12;
    color: white;
}

.btn-unusable:hover {
    background-color: #e67e22;
}

.btn-success {
    background-color: #16a085;
    color: white;
}

.btn-success:hover {
    background-color: #138d75;
}

.drawer-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: #2c3e50;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.drawer-close:hover {
    background-color: #e74c3c;
    color: white;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #ecf0f1;
    background-color: #f8f9fa;
}

/* Quick Audit Checkbox */
.quick-audit-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    margin-right: 1rem;
}

.quick-audit-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Job Detail Styles */
.job-detail {
    font-size: 0.95rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: #7f8c8d;
    min-width: 120px;
    flex-shrink: 0;
}

.detail-row .value {
    color: #2c3e50;
    flex: 1;
    word-break: break-word;
}

.detail-row .value a {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
}

.detail-row .value a:hover {
    text-decoration: underline;
}

.jd-content {
    line-height: 1.8;
    color: #2c3e50;
    white-space: pre-wrap;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 2rem;
}

.keyboard-hint {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: none;
}

.modal.open {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #ecf0f1;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.reject-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

.reject-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.quick-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.phrase-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid #bdc3c7;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
}

.phrase-btn:hover {
    background-color: #3498db;
    border-color: #3498db;
    color: #fff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #ecf0f1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .drawer-content.drawer-split {
        width: 95vw;
    }

    .drawer-right {
        width: 400px;
    }
}

@media (max-width: 768px) {
    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .drawer-content {
        width: 100%;
        max-width: 100%;
    }

    .drawer-content.drawer-split {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .drawer-left {
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #ecf0f1;
    }

    .drawer-right {
        width: 100%;
        flex: 1;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-row .label {
        margin-bottom: 0.25rem;
    }
}

/* Links */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Drawer Header Actions */
.drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Filter Section */
.filter-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.filter-label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

.stats-divider {
    margin: 0 0.5rem;
    color: #bdc3c7;
}

.source-info {
    font-size: 0.75rem;
    font-weight: normal;
    color: #7f8c8d;
    margin-left: 0.5rem;
}

.source-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.source-detail-item a {
    color: #3498db;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: all;
    animation: slideIn 0.3s ease;
    font-size: 0.95rem;
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-success {
    background-color: #27ae60;
    color: white;
}

.toast-error {
    background-color: #e74c3c;
    color: white;
}

.toast-info {
    background-color: #3498db;
    color: white;
}

.toast-warning {
    background-color: #f39c12;
    color: white;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}
