/* 简化版样式 - 提高加载速度 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 移除加载状态样式，直接显示页面 */

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
}

/* 选题卡片样式 */
.topic-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    cursor: pointer;
    border: none;
    overflow: hidden;
    position: relative;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.topic-card:hover::before {
    transform: scaleX(1);
}

.topic-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.3s ease;
}

.topic-card:hover .topic-image {
    transform: scale(1.05);
}

.topic-card-body {
    padding: 1.25rem;
}

.topic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.topic-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-category {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.physical-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.physical-badge.has-physical {
    background: #d4edda;
    color: #155724;
}

.physical-badge.no-physical {
    background: #f8d7da;
    color: #721c24;
}

.rating-stars {
    color: #ffc107;
    font-size: 1rem;
}

/* 筛选卡片样式 */
.filter-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
}

.filter-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border: none;
    padding: 1rem 1.25rem;
}

.filter-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-select, .form-control {
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.3s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 按钮样式 */
.btn {
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 10px;
    outline: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    border: none;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 600;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.3rem - 1px);
    border-bottom-left-radius: calc(0.3rem - 1px);
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.5 3.5 3 3 3-3 3 3 3-3 3 3-3 3 3 3-3 3 3 3-3-3 3-3-3-3z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

.btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    opacity: 1;
}

.btn-close:disabled,
.btn-close.disabled {
    pointer-events: none;
    user-select: none;
    opacity: 0.25;
}

.modal-scrollbar-measure {
    position: absolute;
    top: -9999px;
    width: 50px;
    height: 50px;
    overflow: scroll;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
    .modal-sm {
        max-width: 300px;
    }
}

@media (min-width: 992px) {
    .modal-lg,
    .modal-xl {
        max-width: 800px;
    }
}

@media (min-width: 1200px) {
    .modal-xl {
        max-width: 1140px;
    }
}

/* 页脚样式 */
footer {
    background: #343a40 !important;
    border-top: 3px solid #667eea;
}

/* 认证结果样式 */
.auth-success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #c3e6cb;
}

.auth-danger {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

.auth-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #bee5eb;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* 性能优化 - 移除图片模糊效果 */
.topic-image {
    /* 移除所有可能导致模糊的样式 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* 图片清晰显示 */
.topic-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    opacity: 1 !important;
}

/* 加载状态优化 */
#loadingIndicator {
    position: relative;
    z-index: 1000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .topic-card {
        margin-bottom: 1rem;
    }
    
    .topic-image {
        height: 180px;
    }
    
    .topic-meta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .topic-meta .topic-category,
    .topic-meta .rating-stars,
    .topic-meta .physical-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
}

/* 分页样式 */
.pagination .page-link {
    color: #667eea;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 0 2px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    color: #764ba2;
    background-color: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

/* 自动消失提示框样式 */
.auto-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.auto-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.auto-toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .auto-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .auto-toast.show {
        transform: translateY(0);
    }
    
    .auto-toast.hide {
        transform: translateY(-100%);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 筛选卡片样式 */
.filter-card {
    background: white;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
    transition: all 0.3s ease;
}

.filter-card:hover {
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
    transform: translateY(-2px);
}

.filter-card .card-header {
    background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
    color: white;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

.filter-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.filter-card .card-body {
    padding: 1.5rem;
}

/* 搜索卡片样式 */
.search-card {
    background: white;
    border: 1px solid #e8f5e8;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.1);
    transition: all 0.3s ease;
}

.search-card:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.search-card .card-header {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    color: white;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

.search-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.search-card .card-body {
    padding: 1.5rem;
}

/* 表单样式优化 */
.filter-card .form-label,
.search-card .form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
}

.filter-card .form-select,
.search-card .form-control {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 0.75rem;
}

.filter-card .form-select:focus,
.search-card .form-control:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.15);
}

/* 按钮样式优化 */
.filter-card .btn-primary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-card .btn-primary:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.search-card .btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-card .btn-success:hover {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* 重置按钮样式 */
.btn-outline-secondary {
    border: 2px solid #e0e0e0;
    color: #666;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-outline-secondary:hover {
    background: #f5f5f5;
    border-color: #bdbdbd;
    color: #333;
    transform: translateY(-1px);
}

/* 移动端按钮优化 */
@media (max-width: 768px) {
    .filter-card .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-outline-secondary {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .filter-card .card-body {
        padding: 1rem;
    }
    
    .filter-card .form-select,
    .filter-card .form-control {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    /* 移动端按钮行样式 */
    .d-md-none .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    /* 新的统一按钮样式 */
    .filter-card .d-flex .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        font-weight: 500;
    }
}

@media (max-width: 576px) {
    .filter-card .btn-primary {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .btn-outline-secondary {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .filter-card .card-body {
        padding: 0.8rem;
    }
    
    .filter-card .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    /* 小屏幕移动端按钮 */
    .d-md-none .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    /* 新的统一按钮样式 - 小屏幕 */
    .filter-card .d-flex .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        font-weight: 500;
    }
}

/* 选题图片容器样式 */
.topic-image-container {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.topic-image-container:hover {
    border-color: #2196f3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.topic-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.topic-image-container:hover img {
    transform: scale(1.05);
}

/* 图片悬停遮罩层 */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.topic-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    color: white;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 选题详情紧凑布局样式 */
.topic-info-compact {
    padding: 0.5rem 0;
}

.topic-info-compact .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.topic-info-compact .info-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.topic-info-compact .info-item:last-child {
    margin-bottom: 0;
}

.topic-info-compact .info-item i {
    font-size: 1.1rem;
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
}

.topic-info-compact .info-label {
    font-weight: 500;
    color: #6c757d;
    margin-right: 0.5rem;
    min-width: 50px;
}

.topic-info-compact .info-value {
    font-weight: 600;
    color: #495057;
    flex: 1;
}

/* 描述内容样式 */
.description-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    line-height: 1.6;
    color: #495057;
    white-space: normal;
    word-wrap: break-word;
    min-height: 60px;
}

/* 模态框中的描述样式 */
.modal-description {
    margin-top: 1rem;
}

.modal-description h6 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.modal-description .description-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    line-height: 1.6;
    color: #495057;
    white-space: normal;
    word-wrap: break-word;
    min-height: 80px;
    max-height: none;
    overflow: visible;
    display: block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .topic-image-container {
        height: 150px;
        margin-bottom: 1rem;
    }
    
    .topic-info-compact .info-item {
        padding: 0.4rem 0.6rem;
        margin-bottom: 0.6rem;
    }
    
    .topic-info-compact .info-item i {
        font-size: 1rem;
        margin-right: 0.6rem;
    }
    
    .description-content {
        padding: 0.8rem;
    }
}