/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
    background-color: #fff;
}

/* 左侧菜单栏 */
.sidebar {
    width: 240px;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

/* 菜单样式 */
.menu {
    flex: 1;
    padding: 20px 0;
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    border-radius: 0 20px 20px 0;
    transition: all 0.3s ease;
    position: relative;
}

.menu-link:hover {
    background-color: #f0f0f0;
    color: #1a1a1a;
}

.menu-item.active .menu-link {
    background-color: #e8e8e8;
    color: #1a1a1a;
    font-weight: 500;
}

.menu-item.active .menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #1a1a1a;
    border-radius: 0 3px 3px 0;
}

.menu-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.menu-text {
    font-size: 14px;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.copyright {
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 30px;
    background-color: #fafafa;
    min-height: 100vh;
}

/* 主头部 */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.header-title h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.header-title p {
    font-size: 14px;
    color: #666;
}

/* 搜索框 */
.header-search {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #999;
}

/* 工具卡片区域 */
.tools-section {
    margin-top: 30px;
}

/* 工具网格布局 - 一行7个 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
    margin: 0 -10px;
    padding: 0 10px;
}

/* 工具卡片样式 */
.tool-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #1a1a1a;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #d0d0d0;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    font-size: 36px;
    margin-bottom: 15px;
    display: block;
    color: #333;
}

.tool-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.tool-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 使用按钮 */
.tool-action {
    margin-top: auto;
}

.btn-use {
    display: inline-block;
    padding: 8px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.btn-use:hover {
    background-color: #e0e0e0;
    color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .tools-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1400px) {
    .tools-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 20px;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-search {
        width: 100%;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.4s ease forwards;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }
.tool-card:nth-child(7) { animation-delay: 0.35s; }
.tool-card:nth-child(8) { animation-delay: 0.4s; }
.tool-card:nth-child(9) { animation-delay: 0.45s; }
.tool-card:nth-child(10) { animation-delay: 0.5s; }
.tool-card:nth-child(11) { animation-delay: 0.55s; }
.tool-card:nth-child(12) { animation-delay: 0.6s; }
.tool-card:nth-child(13) { animation-delay: 0.65s; }
.tool-card:nth-child(14) { animation-delay: 0.7s; }

/* 选择文本样式 */
::selection {
    background-color: #e0e0e0;
    color: #1a1a1a;
}

::-moz-selection {
    background-color: #e0e0e0;
    color: #1a1a1a;
}

/* 焦点样式 */
*:focus {
    outline: 2px solid rgba(0, 0, 0, 0.1);
    outline-offset: 2px;
}

/* 按钮焦点样式 */
.btn-use:focus {
    outline: 2px solid rgba(0, 0, 0, 0.2);
    outline-offset: 2px;
}

/* 菜单链接焦点样式 */
.menu-link:focus {
    outline: none;
    background-color: #f0f0f0;
}

/* 工具卡片焦点样式 */
.tool-card:focus {
    outline: 2px solid rgba(0, 0, 0, 0.2);
    outline-offset: 2px;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}