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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0c0e1a 0%, #1a1040 30%, #0d1b2a 60%, #0a1628 100%);
    min-height: 100vh;
    color: #e0e0e0;
    overflow-x: hidden;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 20px);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.site-title {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    max-width: 420px;
    width: 350px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: rgba(102, 126, 234, 0.5);
}

.search-engine {
    background: transparent;
    border: none;
    color: #ccc;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.search-engine option {
    background: #1a1040;
    color: #e0e0e0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}

.search-input::placeholder {
    color: #888;
}

.search-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.3s;
}

.search-btn:hover {
    opacity: 0.85;
}

.datetime {
    color: #888;
    font-size: 13px;
    text-align: right;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    color: #bbb;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.tab-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-color: rgba(102, 126, 234, 0.4);
    color: #fff;
}

.tab-item i {
    font-size: 13px;
}

/* All tab */
.tab-all {
    margin-right: 5px;
}

/* Links Content */
.links-section {
    display: none;
}

.links-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-header i {
    font-size: 18px;
    color: #667eea;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px 16px;
    background: rgba(30, 25, 70, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.link-card:hover {
    transform: translateY(-4px);
    background: rgba(40, 35, 90, 0.95);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.link-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
}

.link-title {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 4px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-desc {
    font-size: 11px;
    color: #888;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.links-content {
    flex: 1;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0 20px;
    color: #555;
    font-size: 13px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive — tablet */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px 40px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }

    .site-title {
        font-size: 38px;
        text-align: center;
        letter-spacing: 6px;
        line-height: 1.4;
    }

    .header-right {
        align-items: stretch;
    }

    .search-box {
        width: 80%;
        max-width: 260px;
        margin: 0 auto;
    }

    .datetime {
        text-align: center;
    }

    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .category-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .link-card {
        padding: 14px 8px 12px;
    }

    .link-icon {
        width: 40px;
        height: 40px;
    }

    .section-header h2 {
        font-size: 17px;
    }
}

/* Responsive — small mobile */
@media (max-width: 400px) {
    .container {
        padding: 16px 12px 30px;
    }

    .site-title {
        font-size: 32px;
        letter-spacing: 4px;
    }

    .search-box {
        width: 70%;
        max-width: 220px;
        margin: 0 auto;
    }

    .links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .link-card {
        padding: 10px 6px 10px;
    }

    .link-icon {
        width: 36px;
        height: 36px;
    }

    .link-title {
        font-size: 12px;
    }

    .link-desc {
        font-size: 10px;
    }

    .tab-item {
        padding: 7px 14px;
        font-size: 13px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
