* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
h2 {
    font-size: 20px;
}
body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 10px;
    background-color: #f8f9fa;
    height: 30px; /* 根据需要调整高度 */
}
.logo {
    height: 100%;
    object-fit: contain; /* 确保图片不会被拉伸 */
}
/*.ip-info {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    background: #333;*/
/*    color: #fff;*/
/*    padding: 1px 10px;*/
/*    font-size: 14px; !* 调整字体大小 *!*/
/*}*/

.side-nav {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}
.side-nav button {
    display: block;
    writing-mode: vertical-lr;
    padding: 25px 12px;
    width: 45px;
    background: #E8F0FE; /* 更柔和的蓝色背景 */
    color: #4285f4;     /* 保持文字为谷歌蓝 */
    border: none;
    cursor: pointer;
    margin: 3px 0;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s;
    font-size: 16px;    /* 更大的字体 */
    font-weight: 500;   /* 稍微加粗 */
    letter-spacing: 2px;/* 增加字间距 */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}
.side-nav button:hover {
    background: #4285f4;
    color: white;
    width: 50px;
}
.side-nav button.active {
    background: #4285f4;
    color: white;
    width: 50px;
}
.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px;
}

.search-box {
    text-align: center;
    margin: 30px 0;
}
.search-box input {
    width: 500px;
    height: 40px;
    padding: 0 15px;
    border: 2px solid #4285f4;
    border-radius: 20px;
    font-size: 16px;
}
.content-section {
    display: none; /* 默认隐藏所有内容区域 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}
.content-section.active {
    display: block; /* 显示激活的内容区域 */ 
}
.nav-section {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.section-title {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4285f4;
}
.nav-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 一行显示5个 */
    gap: 20px;
    padding: 10px;
}
.nav-item {
    text-align: center;
}
.nav-item a {
    display: block;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    text-decoration: none;
    transition: all 0.3s ease;
    height: 100%;
}

.nav-item a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(66,133,244,0.15);
    border-color: #4285f4;
}

.model-name {
    font-size: 18px;
    font-weight: bold;
    color: #4285f4;
    margin-bottom: 8px;
}

.model-company {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.model-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    line-height: 1.4;
}

.model-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f0fe;
    color: #4285f4;
    border-radius: 4px;
    font-size: 12px;
}

/* 响应式布局调整 */
@media screen and (max-width: 1200px) {
    .container {
        max-width: calc(100% - 40px);
        margin: 0 auto;
    }
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .link-grid {
        grid-template-columns: repeat(4, 1fr); /* 中等屏幕每行显示4个 */
    }
}
@media (max-width: 768px) {
    .link-grid {
        grid-template-columns: repeat(2, 1fr); /* 小屏幕每行显示2个 */
    }
}

