/* 页面标题样式 */
.page-title {
    text-align: center;
    font-size: 2rem;
    color: var(--text-color);
    margin: 2rem 0;
}

/* 转换器容器样式 */
.converter-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

/* 输入输出区域样式 */
.input-section, .output-section {
    flex: 1;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.input-section h2, .output-section h2 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* 文本框样式 */
textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
}

/* 按钮通用样式 */
.copy-button, .download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #f1f5f9;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.copy-button:hover, .download-button:hover {
    background-color: #e2e8f0;
}

.button-icon {
    font-size: 1.1rem;
}

/* 图片预览区域 */
.image-preview {
    flex: 1;
    min-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    margin-bottom: 1rem;
    padding: 1rem;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 禁用状态 */
.download-button:disabled {
    background-color: #f1f5f9;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 转换器页面主体 */
.converter-main {
    min-height: calc(100vh - 60px - 400px);
    padding-bottom: 4rem;
}

/* 文件输入区域 */
.file-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 预览框样式优化 */
.preview-box {
    flex: 1;
    min-height: 300px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 2rem;
    user-select: none;
}

.preview-box:hover {
    border-color: #4a90e2;
    background-color: rgba(74, 144, 226, 0.05);
    transform: translateY(-2px);
}

.preview-box:active {
    transform: translateY(0);
}

.preview-box .preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    color: #6c757d;
    text-align: center;
    pointer-events: none;
}

.preview-box .drag-icon {
    font-size: 4rem;
    color: #4a90e2;
    animation: bounce 2s infinite ease-in-out;
}

.preview-box .drag-title {
    font-size: 1.4rem;
    color: #4a90e2;
    font-weight: 500;
}

.preview-box .drag-text {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.6;
}

.preview-box .file-name {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 添加动画效果 */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 添加键盘焦点样式 */
.preview-box:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* 固定高度的文本框 */
.fixed-height {
    height: 200px !important;
    resize: none;
}

.copy-button:disabled {
    background-color: #f1f5f9;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.copy-button:disabled:hover {
    background-color: #f1f5f9;
    transform: none;
}

/* 修改复制按钮样式 */
.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #4a90e2; /* 更改为蓝色背景 */
    color: white; /* 白色文字 */
    border: none; /* 移除边框 */
    padding: 1rem 1.5rem; /* 稍微增加内边距 */
    border-radius: 6px; /* 增加圆角 */
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    font-weight: 500; /* 稍微加粗字体 */
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2); /* 添加阴影效果 */
}

.copy-button:hover {
    background-color: #357abd; /* 悬停时的深蓝色 */
    transform: translateY(-1px); /* 轻微上浮效果 */
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3); /* 悬停时增加阴影 */
}

.copy-button:active {
    transform: translateY(0); /* 点击时的下沉效果 */
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

/* 复制按钮禁用状态 */
.copy-button:disabled {
    background-color: #e2e8f0;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

.copy-button:disabled:hover {
    background-color: #e2e8f0;
    transform: none;
    box-shadow: none;
}

/* 复制成功状态 */
.copy-button.success {
    background-color: #4ade80; /* 成功时的绿色 */
    color: white;
}

/* 修改下载按钮样式，与复制按钮保持一致 */
.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #4a90e2; /* 蓝色背景 */
    color: white; /* 白色文字 */
    border: none; /* 移除边框 */
    padding: 1rem 1.5rem; /* 增加内边距 */
    border-radius: 6px; /* 圆角 */
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    font-weight: 500; /* 加粗字体 */
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2); /* 阴影效果 */
}

.download-button:hover {
    background-color: #357abd; /* 悬停时的深蓝色 */
    transform: translateY(-1px); /* 上浮效果 */
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3); /* 增加阴影 */
}

.download-button:active {
    transform: translateY(0); /* 点击时的下沉效果 */
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

/* 下载按钮禁用状态 */
.download-button:disabled {
    background-color: #e2e8f0;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

.download-button:disabled:hover {
    background-color: #e2e8f0;
    transform: none;
    box-shadow: none;
}

/* 下载成功状态 */
.download-button.success {
    background-color: #4ade80; /* 成功时的绿色 */
    color: white;
}

/* 按钮图标样式统一 */
.button-icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 当有图片时隐藏提示文本 */
.preview-box img:not(.hidden) + .preview-placeholder {
    display: none;
}

/* 完全移除旧的文件输入相关样式 */
.file-input-button, .file-name-display {
    display: none !important;
}

.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
  