/* ==========================================
   全局重置
   ========================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================
   CSS 变量（浅色主题）
   ========================================== */
:root {
    --bg: #F6F7FB;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-header: rgba(255, 255, 255, 0.86);
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: rgba(203, 213, 225, 0.75);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 20px 42px rgba(15, 23, 42, 0.14);
    --radius-card: 14px;
    --transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-main: linear-gradient(135deg, #2563EB 0%, #E11D48 100%);
    --gradient-accent: linear-gradient(135deg, #0EA5E9 0%, #F97316 100%);
}

/* ==========================================
   深色主题
   ========================================== */
body.dark {
    --bg: #0B1120;
    --bg-card: rgba(15, 23, 42, 0.88);
    --bg-header: rgba(15, 23, 42, 0.88);
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: rgba(71, 85, 105, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 10px 24px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 24px 52px rgba(0, 0, 0, 0.44);
}

/* ==========================================
   基础样式
   ========================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    background-color: var(--bg);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 247, 251, 0.88)),
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
        radial-gradient(circle at 92% 16%, rgba(225, 29, 72, 0.10), transparent 30%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
    overflow-x: hidden;
}

body.dark {
    background-image:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.18), transparent 34%),
        radial-gradient(circle at 92% 16%, rgba(225, 29, 72, 0.13), transparent 30%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   背景装饰
   ========================================== */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.18;
    animation: blobFloat 8s ease-in-out infinite alternate;
}

.bg-blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #a78bfa, transparent 70%);
    top: -150px; left: -150px;
    animation-delay: 0s;
}

.bg-blob-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #f472b6, transparent 70%);
    top: 30%; right: -100px;
    animation-delay: 2.5s;
}

.bg-blob-3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #60a5fa, transparent 70%);
    bottom: 100px; left: 20%;
    animation-delay: 5s;
}

body.dark .bg-blob { opacity: 0.10; }

@keyframes blobFloat {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 20px) scale(1.08); }
}

/* ==========================================
   导航栏
   ========================================== */
header {
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition), box-shadow 0.3s, padding-bottom 0.3s;
}

