/* 苹果风格设计 - 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部样式 - 苹果风格毛玻璃效果 */
.header {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.7);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

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

.header-text {
    text-align: center;
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 18px;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
}

.admin-btn:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.2);
    border-color: rgba(0, 122, 255, 0.3);
}

.admin-btn:active {
    transform: scale(0.98);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.2rem;
    color: #86868b;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

/* 侧边栏样式 - 苹果风格毛玻璃 */
.sidebar {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 20px;
}

.sidebar h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    letter-spacing: -0.01em;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 6px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    text-decoration: none;
    color: #1d1d1f;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-item:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.2);
    border-color: rgba(0, 122, 255, 0.3);
}

.category-item.active {
    background: #007aff;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
    border-color: #007aff;
}

/* 内容区域样式 */
.content {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.search-box:focus-within {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#searchInput {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #1d1d1f;
    width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}

#searchInput::placeholder {
    color: #86868b;
}

#searchBtn, #clearBtn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

#searchBtn {
    color: #007aff;
}

#searchBtn:hover {
    background: rgba(0, 122, 255, 0.1);
}

#clearBtn {
    color: #86868b;
}

#clearBtn:hover {
    background: rgba(134, 134, 139, 0.1);
    color: #1d1d1f;
}

.tools-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.02em;
}

.tools-count {
    background: #007aff;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* 工具卡片 - 苹果风格 */
.tool-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 40px rgba(31, 38, 135, 0.2);
    border-color: rgba(0, 122, 255, 0.3);
    background: rgba(0, 122, 255, 0.1);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.tool-name, .tool-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.tool-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: #007aff;
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: middle;
}

.tool-description {
    font-size: 14px;
    color: #86868b;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-link {
    display: none;
}

.tool-link:hover {
    background: #007aff;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary {
    background: #007aff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
    background: #0056d6;
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #86868b;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 122, 255, 0.2);
    border-top: 3px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #86868b;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.empty-state p {
    font-size: 1rem;
    color: #86868b;
}

/* 分页组件 - 苹果风格 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 35px;
    padding: 25px 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 110px;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.pagination-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
    background: #0056d6;
}

.pagination-btn.disabled {
    background: rgba(142, 142, 147, 0.3);
    color: #86868b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-btn span {
    font-size: 1.2rem;
    font-weight: bold;
}

.pagination-info {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: #1d1d1f;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 130px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pagination-info span {
    font-weight: 600;
    color: #007aff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        position: static;
        order: 2;
        padding: 25px;
    }
    
    .content {
        order: 1;
        padding: 30px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
        justify-content: space-between;
    }
    
    #searchInput {
        width: 100%;
        flex: 1;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .header {
        padding: 30px;
    }
    
    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .category-list li {
        margin-bottom: 0;
    }
    
    .pagination {
        gap: 15px;
        margin-top: 25px;
    }
    
    .pagination-btn {
        min-width: 90px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .pagination-info {
        min-width: 110px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 25px;
    }
    
    .header h1 {
        font-size: 1.9rem;
    }
    
    .sidebar,
    .content {
        padding: 20px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 16px 20px;
        min-height: 70px;
    }
}

/* 滚动条样式 - 苹果风格 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 122, 255, 0.6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 122, 255, 0.8);
}

/* 苹果风格动画增强 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeInUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.tool-card:nth-child(1) { animation-delay: 0.02s; }
.tool-card:nth-child(2) { animation-delay: 0.04s; }
.tool-card:nth-child(3) { animation-delay: 0.06s; }
.tool-card:nth-child(4) { animation-delay: 0.08s; }
.tool-card:nth-child(5) { animation-delay: 0.1s; }
.tool-card:nth-child(6) { animation-delay: 0.12s; }
.tool-card:nth-child(7) { animation-delay: 0.14s; }
.tool-card:nth-child(8) { animation-delay: 0.16s; }
.tool-card:nth-child(9) { animation-delay: 0.18s; }
.tool-card:nth-child(10) { animation-delay: 0.2s; }

/* 苹果风格选择效果 */
.category-item:active,
.tool-card:active,
.btn-primary:active,
.pagination-btn:active {
    transform: scale(0.98);
}

/* 毛玻璃效果增强 */
@supports (backdrop-filter: blur(20px)) {
    .header,
    .sidebar,
    .content {
        background: rgba(255, 255, 255, 0.6);
    }
    
    .tool-card {
        background: rgba(255, 255, 255, 0.7);
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        color: #f5f5f7;
    }
    
    .header,
    .sidebar,
    .content {
        background: rgba(28, 28, 30, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .tool-card {
        background: rgba(44, 44, 46, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .header h1,
    .sidebar h3,
    .tools-header h2,
    .tool-name,
    .tool-title {
        color: #f5f5f7;
    }
    
    .category-item {
        color: #f5f5f7;
        background: rgba(44, 44, 46, 0.6);
    }
    
    .pagination-info {
        background: rgba(44, 44, 46, 0.8);
        color: #f5f5f7;
    }
}