/* 首页样式文件 - home.css */

/* 功能选择器 */
.function-selector {
    margin-bottom: 2rem;
    text-align: center;
}

.selector-buttons {
    display: inline-flex;
    background-color: #f8f9fa;
    border-radius: 25px;
    padding: 0.3rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.selector-btn {
    padding: 0.8rem 2rem;
    border: none;
    background: transparent;
    color: #778899;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.selector-btn.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(173, 216, 230, 0.3);
}

/* 上传区域样式 */
.upload-section,
.text-section {
    margin-bottom: 2rem;
    display: none;
}

.upload-section.active,
.text-section.active {
    display: block;
}

.upload-area {
    border: 2px dashed var(--accent-color);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background-color: #ffc7730d;
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background-color: rgba(173, 216, 230, 0.1);
    transform: scale(1.02);
}

.upload-content .upload-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-content .upload-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.upload-content h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.upload-content p {
    color: #778899;
    margin-bottom: 1.5rem;
}

#file-input {
    display: none;
}

.upload-btn {
    background: var(--accent-color);
    color: #FFFFFF;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(173, 216, 230, 0.2);
}

.upload-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(173, 216, 230, 0.3);
}

/* 文件列表样式 */
.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
    border-color: #FFC773;
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.file-size {
    color: #778899;
}

.file-status {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-ready {
    background: #e3f2fd;
    color: #1976d2;
}

.status-processing {
    background: #fff3e0;
    color: #f57c00;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-error {
    background: #ffebee;
    color: #c62828;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #dc3545;
    color: white;
}

/* 文本输入区域 */
.text-input-area {
    background-color: #f8f9fa;
    border: 2px dashed var(--accent-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.text-input-area:hover {
    border-color: var(--secondary-color);
    background-color: #ffc7730d;
}

#text-input {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 200px;
    transition: border-color 0.3s ease;
}

#text-input:focus {
    outline: none;
    border-color: #FFC773;
    box-shadow: 0 0 0 3px rgba(173, 216, 230, 0.1);
}

.text-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

#word-count {
    color: #778899;
    font-size: 0.9rem;
}

/* 操作按钮样式 */
.upload-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 处理按钮和进度条 */
.process-section {
    text-align: center;
    margin-bottom: 2rem;
}

.process-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    color: #FFFFFF;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(173, 216, 230, 0.2);
    margin-bottom: 1.5rem;
}

.process-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(173, 216, 230, 0.3);
}

.process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.progress-container {
    max-width: 400px;
    margin: 0 auto;
    display: none;
    padding: 0.5rem 0;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #FFC773;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #778899;
    font-size: 0.9rem;
    text-align: center;
    display: block;
    margin-top: 0.25rem;
    font-weight: 500;
    line-height: 1.2;
}

/* 结果区域 */
.result-section {
    background-color: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: none;
}

.result-section.active {
    display: block;
}

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

.result-header h3 {
    color: #333;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

/* 统一的结果按钮样式 */
.result-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

/* 主要按钮 - 下载结果 */
.result-btn.primary {
    background: var(--secondary-color);
    color: #FFFFFF;
}

/* 次要按钮 - 复制文本 */
.result-btn.secondary {
    background: none;
    border: 1px solid #FFC773;
    color: #FFC773;
}

/* 第三按钮 - 新任务 */
.result-btn.tertiary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

/* 悬停效果 */
.result-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-btn.primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
}

.result-btn.secondary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    color: #FFFFFF;
}

.result-btn.tertiary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.result-content {
    background-color: #FFFFFF;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    min-height: 200px;
}

/* 检测报告区域 */
.detection-report {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.detection-report h4 {
    margin: 0 0 20px 0;
    color: var(--dark-text);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.report-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.report-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.report-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.report-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

/* 检测报告展示区域 */
.report-section {
    background-color: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.report-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.5rem;
    text-align: center;
}

.report-subtitle {
    color: #666;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.6;
    font-weight: 400;
}

.report-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: space-evenly;
}

.report-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: #FFFFFF;
    color: #778899;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.report-tab.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    color: #FFFFFF;
}

.report-content {
    background-color: #FFFFFF;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.report-panels-container {
    display: flex;
    width: 400%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
}

