/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    /* REM单位适配 */
    font-size: calc(12px + 0.5vw);
    max-font-size: 16px;
    min-font-size: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 顶部导航栏 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.5rem 0;
}

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

.logo h1 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
    margin: 0;
}

/* 搜索区域 */
.search-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 600px;
    min-width: 200px;
}

.search-box {
    display: flex;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#searchInput {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background-color: transparent;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 2px;
}

.search-btn:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 高级搜索 */
.advanced-search {
    position: relative;
}

.advanced-btn {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.advanced-btn:hover {
    background-color: #e0e0e0;
}

.advanced-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    z-index: 1001;
    min-width: 150px;
    margin-top: 0.5rem;
}

.advanced-item {
    margin-bottom: 0.5rem;
}

.advanced-item:last-child {
    margin-bottom: 0;
}

.advanced-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #555;
    transition: color 0.2s ease;
}

.advanced-item label:hover {
    color: #333;
}

.advanced-item input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.1);
}

/* 上传按钮 */
.upload-btn-container {
    display: flex;
    align-items: center;
}

.upload-btn {
    padding: 0.75rem 1.5rem;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background-color: #4cae4c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 主要内容区域 */
.main {
    margin-top: 80px; /* 为固定导航栏留出空间 */
    padding: 2rem 0;
}

/* 搜索结果区域 */
.results-area {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    min-height: 400px;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading p {
    color: #666;
    font-size: 1rem;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 3rem 0;
    color: #999;
    font-size: 1rem;
}

/* 搜索结果列表 */
.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* 结果卡片 */
.result-card {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: #4a90e2;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.detail-btn {
    padding: 0.5rem 1rem;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.detail-btn:hover {
    background-color: #357abd;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.detail-content {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.close-btn {
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* 表单样式 */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
    background-color: #4cae4c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 详情模态框内容 */
.detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #666;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.detail-content-full {
    color: #444;
    line-height: 1.8;
    font-size: 1.05rem;
    white-space: pre-wrap;
    background-color: #fafafa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 提示框样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    font-size: 0.95rem;
    animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
    max-width: 300px;
    word-wrap: break-word;
}

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

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .results-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-area {
        max-width: 100%;
        justify-content: center;
    }
    
    .upload-btn-container {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .results-list {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .main {
        margin-top: 140px;
    }
    
    .search-area {
        flex-direction: column;
        align-items: stretch;
    }
    
    .advanced-menu {
        right: auto;
        left: 0;
        width: 100%;
    }
    
    .card-meta {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.75rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .search-btn {
        margin-right: 0;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    #searchInput {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .results-area {
        padding: 1rem;
    }
    
    .result-card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 审核状态标签 */
.audit-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-passed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
