/* Base64 工具样式 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2F6BF3;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #333;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 容器 */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* 头部 */
.header {
    background: #2F6BF3;
    color: white;
    padding: 1.5rem 0;
    /* box-shadow: var(--shadow); */
}

.header .container {
    text-align: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 300;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 0.75rem 0;
}

/* 工具描述 */
.tool-description {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.description-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.4;
}

/* 屏幕阅读器专用（SEO优化） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 工具容器 */
.tool-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
}

/* 输入输出区域 */
.input-section,
.output-section {
    margin-bottom: 0.75rem;
}

.section-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.text-area {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    resize: vertical;
    min-height: 160px;
    transition: border-color 0.2s;
    background-color: #fafafa;
    line-height: 1.5;
    font-weight: 300;
}

.text-area:focus {
    outline: none;
    border-color: #64748b;
    background-color: white;
}

.input-area {
    color: var(--text-primary);
}

.output-area {
    color: var(--text-primary);
    background-color: #f9fafb;
}

.output-area:focus {
    background-color: white;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.825rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    /* box-shadow: var(--shadow); */
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    /* transform: translateY(-1px); */
    /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); */
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    /* transform: translateY(-1px); */
}

.btn-copy {
    background-color: var(--success-color);
    color: white;
    margin-top: 0.35rem;
    width: 100%;
}

.btn-copy:hover {
    background-color: #059669;
    /* transform: translateY(-1px); */
}

.btn-copy.copied {
    background-color: var(--success-color);
}

/* 快捷键提示 */
.shortcut-hint {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.shortcut-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

kbd {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 状态提示栏 */
.status-bar {
    background-color: #eaf8ed;
    /* border: 1px solid #6ee7b7; */
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.status-text {
    flex: 1;
    min-width: 200px;
}

.status-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.status-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.status-link:active {
    color: var(--primary-hover);
}

/* 图片上传区域 */
.image-upload-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.upload-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
}

.file-input {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.file-input:hover {
    border-color: var(--primary-color);
    background-color: #f0f9ff;
}

.image-preview {
    margin-top: 0.5rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* 使用说明区域 */
.usage-section,
.faq-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}

.usage-section h2,
.faq-section h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
    font-weight: 400;
}

.usage-list {
    list-style: none;
    padding: 0;
}

.usage-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    font-weight: 300;
}

.usage-list li:last-child {
    border-bottom: none;
}

.usage-list li strong {
    color: var(--text-primary);
}

/* 常见问题 */
.faq-list {
    padding: 0;
}

.faq-list dt {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.faq-list dt:first-child {
    margin-top: 0;
}

.faq-list dd {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
    font-size: 0.85rem;
    font-weight: 300;
}

/* 页脚 */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white;
}

/* 消息提示 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    /* box-shadow: var(--shadow-lg); */
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.8rem;
    max-width: 300px;
}

.message-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.message-success {
    background-color: var(--success-color);
    color: white;
}

.message-error {
    background-color: var(--error-color);
    color: white;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    .tool-container {
        padding: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .message-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .status-text {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .tool-container {
        padding: 1rem;
    }
    
    .text-area {
        font-size: 0.875rem;
        min-height: 150px;
    }
}

/* 打印样式 */
@media print {
    .header,
    .button-group,
    .image-upload-section,
    .footer {
        display: none;
    }
    
    .tool-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
