/* 基础样式 - 苹果设计风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --apple-blue: #007AFF;
    --apple-gray: #8E8E93;
    --apple-light-gray: #F2F2F7;
    --apple-dark-gray: #1C1C1E;
    --apple-green: #34C759;
    --apple-background: #FFFFFF;
    --apple-highlight: rgba(0, 122, 255, 0.1);
    --apple-shadow: rgba(0, 0, 0, 0.05);
    --apple-card-shadow: rgba(0, 0, 0, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background-color: var(--apple-light-gray);
    color: var(--apple-dark-gray);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: var(--apple-dark-gray);
    transition: all 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--apple-dark-gray);
    font-weight: 700;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--apple-dark-gray);
}

/* 头部样式 */
header {
    background-color: var(--apple-background);
    padding: 20px 0;
    box-shadow: 0 2px 10px var(--apple-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    color: var(--apple-blue);
    font-size: 1.8rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    letter-spacing: -0.03em;
}

header h1 i {
    margin-right: 10px;
    color: var(--apple-blue);
}

.search-box {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    align-items: center;
}

#search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--apple-light-gray);
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    background-color: var(--apple-light-gray);
}

#search-btn {
    background-color: var(--apple-blue);
    color: white;
    border: none;
    padding: 0 15px;
    height: 38px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-btn:hover {
    background-color: #0062cc;
}

.language-selector {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.lang-label {
    font-size: 14px;
    color: var(--apple-gray);
    margin-right: 8px;
}

.lang-btn {
    background-color: var(--apple-light-gray);
    color: var(--apple-blue);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.lang-btn:hover {
    background-color: var(--apple-highlight);
}

/* 主容器布局 */
.main-container {
    display: flex;
    margin: 20px auto;
    max-width: 1400px;
    padding: 0 15px;
}

/* 侧边栏导航样式 */
.sidebar {
    width: 220px;
    background-color: var(--apple-background);
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--apple-shadow);
    padding: 20px 0;
    margin-right: 20px;
    height: calc(100vh - 170px);
    position: sticky;
    top: 100px;
    overflow-y: auto;
}

.sidebar-title {
    padding: 0 20px;
    margin-bottom: 15px;
    color: var(--apple-gray);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-items {
    display: flex;
    flex-direction: column;
    padding: 0 15px;
}

.nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    background-color: var(--apple-light-gray);
}

.nav-item i {
    margin-right: 12px;
    font-size: 16px;
    color: var(--apple-blue);
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background-color: var(--apple-highlight);
    transform: translateX(5px);
}

.nav-item.active {
    background-color: var(--apple-blue);
    color: white;
}

.nav-item.active i {
    color: white;
}

/* 主要内容区样式 */
.content {
    flex: 1;
    padding: 0 10px;
}

.content-title {
    margin-bottom: 20px;
    color: var(--apple-dark-gray);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.site-card {
    background-color: var(--apple-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px var(--apple-card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.site-card a {
    display: block;
    height: 100%;
    padding: 20px;
    color: inherit;
}

.site-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.site-card-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #34aadc 0%, var(--apple-blue) 100%);
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
}

.site-card-icon i {
    font-size: 24px;
    color: white;
}

.site-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.site-card-category {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 11px;
    color: #fff;
    background-color: rgba(0, 122, 255, 0.8);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.site-card-description {
    font-size: 14px;
    color: var(--apple-gray);
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 底部样式 */
footer {
    background-color: var(--apple-background);
    padding: 20px 0;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 -2px 10px var(--apple-shadow);
}

footer p {
    color: var(--apple-gray);
    font-size: 14px;
}

/* 没有结果时的样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background-color: var(--apple-background);
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--apple-shadow);
}

.no-results p {
    font-size: 16px;
    color: var(--apple-gray);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
        height: auto;
        position: relative;
        top: 0;
    }
    
    .nav-items {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        white-space: nowrap;
    }
    
    .nav-item {
        display: inline-flex;
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .nav-item:hover {
        transform: translateY(-3px);
    }
    
    .site-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .search-box {
        flex-wrap: wrap;
    }
    
    #search-input {
        flex: 1 0 70%;
        border-radius: 8px 0 0 8px;
    }
    
    #search-btn {
        flex: 0 0 auto;
        border-radius: 0 8px 8px 0;
    }
    
    .language-selector {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .site-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .site-card-icon {
        width: 40px;
        height: 40px;
    }
    
    .site-card-icon i {
        font-size: 20px;
    }
    
    .site-card-title {
        font-size: 16px;
    }
    
    .site-card-description {
        -webkit-line-clamp: 2;
    }
    
    .language-selector {
        justify-content: flex-start;
    }
}

/* 特殊样式 - 高亮显示搜索结果 */
.highlight {
    background-color: var(--apple-highlight);
}

.hidden {
    display: none;
} 