/* 网站导航使用样式 start */
header {
    text-align: center;
    padding: 40px 0;
    background: #2c3e50;
    color: white;
    margin-bottom: 30px;
}
.search-box {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}
.search-buttons {
    display: flex;
    gap: 8px;
}
.search-buttons button {
    padding: 8px 15px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.search-buttons button:hover {
    background: #2c5fbb;
    transform: translateY(-1px);
}

.category {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 每行显示7个 */
    /*grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); !* 自动调整列宽 *!*/
    gap: 6px;
}
.link-grid a {
    font-size: 16px; /* 减小链接字体大小 */
    text-decoration: none;
    color: #666;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}
.link-grid a:hover {
    background: #f8f9fa;
    color: #2980b9;
    transform: translateX(5px);
}
.link-grid-live {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 每行显示7个 */
    gap: 15px;
}
.link-grid-live a {
    text-decoration: none;
    color: #666;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-align: center;
    display: block;
}
.link-grid-live a:hover {
    background: #f8f9fa;
    color: #2980b9;
    transform: translateX(5px);
}
/* 覆盖原.container样式 */
#websites .container {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px;
}

/* 覆盖原.container样式 */
#dev-tools {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

/*!* 网站导航使用样式 end *!*/

.json-formatter {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 90vh; /* 占屏幕高度的90% */
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tool-button {
    padding: 8px 15px;
    background: linear-gradient(135deg, #4285f4, #5c9fff);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    user-select: none;
    box-shadow: 0 2px 4px rgba(66,133,244,0.15);
    border: none;
    position: relative;
    overflow: hidden;
}

.tool-button:hover {
    background: linear-gradient(135deg, #3b78e7, #4285f4);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66,133,244,0.25);
}

.tool-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(66,133,244,0.2);
}

.tool-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    transition: 0.5s;
}

.tool-button:hover::before {
    left: 100%;
}

.json-inputs {
    display: flex;
    justify-content: space-between;
    /*max-width: 90%; !* 占页面宽度的90% *!*/
    width: 100%;
    height: 100%; /* 占父容器高度的100% */
}

.editor-container {
    display: flex;
    width: 49%; /* 每个文本框占页面宽度的45% */
    height: 100%; /* 占父容器高度的100% */
    border: 1px solid #ccc;
    position: relative;
}

.line-numbers {
    overflow-y: scroll; /* 替换原来的auto更明确 */
    background-color: #f0f0f0;
    padding: 2px 5px;
    text-align: right;
    overflow-y: auto;
    user-select: none;
    font-family: monospace;
    line-height: 1.5;
    width: 30px; /* 行号列的宽度 */
    /* 新增以下属性 */
    pointer-events: none; /* 防止行号区域干扰滚动 */
    position: relative;
    z-index: 1;
    /* 新增以下属性 */
    min-height: 100px; /* 保证空内容时也有最小高度 */
    height: calc(100% - 4px); /* 留出滚动条空间 */
}

.line-numbers span {
    will-change: contents;
    backface-visibility: hidden;
    display: block;
    color: #999;
}

textarea {
    flex: 1;
    padding: 2px 5px;
    border: none;
    outline: none;
    resize: none;
    font-family: monospace;
    line-height: 1.5;
    /* 调整定位层级 */
    position: absolute;
    left: 30px; /* 行号宽度 */
    width: calc(100% - 30px);
    height: 100%;
    z-index: 2;
    overflow-y: auto !important;
    white-space: pre-wrap; /* 支持自动换行 */
}
.separator {
    color: #ccc;
    margin: 0 10px;
}


/* 添加在CSS文件底部 */
.site-footer {
    background-color: #f5f5f5;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #e7e7e7;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.footer-content p {
    margin: 5px 0;
}

.footer-content a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

.footer-content a:hover {
    color: #333;
    text-decoration: underline;
}

/* Tab栏样式美化 */
.tool-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.tab-button {
    position: relative;
    padding: 12px 24px;
    background: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    outline: none;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.tab-button:hover {
    background: #f0f7ff;
    color: #4285f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66,133,244,0.15);
}

.tab-button:hover::before {
    transform: translateX(100%);
}

.tab-button.active {
    background: linear-gradient(135deg, #4285f4, #5c9fff);
    color: white;
    box-shadow: 0 4px 12px rgba(66,133,244,0.25);
    transform: translateY(-1px);
}

.tab-button:not(.active):active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(66,133,244,0.1);
}

/* 添加响应式设计 */
@media (max-width: 768px) {
    .tool-tabs {
        padding: 6px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tool-tabs {
        flex-direction: column;
        gap: 6px;
    }
    
    .tab-button {
        width: 100%;
        text-align: center;
    }
}

/* 工具内容区域的基础样式 */
.tool-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 激活状态的工具内容 */
.tool-content.active {
    display: flex;
    opacity: 1;
    flex-wrap: wrap;
    gap: 10px;
}

/* 默认隐藏时间和编码工具区域 */
#time-section,
#encode-section {
    display: none;
}

/* 确保JSON工具区域默认显示 */
#json-section.active {
    display: flex;
}
