/* 在线网页截图工具样式 */

/* 快捷键提示 */
.shortcut-tips {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid #2196f3;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.12);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tips-icon {
    font-size: 14px;
}

.tips-text {
    color: #1976d2;
    font-weight: 600;
    font-size: 12px;
}

.shortcut-tips kbd {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 10px;
    font-weight: 600;
    color: #333;
    border: 1px solid #e1e8ed;
    font-family: 'Courier New', monospace;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 步骤区块 */
.step-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-section:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* 步骤标题 */
.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.step-header h3 {
    margin: 0;
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
}

/* URL输入区域 */
.url-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.url-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Courier New', monospace;
}

.url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

.url-input:hover {
    border-color: #cbd5e0;
}

.test-button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 12px;
}

.test-button:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}

.url-hint {
    font-size: 11px;
    color: #718096;
    padding: 5px 8px;
    background: rgba(59, 130, 246, 0.04);
    border-radius: 4px;
    margin-bottom: 8px;
}

.url-test-result {
    padding: 8px;
    border-radius: 5px;
    margin-top: 8px;
    font-size: 12px;
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.url-test-result.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border-left: 3px solid #10b981;
}

.url-test-result.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

.url-test-result.testing {
    display: block;
    background: #dbeafe;
    color: #1e40af;
    border-left: 3px solid #3b82f6;
}

.url-test-result .result-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 14px;
}

.url-test-result .loading-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 选项区块 */
.options-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #2d3748;
    font-size: 12px;
}

.label-icon {
    font-size: 14px;
}

.option-select,
.option-input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.option-select:focus,
.option-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

.option-select:hover,
.option-input:hover {
    border-color: #cbd5e0;
}

.custom-input {
    margin-top: 4px;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-input.hidden {
    display: none;
}

/* 图片质量滑块 */
.quality-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quality-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #ef4444 0%, #fbbf24 50%, #10b981 100%);
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #667eea;
}

.quality-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #667eea;
}

.quality-value {
    font-weight: 700;
    color: #667eea;
    min-width: 45px;
    text-align: center;
    font-size: 14px;
}

/* 高级选项 */
.advanced-options {
    margin-top: 12px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
}

.advanced-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-header:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #f8f9fa 100%);
}

.advanced-icon {
    font-size: 14px;
}

.advanced-title {
    flex: 1;
    font-weight: 600;
    color: #2d3748;
    font-size: 13px;
}

.advanced-toggle {
    font-size: 11px;
    color: #718096;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-header.active .advanced-toggle {
    transform: rotate(180deg);
}

.advanced-content {
    padding: 12px;
    display: none;
    border-top: 1px solid #e2e8f0;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-content.show {
    display: block;
}

.checkbox-group {
    margin-bottom: 8px;
}

.checkbox-group:last-child {
    margin-bottom: 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-group label:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(2px);
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label {
    font-size: 12px;
    color: #2d3748;
    font-weight: 500;
}

/* AI辅助区块 */
.ai-assist {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

.ai-desc {
    color: #78716c;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(251, 191, 36, 0.08);
    border-left: 3px solid #fbbf24;
    border-radius: 4px;
}

.ai-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ai-prompt-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-prompt-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
    transform: scale(1.01);
}

.ai-prompt-input:hover {
    border-color: #fcd34d;
}

.ai-button {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 12px;
}

.ai-button:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 10px rgba(251, 191, 36, 0.25);
}

.ai-result {
    display: none;
    padding: 12px;
    background: white;
    border: 2px solid #fbbf24;
    border-radius: 6px;
    margin-top: 10px;
}

.ai-result.show {
    display: block;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-suggestions {
    margin-top: 8px;
    padding: 8px;
    background: #fffbeb;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.5;
    color: #78716c;
    white-space: pre-wrap;
}

/* AI加载状态 */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
}

.ai-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #fef3c7;
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ai-loading-text {
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
}

/* AI成功状态 */
.ai-success {
    padding: 12px;
    background: linear-gradient(135deg, #d1fae5 0%, #f0fff4 100%);
    border-radius: 6px;
    border-left: 4px solid #10b981;
    color: #065f46;
    font-size: 12px;
    line-height: 1.6;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* AI错误状态 */
.ai-error {
    padding: 12px;
    background: linear-gradient(135deg, #fee2e2 0%, #fff5f5 100%);
    border-radius: 6px;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-error .error-icon {
    font-size: 16px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* 提交按钮区域 */
.submit-section {
    background: linear-gradient(135deg, #e0e7ff 0%, #ffffff 100%);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.3);
}

.button.hidden {
    display: none;
}

.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.secondary-button {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    color: #2d3748;
}

.secondary-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(160, 174, 192, 0.3);
}

.save-button {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.save-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.submit-hint {
    font-size: 12px;
    color: #718096;
    padding: 6px 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 12px;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border: 2px solid #3b82f6;
    border-radius: 8px;
    margin-top: 12px;
}

.loading-indicator.hidden {
    display: none;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #dbeafe;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #1e40af;
    font-weight: 600;
    font-size: 14px;
}

/* 结果展示区域 */
.result-section {
    background: linear-gradient(135deg, #d1fae5 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 18px;
    margin-top: 16px;
    box-shadow: 0 4px 16px rgba(72, 187, 120, 0.1);
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.info-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    word-break: break-all;
}

/* 截图预览 */
.screenshot-preview {
    background: white;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.preview-header > span {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-icon {
    font-size: 14px;
}

.preview-image-wrapper {
    max-height: 600px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #f8f9fa;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}

.toast.hidden {
    display: none;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-toast {
    background: linear-gradient(135deg, #fed7d7 0%, #fff5f5 100%);
    border-left: 4px solid #f56565;
}

.success-toast {
    background: linear-gradient(135deg, #c6f6d5 0%, #f0fff4 100%);
    border-left: 4px solid #48bb78;
}

.warning-toast {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    border-left: 4px solid #fbbf24;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-close:hover {
    color: #2d3748;
    transform: scale(1.2);
}

/* 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .step-section {
        padding: 14px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .ai-input-group {
        flex-direction: column;
    }

    .result-info {
        grid-template-columns: 1fr;
    }

    .toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .shortcut-tips {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }
    
    .tips-text {
        font-size: 12px;
    }
    
    .shortcut-tips kbd {
        font-size: 10px;
        padding: 2px 5px;
    }

    .url-input-wrapper {
        flex-direction: column;
    }

    .preview-actions {
        flex-wrap: wrap;
    }

    .action-btn .btn-text {
        display: none;
    }
}

@media (max-width: 640px) {
    .step-header h3 {
        font-size: 14px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
}
