:root {
    --bg-color: #09090b;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent-color: #ec4899;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --header-height: 70px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 25%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Header */
.navbar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-auth {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.nav-item {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
}

.nav-btn {
    padding: 8px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 0 25px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    margin-left: auto; /* Push to right if needed, but flex handles it */
    margin-right: 15px;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 60px;
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Search Bar */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 50px;
}

.search-input {
    width: 100%;
    padding: 18px 25px;
    padding-left: 50px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 2;
}

/* Announcement */
.announcement-box {
    display: inline-flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    margin-bottom: 40px;
    max-width: 90%;
    text-align: left;
}

.announcement-icon {
    color: var(--primary-color);
    display: flex;
    margin-top: 3px;
    flex-shrink: 0;
}

.announcement-content {
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.announcement-item {
    line-height: 1.6;
}

.announcement-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 8px;
    white-space: nowrap;
}

/* Text Ads */
.text-ads-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.text-ad-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.text-ad-item:hover {
    border-color: var(--ad-color, var(--primary-color));
    color: var(--text-main);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.text-ad-item .mdi {
    color: var(--ad-color, var(--primary-color));
}

/* Main Content */
.main-content {
    padding: 40px 0 80px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--gradient-main);
    border-radius: 2px;
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.cat-tag {
    padding: 8px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cat-tag:hover, .cat-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* API Grid */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.api-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.api-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

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

.api-card.is-hot {
    border-color: rgba(244, 63, 94, 0.5);
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.03), rgba(244, 63, 94, 0.05));
}

.api-card.is-hot:hover {
    border-color: #f43f5e;
    box-shadow: 0 10px 30px -10px rgba(244, 63, 94, 0.3);
}

.api-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.api-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.api-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tag-public { background: rgba(99, 102, 241, 0.15); color: var(--primary-color); }
.tag-paid { background: rgba(236, 72, 153, 0.15); color: var(--accent-color); }
.tag-key { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.tag-hot { 
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 16px 0 16px 0;
    padding: 6px 16px;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); 
    color: white; 
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.4); 
    border: none; 
    z-index: 10;
}

/* 火爆卡片调整内边距，防止标签遮挡内容 */
.api-card.is-hot {
    padding-top: 45px;
}

.api-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 24px;
}

.api-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-normal { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.status-error { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-maintenance { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.status-deprecated { background: rgba(107, 114, 128, 0.1); color: #6b7280; }

.api-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.api-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.api-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.api-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.api-btn:hover {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Footer */
.footer {
    background: #050506;
    border-top: 1px solid var(--card-border);
    padding: 80px 0 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    background: var(--gradient-main);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links {
    display: contents;
}

.link-group h4 {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: var(--text-main);
}

.link-group a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.link-group a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-declaration {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--card-border);
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        padding: 0 15px;
        position: relative; /* For absolute positioning of menu */
    }
    
    .mobile-menu-btn {
        display: block;
        order: 1;
        margin-left: 0;
        margin-right: 10px;
    }

    .nav-auth {
        order: 3;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(9, 9, 11, 0.95);
        backdrop-filter: blur(15px);
        padding: 20px;
        flex-direction: column;
        border-bottom: 1px solid var(--card-border);
        animation: slideDown 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .nav-brand {
        font-size: 1.2rem;
        order: 2;
        margin-right: auto;
    }

    .nav-brand img {
        display: none;
    }

    .nav-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
    
    .hero {
        padding: 80px 0 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .search-wrapper {
        width: 80%;
        margin: 0 auto 30px auto;
    }

    .search-input {
        padding: 12px 15px;
        padding-left: 42px;
        font-size: 0.9rem;
    }
    
    .search-icon {
        left: 14px;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-brand p {
        margin: 0 auto;
    }
}

/* Fix Layui Popup Visibility - Ensure text is dark on white backgrounds */
.layui-layer {
    color: #333 !important;
}
.layui-layer-content {
    color: #333 !important;
}
.layui-layer-title {
    color: #333 !important;
    border-bottom-color: #eee !important;
}
.layui-layer-btn .layui-layer-btn0 {
    border-color: var(--primary-color) !important;
    background-color: var(--primary-color) !important;
    color: #fff !important;
}
.layui-layer-btn .layui-layer-btn1 {
    border-color: #dedede !important;
    background-color: #fff !important;
    color: #333 !important;
}
