html, body {
    width: 100vw;
    max-width: 430px;
    min-width: 320px;
    margin: 0 auto;
    overflow-x: hidden;
    padding: 0;
    background: linear-gradient(-45deg, #f8f9fa, #e8f5e8, #dda0dd, #ffe4e1, #f0f8ff, #f5f5dc);
    background-size: 400% 400%;
    animation: gradientShift 20s ease-in-out infinite;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    /* 性能优化 */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    20% {
        background-position: 50% 0%;
    }
    40% {
        background-position: 100% 50%;
    }
    60% {
        background-position: 50% 100%;
    }
    80% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before {
    content: "";
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    background: rgba(255,255,255,0.15); /* 降低透明度，让梦幻背景更明显 */
    pointer-events: none;
    z-index: 0;
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 添加梦幻气泡效果 */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(221, 160, 221, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 228, 225, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(232, 245, 232, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(240, 248, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bubbleFloat 25s ease-in-out infinite;
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-15px) rotate(0.5deg) scale(1.05);
    }
    50% {
        transform: translateY(8px) rotate(-0.5deg) scale(0.95);
    }
    75% {
        transform: translateY(-8px) rotate(0.3deg) scale(1.02);
    }
}
.container, .glass-card, .bottom-nav {
    position: relative;
    z-index: 1;
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
.glass-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.25);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.3);
    margin: 10px 10px;
    padding: 10px 14px 10px 12px;
    transition: all 0.3s ease;
    max-width: 420px;
    will-change: transform;
    position: relative;
    overflow: hidden;
    /* 硬件加速 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.glass-card:hover::before {
    left: 100%;
}
.glass-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1.5px solid rgba(255,255,255,0.5);
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
}
.card-info {
    flex: 1;
    min-width: 0;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.card-desc {
    font-size: 13px;
    color: #3a5a6e;
    font-family: 'PingFang SC', 'HarmonyOS_Regular', 'Microsoft YaHei', Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.glass-btn {
    background: rgba(255,255,255,0.35);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 16px;
    padding: 5px 14px;
    color: #4a5568;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    outline: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
.glass-btn:hover {
    background: rgba(255,255,255,0.5);
    color: #2d3748;
    border: 1px solid rgba(255,255,255,0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 10px;
    width: fit-content;
    height: 58px;
    margin: 0 auto;
    background: rgba(255,255,255,0.4);
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.04), 0 0 0 0 rgba(78,252,179,0.08), 0 0 4px 1px rgba(78,252,179,0.08);
    border-radius: 28px;
    border-top: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 100;
    transition: box-shadow 0.2s, background 0.2s;
    overflow: visible;
    animation: nav-glow 2.5s infinite alternate;
    padding: 0 16px;
    will-change: auto;
}
@keyframes nav-glow {
    0% {
        box-shadow: 0 2px 8px 0 rgba(0,0,0,0.04), 0 0 0 0 rgba(78,252,179,0.08), 0 0 4px 1px rgba(78,252,179,0.08);
    }
    100% {
        box-shadow: 0 2px 8px 0 rgba(0,0,0,0.04), 0 0 0 1px rgba(78,252,179,0.10), 0 0 6px 2px rgba(78,252,179,0.10);
    }
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0;
    text-decoration: none;
    padding: 0;
    transition: color 0.2s;
}
.nav-item.active {
    color: #007aff;
}
.nav-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.18);
}
@media (max-width: 520px) {
    .container, .bottom-nav {
        max-width: 100vw;
    }
    .bottom-nav {
        left: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }
}
@media (prefers-color-scheme: dark) {
  body::before {
    background: rgba(30,34,38,0.25); /* 暗色模式下用浅灰色半透明 */
  }
  body {
    background: #181c1f url("/img/bj.jpeg") center center no-repeat;
    background-size: cover;
    color: #eaeaea;
  }
  .glass-card {
    background: rgba(30, 34, 38, 0.38);
    border: 1.5px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 12px rgba(0,0,0,0.20);
  }
  .card-title, .card-desc {
    color: #eaeaea;
    text-shadow: 0 1px 2px rgba(0,0,0,0.20);
  }
  .glass-btn {
    background: rgba(40,40,40,0.22);
    color: #90c8ff;
    border: 1.5px solid rgba(255,255,255,0.18);
  }
  .glass-btn:hover {
    background: rgba(60,60,60,0.38);
    color: #2196f3;
    border: 1.5px solid #90caf9;
  }
  .nav-icon, .card-icon {
    border: 1.5px solid rgba(255,255,255,0.18);
    background: #23272b;
  }
  .card-desc {
    color: #b3d1e7;
  }
}
/* 去除底栏图标点击/聚焦时的高亮和复选框效果 */
.nav-item:focus, .nav-item:active, .nav-icon:focus, .nav-icon:active,
.nav-item:focus-visible, .nav-item:focus-within {
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
    border-color: inherit !important;
}

