/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active,
.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    margin: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-sm {
    max-width: 400px;
}

.modal-content.modal-lg {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===== Annotations inline highlights ===== */
.ann-term {
    border-bottom: 2px dashed #2563eb;
    background: rgba(37,99,235,0.08);
    cursor: pointer;
    transition: background-color .15s ease;
}
.ann-term:hover { background: rgba(37,99,235,0.14); }
.ann-term.active { background: rgba(37,99,235,0.22); border-bottom-color:#1d4ed8; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex: 0 0 auto;
    background: #fff;
}

/* Parameter Configuration Styles */
.parameter-config-container {
    max-width: 1200px;
    margin: 0 auto;
}

.action-bar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.action-bar-left,
.action-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-bar-right {
    flex-wrap: wrap;
}

/* Filter Dropdown */
.filter-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 200px;
    z-index: 10001;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: #f9fafb;
}

/* Parameters List */
.parameters-list {
    display: grid;
    gap: 16px;
}

.parameter-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.parameter-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.parameter-card.deleted {
    opacity: 0.6;
    background: #f9fafb;
}

.parameter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.parameter-info {
    flex: 1;
}

.parameter-name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.parameter-display-name {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.parameter-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.parameter-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.parameter-type {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.parameter-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.parameter-badge.system {
    background: #dbeafe;
    color: #1d40af;
}

.parameter-badge.deleted {
    background: #fee2e2;
    color: #dc2626;
}

.parameter-actions {
    display: flex;
    gap: 8px;
}

/* Options Display */
.parameter-options {
    margin-top: 16px;
}

.options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.options-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.options-count {
    font-size: 12px;
    color: #6b7280;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.option-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.option-item.inactive {
    opacity: 0.5;
}

.option-content {
    flex: 1;
    min-width: 0;
}

.option-display-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.option-value {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', monospace;
}

.option-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.option-item:hover .option-actions {
    opacity: 1;
}

.option-action-btn {
    padding: 4px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.option-action-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.option-action-btn.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Options Container in Modal */
.options-container {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.option-row:last-child {
    border-bottom: none;
}

.option-row-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
}

.option-row-actions {
    display: flex;
    gap: 4px;
}

.option-row-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.drag-handle {
    cursor: grab;
    color: #9ca3af;
    padding: 4px;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #d1d5db;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.loading-state .spinner {
    margin: 0 auto 16px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.error-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #ef4444;
}

/* Sortable Styles */
.sortable-ghost {
    opacity: 0.5;
}

.sortable-chosen {
    background: #f3f4f6;
}

.sortable-drag {
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: rotate(5deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .action-bar-left,
    .action-bar-right {
        justify-content: center;
    }
    
    .parameter-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .parameter-actions {
        align-self: flex-start;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .parameter-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .option-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .option-row-actions {
        justify-content: center;
    }
}

/* Template Cards */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.template-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.template-card.selected {
    border-color: #3b82f6;
    background: #f8faff;
}

.template-card.deleted {
    opacity: 0.6;
    background: #f9fafb;
}

.template-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.template-card-select {
    flex-shrink: 0;
    margin-top: 2px;
}

.template-card-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.template-card-title h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
}

.template-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.template-type {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.template-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.template-status.status-active {
    background: #dcfce7;
    color: #166534;
}

.template-status.status-inactive {
    background: #fef3c7;
    color: #92400e;
}

.system-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.deleted-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.template-card-actions {
    flex-shrink: 0;
    position: relative;
}

/* Dropdown in template cards */
.template-card-actions .dropdown {
    position: relative;
}

.template-card-actions .dropdown-trigger {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.template-card-actions .dropdown-trigger:hover {
    background: #f3f4f6;
    color: #374151;
}

.template-card-actions .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    min-width: 160px;
    z-index: 10001;
    display: none;
}

.template-card-actions .dropdown-menu.show {
    display: block;
}

.template-card-actions .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #374151;
}

.template-card-actions .dropdown-item:hover {
    background: #f9fafb;
}

.template-card-actions .dropdown-item.text-danger {
    color: #dc2626;
}

.template-card-actions .dropdown-item.text-danger:hover {
    background: #fef2f2;
}

.template-card-actions .dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.template-card-body {
    margin-bottom: 16px;
}

.template-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.template-preview pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #374151;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.template-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, #f9fafb);
    pointer-events: none;
}

.template-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.template-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #6b7280;
}

.template-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.template-stats .stat i {
    width: 14px;
    height: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    margin-bottom: 16px;
}

.empty-state-icon i {
    width: 48px;
    height: 48px;
    color: #d1d5db;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.empty-state p {
    margin: 0 0 24px 0;
    font-size: 14px;
}

/* Fullscreen Editor */
.template-editor-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    display: flex;
    flex-direction: column;
}

.template-editor-container.fullscreen .template-editor {
    flex: 1;
    min-height: auto;
    height: auto;
    resize: none;
}

.modal-fullscreen {
    overflow: hidden;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.toast-content i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 4px;
}

.toast-close:hover {
    background: #f3f4f6;
}

.toast-close i {
    width: 16px;
    height: 16px;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-content i {
    color: #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-content i {
    color: #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-content i {
    color: #3b82f6;
}

/* Loading State */
.loading {
    cursor: wait;
}

.loading * {
    pointer-events: none;
}

.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 9999;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .template-card {
        padding: 16px;
    }
    
    .template-card-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .template-card-actions {
        align-self: flex-end;
    }
    
    .template-card-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .template-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
}

/* Exam Varieties Styles */
.exam-varieties-container {
    padding: 24px;
}

.varieties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.variety-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.variety-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.variety-card.variety-deleted {
    opacity: 0.6;
    background: #f9fafb;
}

.variety-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.variety-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.variety-card-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

.variety-code {
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', monospace;
}

.variety-checkbox {
    margin: 0;
    cursor: pointer;
}

.variety-card-actions {
    position: relative;
}

.variety-card-actions .dropdown {
    position: relative;
}

.variety-card-actions .dropdown-trigger {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.variety-card-actions .dropdown-trigger:hover {
    background: #f3f4f6;
    color: #374151;
}

.variety-card-actions .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    min-width: 160px;
    z-index: 10001;
    display: none;
}

.variety-card-actions .dropdown-menu.show {
    display: block;
}

.variety-card-actions .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #374151;
}

.variety-card-actions .dropdown-item:hover {
    background: #f9fafb;
}

.variety-card-actions .dropdown-item.text-danger {
    color: #dc2626;
}

.variety-card-actions .dropdown-item.text-danger:hover {
    background: #fef2f2;
}

.variety-card-actions .dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.variety-card-body {
    margin-bottom: 16px;
}

.variety-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.variety-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    color: #111827;
    font-weight: 500;
    text-align: right;
}

