* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 50%;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #3498db;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #3498db;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links .active a {
    color: #3498db;
}

.nav-links .active a::after {
    width: 100%;
}

/* 页面标题 */
.page-title {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

.page-title h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-title p {
    font-size: 16px;
    opacity: 0.9;
}

/* 工具容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 工具选项卡 */
.tool-tabs {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #e0e0e0;
}

.tab-item {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.tab-item:hover {
    color: #3498db;
}

.tab-item.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: #f9f9f9;
}

/* 工具内容 */
.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tool-section {
    margin-bottom: 40px;
}

.tool-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    resize: vertical;
    min-height: 150px;
    font-family: 'Courier New', Courier, monospace;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 结果区域 */
.result-area {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.result-area h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.result-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-area textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: vertical;
    background: #f5f5f5;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tool-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tool-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.tool-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.tool-card .btn {
    width: 100%;
}

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

    .nav-links {
        margin-top: 15px;
    }

    .nav-links li {
        margin-left: 0;
        margin-right: 20px;
    }

    .page-title h1 {
        font-size: 24px;
    }

    .tabs-header {
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab-item {
        white-space: nowrap;
    }

    .tab-content {
        padding: 20px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-title {
        padding: 30px 0;
    }

    .page-title h1 {
        font-size: 20px;
    }

    .container {
        padding: 20px 15px;
    }

    .tab-content {
        padding: 15px;
    }

    .tool-card {
        padding: 20px;
    }
}

/* 特殊工具样式 */
.time-converter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.base64-tool {
    display: block;
}

.base64-tool .form-group textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    min-height: 150px;
    width: 100%;
    box-sizing: border-box;
}

.base64-tool .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.base64-tool .form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    color: #555;
}

/* 时间戳工具样式 */
#timestamp input[type="text"] {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    transition: border-color 0.3s ease;
}

#timestamp input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#timestamp select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#timestamp select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#timestamp .btn {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#timestamp .btn-primary {
    background-color: #3498db;
    color: #fff;
}

#timestamp .btn-primary:hover {
    background-color: #2980b9;
}

#timestamp .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

#timestamp .btn-secondary:hover {
    background-color: #e0e0e0;
}

#timestamp .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 时间戳工具布局调整 */
#timestamp .tool-section > div {
    margin-bottom: 15px;
}

#timestamp .tool-section h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

/* 密码生成器选项 */
.password-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    align-items: center;
}

.option-item input[type="checkbox"] {
    margin-right: 10px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

/* 成功提示 */
.success-message {
    color: #27ae60;
    margin-top: 10px;
    font-size: 14px;
}

/* JSON语法高亮样式 */
#json pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
}

#json .string {
    color: #27ae60;
}

#json .number {
    color: #3498db;
}

#json .boolean {
    color: #e74c3c;
}

#json .null {
    color: #9b59b6;
}

#json .key {
    color: #f39c12;
}

/* 文本比对差异高亮 */
.diff-removed {
    background-color: #ffcccc;
    color: #cc0000;
    border-radius: 2px;
    padding: 0 2px;
}

.diff-added {
    background-color: #cce5ff;
    color: #0066cc;
    border-radius: 2px;
    padding: 0 2px;
}

/* 文本比对编辑器样式 */
.diff-editor {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 400px;
    overflow: hidden;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    padding: 10px 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    overflow: hidden;
}

.diff-text {
    width: 100%;
    height: 100%;
    padding: 10px 10px 10px 50px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    border: none;
    outline: none;
    white-space: pre;
    overflow: auto;
}

.diff-text:focus {
    outline: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 全局样式 */
    .container {
        padding: 10px;
    }
    
    /* 导航菜单 */
    .navbar-container {
        padding: 0 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 5px;
    }
    
    .nav-links a {
        font-size: 16px;
    }
    
    /* Tab菜单 */
    .tabs-header {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    
    .tabs-header .tab-item {
        flex: 0 0 auto;
        margin: 0 5px;
        font-size: 12px;
        padding: 10px 5px;
    }
    
    /* 工具内容 */
    .tab-content {
        padding: 15px;
    }
    
    /* 表单元素 */
    .form-group input,
    .form-group textarea {
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 按钮 */
    .btn {
        font-size: 14px;
        padding: 8px 16px;
        margin: 5px 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Base64工具 */
    .base64-tool .form-group {
        margin-bottom: 15px;
    }
    
    .base64-tool .form-group textarea {
        min-height: 120px;
    }
    
    .base64-tool > div:not(.form-group) {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 15px 0;
    }
    
    .base64-tool > div:not(.form-group) .btn {
        flex: 1 1 calc(50% - 5px);
        margin: 0;
    }
    
    /* 时间戳工具 */
    #timestamp .tool-section > div {
        margin-bottom: 20px;
    }
    
    #timestamp div[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    #timestamp input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }
    
    #timestamp select {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 详细日期选择 */
    #timestamp div[style*="display: flex"] input[type="text"] {
        flex: 1;
        min-width: 60px;
    }
    
    /* JSON编辑器 */
    .json-editor {
        flex-direction: column;
        gap: 15px;
    }
    
    .json-panel textarea,
    .json-panel pre {
        height: 300px;
        font-size: 12px;
    }
    
    /* JSON工具栏 */
    .json-toolbar {
        flex-direction: column;
    }
    
    .json-toolbar .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    /* 文本比对工具 */
    .diff-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .diff-panel textarea {
        height: 300px;
        font-size: 12px;
    }
    
    /* 文本比对工具栏 */
    .diff-toolbar {
        flex-direction: column;
    }
    
    .diff-toolbar .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo img {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 50%;
}

.footer-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.footer-about p {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
}

.footer-links h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

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

.footer-links a:hover {
    color: #3498db;
}

/* 友情链接样式 */
.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.friend-link-item {
    display: inline-block;
    padding: 5px 10px;
    background-color: #444;
    border-radius: 4px;
    text-decoration: none;
    color: #ccc;
    font-size: 14px;
    transition: all 0.3s ease;
    max-width: 120px;
    text-align: center;
}

.friend-link-item:hover {
    background-color: #3498db;
    color: #fff;
    transform: translateY(-2px);
}

.friend-link-item img {
    max-width: 80px;
    max-height: 30px;
    object-fit: contain;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 30px;
    text-align: center;
    font-size: 14px;
    color: #999;
}

.footer-bottom a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .friend-links {
        justify-content: center;
    }
}