/* ===== 简洁主题配色 ===== */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #66a6ff 0%, #89f7fe 100%);
    --sidebar-bg: rgba(255, 255, 255, 0.15);
    --card-bg: rgba(255, 255, 255, 0.75);
    --text-primary: #1f2937;
    --text-secondary: #646b78;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
}

/* ===== 顶部搜索和时间区域 ===== */
.top-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
    animation: fadeInDown 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 20px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    background: white;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    position: absolute;
    right: 8px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.time-display {
    text-align: right;
    margin-left: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.time {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== 侧边栏样式 ===== */
.sidebar {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 1rem;
    }
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-item {
    display: block;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-color: transparent;
}

.nav-item.active:hover {
    background: var(--primary-hover);
    transform: none;
}

/* ===== 链接卡片网格 ===== */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 搜索结果区域 ===== */
.search-results {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
    animation: fadeIn 0.3s ease;
}

.no-results {
    width: 100%;
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* ===== 链接卡片 ===== */
.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px 10px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 8px;
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(137, 247, 254, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(79, 70, 229, 0.2);
}

.link-card:active {
    transform: translateY(-2px);
}

.link-category {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.link-img-container {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(233, 236, 239, 0.8) 100%);
    border-radius: 12px;
    padding: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.link-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.link-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
    letter-spacing: -0.01em;
}

/* ===== 响应式优化 ===== */
@media (max-width: 991px) {
    .sidebar {
        position: static !important;
        margin-bottom: 24px;
        max-height: none;
        overflow-y: visible;
    }

    .sidebar-title {
        font-size: 16px;
    }

    /* 移动端导航按钮 */
    .mobile-nav-toggle {
        display: block;
        margin-bottom: 16px;
    }

    .top-section {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .search-container {
        max-width: 100%;
    }

    .time-display {
        margin-left: 0;
        text-align: center;
    }
}

@media (max-width: 575px) {
    body {
        background: var(--bg-gradient);
    }

    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .sidebar {
        padding: 12px;
    }

    .sidebar-title {
        font-size: 15px;
    }

    .nav-item {
        padding: 10px 12px;
        font-size: 14px;
    }

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

    .link-img-container {
        width: 42px;
        height: 42px;
        margin-bottom: 8px;
    }

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

    .top-section {
        padding: 12px;
        margin-bottom: 16px;
    }

    .time {
        font-size: 24px;
    }

    .date {
        font-size: 12px;
    }

    .search-input {
        padding: 10px 40px 10px 16px;
        font-size: 14px;
    }

    /* 移动端隐藏滚动条 */
    .sidebar::-webkit-scrollbar {
        display: none;
    }
}