.variety-templates {
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

.templates-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.templates-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.view-templates-btn {
    font-size: 12px;
    padding: 4px 8px;
}

.variety-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

.variety-status {
    display: flex;
    gap: 8px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-deleted {
    background: #f3f4f6;
    color: #6b7280;
}

.variety-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* Form Sections */
.form-section {
    margin: 16px 0;
    padding: 16px;
}

.form-section-title {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

/* Template Selectors */
.template-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.template-selector .form-select {
    flex: 1;
}

.template-multi-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selected-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
}

.selected-template {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
}

.template-name {
    color: #1e40af;
    font-weight: 500;
}

.remove-template-btn {
    padding: 2px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-template-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.remove-template-btn i {
    width: 12px;
    height: 12px;
}

/* Template Preview Modal */
.template-preview-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item .info-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item .info-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}

.template-content {
    flex: 1;
}

.template-content h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.template-content pre {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Filter Sections */
.filter-section {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.form-select-sm {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
}

/* Responsive Design for Exam Varieties */
@media (max-width: 768px) {
    .varieties-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .variety-card {
        padding: 16px;
    }
    
    .variety-card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .variety-card-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .variety-info {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .variety-card-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .template-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-section {
        margin: 16px 0;
        padding: 16px;
    }
}

/* Dynamic Parameters Styles */
.dynamic-parameters-container {
    margin-bottom: 20px;
    min-height: 60px;
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.dynamic-parameters-container:not(:empty) {
    border-color: #007bff;
    background-color: #ffffff;
    border-style: solid;
    border-width: 1px;
}

.no-parameters-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 0;
    padding: 20px 0;
}

.add-parameter-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.parameter-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.parameter-selector .form-select {
    flex: 1;
}

.parameter-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.parameter-input-container .form-select,
.parameter-input-container .form-input {
    flex: 1;
}

.remove-parameter-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #dc3545;
    color: #dc3545;
}

.remove-parameter-btn:hover {
    background-color: #dc3545;
    color: white;
}

.remove-parameter-btn i {
    width: 16px;
    height: 16px;
}

/* Parameter form group styling */
.dynamic-parameters-container .form-group {
    margin-bottom: 15px;
}

.dynamic-parameters-container .form-group:last-child {
    margin-bottom: 0;
}

.dynamic-parameters-container .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.dynamic-parameters-container .form-help {
    margin-top: 3px;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Animation for parameter addition/removal */
.dynamic-parameters-container .form-row {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for dynamic parameters */
@media (max-width: 768px) {
    .parameter-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .parameter-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .remove-parameter-btn {
        align-self: flex-end;
        width: auto;
        padding: 8px 12px;
    }
}

/* Test Papers Management Styles */
.test-papers-container {
    max-width: 1400px;
    margin: 0 auto;
}

.main-content-area {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

.papers-list-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.detail-tabs-panel {
    width: 500px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

/* View Toggle */
.view-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle .btn {
    border: none;
    border-radius: 0;
    margin: 0;
}

.view-toggle .btn:first-child {
    border-right: 1px solid #e5e7eb;
}

/* Statistics Bar */
.statistics-bar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Table View */
.papers-table-view {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    /* 允许操作列的下拉菜单超出容器显示，避免被裁剪 */
    overflow: visible;
}

.table-container {
    overflow-x: auto;
    height: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.data-table td {
    vertical-align: top;
}

.checkbox-column {
    width: 40px;
}

.actions-column {
    width: 140px;
}

/* Paper Information column takes remaining space */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: auto;
    min-width: 300px;
}

.paper-name {
    cursor: pointer;
    transition: color 0.2s ease;
}

.paper-name strong {
    color: #1f2937;
}

.paper-name small {
    display: block;
}

/* New styles for improved paper information layout */
.paper-info-cell {
    min-width: 0; /* Allow text to wrap */
}

.paper-name .paper-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.paper-name .paper-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    overflow: visible;
}

.paper-meta .meta-item {
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.paper-meta .variety-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.paper-meta .status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.clickable-paper-name:hover .paper-title {
    color: #3b82f6;
}

.variety-badge {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-uploaded {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-converting {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.status-formatted {
    background: #d1fae5;
    color: #059669;
}

.status-badge.status-structured {
    background: #e0e7ff;
    color: #5b21b6;
}

.status-badge.status-error {
    background: #fee2e2;
    color: #dc2626;
}

/* Card View */
.papers-card-view {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.paper-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.paper-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.card-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.meta-item i {
    width: 14px;
    height: 14px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    transition: all 0.2s ease;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: #3b82f6;
    background: #f8faff;
}

.upload-zone {
    cursor: pointer;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #6b7280;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.files-list {
    margin-top: 20px;
}

.files-list h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.files-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    margin-bottom: 8px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.remove-file-btn {
    padding: 4px;
    border: none;
    background: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.remove-file-btn i {
    width: 16px;
    height: 16px;
}

/* Batch upload results */
.upload-summary {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.upload-summary p {
    margin: 4px 0;
    font-size: 14px;
}

.upload-summary p:first-child {
    font-weight: 600;
    color: #1f2937;
}

.upload-details {
    max-height: 300px;
    overflow-y: auto;
}

.result-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item.success {
    border-color: #10b981;
    background: #f0fdf4;
}

.result-item.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.result-header i {
    width: 16px;
    height: 16px;
}

.result-item.success .result-header i {
    color: #10b981;
}

.result-item.error .result-header i {
    color: #ef4444;
}

.result-header .filename {
    font-weight: 500;
    color: #1f2937;
    flex: 1;
}

.result-header .file-size {
    font-size: 12px;
    color: #6b7280;
}

.result-details {
    padding: 12px 16px;
}

.txt-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.txt-length {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}

.txt-length i {
    width: 14px;
    height: 14px;
}

.paper-name-info {
    margin-top: 8px;
    padding: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    font-size: 12px;
}

.error-info {
    color: #dc2626;
}

.error-message {
    font-size: 12px;
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.upload-results {
    max-height: 300px;
    overflow-y: auto;
}

.upload-summary {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.upload-summary p {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.upload-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
}

.result-item.success {
    background: #f0fdf4;
    color: #166534;
}

.result-item.error {
    background: #fef2f2;
    color: #dc2626;
}

.error-text {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

/* Tabs */
.tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tabs-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background: #f9fafb;
    color: #374151;
}

.tab-button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.tab-title {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.tab-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tabs-content {
    flex: 1;
    overflow-y: auto;
}

.tab-pane {
    display: none;
    padding: 20px;
    height: 100%;
}

.tab-pane.active {
    display: block;
}

/* Paper Detail */
.paper-detail-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
}

.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Special styling for Paper Name field to allow full width */
.info-grid .paper-name-item {
    grid-column: 1 / -1; /* Take full width */
}

.paper-name-container {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item .paper-name-input {
    flex: 1;
    min-width: 350px;
    width: 70%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
    line-height: 1.4;
    resize: vertical;
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 300px;
}

.actions-grid .btn {
    font-size: 13px;
    padding: 8px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actions-grid .btn i {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content-area {
        flex-direction: column;
        height: auto;
    }
    
    .detail-tabs-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .action-bar-left,
    .action-bar-right {
        justify-content: center;
    }
    
    .statistics-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        max-width: 200px;
    }
    
    .tabs-nav {
        overflow-x: auto;
    }

    /* Mobile optimizations for paper information */
    .paper-name .paper-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .paper-meta .meta-item,
    .paper-meta .variety-badge,
    .paper-meta .status-badge {
        font-size: 11px;
        padding: 1px 6px;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 200px;
    }

    /* Paper Name field responsive adjustments */
    .paper-name-container {
        flex-direction: column;
        gap: 8px;
    }

    .info-item .paper-name-input {
        min-height: 60px; /* Allow more height on mobile for long text */
    }
}

.generate-name-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.generate-name-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.generate-name-btn:disabled {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}

.generate-name-btn .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Formatting pipeline styles */
.pipeline-step[data-step="formatted"] .start-format-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.pipeline-step[data-step="formatted"] .start-format-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.pipeline-step[data-step="formatted"] .start-format-btn:disabled {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}

.pipeline-step[data-step="formatted"] .preview-formatted-btn,
.pipeline-step[data-step="formatted"] .edit-formatted-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.pipeline-step[data-step="formatted"] .preview-formatted-btn:hover,
.pipeline-step[data-step="formatted"] .edit-formatted-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.status-indicator.status-processing {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.formatted-editor {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.formatted-content {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.formatted-editor .editor-actions {
    margin-top: 12px;
    display: flex !important;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 5;
    min-height: 40px;
    padding: 4px 0;
}

.formatted-editor .editor-actions .save-formatted-btn,
.save-formatted-btn.btn.btn-primary {
    background: #10b981 !important;
    color: white !important;
    border: 1px solid #10b981 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.formatted-editor .editor-actions .save-formatted-btn:hover,
.save-formatted-btn.btn.btn-primary:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    color: white !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.formatted-editor .editor-actions .cancel-edit-btn,
.cancel-edit-btn.btn.btn-outline {
    background: #6b7280 !important;
    color: white !important;
    border: 1px solid #6b7280 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.formatted-editor .editor-actions .cancel-edit-btn:hover,
.cancel-edit-btn.btn.btn-outline:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
    color: white !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Raw editor buttons protection */
.raw-editor .editor-actions .cancel-edit-raw-btn,
.cancel-edit-raw-btn.btn.btn-outline {
    background: #6b7280 !important;
    color: white !important;
    border: 1px solid #6b7280 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.raw-editor .editor-actions .cancel-edit-raw-btn:hover,
.cancel-edit-raw-btn.btn.btn-outline:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
    color: white !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.raw-editor .editor-actions .save-raw-btn,
.save-raw-btn.btn.btn-primary {
    background: #10b981 !important;
    color: white !important;
    border: 1px solid #10b981 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.raw-editor .editor-actions .save-raw-btn:hover,
.save-raw-btn.btn.btn-primary:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    color: white !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* AI Explanation pipeline styles */
.pipeline-step[data-step="ai-explanation"] .generate-explanation-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.pipeline-step[data-step="ai-explanation"] .generate-explanation-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.4);
}

.pipeline-step[data-step="ai-explanation"] .generate-explanation-btn:disabled {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.pipeline-step[data-step="ai-explanation"] .generate-explanation-btn:disabled:hover {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}

.pipeline-step[data-step="ai-explanation"] .generate-explanation-btn:disabled i[data-feather="lock"] {
    color: #6b7280;
}

.pipeline-step[data-step="ai-explanation"] .preview-explanation-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.pipeline-step[data-step="ai-explanation"] .view-explanation-logs-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.pipeline-step[data-step="ai-explanation"] .preview-explanation-btn:hover,
.pipeline-step[data-step="ai-explanation"] .view-explanation-logs-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateY(-1px);
}

.explanation-progress {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.progress-label {
    color: #374151;
    font-weight: 600;
    font-size: 15px;
}

.progress-stats {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed, #6d28d9);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress messages area */
.progress-messages {
    margin-top: 12px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #e5e7eb;
}

.progress-message {
    padding: 3px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.progress-message:last-child {
    border-bottom: none;
}

.progress-message-success {
    color: #059669;
}

.progress-message-error {
    color: #dc2626;
}

.progress-message-warning {
    color: #d97706;
}

.progress-message-info {
    color: #4b5563;
}

/* Status indicators for AI explanation */
.status-indicator.status-processing {
    background: #f59e0b;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-indicator.status-success {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.status-error {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-indicator.status-disabled {
    background: #9ca3af;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Brain icon fallback */
.step-icon i[data-feather="brain"]::before {
    content: "🧠";
    font-style: normal;
}

/* 日志模态框样式 */
.logs-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.logs-modal .modal-body {
    overflow-y: auto;
    flex: 1;
}

.logs-info {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
}

.logs-info h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
}

.logs-info p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-entry {
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #e5e7eb;
}

.log-entry.log-info {
    background: #f0f9ff;
    border-left-color: #0ea5e9;
}

.log-entry.log-success {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.log-entry.log-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.log-entry.log-error {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.log-entry.log-default {
    background: #f9fafb;
    border-left-color: #9ca3af;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-type {
    font-weight: 600;
    font-size: 14px;
}

.log-timestamp {
    font-size: 12px;
    color: #6b7280;
}

.log-message {
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

.log-details {
    background: #f9fafb;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

.log-details pre {
    margin: 0;
    font-size: 12px;
    color: #4b5563;
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.no-logs {
    text-align: center;
    padding: 32px;
    color: #6b7280;
    font-style: italic;
}

/* User Menu Dropdown Styles */
.user-menu {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.user-menu-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.user-menu-role {
    display: block;
    font-size: 12px;
    color: #6b7280;
    text-transform: capitalize;
}

.user-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.user-menu-item:hover {
    background: #f3f4f6;
    color: #1f2937;
    text-decoration: none;
}

.user-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.user-menu-item i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.user-menu-item span {
    flex: 1;
}

/* Standard Answer Status Styles */
.standard-answer-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
    white-space: nowrap;
}

.standard-answer-badge.standard-answer-imported {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.standard-answer-badge.standard-answer-not-imported {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.standard-answer-badge i {
    width: 12px;
    height: 12px;
    font-size: 10px;
}

/* AI Explanation Status Styles */
.ai-explanation-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
    white-space: nowrap;
}

.ai-explanation-badge.ai-explanation-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.ai-explanation-badge.ai-explanation-processing {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    animation: pulse 2s infinite;
}

.ai-explanation-badge.ai-explanation-completed {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.ai-explanation-badge.ai-explanation-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.ai-explanation-badge i {
    width: 12px;
    height: 12px;
    font-size: 10px;
    margin-right: 4px;
    display: none;
}

/* Responsive adjustments for status badges */
@media (max-width: 768px) {
    .standard-answer-badge,
    .ai-explanation-badge {
        font-size: 10px;
        padding: 1px 6px;
        gap: 2px;
    }
    
    .standard-answer-badge i,
    .ai-explanation-badge i {
        width: 10px;
        height: 10px;
        font-size: 8px;
    }
}

/* Card view specific adjustments */
.paper-card .card-header .standard-answer-badge,
.paper-card .card-header .ai-explanation-badge {
    margin-left: 4px;
}

/* Table view specific adjustments */
.paper-meta .standard-answer-badge,
.paper-meta .ai-explanation-badge {
    margin-right: 8px;
}

/* Audio status badge */
.audio-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
}

.audio-badge.audio-available {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #34d399;
    color: #065f46;
}

.audio-badge i {
    width: 14px;
    height: 14px;
}

/* Annotation status badge */
.annotation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
}

.annotation-badge.annotation-available {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #60a5fa;
    color: #1d4ed8;
}

.annotation-badge i {
    width: 14px;
    height: 14px;
}

/* Processing Pipeline Styles */
.pipeline-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.pipeline-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.step-connector {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, #3b82f6, #e5e7eb);
    margin-top: 8px;
}

.pipeline-step:last-child .step-connector {
    display: none;
}

.step-card {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.step-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.step-card.step-disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
    opacity: 0.7;
}

.step-card.step-disabled:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-color: #e5e7eb;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.step-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0f9ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    flex-shrink: 0;
    font-size: 24px;
    line-height: 1;
}

.step-disabled .step-icon {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    color: #9ca3af;
    filter: grayscale(100%);
}

.step-details {
    flex: 1;
}

.step-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.step-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.step-disabled .step-title {
    color: #9ca3af;
}

.step-disabled .step-description {
    color: #d1d5db;
}

/* Publish pipeline step styles */
.pipeline-step[data-step="publish"] .publish-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pipeline-step[data-step="publish"] .publish-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.pipeline-step[data-step="publish"] .publish-btn:disabled {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.pipeline-step[data-step="publish"] .unpublish-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.pipeline-step[data-step="publish"] .unpublish-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateY(-1px);
}

.pipeline-step[data-step="publish"] .publish-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
}

.pipeline-step[data-step="publish"] .publish-info .text-muted {
    color: #6b7280;
    font-size: 13px;
}

/* Publish status badge styles */
.publish-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.publish-status-badge.publish-status-published {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.publish-status-badge i {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    display: none;
}

/* Status badges container */
.paper-status-badges {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 6px;
    margin-top: 6px;
    overflow-x: auto;
    white-space: nowrap;
    align-items: center;
    width: 100%;
    min-height: 24px;
}

.card-status-badges {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    overflow-x: auto;
    white-space: nowrap;
    align-items: center;
    width: 100%;
    min-height: 24px;
}

/* Ensure all status badges stay inline */
.paper-status-badges > *,
.card-status-badges > * {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
}

/* Force all status badges to be inline */
.paper-status-badges .status-badge,
.paper-status-badges .validation-status-badge,
.paper-status-badges .standard-answer-badge,
.paper-status-badges .ai-explanation-badge,
.paper-status-badges .publish-status-badge,
.card-status-badges .status-badge,
.card-status-badges .validation-status-badge,
.card-status-badges .standard-answer-badge,
.card-status-badges .ai-explanation-badge,
.card-status-badges .publish-status-badge {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    margin: 0 !important;
    float: none !important;
}

.validation-status-badge .validation-indicator {
    display: none;
}

/* Update meta items to remove icon spacing */
.paper-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 16px;
    font-size: 13px;
    color: #6b7280;
}

.card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

/* Remove icon-related styles from badges */
.standard-answer-badge i,
.ai-explanation-badge i,
.publish-status-badge i {
    display: none;
}

.validation-status-badge .validation-indicator {
    display: none;
}

/* Override any media query effects on status badges */
@media (max-width: 768px) {
    .paper-status-badges {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
    }
    
    .card-status-badges {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
    }
    
    .paper-status-badges > *,
    .card-status-badges > * {
        display: inline-flex !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}

/* Batch Import Answer Upload Modal Styles */
#batch-import-answer-upload-modal .modal-content {
    max-width: 700px;
    width: 90vw;
}

.selection-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.selection-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.selection-icon {
    color: #3b82f6;
    width: 20px;
    height: 20px;
}

.naming-rule-info {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}

.naming-rule-info .section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.rule-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.rule-label {
    color: #6b7280;
    min-width: 100px;
}

.rule-item code {
    background: #f1f5f9;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.rule-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #d97706;
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #fbbf24;
}

.rule-warning i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.file-upload-section {
    margin-top: 24px;
}

.file-upload-area {
    margin-bottom: 20px;
}

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.upload-zone .upload-icon {
    color: #6b7280;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
    color: #3b82f6;
}

.upload-text {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
}

.upload-text strong {
    color: #1f2937;
}

.upload-hint {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.files-list {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.files-list h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.files-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #f3f4f6;
    border-radius: 6px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: white;
    transition: background-color 0.2s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: #f9fafb;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    color: #6b7280;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.remove-file-btn {
    background: none;
    border: none;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    color: #dc2626;
    background: #fee2e2;
}

.remove-file-btn i {
    width: 16px;
    height: 16px;
}

/* Loading state for import button */
.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #batch-import-answer-upload-modal .modal-content {
        width: 95vw;
        margin: 20px auto;
    }
    
    .selection-info {
        padding: 16px;
    }
    
    .upload-zone {
        padding: 30px 16px;
    }
    
    .upload-zone .upload-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 12px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .upload-hint {
        font-size: 12px;
    }
    
    .rule-examples {
        gap: 6px;
    }
    
    .rule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .rule-label {
        min-width: auto;
        font-weight: 500;
    }
}

/* ==========================================
   AUDIO LESSONS STYLES
   ========================================== */

/* 音频课程按钮样式 */
.audio-lessons-btn-container {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-audio-lessons {
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-audio-available {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 1px solid #059669;
}

.btn-audio-available:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-audio-available:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-audio-partial {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: 1px solid #4b5563;
    cursor: pointer;
}

.btn-audio-partial:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.btn-audio-partial:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

/* Actions列布局调整 - 使用承重层容器，避免 td 同时承担 table 与 flex 语义 */
.actions-cell {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

/* 音频课程模态框样式 */
.modal-lg .modal-content {
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: visible; /* 允许滚动 */
    display: flex;
    flex-direction: column;
}

/* 确保音频课程模态框的body可以滚动 */
#audio-lessons-modal .modal-body {
    max-height: calc(80vh - 120px); /* 减去头部和内边距的高度 */
    overflow-y: auto;
    flex: 1;
    position: relative;
}

/* 解决与全局 .modal-overlay 样式冲突导致的遮挡与无法滚动问题
   音频课程使用的是父级 .modal 容器 + 子级 overlay + content 结构。
   这里强制该模态框内的 overlay 为绝对定位并位于 content 之下，
   避免被全局的固定定位 overlay（用于其他独立覆盖层模态）覆盖内容。 */
#audio-lessons-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 0; /* 确保内容在其之上可点击与滚动 */
    display: block;
    opacity: 1;
}

/* 修复音频课程列表滚动 */
#audio-lessons-modal .audio-lessons-list {
    max-height: calc(80vh - 200px); /* 为info区域留出更多空间 */
    overflow-y: auto;
    padding-right: 8px;
    position: relative;
}

.audio-lessons-info {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.audio-lessons-info p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.audio-lessons-info p:not(:last-child) {
    margin-bottom: 8px;
}

.audio-lessons-info strong {
    color: #1e293b;
    font-weight: 600;
}

.audio-lessons-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 8px;
}

/* 自定义滚动条 */
.audio-lessons-list::-webkit-scrollbar {
    width: 6px;
}

.audio-lessons-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.audio-lessons-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.audio-lessons-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.audio-lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.audio-lesson-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.audio-lesson-item:last-child {
    margin-bottom: 0;
}

.lesson-info h4 {
    margin: 0 0 6px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.lesson-info small {
    color: #6b7280;
    font-size: 13px;
    display: block;
}

.lesson-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-play-audio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-play-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-play-audio:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-play-audio:not(:disabled):active {
    transform: translateY(0);
}

.btn-play-audio .play-text {
    font-size: 13px;
}

.audio-player-container {
    min-width: 250px;
}

.audio-player {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    outline: none;
}

.audio-player::-webkit-media-controls-panel {
    background-color: #f8fafc;
    border-radius: 6px;
}

.audio-player::-webkit-media-controls-play-button,
.audio-player::-webkit-media-controls-pause-button {
    background-color: #3b82f6;
    border-radius: 50%;
}

/* 隐藏音频播放器的下载按钮 */
.audio-player::-webkit-media-controls-download-button {
    display: none !important;
}

.audio-player::-webkit-media-controls-overflow-button {
    display: none !important;
}

/* Card View 中的音频按钮调整 */
.paper-card .card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.paper-card .audio-lessons-btn-container {
    margin-right: 0;
}

/* 音频生成按钮样式 */
.btn-generate-audio {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.btn-generate-audio:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-generate-audio:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-generate-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
}

/* 重新生成音频按钮样式 */
.btn-regenerate-audio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    margin-right: 8px;
}

.btn-regenerate-audio:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-regenerate-audio:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.btn-regenerate-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
}

/* 批量音频生成按钮样式 */
.btn-generate-bulk-audio {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-generate-bulk-audio:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.btn-generate-bulk-audio:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-generate-bulk-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
    box-shadow: none;
}

/* 批量重新生成音频按钮样式 */
.btn-regenerate-bulk-audio {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-regenerate-bulk-audio:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.4);
}

.btn-regenerate-bulk-audio:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.btn-regenerate-bulk-audio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
    box-shadow: none;
}

/* 批量音频生成按钮样式（Batch Actions Modal中的按钮）*/
.btn-audio.btn-action {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: 1px solid #4f46e5;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.btn-audio.btn-action:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

.btn-audio.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-audio.btn-action .btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-audio.btn-action .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.btn-audio.btn-action .btn-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
    color: white;
}

.btn-audio.btn-action .btn-description {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
}

.btn-audio.btn-action i[data-feather] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 批量注解生成按钮样式（Batch Actions Modal中的按钮）*/
.btn-annotation.btn-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid #764ba2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-annotation.btn-action:hover {
    background: linear-gradient(135deg, #5568d3 0%, #614991 100%);
    border-color: #614991;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-annotation.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-annotation.btn-action .btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-annotation.btn-action .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.btn-annotation.btn-action .btn-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
    color: white;
}

.btn-annotation.btn-action .btn-description {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
}

.btn-annotation.btn-action i[data-feather] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 批量重新生成音频按钮样式 */
.btn-audio-regenerate.btn-action {
    background: linear-gradient(135deg, #ff7043 0%, #f4511e 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.25);
    transition: all 0.3s ease;
}

.btn-audio-regenerate.btn-action:hover {
    background: linear-gradient(135deg, #ff8a65 0%, #ff5722 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 112, 67, 0.35);
}

.btn-audio-regenerate.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 112, 67, 0.25);
}

.btn-audio-regenerate.btn-action .btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-audio-regenerate.btn-action .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.btn-audio-regenerate.btn-action .btn-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
}

.btn-audio-regenerate.btn-action .btn-description {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
}

.btn-audio-regenerate.btn-action i[data-feather] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 题号选择弹窗样式 */
#regenerate-audio-questions-modal .variety-info-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

#regenerate-audio-questions-modal .variety-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 16px;
    color: #1565c0;
}

#regenerate-audio-questions-modal .variety-header i[data-feather] {
    width: 18px;
    height: 18px;
    color: #1976d2;
}

#regenerate-audio-questions-modal .variety-stats {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #555;
}

#regenerate-audio-questions-modal .variety-stats strong {
    color: #1565c0;
}

#regenerate-audio-questions-modal .question-selection-section {
    margin-bottom: 20px;
}

#regenerate-audio-questions-modal .question-selection-section .section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

#regenerate-audio-questions-modal .question-selection-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

#regenerate-audio-questions-modal .question-selection-actions .btn {
    padding: 6px 14px;
    font-size: 12px;
}

#regenerate-audio-questions-modal .question-checkboxes {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

#regenerate-audio-questions-modal .question-checkbox-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid #e0e0e0;
    user-select: none;
}

#regenerate-audio-questions-modal .question-checkbox-item:hover {
    border-color: #1976d2;
    background: #e3f2fd;
}

#regenerate-audio-questions-modal .question-checkbox-item:has(.question-checkbox:checked) {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-color: #1565c0;
    color: white;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
    transform: translateY(-1px);
}

#regenerate-audio-questions-modal .question-checkbox {
    display: none;
}

#regenerate-audio-questions-modal .question-number {
    font-weight: 500;
    font-size: 14px;
}

#regenerate-audio-questions-modal .selected-count {
    margin-top: 14px;
    text-align: right;
    font-size: 14px;
    color: #666;
}

#regenerate-audio-questions-modal .selected-count strong {
    color: #1976d2;
    font-weight: 600;
}

#regenerate-audio-questions-modal .regenerate-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 10px;
    border-left: 4px solid #ff9800;
    font-size: 13px;
    color: #e65100;
    line-height: 1.5;
}

#regenerate-audio-questions-modal .regenerate-warning i[data-feather] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    color: #f57c00;
}

#regenerate-audio-questions-modal .regenerate-warning strong {
    color: #d84315;
}

#regenerate-audio-questions-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

#regenerate-audio-questions-modal #regenerate-audio-start-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

#regenerate-audio-questions-modal #regenerate-audio-start-btn i[data-feather] {
    width: 16px;
    height: 16px;
}

/* 批量重新生成音频进度模态框样式 */
#batch-regenerate-audio-progress-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#batch-regenerate-audio-progress-modal .modal-title-icon {
    width: 20px;
    height: 20px;
    color: #ff7043;
}

#batch-regenerate-audio-progress-modal .progress-container {
    margin-bottom: 20px;
}

#batch-regenerate-audio-progress-modal .progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

#batch-regenerate-audio-progress-modal .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7043 0%, #f4511e 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

#batch-regenerate-audio-progress-modal .progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
}

#batch-regenerate-audio-progress-modal .progress-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    padding: 14px;
    background: #f5f5f5;
    border-radius: 8px;
}

#batch-regenerate-audio-progress-modal .stat-item {
    font-size: 14px;
    color: #555;
}

#batch-regenerate-audio-progress-modal .stat-item .stat-value {
    font-weight: 600;
    color: #333;
}