/* 搜索框样式 */
.search-container {
    position: sticky;
    top: 10px;
    z-index: 10;
    margin: 10px 10px 5px 10px;
    /* max-width: 420px; */
    /* margin-left: auto; */
    /* margin-right: auto; */
}

.search-box {
    width: 100%;
    background: rgba(255,255,255,0.35);
    border: 1.5px solid rgba(255,255,255,0.45);
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 14px;
    color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.search-box::placeholder {
    color: #666;
    opacity: 0.8;
}

.search-box:focus {
    background: rgba(255,255,255,0.45);
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 3px 12px rgba(0,0,0,0.10);
}

.search-box:focus::placeholder {
    opacity: 0.6;
}

/* 搜索结果高亮 */
.glass-card.highlight {
    background: rgba(255,255,255,0.35);
    border: 1.5px solid rgba(255,255,255,0.55);
    box-shadow: 0 3px 16px rgba(0,0,0,0.12);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.glass-card.highlight .card-title {
    color: #007aff;
    text-shadow: 0 1px 2px rgba(0,122,255,0.15);
}

.glass-card.hidden {
    display: none;
}

/* 搜索统计 */
.search-stats {
    text-align: center;
    margin: 6px 10px 8px 10px;
    font-size: 12px;
    color: #666;
    opacity: 0.8;
}

/* 暗黑模式下的搜索框 */
@media (prefers-color-scheme: dark) {
    .search-box {
        background: rgba(30, 34, 38, 0.45);
        border: 1.5px solid rgba(255,255,255,0.18);
        color: #eaeaea;
    }
    
    .search-box::placeholder {
        color: #b3d1e7;
    }
    
    .search-box:focus {
        background: rgba(30, 34, 38, 0.55);
        border-color: rgba(255,255,255,0.25);
    }
    
    .glass-card.highlight {
        background: rgba(30, 34, 38, 0.45);
        border: 1.5px solid rgba(255,255,255,0.25);
    }
    
    .glass-card.highlight .card-title {
        color: #90c8ff;
    }
    
    .search-stats {
        color: #b3d1e7;
    }
}

/* 主标题样式 */
.main-title {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    color: rgba(34, 34, 34, 0.72);
    margin: 18px 10px 8px 10px;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    letter-spacing: 0.08em;
    /* 梦幻风格文字效果 */
    text-shadow:
        0 1px 4px rgba(255,255,255,0.4), /* 高光 */
        0 1px 3px rgba(0,0,0,0.08),       /* 轻微阴影 */
        0 0 12px rgba(102, 126, 234, 0.3),  /* 紫色光晕 */
        0 0 20px rgba(240, 147, 251, 0.2);  /* 粉色光晕 */
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    transition: color 0.2s, text-shadow 0.2s;
    margin-bottom: 24px; /* 控制下方空白距离 */
    animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow:
            0 1px 4px rgba(255,255,255,0.4),
            0 1px 3px rgba(0,0,0,0.08),
            0 0 12px rgba(102, 126, 234, 0.3),
            0 0 20px rgba(240, 147, 251, 0.2);
    }
    100% {
        text-shadow:
            0 1px 4px rgba(255,255,255,0.4),
            0 1px 3px rgba(0,0,0,0.08),
            0 0 15px rgba(102, 126, 234, 0.5),
            0 0 25px rgba(240, 147, 251, 0.4);
    }
}

@media (prefers-color-scheme: dark) {
    .main-title {
        color: rgba(234, 234, 234, 0.82);
        text-shadow:
            0 1px 4px rgba(255,255,255,0.18),
            0 1px 3px rgba(0,0,0,0.22),
            0 0 8px rgba(120,180,255,0.13);
    }
}

#card-list {
    position: static !important;
    height: auto !important;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    padding-bottom: 0px;
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    /* 硬件加速 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 优化滚动 */
    -webkit-overflow-scrolling: touch;
}

/* 只针对随机卡组的卡片，保证宽度和静态卡片一致 */
#card-list .glass-card {
    max-width: 420px;
    margin: 10px 10px;
    box-sizing: border-box;
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
} 
.container {

    padding-bottom: 70px; /* 防止底栏遮挡内容 */
}

