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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ecf0f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-link.active {
    background-color: #2e9c6d;
}

.main {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category {
    margin: 0;
}

.category-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #2e9c6d;
    padding-bottom: 10px;
}

.tools-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.tool-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.tool-icon {
    font-size: 40px;
    margin-bottom: 12px;
    text-align: center;
}

.tool-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.tool-page {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-title {
    font-size: 32px;
    margin-bottom: 30px;
    color: #2c3e50;
}

.tool-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.tool-section h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 15px;
}

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

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

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2e9c6d;
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group input[type="checkbox"] {
    margin-right: 5px;
}

.btn {
    padding: 10px 20px;
    background-color: #2e9c6d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #258258;
}

.btn-secondary {
    background-color: #95a5a6;
}

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

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.hash-results {
    display: grid;
    gap: 15px;
}

.hash-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hash-item label {
    min-width: 80px;
    font-weight: 500;
    color: #555;
}

.hash-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    transition: border-color 0.3s;
}

.hash-item input:focus {
    outline: none;
    border-color: #2e9c6d;
}

.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-page {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .hash-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hash-item input {
        width: 100%;
    }
}

/* 自定义提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #2e9c6d;
}

.toast.success {
    border-left-color: #2e9c6d;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.warning {
    border-left-color: #f39c12;
}

.toast.info {
    border-left-color: #3498db;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #2e9c6d;
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.warning .toast-icon {
    color: #f39c12;
}

.toast.info .toast-icon {
    color: #3498db;
}

.toast-message {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

/* 自定义模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 24px;
    min-width: 320px;
    max-width: 500px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease-out;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.modal-message {
    color: #555;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Textarea 行号和可调整大小样式 */
.textarea-wrapper {
    position: relative;
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.textarea-wrapper:focus-within {
    border-color: #2e9c6d;
}

.line-numbers {
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    color: #999;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 10px 8px;
    text-align: right;
    user-select: none;
    min-width: 40px;
    overflow-y: hidden;
    overflow-x: hidden;
    white-space: pre;
    height: inherit;
}

.textarea-wrapper textarea {
    flex: 1;
    border: none;
    resize: none;
    outline: none;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
    overflow-y: scroll;
    height: inherit;
}

.textarea-wrapper textarea:focus {
    outline: none;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, transparent, #f0f0f0);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle::after {
    content: '';
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
}

.resize-handle:hover::after {
    background: #999;
}

/* 工具分类切换样式 */
.tool-categories {
    background-color: #f8f9fa;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid #e9ecef;
}

.category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.category-tabs .tab {
    padding: 10px 20px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-tabs .tab:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.category-tabs .tab.active {
    background-color: #2e9c6d;
    color: white;
    border-color: #2e9c6d;
}

.category-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 默认隐藏所有工具分类 */
.category-tools {
    display: none;
}

/* 只显示激活状态的工具分类 */
.category-tools.active {
    display: block;
}



/* 工具项样式 */
.category-content .tool-item {
    display: inline-block;
    margin-right: 15px;
    padding: 5px 10px;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    background-color: #f8f9fa;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.category-content .tool-item:hover {
    background-color: #e9ecef;
    color: #2e9c6d;
}

@media (max-width: 768px) {
    .category-tabs {
        gap: 5px;
    }
    
    .category-tabs .tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .category-content {
        padding: 15px;
    }
    
    .category-content .tool-item {
        margin-right: 10px;
        margin-bottom: 10px;
        font-size: 13px;
    }
}
