/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 0 10px;
}

/* Logo动态交互设计 */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #2d3748;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

/* Logo图标容器 */
.logo-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #2d3748;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.logo-icon-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Logo图标 */
.logo-icon {
    font-size: 2.5rem;
    color: white;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.logo:hover .logo-icon {
    transform: rotate(-5deg) scale(1.1);
    animation: iconPulse 2s infinite ease-in-out;
}

/* Logo文本 */
.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-text-main {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    transition: all 0.3s ease;
}

.logo-text-sub {
    font-size: 1rem;
    font-weight: 400;
    color: #718096;
    margin-top: -5px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.logo:hover .logo-text-main {
    transform: translateX(5px);
}

.logo:hover .logo-text-sub {
    opacity: 1;
    color: #4a5568;
    transform: translateX(5px);
}

/* 粒子效果 */
.logo-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation: float1 3s infinite ease-in-out;
}

.particle:nth-child(2) {
    top: 30%;
    right: 15%;
    animation: float2 2.5s infinite ease-in-out 0.5s;
}

.particle:nth-child(3) {
    bottom: 25%;
    left: 15%;
    animation: float3 3.5s infinite ease-in-out 1s;
}

.particle:nth-child(4) {
    bottom: 30%;
    right: 20%;
    animation: float4 2.8s infinite ease-in-out 1.5s;
}

.particle:nth-child(5) {
    top: 50%;
    left: 50%;
    animation: float5 3.2s infinite ease-in-out 0.8s;
}

.logo:hover .particle {
    animation-play-state: running;
}

/* 关键帧动画 */
@keyframes iconPulse {
    0%, 100% {
        transform: rotate(-5deg) scale(1.1);
    }
    50% {
        transform: rotate(-5deg) scale(1.15);
    }
}

@keyframes float1 {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px) translateX(5px);
    }
}

@keyframes float2 {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-15px) translateX(-5px);
    }
}

@keyframes float3 {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(10px) translateX(8px);
    }
}

@keyframes float4 {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(8px) translateX(-8px);
    }
}

@keyframes float5 {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px) scale(1.2);
    }
}

/* Logo点击动画 */
.logo-clicked {
    animation: logoClick 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes logoClick {
    0% {
        transform: translateY(-2px) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
    }
    100% {
        transform: translateY(-2px) scale(1);
    }
}

/* 粒子爆发动画 */
@keyframes burst1 {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) translateX(20px) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) translateX(40px) scale(0.5);
    }
}

@keyframes burst2 {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-25px) translateX(-20px) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateY(-45px) translateX(-35px) scale(0.5);
    }
}

@keyframes burst3 {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(25px) translateX(30px) scale(1.4);
    }
    100% {
        opacity: 0;
        transform: translateY(40px) translateX(50px) scale(0.5);
    }
}

@keyframes burst4 {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(20px) translateX(-25px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(35px) translateX(-45px) scale(0.5);
    }
}

@keyframes burst5 {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-15px) translateX(0) scale(1.6);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) translateX(0) scale(0.3);
    }
}

/* Toast提示样式 */
.logo-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2d3748;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
}

.logo-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* 翻译中的Logo动画 */
.logo-icon.translating {
    animation: translatingPulse 1.5s infinite ease-in-out;
}

.logo-icon-container.translating-container {
    animation: translatingGlow 2s infinite ease-in-out;
}

.logo-icon.translation-complete {
    animation: translationSuccess 0.6s ease-out;
}

@keyframes translatingPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        color: rgba(255, 255, 255, 1);
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        color: rgba(255, 255, 255, 0.8);
    }
}

@keyframes translatingGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        background: #2d3748;
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
        background: #1a202c;
    }
}

@keyframes translationSuccess {
    0% {
        transform: scale(1);
        color: rgba(255, 255, 255, 1);
    }
    50% {
        transform: scale(1.2);
        color: rgba(76, 175, 80, 1);
    }
    100% {
        transform: scale(1);
        color: rgba(255, 255, 255, 1);
    }
}

