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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e6ed 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 主要内容区 */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 20px;
    width: 100%;
}

/* 融合的工具容器 */
.tool-container {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e8e8e8;
    position: relative;
    z-index: 10;
    transition: box-shadow 0.3s ease;
}

/* 输入输出区域容器 */
.io-container {
    display: flex;
    gap: 0;
    height: 68vh;
}

/* 输入输出区域通用样式 */
.input-section, .output-section {
    flex: 1;
    background-color: #ffffff;
    overflow: hidden;
    border-right: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
}

/* 区域头部 */
.section-header {
    flex-shrink: 0;
}

.output-section {
    border-right: none;
}

/* 区域头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    background-color: #ffffff;
    color: #1a1a1a;
    border-bottom: 1px solid #e8e8e8;
}

.section-title {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    padding: 4px 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* 工具按钮 */
.section-tools {
    display: flex;
    gap: 12px;
}

.tool-item {
    color: #666666;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    min-width: 36px;
    min-height: 36px;
}

.tool-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 196, 140, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tool-item:hover::before {
    width: 100px;
    height: 100px;
}

.tool-item:hover {
    background-color: #f7fff9;
    color: #00c48c;
    border-color: #e8f5e9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 196, 140, 0.15);
}

/* 代码容器 */
.code-container {
    display: flex;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    width: 100%;
}

.code-editor {
    width: 100%;
    height: 100%;
}

/* 行号容器 */
.line-numbers-container {
    flex-shrink: 0;
    /* width: 80px; */
    overflow-y: auto;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    background-color: #f1f3f5;
    border-right: 1px solid #dee2e6;
}

/* Chrome/Safari/Opera - 隐藏滚动条 */
.line-numbers-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* 行号 */
.line-numbers {
    background-color: #f1f3f5;
    padding: 16px 16px;
    text-align: right;
    user-select: none;
    color: #868e96;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    min-height: 100%;
}

/* 代码输入输出 */
.code-input, .code-output {
    flex: 1;
    padding: 16px 24px;
    border: none;
    outline: none;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 15px;
    line-height: 1.7;
    resize: none;
    background-color: #ffffff;
    color: #212529;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: hidden;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.code-input {
    background-color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.code-input:focus {
    background-color: #ffffff;
    box-shadow: inset 0 0 0 2px rgba(0, 196, 140, 0.5);
}

.code-input::placeholder {
    color: #adb5bd;
    opacity: 0.8;
    font-style: italic;
}

/* 优化滚动条样式 */
.code-input::-webkit-scrollbar,
.code-output::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.code-input::-webkit-scrollbar-track,
.code-output::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 6px;
}

.code-input::-webkit-scrollbar-thumb,
.code-output::-webkit-scrollbar-thumb {
    background: #c1c8d0;
    border-radius: 6px;
}

.code-input::-webkit-scrollbar-thumb:hover,
.code-output::-webkit-scrollbar-thumb:hover {
    background: #a0a7ad;
}

/* 功能按钮区 - 融合在容器底部 */
.function-buttons {
    display: flex;
    gap: 16px;
    padding: 22px 22px;
    background-color: #ffffff;
    border-top: 1px solid #e8e8e8;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

/* 顶部功能按钮区域样式 */
.image-tools-container .function-buttons:first-of-type {
    border-top: none;
    border-bottom: 1px solid #e1e5e9;
    background-color: #f0f2f5;
    padding: 12px 20px;
}

/* 选项组样式 */
.option-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.option-group:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
}

.option-group input[type="text"],
.option-group input[type="number"],
.option-group select {
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    width: 100px;
    transition: all 0.3s ease;
}

.option-group input[type="number"] {
    width: 60px;
}

.option-group select {
    width: auto;
}

.option-group input[type="text"]:focus,
.option-group input[type="number"]:focus,
.option-group select:focus {
    outline: none;
    border-color: #36a2eb;
    box-shadow: 0 0 0 2px rgba(54, 162, 235, 0.2);
}

.option-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #36a2eb;
    cursor: pointer;
}