#batch-regenerate-audio-progress-modal .stat-item.success .stat-value {
    color: #059669;
}

#batch-regenerate-audio-progress-modal .stat-item.error .stat-value {
    color: #dc2626;
}

#batch-regenerate-audio-progress-modal .current-paper-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 112, 67, 0.1);
    border: 1px solid rgba(255, 112, 67, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: #d84315;
}

#batch-regenerate-audio-progress-modal .current-paper-info i[data-feather] {
    width: 16px;
    height: 16px;
    color: #ff7043;
    flex-shrink: 0;
}

#batch-regenerate-audio-progress-modal .current-paper-info strong {
    color: #bf360c;
}

#batch-regenerate-audio-progress-modal .regenerate-results {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

#batch-regenerate-audio-progress-modal .batch-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#batch-regenerate-audio-progress-modal .results-section {
    margin-bottom: 12px;
}

#batch-regenerate-audio-progress-modal .results-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

#batch-regenerate-audio-progress-modal .success-section .results-title {
    color: #059669;
}

#batch-regenerate-audio-progress-modal .error-section .results-title {
    color: #dc2626;
}

#batch-regenerate-audio-progress-modal .results-title i[data-feather] {
    width: 16px;
    height: 16px;
}

#batch-regenerate-audio-progress-modal .results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#batch-regenerate-audio-progress-modal .result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
}

