/* 动机信功能专用样式 */

/* 模式切换按钮优化样式 */
.mode-selector {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    justify-content: center;
    flex-wrap: nowrap;
}

.mode-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    max-width: 300px;
    min-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.mode-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 163, 127, 0.1), transparent);
    transition: left 0.5s ease;
}

.mode-button:hover::before {
    left: 100%;
}

.mode-button:hover {
    border-color: #10a37f;
    color: #10a37f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
}

.mode-button.active {
    border-color: #10a37f;
    background: linear-gradient(135deg, #10a37f 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.3);
}

.mode-button svg {
    width: 20px;
    height: 20px;
    z-index: 1;
}

/* 表单字段组优化样式 */
.mode-form-fields {
    transition: all 0.4s ease;
    opacity: 1;
}

.mode-form-fields[style*="none"] {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* 结果展示优化样式 */
.result-tabs {
    display: flex;
    border-bottom: 3px solid #f3f4f6;
    margin-bottom: 28px;
    gap: 4px;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
    padding: 8px 8px 0 8px;
}

.result-tab {
    padding: 14px 28px;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #6b7280;
    font-size: 15px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.result-tab.active {
    color: #10a37f;
    border-bottom-color: #10a37f;
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.result-tab:hover:not(.active) {
    color: #4b5563;
    background: rgba(255, 255, 255, 0.7);
}

.tab-content {
    transition: all 0.3s ease;
    background: white;
    border-radius: 0 0 12px 12px;
}

.result-text-content {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    font-family: 'Georgia', serif;
    line-height: 1.8;
    font-size: 15px;
    color: #2d3748;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-changes-content {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

.changes-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.change-item {
    background: white;
    border-radius: 10px;
    padding: 18px;
    border-left: 5px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.change-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.change-item h4 {
    color: #92400e;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
}

.change-item p {
    margin: 10px 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
}

.change-item strong {
    color: #92400e;
    font-weight: 700;
}

/* 结果操作按钮优化样式 */
.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.result-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #374151;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
}

.result-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.result-action-btn:hover::before {
    left: 100%;
}

.result-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-action-btn.primary {
    background: linear-gradient(135deg, #10a37f 0%, #059669 100%);
    color: white;
    border-color: #10a37f;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
}

.result-action-btn.primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #059669;
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.3);
}

.result-action-btn svg {
    width: 18px;
    height: 18px;
    z-index: 1;
}

/* 队列状态指示器优化样式 */
.queue-status-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 18px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.queue-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.queue-icon svg {
    width: 16px;
    height: 16px;
}

.queue-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-position {
    font-weight: 700;
    color: #1e40af;
    font-size: 15px;
}

.queue-hint {
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
}

/* 移除重复的Hero样式，使用主站统一样式 */

/* 移除重复的卡片样式，使用主站统一样式 */

/* 移除重复的模式选择器样式，已在上方优化定义 */

/* 移除重复的权限信息样式，使用主站统一样式 */

/* 移除重复的购买区域样式，使用主站统一样式 */

/* 移除重复的必需句子样式，使用主站统一样式 */

/* 移除重复的表单样式，使用主站统一样式 */

/* 移除重复的任务状态样式，使用主站统一样式 */

/* 移除重复的结果区域样式，已在上方优化定义 */

/* 移除重复的操作按钮样式，已在上方优化定义 */

/* 动机信专用响应式优化 */
@media (max-width: 768px) {
    .mode-selector {
        gap: 8px;
        margin: 20px 0;
    }

    .mode-button {
        min-width: 120px;
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
        gap: 6px;
    }
}

    .result-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .result-action-btn {
        width: 100%;
        max-width: 280px;
    }

    .result-tabs {
        flex-direction: column;
        gap: 0;
        border-radius: 8px;
    }

    .result-tab {
        text-align: center;
        border-bottom: 1px solid #e5e7eb;
        border-radius: 0;
        margin: 0;
    }

    .result-tab:first-child {
        border-radius: 8px 8px 0 0;
    }

    .result-tab:last-child {
        border-bottom: none;
    }

    .result-tab.active {
        border-bottom: 1px solid #10a37f;
        background: rgba(16, 163, 127, 0.1);
        border-radius: 0;
    }

    .tab-content {
        border-radius: 0 0 8px 8px;
    }
}

@media (max-width: 480px) {
    .mode-selector {
        gap: 6px;
        margin: 16px 0;
    }

    .mode-button {
        min-width: 100px;
        font-size: 13px;
        padding: 10px 12px;
        gap: 4px;
    }

    .mode-button svg {
        width: 16px;
        height: 16px;
    }
}

    .result-text-content {
        padding: 16px;
        font-size: 14px;
    }

    .result-changes-content {
        padding: 16px;
    }

    .change-item {
        padding: 14px;
    }

    .queue-status-indicator {
        padding: 14px;
        gap: 12px;
    }

    .queue-icon {
        width: 28px;
        height: 28px;
    }

    .queue-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* 撰写模式简洁内容样式 */
.letter-content {
    padding: 0;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.letter-text {
    padding: 32px;
    line-height: 1.8;
    font-size: 15px;
    color: #2d3748;
    font-family: 'Georgia', serif;
    text-align: justify;
    white-space: pre-wrap;
}

/* 优化模式批注式显示样式 */
.optimized-content-container {
    padding: 0;
}

.optimized-text {
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.optimized-text h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.content-text {
    line-height: 1.8;
    font-size: 14px;
    color: #2d3748;
    font-family: 'Georgia', serif;
    text-align: justify;
}

.changes-annotations {
    margin-top: 20px;
}

.changes-annotations h4 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px 8px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
}

.changes-list {
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    background: #ffffff;
}

.change-annotation {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.change-annotation:last-child {
    border-bottom: none;
}

.change-annotation:hover {
    background: #f8fafc;
}

.change-header {
    display: flex;
    align-items: center;
    padding: 15px 20px 10px 20px;
    gap: 10px;
}

.change-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.change-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
}

.change-content {
    padding: 0 20px 15px 50px;
}

.change-description {
    margin-bottom: 12px;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
}

.change-before,
.change-after {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.change-before {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    border-left: 4px solid #e53e3e;
}

.change-after {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    border-left: 4px solid #38a169;
}

.change-label {
    font-weight: 600;
    margin-right: 8px;
}

.before-text {
    color: #742a2a;
    text-decoration: line-through;
    text-decoration-color: #e53e3e;
    text-decoration-thickness: 2px;
}

.after-text {
    color: #22543d;
    font-weight: 500;
}

/* 不同类型优化点的颜色标识 */
.change-annotation[data-type="grammar"] .change-icon {
    color: #3182ce;
}

.change-annotation[data-type="structure"] .change-icon {
    color: #dd6b20;
}

.change-annotation[data-type="expression"] .change-icon {
    color: #38a169;
}

.change-annotation[data-type="content"] .change-icon {
    color: #805ad5;
}

.change-annotation[data-type="style"] .change-icon {
    color: #d69e2e;
}

.change-annotation[data-type="clarity"] .change-icon {
    color: #0987a0;
}

.change-annotation[data-type="professional"] .change-icon {
    color: #2d3748;
}

.change-annotation[data-type="flow"] .change-icon {
    color: #2b6cb0;
}

/* 结果内容标题样式 */
.result-content-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 24px 0;
    padding: 0;
    border-bottom: 3px solid #10a37f;
    padding-bottom: 12px;
}

/* PDF预览容器样式 */
.pdf-preview-container {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.pdf-viewer-wrapper {
    position: relative;
    width: 85%;
    max-width: 1200px;
    height: 600px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #6b7280;
    z-index: 2;
}

.pdf-loading .loading-spinner {
    margin-bottom: 16px;
}

.pdf-loading p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.pdf-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: #dc2626;
    z-index: 2;
}

.pdf-error .error-icon {
    margin-bottom: 16px;
}

.pdf-error .error-icon svg {
    width: 48px;
    height: 48px;
    color: #dc2626;
}

.pdf-error p {
    margin: 4px 0;
    text-align: center;
}

/* 响应式PDF预览 */
@media (max-width: 1024px) {
    .pdf-viewer-wrapper {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .pdf-viewer-wrapper {
        width: 95%;
        height: 500px;
    }

    .result-content-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .pdf-viewer-wrapper {
        width: 100%;
        height: 400px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .result-content-title {
        font-size: 18px;
    }
}

/* 操作按钮响应式布局优化 - 适应两个按钮 */
.result-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.result-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #374151;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    min-height: 52px;
}

/* 移除非主要按钮的默认阴影 */
.result-action-btn:not(.primary) {
    box-shadow: none;
}

.result-action-btn:not(.primary):hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 窄屏：竖列显示 */
@media (max-width: 480px) {
    .result-actions {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: none;
    }

    .result-action-btn {
        padding: 16px 20px;
        font-size: 15px;
    }
}

/* 动机信专用滚动条优化样式 */
.result-text-content::-webkit-scrollbar,
.result-changes-content::-webkit-scrollbar {
    width: 10px;
}

.result-text-content::-webkit-scrollbar-track,
.result-changes-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.result-text-content::-webkit-scrollbar-thumb,
.result-changes-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.result-text-content::-webkit-scrollbar-thumb:hover,
.result-changes-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* 开发中提示样式 */
.development-notice {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    position: relative;
    overflow: hidden;
}

.development-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.notice-icon svg {
    width: 24px;
    height: 24px;
}

.notice-content {
    flex: 1;
}

.notice-title {
    margin: 0 0 8px 0;
    color: #92400e;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notice-description {
    margin: 0 0 8px 0;
    color: #92400e;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.notice-hint {
    margin: 0;
    color: #a16207;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    font-style: italic;
}

/* 优化模式按钮禁用状态 */
.mode-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    pointer-events: none;
}

.mode-button.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #e5e7eb;
    color: #9ca3af;
}

/* 提交按钮禁用状态 */
.analyze-submit-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    pointer-events: none;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .development-notice {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px;
    }
    
    .notice-icon {
        width: 40px;
        height: 40px;
    }
    
    .notice-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .notice-title {
        font-size: 16px;
        justify-content: center;
    }
    
    .notice-description {
        font-size: 14px;
    }
    
    .notice-hint {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .development-notice {
        padding: 16px;
    }
    
    .notice-icon {
        width: 36px;
        height: 36px;
    }
    
    .notice-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .notice-title {
        font-size: 15px;
    }
    
    .notice-description {
        font-size: 13px;
    }
    
    .notice-hint {
        font-size: 12px;
    }
}

/* 动机信撰写进度条样式 */
.motivation-progress-container {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 呼吸灯动画 */
.breathing-light {
    position: relative;
    overflow: hidden;
}

.breathing-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        rgba(16, 163, 127, 0.3) 0%,
        rgba(16, 163, 127, 0.8) 50%,
        rgba(16, 163, 127, 0.3) 100%
    );
    animation: breathingGlow 2s ease-in-out infinite;
    border-radius: 3px;
}

@keyframes breathingGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scaleX(1);
    }
    50% {
        opacity: 1;
        transform: scaleX(1.05);
    }
}

/* 进度条在呼吸状态下的样式 */
.enhanced-step.breathing .enhanced-progress-bar {
    background: linear-gradient(90deg, #10a37f, #059669);
    position: relative;
    overflow: hidden;
}

.enhanced-step.breathing .enhanced-progress-bar.breathing-light {
    width: 100% !important;
}

/* 进度步骤特殊状态 */
.enhanced-step.processing .enhanced-step-details {
    opacity: 1;
    color: #10a37f;
    font-style: normal;
    font-weight: 500;
}

.enhanced-step.processing .enhanced-step-number {
    background: linear-gradient(135deg, #10a37f 0%, #059669 100%);
    color: white;
    transform: scale(1.1);
    animation: processingPulse 1.5s ease-in-out infinite;
}

@keyframes processingPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(16, 163, 127, 0.5);
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .motivation-progress-container {
        margin-top: 20px;
        padding: 16px;
    }

    .enhanced-loading-steps {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .enhanced-step {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .motivation-progress-container {
        margin-top: 16px;
        padding: 12px;
    }
}