:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --text-color: #333;
    --text-light: #7f8c8d;
    --editor-bg: #1e1e1e;
    --editor-text: #d4d4d4;
    --editor-line: #333;
    --editor-selection: #264f78;
    --editor-keyword: #569cd6;
    --editor-function: #dcdcaa;
    --editor-string: #ce9178;
    --editor-number: #b5cea8;
    --editor-comment: #6a9955;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
header {
    background: linear-gradient(135deg, var(--secondary-color), var(--dark-color));
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent-color);
}

.logo i {
    margin-right: 10px;
    font-size: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 8px 15px;
    transition: all 0.3s ease;
}

.search-box:hover {
    background: rgba(255, 255, 255, 0.3);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 200px;
    padding: 5px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

/* 主要内容区 */
.main-content {
    display: flex;
    margin: 30px 0;
    gap: 30px;
}

/* 左侧工具区域 */
.sql-formatter {
    flex: 2;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* 工具操作区 */
.tool-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--light-color);
    color: var(--secondary-color);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.action-btn i {
    margin-right: 5px;
}

.action-btn:hover {
    background: var(--accent-color);
    color: white;
}

/* 编辑器区域 */
.editor-container {
    position: relative;
    margin-bottom: 20px;
}

.editor-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

#sqlInput, #sqlOutput {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid var(--editor-line);
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    background-color: var(--editor-bg);
    color: var(--editor-text);
    tab-size: 4;
}

#sqlInput:focus, #sqlOutput:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2);
}

/* SQL语法高亮 */
.keyword {
    color: var(--editor-keyword);
    font-weight: bold;
}

.function {
    color: var(--editor-function);
}

.string {
    color: var(--editor-string);
}

.number {
    color: var(--editor-number);
}

.comment {
    color: var(--editor-comment);
    font-style: italic;
}

/* 错误提示 */
.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

/* 示例SQL */
.sample-sql {
    margin-top: 30px;
}

.sample-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.sample-item {
    background: var(--light-color);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sample-item:hover {
    background: var(--accent-color);
    color: white;
}

/* 右侧边栏 */
.sidebar {
    flex: 1;
}

.widget {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-color);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.widget-title i {
    margin-right: 10px;
    color: var(--accent-color);
}

.author-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--accent-color);
    padding: 3px;
}

.author-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.author-bio {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--light-color);
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 10px;
}

.category-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--light-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.category-item a:hover {
    background: var(--accent-color);
    color: white;
    padding-left: 15px;
}

.category-item span {
    background: white;
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.hot-articles {
    list-style: none;
}

.article-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--light-color);
}

.article-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.article-item a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.article-item a:hover {
    color: var(--accent-color);
}

.article-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* 页脚 */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
    padding: 0 15px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--light-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light-color);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
    }

    .nav-links li {
        margin: 5px 15px 5px 0;
    }

    .search-box {
        margin-top: 15px;
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .main-content {
        flex-direction: column;
    }

    .tool-actions {
        flex-direction: column;
        gap: 10px;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .footer-column {
        flex: 100%;
    }
}