*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0c29;
    --bg-secondary: #302b63;
    --bg-accent: #24243e;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-hover: rgba(255, 255, 255, 0.14);
    --text-primary: #f0f0f0;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.4);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary), var(--bg-accent));
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.4), transparent);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.3), transparent);
    top: 50%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.3), transparent);
    bottom: -5%;
    left: 30%;
    animation-delay: -10s;
}

.orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 230, 109, 0.2), transparent);
    top: 30%;
    left: 60%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    padding: 50px 0 30px;
}

.header-inner {
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 36px;
    color: var(--accent);
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #c8b6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
    letter-spacing: 1px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0 18px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow);
}

.search-box i.fa-search {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 14px 12px;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
    display: none;
    transition: color 0.2s;
}

.search-clear:hover {
    color: var(--text-primary);
}

.main-content {
    flex: 1;
    padding: 10px 0 40px;
}

.category-section {
    margin-bottom: 36px;
    animation: fadeInUp 0.6s ease-out both;
}

.category-section:nth-child(1) { animation-delay: 0.1s; }
.category-section:nth-child(2) { animation-delay: 0.2s; }
.category-section:nth-child(3) { animation-delay: 0.3s; }
.category-section:nth-child(4) { animation-delay: 0.4s; }
.category-section:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 0 4px;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
    flex-shrink: 0;
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.category-count {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--glass-bg);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.link-card:hover {
    background: var(--glass-hover);
    border-color: rgba(108, 99, 255, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.link-card:hover::before {
    opacity: 1;
}

.link-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: rgba(108, 99, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
    transition: var(--transition);
}

.link-card:hover .link-icon {
    background: rgba(108, 99, 255, 0.3);
    transform: scale(1.08);
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-desc {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.link-card:hover .link-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 16px;
}

.footer {
    text-align: center;
    padding: 30px 0 20px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.admin-entry {
    color: var(--text-muted);
    font-size: 16px;
    transition: var(--transition);
    padding: 6px;
    border-radius: 50%;
}

.admin-entry:hover {
    color: var(--accent);
    background: var(--glass-bg);
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header {
        padding: 30px 0 20px;
    }

    .logo h1 {
        font-size: 26px;
    }

    .logo i {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .links-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .link-card {
        padding: 14px 16px;
    }

    .link-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .category-title {
        font-size: 18px;
    }

    .bg-orb {
        filter: blur(60px);
        opacity: 0.35;
    }

    .orb-1 { width: 300px; height: 300px; }
    .orb-2 { width: 250px; height: 250px; }
    .orb-3 { width: 200px; height: 200px; }
    .orb-4 { width: 180px; height: 180px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 22px;
    }

    .search-box input {
        font-size: 14px;
        padding: 12px 10px;
    }

    .category-header {
        gap: 8px;
    }

    .category-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .category-count {
        font-size: 12px;
        padding: 3px 10px;
    }
}

::-webkit-scrollbar {
    width: 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);
}
