/* 公共样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.nav-tools {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    display: flex;
    gap: 30px;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px 0;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    padding: 0 20px 15px;
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* 搜索框样式 */
.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.search-input::placeholder {
    color: #999;
}

.no-results {
    padding: 20px;
}

.tool-menu {
    list-style: none;
}

.tool-menu-item {
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.tool-menu-item a {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.tool-menu-item:hover {
    background: #f8f9ff;
}

.tool-menu-item:hover a {
    color: #667eea;
}

.tool-menu-item.active {
    background: #f8f9ff;
    border-left-color: #667eea;
}

.tool-menu-item.active a {
    color: #667eea;
    font-weight: 600;
}

.tool-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* 高亮搜索结果 */
.tool-menu-item.highlight {
    animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
    0%, 100% { background: #f8f9ff; }
    50% { background: #e8ebff; }
}

/* 内容区域 */
.content-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 40px;
    min-height: 600px;
}

.tool-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tool-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.tool-header .subtitle {
    color: #666;
    font-size: 14px;
}

/* 通用组件样式 */
.button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.button-secondary {
    background: #f5f5f5;
    color: #555;
}

.button-secondary:hover {
    background: #e0e0e0;
    box-shadow: none;
}

.info-box {
    background: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

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

.tool-section h2 {
    color: #555;
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.tool-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #667eea;
    margin-right: 10px;
    border-radius: 2px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Excel MD5工具特定样式 */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #e8ebff;
    border-color: #764ba2;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

input[type="file"] {
    display: none;
}

.preview {
    margin-top: 30px;
    display: none;
}

.preview.show {
    display: block;
}

.table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: #f8f9ff;
}

.success {
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    color: #2e7d32;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        display: none;
    }
    
    .sidebar.mobile-open {
        display: block;
    }
}

@media (max-width: 600px) {
    .main-container {
        padding: 15px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .header-content {
        padding: 15px 20px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .button {
        width: 100%;
        justify-content: center;
    }
}