/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

/* 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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.logo-icon-container:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.4);
}

/* 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;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    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: #4299e1;
    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: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    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-toast:before {
    content: '💬';
    margin-right: 8px;
}

/* 翻译中的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 8px 32px rgba(102, 126, 234, 0.3);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6), 0 0 20px rgba(102, 126, 234, 0.4);
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }
}

@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: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 40px;
    min-height: 600px;
    align-items: stretch;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 左侧源语言区域 */
.source-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 右侧目标语言区域 */
.target-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 语言选择器 */
.language-selector {
    margin-bottom: 20px;
}

.language-dropdown {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #4299e1;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.language-dropdown:hover {
    border-color: #4299e1;
    background: #f7fafc;
}

.language-dropdown:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* 输入/输出区域 */
.input-section, .output-section {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-title {
    color: #6b7280;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.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: #4299e1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 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: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.swap-btn:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

/* 常用短语 */
.common-phrases {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    flex-shrink: 0;
}

.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: #3b82f6;
}

.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: #4299e1;
    color: white;
    border-color: #4299e1;
    transform: translateY(-1px);
}

/* 翻译状态 */
.translation-status {
    margin-top: 20px;
    flex-shrink: 0;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4299e1;
    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;
    }
    
    .swap-section {
        order: -1;
    }
    
    .swap-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }


}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .translator-container {
        padding: 20px;
    }
    
    .logo {
        font-size: 2rem;
    }
}

/* API能力说明区域样式 */
.api-info {
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.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: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.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: #ffd700;
}

@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;
    }
}