header.scrolled {
    box-shadow: var(--shadow-md);
    background: var(--bg-header);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* 左侧：Logo + 汉堡 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hamburger {
    display: none;
    width: 36px; height: 36px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-card);
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    align-items: center; justify-content: center;
    transition: var(--transition);
}
.hamburger:hover { color: #2563EB; border-color: rgba(37, 99, 235, 0.28); }

/* 右侧：时间 + 主题 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-clock {
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    text-decoration: none;
}

.logo-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: var(--gradient-main);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* 导航链接 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.10);
    color: #2563EB;
}

/* 主题切换按钮 */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   移动端下拉菜单
   ========================================== */
.mobile-menu {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}
.mobile-menu.open {
    display: block;
    max-height: 300px;
    opacity: 1;
    padding: 8px 20px 16px;
}
.mobile-menu-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}
.mobile-menu-item:hover { background: rgba(37, 99, 235, 0.08); color: #2563EB; }

/* ==========================================
   主内容
   ========================================== */
main {
    flex: 1;
    padding: 36px 0 60px;
    position: relative;
    z-index: 1;
}

/* ==========================================
   Hero 区
   ========================================== */
.hero {
    text-align: center;
    margin-bottom: 44px;
    animation: fadeInUp 0.7s ease both;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    font-size: 13px;
    color: #6366F1;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0;
}

.hero h1 {
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 14px;
    letter-spacing: 0;
    color: var(--text-primary);
}

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

.divider {
    width: 48px;
    height: 3px;
    background: var(--gradient-main);
    margin: 22px auto 0;
    border-radius: 4px;
}

/* ==========================================
   分区
   ========================================== */
.card-section {
    margin-bottom: 36px;
    scroll-margin-top: 82px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.tag-blue  { background: rgba(59, 130, 246, 0.12);  color: #3B82F6; }
.tag-green { background: rgba(16, 185, 129, 0.12);  color: #10B981; }
.tag-pink  { background: rgba(236, 72, 153, 0.12);  color: #EC4899; }

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================
   卡片网格
   ========================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

/* ==========================================
   卡片
   ========================================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-card);
    padding: 16px 46px 16px 16px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.26);
}

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

/* 卡片入场动画 — 使用 animation 而非 opacity:0 初始态
   即使 JS 不执行，卡片也会正常显示 */
.card-animate {
    animation: cardIn 0.5s ease both;
}

.card-animate.visible {
    animation: none;
    opacity: 1;
    transform: translateY(0);
}

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

/* 精选卡片 */
.card-featured {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, var(--bg-card), rgba(254, 243, 199, 0.3));
}

body.dark .card-featured {
    background: linear-gradient(135deg, var(--bg-card), rgba(120, 80, 10, 0.15));
}

.card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.card:hover .card-icon { transform: scale(1.04); }

.card-icon-img {
    padding: 6px;
}

.card-icon-img img {
    width: 32px; height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.card-body {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-word;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-word;
}

.card-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    bottom: auto;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    transform: translateY(-50%);
}

.card:hover .card-arrow {
    background: rgba(37, 99, 235, 0.14);
    color: #2563EB;
    transform: translate(2px, -50%);
}

/* 角标 */
.card-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.badge-purple { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.badge-red    { background: rgba(239, 68, 68, 0.12);  color: #EF4444; }
.badge-green  { background: rgba(16, 185, 129, 0.12); color: #10B981; }
.badge-gold   { background: rgba(245, 158, 11, 0.15); color: #D97706; }

/* ==========================================
   页脚
   ========================================== */
footer {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 18px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: #2563EB; }

.copyright {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .hero { margin-bottom: 34px; }
    .hero h1 { font-size: 1.9rem; }
    .hero p { font-size: 0.96rem; }
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    main { padding: 28px 0 48px; }
    .search-section { margin-top: 18px; padding: 8px; }
    .search-button { padding: 11px 16px; }
    .card { padding: 14px 14px 42px; flex-direction: column; align-items: flex-start; min-height: 150px; }
    .card-arrow { top: auto; bottom: 14px; transform: none; }
    .card:hover .card-arrow { transform: translateX(2px); }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; line-height: 1.35; }
    .hero-badge { margin-bottom: 12px; }
    .divider { margin-top: 18px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card { padding: 14px; min-height: 136px; }
    .card-icon { width: 44px; height: 44px; font-size: 21px; }
    .card-title { font-size: 13px; }
    .card-subtitle { font-size: 11px; }
    .card-arrow { display: none; }
    .nav-clock { display: none; }
    .logo { font-size: 16px; gap: 8px; }
    .logo-icon { width: 34px; height: 34px; }
    .theme-toggle, .hamburger { width: 34px; height: 34px; }
    .search-form { gap: 6px; }
    .search-input { padding: 11px 12px; }
    .search-button { padding: 11px 12px; font-size: 14px; }
}

/* 搜索框 */
.search-section {
    max-width: 620px;
    margin: 24px auto 0;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    animation: fadeInUp 0.6s ease 0.3s both;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    transition: border-color 0.25s, background-color 0.25s;
}

.search-input:focus {
    border-color: rgba(37, 99, 235, 0.38);
    background: rgba(37, 99, 235, 0.04);
}

.search-button {
    padding: 12px 22px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
    transition: transform 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}

.search-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

/* 搜索清除按钮 */
.search-clear {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.search-clear:hover { color: #EF4444; background: rgba(239,68,68,0.08); }

/* 搜索提示 */
.search-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    min-height: 16px;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    animation: fadeInUp 0.3s ease both;
}
.no-results-emoji { font-size: 48px; margin-bottom: 12px; }
.no-results p { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.no-results span { font-size: 13px; color: var(--text-muted); }

/* ==========================================
   波纹效果
   ========================================== */
.ripple {
    position: absolute;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.14);
    transform: translate(-50%, -50%) scale(0);
    animation: rippleAnim 0.6s linear forwards;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* ==========================================
   回到顶部
   ========================================== */
.back-to-top {
    position: fixed;
    right: 24px; bottom: 24px;
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #2563EB;
    color: white;
    border-color: transparent;
    transform: translateY(-2px) !important;
}