/* 增强粒子效果在翻译中 */
.logo-icon-container.translating-container .particle {
    animation-play-state: running !important;
    opacity: 0.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo {
        flex-direction: column;
        gap: 15px;
        font-size: 2rem;
    }
    
    .logo-icon-container {
        width: 60px;
        height: 60px;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .logo-text-main {
        font-size: 2rem;
    }
    
    .logo-text-sub {
        font-size: 0.9rem;
    }
    
    .logo-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        text-align: center;
    }
}

/* 翻译器容器 */
.translator-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 32px 28px;
    min-height: 500px;
    align-items: stretch;
    border: 1px solid #e2e8f0;
}

/* 左侧源语言区域 */
.source-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 右侧目标语言区域 */
.target-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 语言选择器 */
.language-selector {
    margin-bottom: 18px;
}

.language-dropdown {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.language-dropdown:hover {
    border-color: #2d3748;
    background: #f7fafc;
}

.language-dropdown:focus {
    outline: none;
    border-color: #2d3748;
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

/* 输入/输出区域 */
.input-section, .output-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-title {
    color: #4a5568;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.input-container, .output-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.text-input {
    width: 100%;
    height: 200px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    transition: all 0.3s ease;
    background: #ffffff;
}

.text-input:focus {
    outline: none;
    border-color: #2d3748;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

.text-input::placeholder {
    color: #9ca3af;
}



/* 翻译输出区域 */
.translation-output {
    height: 200px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f7fafc;
    font-size: 16px;
    line-height: 1.6;
    overflow-y: auto;
}

.placeholder-text {
    color: #9ca3af;
    font-style: italic;
}



/* 交换按钮 */
.swap-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: #2d3748;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.swap-btn:hover {
    transform: scale(1.05) rotate(180deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #1a202c;
}

/* 常用短语 */
.common-phrases {
    border-top: 1px solid #e5e7eb;
    padding-top: 18px;
    flex-shrink: 0;
    margin-top: auto;
}

.phrases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.phrases-header h3 {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.toggle-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: #2d3748;
}

.phrases-content {
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.phrases-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

.phrase-category {
    margin-bottom: 15px;
}

.phrase-category h4 {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.phrase-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.phrase-tag {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
}

.phrase-tag:hover {
    background: #2d3748;
    color: white;
    border-color: #2d3748;
    transform: translateY(-1px);
}

/* 翻译状态 */
.translation-status {
    margin-top: 18px;
    flex-shrink: 0;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    font-weight: 500;
}

.error {
    color: #ef4444;
    font-weight: 500;
    padding: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.hidden {
    display: none !important;
}







/* 响应式设计 */
@media (max-width: 1024px) {
    .translator-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 20px;
    }
    
    .swap-section {
        order: -1;
    }
    
    .swap-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px 12px;
    }
    
    .translator-container {
        padding: 20px 16px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .header {
        margin-bottom: 24px;
    }
}

/* API能力说明区域样式 */
.api-info {
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
}

.info-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    color: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.info-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.capability-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.capability-item .icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.capability-item .text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.capability-item strong {
    color: #2d3748;
}

@media (max-width: 768px) {
    .info-content {
        grid-template-columns: 1fr;
    }
    
    .capability-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .info-card {
        padding: 1rem;
    }
}

/* 内容区域样式 */
.content-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.content-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.content-card h2 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.content-card h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 15px;
}

.content-card p {
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 15px;
}

.content-card ul, .content-card ol {
    color: #4a5568;
    line-height: 1.8;
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-card li {
    margin-bottom: 10px;
}

.example-box {
    background: #f7fafc;
    border-left: 3px solid #2d3748;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 4px;
}

.example-box strong {
    color: #2d3748;
    display: block;
    margin-bottom: 8px;
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    color: #2d3748;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.faq-answer {
    color: #4a5568;
    line-height: 1.8;
    font-size: 15px;
}

@media (max-width: 768px) {
    .content-card {
        padding: 20px;
    }
    
    .content-card h2 {
        font-size: 20px;
    }
    
    .content-card h3 {
        font-size: 16px;
    }
}

/* 文件上传和下载按钮样式 */
.file-upload-btn,
.file-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.file-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.file-upload-btn:active {
    transform: translateY(0);
}

.file-download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.file-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.file-download-btn:active {
    transform: translateY(0);
}

.file-upload-btn i,
.file-download-btn i {
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .file-upload-btn,
    .file-download-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