.report-panel {
    width: 25%;
    flex-shrink: 0;
    opacity: 1;
}

.report-placeholder {
    text-align: center;
    color: #778899;
    padding: 2rem;
}

/* 对比图表样式 */
.comparison-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.comparison-svg {
    max-width: 100%;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: contain;
}

.comparison-svg:hover {
    transform: scale(1.02);
}

/* 箭头按钮样式 */
.arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: #666;
}

.arrow-btn:hover {
    background: linear-gradient(135deg, rgba(173, 216, 230, 0.9), rgba(173, 216, 230, 0.9));
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(173, 216, 230, 0.3);
}

.arrow-left {
    left: 10px;
}

.arrow-right {
    right: 10px;
}

/* 精选文章区域样式 */
.featured-articles-section .section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.featured-articles-section .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    position: relative;
}

.featured-articles-section .section-subtitle {
    color: #666;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.6;
    font-weight: 400;
}

.featured-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.featured-article-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(119, 136, 153, 0.1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.featured-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

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

.featured-article-card .article-header {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.featured-article-card .article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.featured-article-card .article-excerpt {
    color: var(--light-text);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
}

.featured-article-card .article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--light-text);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(119, 136, 153, 0.1);
}

.featured-article-card .article-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-article-card .article-selection {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.featured-articles-footer {
    text-align: center;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(173, 216, 230, 0.3);
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(173, 216, 230, 0.4);
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-color));
}

.view-all-btn svg {
    transition: transform 0.3s ease;
}

.view-all-btn:hover svg {
    transform: translateX(3px);
}

/* 响应式设计 - 主页样式 */

/* PC端 - 大屏幕 (1200px以上) */
@media (min-width: 1200px) {
    .upload-area {
        padding: 3rem;
    }
    
    .upload-content .upload-icon img {
        width: 64px;
        height: 64px;
    }
    
    .selector-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .featured-articles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* 平板端 - 中等屏幕 (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .upload-area {
        padding: 2.5rem;
    }
    
    .upload-content .upload-icon img {
        width: 56px;
        height: 56px;
    }
    
    .selector-btn {
        padding: 0.7rem 1.8rem;
        font-size: 0.95rem;
    }
    
    .featured-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .text-input-area {
        min-height: 250px;
    }
}

/* 移动端 - 小屏幕 (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .upload-area {
        padding: 2rem 1.5rem;
        margin: 0 -10px;
    }
    
    .upload-content .upload-icon img {
        width: 48px;
        height: 48px;
    }
    
    .upload-content h3 {
        font-size: 1.1rem;
    }
    
    .upload-content p {
        font-size: 0.9rem;
    }
    
    .selector-buttons {
        padding: 0.25rem;
        width: 100%;
        max-width: 400px;
    }
    
    .selector-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        flex: 1;
    }
    
    .featured-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .text-input-area {
        min-height: 200px;
        font-size: 0.9rem;
    }
    
    .process-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .view-all-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* 超小屏幕 - 手机端 (479px以下) */
@media (max-width: 479px) {
    .function-selector {
        margin-bottom: 1.5rem;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
        margin: 0 -5px;
        border-radius: 10px;
    }
    
    .upload-content .upload-icon img {
        width: 40px;
        height: 40px;
    }
    
    .upload-content h3 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .upload-content p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .selector-buttons {
        padding: 0.2rem;
        width: 100%;
        max-width: 320px;
    }
    
    .selector-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        flex: 1;
    }
    
    .featured-articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .featured-article-card {
        padding: 1rem;
    }
    
    .featured-article-card .article-title {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .featured-article-card .article-excerpt {
        font-size: 0.85rem;
    }
    
    .text-input-area {
        min-height: 180px;
        font-size: 0.85rem;
        padding: 0.8rem;
    }
    
    .process-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .view-all-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 25px;
    }
    
    .upload-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .upload-area:hover {
        transform: none;
        border-color: var(--accent-color);
        background-color: #f8f9fa;
    }
    
    .selector-btn,
    .process-btn,
    .upload-btn,
    .view-all-btn {
        min-height: 44px; /* 确保触摸目标足够大 */
    }
}