#batch-regenerate-audio-progress-modal .result-item.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

#batch-regenerate-audio-progress-modal .result-item.error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.2);
}

#batch-regenerate-audio-progress-modal .result-item i[data-feather] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

#batch-regenerate-audio-progress-modal .result-item.success i[data-feather] {
    color: #10b981;
}

#batch-regenerate-audio-progress-modal .result-item.error i[data-feather] {
    color: #dc2626;
}

#batch-regenerate-audio-progress-modal .result-content {
    flex: 1;
    min-width: 0;
}

#batch-regenerate-audio-progress-modal .result-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    word-break: break-word;
}

#batch-regenerate-audio-progress-modal .result-details {
    font-size: 12px;
    color: #666;
}

#batch-regenerate-audio-progress-modal .result-error {
    font-size: 12px;
    color: #dc2626;
    word-break: break-word;
}

#batch-regenerate-audio-progress-modal .modal-footer {
    display: flex;
    justify-content: center;
}

#batch-regenerate-audio-progress-modal .no-results {
    text-align: center;
    color: #888;
    font-size: 14px;
    padding: 20px;
}

/* 批量音频生成进度模态框样式增强 */
#batch-audio-generation-progress-modal .current-paper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 13px;
    color: #1e40af;
}

#batch-audio-generation-progress-modal .current-paper i[data-feather] {
    width: 16px;
    height: 16px;
    color: #3b82f6;
}

