/* Tailwind CSS CDN已通过HTML引入，这里添加自定义配置 */

/* 自定义颜色方案 */
:root {
    --primary-color: #007AFF;
    --primary-light: #5AC8FA;
    --primary-dark: #0051D5;
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --border-color: #D2D2D7;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 选择文本样式 */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* 按钮基础样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* 输入框样式 */
.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* 导航栏样式 */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 上传区域样式 */
.upload-zone {
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--primary-color) !important;
    background-color: rgba(0, 122, 255, 0.05);
}

.upload-zone.drag-over {
    border-color: var(--primary-color) !important;
    background-color: rgba(0, 122, 255, 0.1);
    transform: scale(1.02);
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* 错误消息样式 */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--error-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

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

/* 成功消息样式 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 响应式网格 */
.responsive-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* 文字截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文字多行截断 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 焦点样式 */
.focus-ring {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* RTL支持 */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .tooltip::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0051D5;
        --text-primary: #000000;
        --border-color: #000000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 专业图标样式 */
.icon-flip-h {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(45deg, transparent 45%, var(--primary-color) 45%, var(--primary-color) 55%, transparent 55%);
    position: relative;
}

.icon-flip-v {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(45deg, transparent 45%, var(--primary-color) 45%, var(--primary-color) 55%, transparent 55%);
    transform: rotate(90deg);
}

.icon-flip-180 {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(45deg, transparent 45%, var(--primary-color) 45%, var(--primary-color) 55%, transparent 55%);
    transform: rotate(45deg);
}

.icon-secure {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--success-color);
    border-radius: 50%;
    position: relative;
}

.icon-secure::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
}

.icon-fast {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    border-radius: 4px;
    position: relative;
}

.icon-fast::after {
    content: '⚡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}

.icon-quality {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    position: relative;
}

.icon-quality::before {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}

/* 特色卡片动画 */
.feature-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
    border-color: var(--primary-color);
}

/* 用户评价样式 */
.testimonial {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.testimonial::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 60px;
    color: rgba(0, 122, 255, 0.1);
    font-family: Georgia, serif;
}

.testimonial:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.2);
}

/* 价格卡片样式 */
.pricing-card {
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 122, 255, 0.2);
}

.popular-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* 步骤指示器样式 */
.step {
    position: relative;
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-4px);
}

.step-number {
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 122, 255, 0.3);
}

/* 统计数字动画 */
.stat-number {
    transition: all 0.3s ease;
}

.stat:hover .stat-number {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* FAQ 项目样式 */
.faq-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.faq-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.1);
}

/* 按钮增强效果 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 导航栏滚动效果 */
nav {
    transition: all 0.3s ease;
}

.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 区域滚动动画 */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 特色图标动画 */
.feature-icon {
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
}

/* 加载增强效果 */
.loading-overlay {
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.3);
}

/* 成功/错误消息增强 */
.toast {
    animation: slideInRight 0.3s ease-out;
}

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

/* 格式选择UI样式 */
.format-selection-ui {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.format-selection-ui:hover {
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
}

.format-option {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.format-option:hover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
    transform: translateY(-2px);
}

.format-option.selected {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.format-option.selected .format-name {
    color: var(--primary-color);
    font-weight: 600;
}

.quality-control {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.slider {
    background: linear-gradient(to right, var(--warning-color), var(--success-color));
    height: 8px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.5);
}

.advanced-options {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
}

.preview-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.preview-box {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.preview-box:hover {
    border-color: var(--primary-color);
    border-style: solid;
}

.preview-box img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.format-info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(0, 122, 255, 0.05));
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.format-info:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(0, 122, 255, 0.1));
    transform: translateY(-2px);
}

/* 转换进度样式 */
.conversion-progress {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.progress-bar {
    background: var(--border-color);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 批量格式选择样式 */
.batch-format-controls {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.batch-format-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 6px;
    background: var(--bg-primary);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.batch-format-item:hover {
    background: rgba(0, 122, 255, 0.05);
    transform: translateX(4px);
}

/* 格式比较表格 */
.format-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.format-comparison-table th,
.format-comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.format-comparison-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.format-comparison-table tr:hover {
    background: rgba(0, 122, 255, 0.05);
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 移动端导航 */
    nav {
        padding: 12px 0;
    }
    
    .container {
        padding: 0 16px;
    }
    
    /* 移动端标题 */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    /* 移动端按钮 */
    .btn {
        padding: 16px 24px;
        font-size: 18px;
        touch-action: manipulation;
    }
    
    /* 移动端上传区域 */
    .upload-zone {
        padding: 40px 20px;
        min-height: 300px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .upload-icon {
        font-size: 4rem !important;
        margin-bottom: 1rem;
    }
    
    /* 移动端控制按钮 */
    .controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .controls button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
    }
    
    /* 移动端卡片 */
    .card, .feature-card, .testimonial, .pricing-card {
        margin-bottom: 16px;
        border-radius: 16px;
    }
    
    /* 移动端网格 */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .features-grid, .testimonials-grid, .pricing-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* 移动端表单 */
    input, select, textarea {
        font-size: 16px;
        padding: 16px;
        border-radius: 12px;
    }
    
    /* 移动端触摸优化 */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移动端模态框 */
    .modal {
        padding: 20px;
        max-width: 95%;
        margin: 10px auto;
    }
    
    /* 移动端进度条 */
    .progress-bar {
        height: 8px;
        border-radius: 4px;
    }
    
    /* 移动端工具栏 */
    .toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--border-color);
        padding: 12px;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    /* 移动端手势支持 */
    .gesture-area {
        touch-action: pan-y pinch-zoom;
    }
    
    /* 移动端优化滚动 */
    .scroll-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 移动端状态栏适配 */
    .status-bar-safe-area {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 平板端优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 键盘快捷键提示 */
.shortcut-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shortcut-hint.show {
    opacity: 1;
}

/* 键盘导航高亮 */
.keyboard-focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* 键盘快捷键帮助面板 */
.shortcut-help {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 2000;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.shortcut-help h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.shortcut-help table {
    width: 100%;
    border-collapse: collapse;
}

.shortcut-help td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-help td:first-child {
    font-weight: bold;
    color: var(--primary-color);
}

.shortcut-help kbd {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #FFFFFF;
        --text-secondary: #A1A1A6;
        --bg-primary: #000000;
        --bg-secondary: #1C1C1E;
        --border-color: #38383A;
    }
    
    .card {
        background-color: var(--bg-secondary);
    }
    
    .btn-secondary {
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .feature-card:hover {
        border-color: var(--primary-light);
    }
    
    .shortcut-help {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
    .shortcut-help kbd {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
}