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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --sidebar-width: 280px;
    --header-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 顶部状态栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-toggle:hover {
    background-color: var(--bg-color);
}

.hamburger {
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    transition: var(--transition);
}

.app-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.header-center {
    /* 搜索功能已移除 */
}

.header-right {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.current-tool {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 主容器 */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar-content {
    padding: 24px;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* 最近使用 */
.recent-section {
    margin-bottom: 32px;
}

.recent-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.recent-tool-item:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.recent-tool-icon {
    font-size: 1.2rem;
}

.recent-tool-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.empty-state {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* 工具导航 */
.tool-list {
    list-style: none;
}

.tool-item {
    margin-bottom: 8px;
}

.tool-category {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    border-radius: 12px;
    transition: var(--transition);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.tool-category:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    font-size: 1.2rem;
}

.category-name {
    flex: 1;
}

.expand-icon {
    font-size: 0.875rem;
    transition: var(--transition);
}

.tool-item.expanded .expand-icon {
    transform: rotate(180deg);
}

.tool-sublist {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
    margin-top: 8px;
}

.tool-item.expanded .tool-sublist {
    max-height: 300px;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    margin: 4px 0;
    border: 1px solid transparent;
}

.tool-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(8px);
    border-color: var(--primary-color);
}

.tool-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow);
}

.tool-icon {
    font-size: 1rem;
}

.tool-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* 主内容区 */
.main-content {
    flex: 1;
    background: var(--bg-color);
    overflow-y: auto;
    transition: var(--transition);
}

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    padding: 48px;
}

.welcome-content {
    text-align: center;
    max-width: 500px;
}

.welcome-content h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.tool-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* iframe 容器 */
.tool-frame-container {
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--card-bg);
}

.tool-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--card-bg);
}

/* 加载指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-overlay p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .header {
        padding: 0 16px;
    }
    
    .header-center {
        /* 搜索功能已移除 */
    }
    
    .app-title {
        font-size: 1.125rem;
    }
    
    .current-tool {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        height: calc(100vh - var(--header-height));
        z-index: 1001;
        transition: var(--transition);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .welcome-content h2 {
        font-size: 2rem;
    }
    
    .tool-stats {
        gap: 32px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sidebar-content {
        padding: 16px;
    }
    
    .welcome-content {
        padding: 24px;
    }
    
    .welcome-content h2 {
        font-size: 1.75rem;
    }
    
    .tool-stats {
        flex-direction: column;
        gap: 24px;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 搜索结果高亮样式已移除 */