:root {
    --primary-color: #ff9000;
    --bg-color: #0d0d0d;
    --card-bg-color: rgba(26, 26, 26, 0.6);
    --text-color: #fff;
}

html {
    font-size: 16px;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 30% 30%, #0f0f0f, #000000);
    color: var(--text-color);
    line-height: 1.6;
}

/* 加载指示器 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

.loading-indicator p {
    margin-top: 20px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

header {
    background-color: #000;
    padding: 1rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
    text-transform: uppercase;
}

nav {
    background-color: rgba(20, 20, 20, 0.8);
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(6px);
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav li {
    margin: 0.3rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.5rem 0.8rem;
    border-radius: 1.25rem;
    transition: background-color 0.3s, color 0.3s;
}

nav a:hover,
nav a.active {
    background-color: var(--primary-color);
    color: #000;
}

/* 键盘焦点样式 */
nav a:focus,
.link-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 0.6rem;
    text-transform: uppercase;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 玻璃拟态卡片样式 */
.link-card {
    background: var(--card-bg-color);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    transition: transform 0.2s ease-out, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.link-card a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-decoration: none;
    z-index: 12;
    display: block;
}

.link-card:hover,
.link-card:focus {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 144, 0, 0.3);
    background: rgba(40, 40, 40, 0.65);
}

.link-card i {
    font-size: 1.8rem;
    margin-bottom: 0.7rem;
    color: var(--primary-color);
    transition: transform 0.2s ease;
    position: relative;
    z-index: 11;
}

.link-card:hover i,
.link-card:focus i {
    transform: scale(1.1);
}

.link-card h3 {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-color);
    line-height: 1.3;
    font-weight: 500;
    max-width: 100%;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    white-space: normal;
    padding: 0 0.3rem;
    position: relative;
    z-index: 11;
}

footer {
    background-color: #000;
    color: #ccc;
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
}

footer nav {
    margin-top: 0.6rem;
    background-color: transparent;
}

footer nav a {
    color: #ccc;
    margin: 0 0.6rem;
    font-size: 0.75rem;
}

/* 移动端优化 */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .link-card {
        padding: 1rem;
        min-height: 90px;
        border-radius: 10px;
    }

    .link-card i {
        font-size: 1.9rem;
    }

    .link-card h3 {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    nav a {
        font-size: 1rem;
        padding: 0.5rem 0.9rem;
    }

    .link-grid {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .link-grid {
        grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
        gap: 0.8rem;
    }

    header h1 {
        font-size: 1.6rem;
    }

    nav a {
        padding: 0.45rem 0.8rem;
        font-size: 0.95rem;
    }
}