/**
 * PerToolBox Front - 响应式侧边栏样式
 * Copyright (C) 2024 Sea Network Technology Studio
 * Author: Canglan <admin@sea-studio.top>
 * License: AGPL v3
 */

/* 侧边栏基础样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 桌面端显示 */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }
    
    body {
        margin-left: 280px;
    }
}

/* 移动端打开状态 */
.sidebar.open {
    transform: translateX(0);
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 导航菜单 */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #e2e8f0;
    transition: all 0.2s;
    text-decoration: none;
}

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

/* 侧边栏底部 */
.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
    display: none;
}

.overlay.active {
    display: block;
}

@media (min-width: 768px) {
    .overlay {
        display: none !important;
    }
}

/* 主要内容区域容器 */
.main-content {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 工具卡片网格 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.tool-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.tool-stats {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: #3b82f6;
    ring: 2px solid #3b82f6;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #374151;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}