/* =========================================
   Nebula Theme Variables (星云主题变量)
   ========================================= */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --bg-day: #f8fafc;
    --bg-night: #0f172a;
    --card-bg-day: rgba(255, 255, 255, 0.7);
    --card-bg-night: rgba(30, 41, 59, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px -10px rgba(99, 102, 241, 0.3);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* 全局字体与背景 */
body,
html {
    font-size: 14px;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-day);
}

body {
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
}

/* 覆盖默认的网格背景 */
.io-grey-mode .page-container .grid-bg {
    background: transparent;
}


/* =========================================
   UI Components Overrides
   ========================================= */

/* 1. 网址卡片 (Card) - 毛玻璃风格 */
.url-card .url-body {
    background: var(--card-bg-day);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 2px;
    /* Slight padding for inner content */
}

/* 卡片悬停效果 */
.url-card .url-body:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.9);
}

/* 卡片内容微调 */
.url-card .card-body {
    padding: 1rem;
}

.url-card .url-info strong {
    color: #334155;
    font-weight: 600;
    font-size: 15px;
}

.url-card .url-info .text-muted {
    color: var(--text-muted);
}

/* 2. 侧边栏 (Sidebar) - 悬浮透明 */
.sidebar-nav {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-menu-inner ul li a {
    color: #475569;
    border-radius: 0 50px 50px 0;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.sidebar-menu-inner ul li a:hover,
.sidebar-menu-inner ul li.active a {
    background: linear-gradient(90deg, #eef2ff 0%, white 100%);
    color: #6366f1;
    font-weight: 600;
}

.sidebar-menu-inner ul li a i {
    color: #94a3b8;
}

.sidebar-menu-inner ul li a:hover i {
    color: #6366f1;
}

/* 3. 搜索框 (Search) - 视觉中心 */
.header-big {
    padding-top: 100px;
    padding-bottom: 60px;
}

#search-text {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: 60px;
    padding-left: 30px;
    font-size: 16px;
}

#search button {
    background: var(--primary-gradient);
    border-radius: 50px;
    width: 50px;
    height: 50px;
    top: 5px;
    right: 5px;
    margin: 0;
    transition: transform 0.2s;
}

#search button:hover {
    transform: scale(1.05);
    background: var(--primary-gradient);
}


/* 4. 分类标题 (Headers) */
h4.text-gray {
    color: #f8fafc !important;
    /* Force white/light text on the dark background */
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem !important;
    padding-left: 10px;
    border-left: 4px solid #8b5cf6;
    display: flex;
    align-items: center;
}

h4.text-gray i {
    color: #a78bfa;
    margin-right: 10px;
}

/* 5. 顶部导航 (Navbar) */
.navbar-expand-md {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

/* Night Mode Adaptations */
.io-black-mode .url-card .url-body {
    background: var(--card-bg-night);
    border-color: rgba(255, 255, 255, 0.1);
}

.io-black-mode .url-card .url-info strong {
    color: #e2e8f0;
}

.io-black-mode .sidebar-nav {
    background: rgba(15, 23, 42, 0.9) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.io-black-mode .sidebar-menu-inner ul li a {
    color: #94a3b8;
}

.io-black-mode .sidebar-menu-inner ul li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #a78bfa;
}

/* Remove original scrollbar hack if it conflicts */
.sidebar-menu.flex-fill::-webkit-scrollbar {
    width: 4px;
}

/* Footer clean up */
footer.main-footer {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    color: #cbd5e1;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .sidebar-nav {
        background: #fff !important;
        /* Mobile menu needs solid bg */
    }
}

/* =========================================
   Logo Styling
   ========================================= */
.nebula-logo-icon {
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.nebula-logo-text {
    font-size: 18px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.5;
    /* Changed to 1.5 as requested */
    /* Align with icon height */
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.logo-expanded {
    display: flex !important;
    align-items: center;
    padding: 0 15px;
    text-decoration: none !important;
    height: 100%;
}

/* Night mode adjustment for logo text if needed, but gradient usually works on dark too.
   If contrast is low, we might need a backup color. */
.io-black-mode .nebula-logo-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}