/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #9b59b6);
}

.logo {
    text-align: center;
    margin-bottom: 25px;
}

.logo h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo h1 i {
    color: #3498db;
}

.tagline {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.back-home {
    position: absolute;
    top: 30px;
    left: 30px;
    color: #3498db;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.back-home:hover {
    color: #2980b9;
}

/* 搜索框样式 */
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    position: relative;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 18px 25px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-button {
    padding: 18px 35px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(52, 152, 219, 0.3);
}

.search-tips {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
    flex-wrap: wrap;
}

.search-tips .tip {
    color: #7f8c8d;
    font-size: 14px;
}

.search-tips .keyword {
    background: #e8f4fc;
    color: #3498db;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-tips .keyword:hover {
    background: #3498db;
    color: white;
}

/* 主内容区 */
.main-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* 欢迎区域 */
.welcome-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.welcome-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
}

.welcome-card:hover {
    transform: translateY(-5px);
}

.welcome-icon {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 20px;
}

.welcome-card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.welcome-card p {
    color: #666;
}

.instructions {
    background: #f0f7ff;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #3498db;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    color: #555;
}

/* 搜索结果头部 */
.search-results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.search-results-header h2 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 15px;
}

.query-text {
    color: #e74c3c;
    font-weight: 600;
}

.results-count {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: normal;
    margin-left: auto;
}

/* 资源卡片 */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.resource-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s;
}

.resource-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.resource-icon {
    font-size: 2.5rem;
    color: #3498db;
    min-width: 60px;
    text-align: center;
}

.resource-info {
    flex: 1;
}

.resource-title {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.resource-desc {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.resource-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 14px;
}

.meta-item i {
    color: #3498db;
}

.download-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(46, 204, 113, 0.3);
}

/* 无结果样式 */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.back-to-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    margin-top: 20px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.page-link {
    padding: 12px 25px;
    background: #f8f9fa;
    color: #3498db;
    text-decoration: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.page-link:hover {
    background: #3498db;
    color: white;
}

.page-info {
    color: #7f8c8d;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 30px;
}

/* 关注公众号样式 */
.subscribe-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.qr-code-container {
    text-align: center;
}

.qr-code-placeholder {
    width: 200px;
    height: 200px;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #7f8c8d;
}

.qr-code-placeholder i {
    font-size: 4rem;
    margin-bottom: 10px;
    color: #bdc3c7;
}

.account-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.2rem;
}

.subscribe-steps h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscribe-steps ol {
    padding-left: 20px;
    margin-bottom: 25px;
}

.subscribe-steps li {
    margin-bottom: 10px;
    color: #555;
}

.code-input-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

#searchCodeInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

#searchCodeInput:focus {
    outline: none;
    border-color: #3498db;
}

.verify-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.verify-btn:hover {
    opacity: 0.9;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 下载链接样式 */
.download-info h4 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.download-url-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

#downloadUrl {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
    color: #333;
}

.copy-btn {
    padding: 15px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.direct-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
}

.direct-download-btn:hover {
    opacity: 0.9;
}

.download-note {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.download-note i {
    margin-right: 10px;
}

/* 下载页面样式 */
.download-container {
    max-width: 800px;
    margin: 0 auto;
}

.error-message,
.verification-required,
.download-ready {
    text-align: center;
    padding: 40px;
}

.error-icon,
.verification-icon,
.success-icon {
    font-size: 5rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.verification-icon {
    color: #f39c12;
}

.success-icon {
    color: #2ecc71;
}

.verification-required h3 {
    color: #f39c12;
    margin: 20px 0;
}

.verification-form {
    max-width: 400px;
    margin: 30px auto;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.verify-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.verify-submit-btn:hover {
    opacity: 0.9;
}

.subscribe-guide {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: left;
}

.subscribe-guide h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscribe-guide ol {
    padding-left: 20px;
}

.subscribe-guide li {
    margin-bottom: 10px;
    color: #555;
}

/* 下载就绪样式 */
.download-ready h3 {
    color: #2ecc71;
    margin: 20px 0;
}

.resource-details {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    text-align: left;
}

.resource-details h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    color: #7f8c8d;
    font-size: 14px;
}

.detail-value {
    color: #333;
    font-weight: 500;
}

.download-link-box {
    background: #e8f4fc;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    text-align: left;
}

.download-link-box h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.url-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.direct-download-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 15px;
}

.direct-download-link:hover {
    opacity: 0.9;
}

.download-notes {
    text-align: left;
    padding: 25px;
    background: #fff3cd;
    border-radius: 10px;
}

.download-notes h5 {
    color: #856404;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-notes ul {
    padding-left: 20px;
}

.download-notes li {
    margin-bottom: 10px;
    color: #856404;
}

/* 页脚样式 */
.footer {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    font-size: 14px;
}

.footer p {
    margin: 5px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .back-home {
        position: relative;
        top: 0;
        left: 0;
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
        justify-content: center;
    }
    
    .subscribe-info {
        grid-template-columns: 1fr;
    }
    
    .qr-code-placeholder {
        width: 150px;
        height: 150px;
    }
    
    .resource-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .resource-meta {
        justify-content: center;
    }
    
    .download-url-container {
        flex-direction: column;
    }
    
    .code-input-container {
        flex-direction: column;
    }
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .search-container,
    .download-btn,
    .modal {
        display: none !important;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    .main-content {
        box-shadow: none;
        padding: 0;
    }
}

/* 新增的二维码图片样式 */
.qr-code-image {
    width: 200px;
    height: 200px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 编辑按钮样式增强 */
.btn-warning {
    background: #f39c12;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-warning:hover {
    background: #d68910;
    color: white;
}

/* 管理后台表格操作按钮组 */
.action-buttons {
    display: flex;
    gap: 5px;
    white-space: nowrap;
}

/* 上传区域样式增强 */
.file-upload-label span {
    color: #3498db;
    font-weight: 600;
}

.file-upload-label:hover span {
    color: #2980b9;
}