/* 响应式调整顶部功能按钮区域 */
@media (max-width: 768px) {
    .image-tools-container .function-buttons:first-of-type {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .option-group {
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
        justify-content: space-between;
    }
    
    .option-group input[type="text"] {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .option-group input[type="text"] {
        width: 100%;
    }
}

/* 按钮样式 */
.btn {
    padding: 16px 25px;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    background-color: #ffffff;
    color: #4a4a4a;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 196, 140, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    border-color: #00c48c;
    color: #00c48c;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 196, 140, 0.2);
    background-color: #f7fff9;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 196, 140, 0.3);
}

.btn-primary {
    background-color: #00c48c;
    color: #ffffff;
    border-color: #00c48c;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 196, 140, 0.35);
}

.btn-primary::before {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background-color: #00b07c;
    border-color: #00b07c;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 196, 140, 0.5);
}

.btn-primary:active {
    background-color: #009668;
    border-color: #009668;
    box-shadow: 0 6px 20px rgba(0, 196, 140, 0.4);
}

/* 绿色转换按钮样式 */
.green-btn {
    padding: 12px 20px;
    border: 1px solid #28a745;
    border-radius: 8px;
    background-color: #28a745;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.green-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

/* 工具介绍区 */
.tool-intro {
    max-width: 1400px;
    margin: 0px auto 0;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    position: relative;
    z-index: 5;
    transition: box-shadow 0.3s ease;
}

.tool-intro h3 {
    margin-bottom: 24px;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}

.tool-intro h4 {
    margin: 32px 0 16px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.tool-intro p {
    margin-bottom: 20px;
    color: #666666;
    font-size: 16px;
    line-height: 1.8;
}

.tool-intro ul {
    margin-bottom: 24px;
    padding-left: 32px;
    color: #666666;
}
.tool-intro ol {
    margin-bottom: 24px;
    padding-left: 32px;
    color: #666666;
}
.tool-intro li {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.7;
}

.tool-intro a {
    color: #00c48c;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding-bottom: 2px;
}

.tool-intro a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #00c48c;
    transition: width 0.3s ease;
}

.tool-intro a:hover {
    color: #00b07c;
    text-decoration: none;
}

.tool-intro a:hover::after {
    width: 100%;
}

/* 代码高亮 - 优化为更现代化的配色方案 */
.key {
    color: #d73a49;
    font-weight: 600;
}

.string {
    color: #00c48c;
}

.number {
    color: #005cc5;
    font-weight: 500;
}

.keyword {
    color: #6f42c1;
    font-weight: bold;
}

.comment {
    color: #9ca3af;
    font-style: italic;
    opacity: 0.8;
}

.boolean {
    color: #d73a49;
    font-weight: 600;
}

.null {
    color: #d73a49;
    font-weight: 600;
}

/* 页脚样式 */
.footer {
    background-color: #f8f9fa;
    color: #333;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    opacity: 0.9;
}

.footer-links a:hover {
    color: #36a2eb;
    opacity: 1;
    text-decoration: underline;
}

.copyright {
    color: #999;
    font-size: 13px;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .io-container {
        flex-direction: column;
        height: auto;
    }

    .input-section, .output-section {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
        min-height: 500px;
    }

    .output-section {
        border-bottom: none;
    }

    .code-container {
        height: 350px;
        min-height: 300px;
    }

    .function-buttons {
        justify-content: center;
        padding: 24px 20px;
        gap: 16px;
    }

    .function-buttons .btn {
        flex: 1;
        min-width: 120px;
        padding: 14px 24px;
        font-size: 14px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .section-tools {
        width: 100%;
        justify-content: space-around;
        gap: 8px;
    }

    .tool-container {
        margin-bottom: 20px;
    }

    .tool-intro {
        padding: 30px 20px;
        margin-top: 20px;
    }

    .tool-intro h3 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .tool-intro h4 {
        font-size: 18px;
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }

    .function-buttons {
        padding: 16px 12px;
        gap: 12px;
    }

    .function-buttons .btn {
        flex: 1 0 45%;
        min-width: auto;
        padding: 12px 16px;
        font-size: 13px;
    }

    .tool-intro {
        padding: 24px 16px;
    }

    .tool-intro h3 {
        font-size: 20px;
    }

    .tool-intro h4 {
        font-size: 16px;
    }

    .tool-intro p,
    .tool-intro li {
        font-size: 14px;
    }

    .line-numbers-container {
        width: 60px;
    }

    .code-input,
    .code-output {
        padding: 12px 16px;
        font-size: 14px;
    }

    .section-header {
        padding: 12px 16px;
    }

    .section-title {
        font-size: 16px;
    }
}

/* 页脚样式 */
.footer {
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    padding: 24px 0;
}

/* Toast 通知样式 */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 380px;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Toast 显示状态 */
.notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* 不同类型的 Toast */
.notification.success {
    background-color: #00c48c;
}

.notification.error {
    background-color: #f56c6c;
}

.notification.warning {
    background-color: #e6a23c;
}

.notification.info {
    background-color: #409eff;
}

/* 响应式 Toast */
@media (max-width: 768px) {
    .notification {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        padding: 14px 20px;
        font-size: 13px;
    }
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #36a2eb;
}

.copyright {
    color: #999;
    font-size: 12px;
}

/* SQL 工具特定样式 */
.main-content-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px;
    width: 100%;
}

.image-tools-container {
    flex: 1;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e5e9;
    padding: 16px;
    margin-bottom: 16px;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.sidebar-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-section li {
    margin-bottom: 8px;
}

.sidebar-section a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-section a:hover {
    background-color: #f0f2f5;
    color: #333;
    transform: translateY(-1px);
}

.sidebar-section i {
    margin-right: 8px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-top: 20px;
    }
}

/* 调整工具介绍区样式 */
.image-tools-container .tool-intro {
    background-color: #fff;
    padding: 24px;
    border-top: 1px solid #e1e5e9;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
}