#batch-audio-generation-progress-modal .batch-audio-generation-results {
    margin-top: 20px;
}

#batch-audio-generation-progress-modal .batch-results {
    max-height: 300px;
    overflow-y: auto;
}

#batch-audio-generation-progress-modal .results-section {
    margin-bottom: 20px;
}

#batch-audio-generation-progress-modal .results-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

#batch-audio-generation-progress-modal .success-section .results-title {
    color: #059669;
}

#batch-audio-generation-progress-modal .error-section .results-title {
    color: #dc2626;
}

#batch-audio-generation-progress-modal .results-list {
    space: 8px;
}

#batch-audio-generation-progress-modal .result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid;
}

#batch-audio-generation-progress-modal .result-item.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

#batch-audio-generation-progress-modal .result-item.error {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.2);
}

#batch-audio-generation-progress-modal .result-item i[data-feather] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

#batch-audio-generation-progress-modal .result-item.success i[data-feather] {
    color: #059669;
}

#batch-audio-generation-progress-modal .result-item.error i[data-feather] {
    color: #dc2626;
}

#batch-audio-generation-progress-modal .result-content {
    flex: 1;
}

#batch-audio-generation-progress-modal .result-name {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
}

#batch-audio-generation-progress-modal .result-details {
    font-size: 12px;
    color: #6b7280;
}

