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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem;
    width: 100%;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 1rem;
}

.header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* 输入区域和主内容区域共享样式 */
.input-section,
.main-content {
    max-width: 600px;
    margin: 0 auto 0.5rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* 主内容区域特殊样式 */
.main-content {
    overflow: hidden;
    position: relative;
}

/* 输入区域内部样式 */
.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* 输入框样式 */
input[type="text"] {
    flex: 1;
    padding: 0 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    height: 48px;
    background: #f8f9fa;
    line-height: 48px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

/* 按钮基础样式 */
button {
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:active {
    transform: translateY(1px);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 生成按钮 */
.generate-btn {
    background: #3498db;
    color: white;
    padding: 0 1.25rem;
    height: 48px;
    white-space: nowrap;
    min-width: 90px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.generate-btn i {
    font-size: 1.1rem;
    margin-right: 0.3rem;
}

.generate-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

/* 清除按钮 */
.clear-btn {
    background: #f8f9fa;
    color: #666;
    padding: 0;
    width: 48px;
    height: 48px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
}

.clear-btn:hover {
    background: #e9ecef;
    color: #2c3e50;
    border-color: #cbd5e0;
}

.clear-btn i {
    font-size: 1.2rem;
}

/* 下载按钮 */
.download-btn {
    background: #2ecc71;
    color: white;
    padding: 0 1.25rem;
    height: 44px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0;
    min-width: 90px;
}

.download-btn i {
    font-size: 1.1rem;
    margin-right: 0.3rem;
}

.download-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.2);
}

/* 情绪标签 */
.emotion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.emotion-tag {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid #e0e0e0;
}

.emotion-tag:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 表情包容器 */
.meme-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0;
    min-height: 300px;
}

/* 响应容器 */
.response-container {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

/* 占位符样式 */
.placeholder {
    color: #95a5a6;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.placeholder i {
    font-size: 3rem;
    color: #bdc3c7;
}

/* 图片容器 */
.image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* 下载按钮容器 */
.button-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

/* 预览区域 */
.preview-area {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* 加载动画 */
.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: #7f8c8d;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    width: 100%;
    height: 100%;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 底部样式 */
.footer {
    text-align: center;
    color: #7f8c8d;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .generate-btn {
        width: 100%;
        height: auto;
    }

    input[type="text"] {
        min-height: 80px;
    }

    .emotion-tags {
        justify-content: center;
    }

    .meme-container {
        gap: 1rem;
        padding: 1rem;
    }
    
    .download-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
}