#batch-audio-generation-progress-modal .result-error {
    font-size: 12px;
    color: #dc2626;
}

#batch-audio-generation-progress-modal .no-results {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

/* 批量操作按钮容器样式 */
.bulk-actions-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.bulk-generate-help-container {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.bulk-generate-help {
    margin-bottom: 4px;
}

.bulk-regenerate-help {
    margin-bottom: 0;
}

.bulk-generate-help {
    color: #6b7280 !important;
    font-style: italic;
    line-height: 1.3;
}

/* Audio lessons actions区域样式 */
.audio-lessons-actions {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

/* 加载动画 */
.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 音频课程项目状态增强 */
.audio-lesson-item[data-has-audio="true"] {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.audio-lesson-item[data-has-audio="false"] {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.audio-lesson-item[data-has-audio="true"]:hover {
    background: #ecfdf5;
    border-left-color: #059669;
}

.audio-lesson-item[data-has-audio="false"]:hover {
    background: #fef3c7;
    border-left-color: #d97706;
}

/* 音频课程信息增强显示 */
.audio-lessons-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.audio-lessons-info p {
    margin: 0 0 8px 0;
    color: #475569;
    font-size: 14px;
}

.audio-lessons-info p:last-child {
    margin-bottom: 0;
}

.audio-lessons-info strong {
    color: #1e293b;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .actions-column {
        flex-direction: column;
        gap: 8px;
        min-width: 80px;
    }
    
    .audio-lessons-btn-container {
        margin-right: 0;
        margin-bottom: 4px;
    }
    
    .btn-audio-lessons {
        padding: 6px 8px;
        min-width: 36px;
        height: 32px;
        font-size: 12px;
    }
    
    .modal-lg .modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
    }
    
    .audio-lesson-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    
    .lesson-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .audio-player-container {
        min-width: 200px;
        flex: 1;
    }
    
    .audio-player {
        height: 35px;
    }
    
    .btn-play-audio {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .audio-lessons-info {
        padding: 12px;
    }
    
    .audio-lessons-info p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .lesson-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .audio-player-container {
        width: 100%;
        min-width: auto;
    }
    
    .btn-play-audio {
        width: 100%;
    }
}

/* ========================================
   音频生成进度模态框样式 
   ======================================== */

/* 音频生成模态框特殊样式 */
.audio-generation-modal {
    width: 700px;
    max-width: 95vw;
}

.audio-generation-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.audio-generation-modal .modal-header h3 {
    color: white;
    font-weight: 600;
}

.audio-generation-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.audio-generation-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* 试卷信息区域 */
.paper-info {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    font-size: 14px;
    color: #1e293b;
}

/* 进度条容器 */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #f1f5f9, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #1e40af);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 100%);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    min-height: 20px;
}

/* 进度详情网格 */
.progress-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.detail-item span:first-child {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span:last-child {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

/* 控制台输出区域 */
.console-output {
    margin-top: 25px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.console-header {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #f9fafb;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #4b5563;
}

.console-header i {
    width: 14px;
    height: 14px;
}

.console-content {
    background: #111827;
    padding: 15px;
    max-height: 250px;
    min-height: 150px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e5e7eb;
}

.console-line {
    margin-bottom: 6px;
    padding: 2px 0;
    word-wrap: break-word;
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

.console-line:last-child {
    margin-bottom: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条样式 */
.console-content::-webkit-scrollbar {
    width: 8px;
}

.console-content::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

.console-content::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.console-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 音频生成按钮状态样式 */
.dropdown-item.text-primary {
    color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05);
}

.dropdown-item.text-primary:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #2563eb !important;
}

.dropdown-item.text-muted {
    color: #9ca3af !important;
    background: rgba(156, 163, 175, 0.05);
}

.dropdown-item.text-muted:hover {
    background: rgba(156, 163, 175, 0.1) !important;
    color: #9ca3af !important;
}

.dropdown-item:disabled,
.dropdown-item[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-item:disabled:hover,
.dropdown-item[disabled]:hover {
    background: transparent !important;
    color: #9ca3af !important;
}

/* 模态框显示动画 */
.modal-overlay-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay-root.show {
    opacity: 1;
}

.modal-container {
    background: white;
    border-radius: 12px;
    width: 600px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay-root.show .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
}

.modal-header h3 i {
    width: 20px;
    height: 20px;
}

.modal-close {
    background: none;
    border: 1px solid #d1d5db;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
    transform: scale(1.05);
}

.modal-close i {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .audio-generation-modal {
        width: 95vw;
    }
    
    .progress-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .detail-item {
        padding: 8px;
    }
    
    .detail-item span:last-child {
        font-size: 16px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .console-content {
        max-height: 200px;
        min-height: 120px;
        font-size: 11px;
    }
    
    .paper-info {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .progress-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .progress-text {
        font-size: 13px;
    }
    
    .console-header {
        font-size: 11px;
        padding: 10px 15px;
    }
}

/* ===========================
   Pagination Controls Styles
   =========================== */

.pagination-controls,
.pagination-controls-default {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.page-size-selector label {
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
}

.form-select-sm {
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    min-width: 60px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select-sm:hover {
    border-color: #9ca3af;
}

.form-select-sm:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pagination-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.pagination-info {
    display: flex;
    align-items: center;
}

.pagination-text {
    font-size: 14px;
    color: #6b7280;
}

.pagination-buttons {
    display: flex;
    gap: 4px;
    margin-left: 20px;
}

/* Pagination Button Styles */
.pagination-btn {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.pagination-btn:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.pagination-btn.disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pagination-controls,
    .pagination-controls-default {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .pagination-container {
        justify-content: space-between;
    }
    
    .pagination-info {
        justify-content: center;
    }
    
    .pagination-buttons {
        justify-content: center;
        margin-left: 0;
    }
    
    .page-size-selector {
        justify-content: center;
    }
}

/* ===========================
   Search Enhancement Styles
   =========================== */

/* Search Info Display */
.search-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #1d4ed8;
}

.search-info i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.search-info span {
    flex: 1;
    font-weight: 500;
}

/* Clear Search Button */
.clear-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.clear-search-btn i {
    width: 14px;
    height: 14px;
}

/* Search Input Enhancement */
#search-input {
    transition: all 0.2s ease;
}

#search-input.searching {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#search-input::placeholder {
    font-size: 14px;
    color: #9ca3af;
}

#search-input:focus::placeholder {
    color: #d1d5db;
}

/* Search Box Enhancement */
.search-box {
    position: relative;
}

.search-box .search-icon {
    pointer-events: none;
    transition: color 0.2s ease;
}

#search-input:focus + .search-icon {
    color: #3b82f6;
}

#search-input.searching + .search-icon {
    color: #3b82f6;
}

/* Responsive Search Styles */
@media (max-width: 768px) {
    .search-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
    
    .search-info span {
        word-break: break-word;
        line-height: 1.4;
    }
    
    .clear-search-btn {
        align-self: flex-end;
        margin-top: -20px;
    }
    
    #search-input::placeholder {
        font-size: 13px;
    }
}

/* Search Animation */
@keyframes searchPulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

#search-input.searching + .search-icon {
    animation: searchPulse 1.5s infinite ease-in-out;
}

/* ===========================
   Search Status Bar Styles
   =========================== */

.search-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

.search-status-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.search-status-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Search Info Compact */
.search-info-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.search-info-compact i {
    width: 16px;
    height: 16px;
    color: #3b82f6;
    flex-shrink: 0;
}

.search-keywords {
    font-weight: 600;
    color: #1f2937;
}

.result-count {
    color: #6b7280;
    font-weight: 500;
}

/* Clear Search Button Compact */
.clear-search-btn-compact {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.clear-search-btn-compact:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.clear-search-btn-compact i {
    width: 14px;
    height: 14px;
}

/* Pagination Compact */
.pagination-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-nav-btn {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.page-nav-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.page-nav-btn:disabled {
    background: #f9fafb;
    color: #d1d5db;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.page-nav-btn i {
    width: 16px;
    height: 16px;
}

.page-info {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    padding: 0 8px;
    white-space: nowrap;
}

/* Animation */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-status-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 12px 16px;
    }
    
    .search-status-left,
    .search-status-right {
        justify-content: center;
    }
    
    .search-info-compact {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination-compact {
        justify-content: center;
    }
    
    .page-info {
        min-width: 60px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .search-info-compact {
        font-size: 13px;
    }
    
    .page-nav-btn {
        min-width: 28px;
        height: 28px;
        padding: 4px 6px;
    }
    
    .page-info {
        font-size: 13px;
        padding: 0 6px;
    }
}

/* ===== Filter System Styles ===== */

/* Filter button states */
#filter-btn.active,
#filter-btn.has-filters {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

#filter-btn.active i,
#filter-btn.has-filters i {
    color: #1e40af;
}

/* Filter count badge */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #3b82f6;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== CARD-BASED FILTER DROPDOWN (REDESIGNED) ===== */
.filter-dropdown {
    position: relative;
}

.filter-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 16px;
    min-width: 380px;
    max-width: 450px;
    max-height: 640px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: dropdownSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-dropdown .dropdown-menu.show {
    display: block;
}

@keyframes dropdownSlide {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced scrollbar */
.filter-dropdown .dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown .dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.filter-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.filter-dropdown .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Filter Card */
.filter-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.filter-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-card:last-of-type {
    margin-bottom: 0;
}

.filter-card__header {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.3px;
}

.filter-card__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-card__icon i {
    width: 16px;
    height: 16px;
}

.filter-card__body {
    padding: 16px;
}

/* Filter Field */
.filter-field {
    margin-bottom: 16px;
}

.filter-field:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label i {
    width: 14px;
    height: 14px;
    color: #64748b;
}

/* Filter Select */
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-select:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
    outline: none;
    background: white;
}

/* Filter Pills (Grade Levels) */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.filter-pill {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.filter-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-pill__text {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
}

.filter-pill:hover .filter-pill__text {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
}

.filter-pill input[type="checkbox"]:checked + .filter-pill__text {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}

/* Filter Toggle (Show Deleted) */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.filter-toggle:hover {
    background: #f1f5f9;
}

.filter-toggle__input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.filter-toggle__label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

/* Filter Footer */
.filter-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(to top, white, rgba(255, 255, 255, 0.98));
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 16px 16px;
    margin: 16px -16px -16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}

.filter-footer__info {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.filter-footer__actions {
    display: flex;
    gap: 8px;
}

.btn-filter-reset {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: white;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter-reset:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
}

.btn-filter-reset i {
    width: 14px;
    height: 14px;
}

.btn-filter-apply {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-filter-apply:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.btn-filter-apply i {
    width: 14px;
    height: 14px;
}

/* Filter result bar */
.filter-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.filter-result-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0369a1;
    font-weight: 500;
    font-size: 14px;
}

.filter-result-info i {
    width: 18px;
    height: 18px;
    color: #0284c7;
    flex-shrink: 0;
}

.btn-clear-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: white;
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    color: #0284c7;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.btn-clear-filters i {
    width: 14px;
    height: 14px;
}

/* Responsive adjustments for filter system */
@media (max-width: 768px) {
    .filter-dropdown .dropdown-menu {
        right: auto;
        left: 0;
        min-width: 260px;
    }
    
    .filter-result-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 12px 14px;
    }
    
    .filter-result-info {
        justify-content: center;
        text-align: center;
    }
    
    .btn-clear-filters {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .filter-count {
        min-width: 18px;
        height: 18px;
        font-size: 11px;
        padding: 0 5px;
    }
    
    .filter-result-info {
        font-size: 13px;
        gap: 8px;
    }
    
    .btn-clear-filters {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* =============== Oral Scripts Modal Styles =============== */

/* 脚本列表模态框信息区域 */
.oral-scripts-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #bae6fd;
}

.oral-scripts-info .info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.oral-scripts-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oral-scripts-info .info-label {
    color: #64748b;
    font-size: 13px;
}

.oral-scripts-info .info-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

.oral-scripts-info .info-value.complete {
    color: #059669;
}

/* 脚本列表 */
.oral-scripts-list {
    max-height: calc(70vh - 200px);
    overflow-y: auto;
    padding-right: 8px;
}

/* 自定义滚动条 */
.oral-scripts-list::-webkit-scrollbar {
    width: 6px;
}

.oral-scripts-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.oral-scripts-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.oral-scripts-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 脚本列表项 */
.oral-script-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.oral-script-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.oral-script-item[data-has-script="false"] {
    background: #fafafa;
    border-color: #e5e7eb;
}

/* 脚本信息区域 */
.script-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.script-question-number {
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
}

.question-badge.has-script {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.question-badge.no-script {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.audio-indicator {
    display: inline-flex;
    align-items: center;
    color: #3b82f6;
}

.audio-indicator svg {
    width: 14px;
    height: 14px;
}

/* 脚本元数据 */
.script-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.script-meta span {
    font-size: 12px;
    color: #64748b;
}

.script-length {
    background: #f0fdf4;
    color: #15803d !important;
    padding: 2px 8px;
    border-radius: 4px;
}

.script-version {
    background: #eff6ff;
    color: #1d4ed8 !important;
    padding: 2px 8px;
    border-radius: 4px;
}

.script-time {
    color: #94a3b8 !important;
}

.no-script-text {
    color: #9ca3af !important;
    font-style: italic;
}

/* 脚本控制按钮 */
.script-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.script-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.script-controls .btn svg {
    width: 14px;
    height: 14px;
}

/* 无脚本提示 */
.no-scripts-message {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* =============== Script Detail Modal Styles =============== */

.script-detail-info {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e9d5ff;
}

.script-detail-info .info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.script-detail-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.script-detail-info .info-label {
    color: #7c3aed;
    font-size: 13px;
}

.script-detail-info .info-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

/* 脚本内容容器 */
.script-content-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: calc(60vh - 200px);
    overflow-y: auto;
}

.script-content {
    padding: 20px;
    margin: 0;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.script-content-editor {
    width: 100%;
    min-height: 45vh;
    border: none;
    outline: none;
    resize: vertical;
    background: transparent;
    padding: 20px;
    margin: 0;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 脚本内容滚动条 */
.script-content-container::-webkit-scrollbar {
    width: 8px;
}

.script-content-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.script-content-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.script-content-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 加载动画 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .oral-scripts-info .info-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .oral-script-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .script-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .script-detail-info .info-row {
        flex-direction: column;
        gap: 12px;
    }
}
  