/* --- 全局和基础样式 --- */
:root {
    --bg-color: #121212;
    --card-color: rgba(26, 26, 26, 0.85);
    --text-color: #e0e0e0;
    --subtle-text-color: #a0a0a0;
    --glow-color: rgba(255, 255, 255, 0.1);
    --border-color: #333;
}

body {
    background-color: var(--bg-color);
    margin: 0;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-image:
        radial-gradient(ellipse 40% 60% at 30% 40%, #222 15%, transparent 15.5%),
        radial-gradient(circle at 20% 15%, #222 4%, transparent 4.5%),
        radial-gradient(circle at 28% 10%, #222 3%, transparent 3.5%),
        radial-gradient(circle at 38% 9%, #222 2.5%, transparent 3%),
        radial-gradient(circle at 48% 11%, #222 2%, transparent 2.5%),
        radial-gradient(circle at 56% 15%, #222 1.5%, transparent 2%),
        radial-gradient(ellipse 40% 60% at 80% 70%, #222 15%, transparent 15.5%),
        radial-gradient(circle at 90% 85%, #222 4%, transparent 4.5%),
        radial-gradient(circle at 82% 90%, #222 3%, transparent 3.5%),
        radial-gradient(circle at 72% 91%, #222 2.5%, transparent 3%),
        radial-gradient(circle at 62% 89%, #222 2%, transparent 2.5%),
        radial-gradient(circle at 54% 85%, #222 1.5%, transparent 2%);
    background-size: 500px 500px;
}

.container {
    max-width: 1600px;
    width: 90%;
    margin: 40px auto;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    margin-bottom: 50px;
    font-family: "Yusei Magic", sans-serif;
    font-size: 4.5em;
    font-weight: 400;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

/* --- 幻灯片样式 (暗黑主题) --- */
.slideshow-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 50px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000; /* 默认黑色背景 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.slide-item {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-color: #000; /* 新增：为每个slide项目添加背景色 */
    z-index: 1; /* 新增：确保slide在底层 */
}

.slide-item img {
    width: 100%; height: 100%; object-fit: cover;
}

.slide-item.active {
    opacity: 1; 
    z-index: 2; /* 新增：让激活的slide在最上层，防止被其他slide遮挡 */
}

.slide-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 45px; height: 45px;
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 22px; cursor: pointer; 
    z-index: 10; /* 确保箭头在最上层 */
    transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center;
}
.slide-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}
.prev-arrow { left: 20px; }
.next-arrow { right: 20px; }

.slide-dots {
    position: absolute; bottom: 20px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 12px; z-index: 10;
}

.dot {
    width: 12px; height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
    font-size: 0;
}
.dot:hover { background-color: rgba(255, 255, 255, 0.7); }
.dot.active { background-color: #fff; transform: scale(1.2); }


/* --- 网格与卡片布局 --- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px; width: 100%; }
.item-card { background: var(--card-color); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4); transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; }
.item-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--glow-color); border-color: rgba(255, 255, 255, 0.2); }
.image-link { display: block; text-decoration: none; }
.item-image-wrapper { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; position: relative; background-color: #000; }
.item-image { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.item-card:hover .item-image { transform: scale(1.05); }
.item-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.description-link { text-decoration: none; color: inherit; display: block; flex-grow: 1; }
.item-description { font-size: 1rem; line-height: 1.6; color: var(--text-color); margin: 0 0 20px 0; font-weight: 300; }
.item-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tag { font-size: 0.75rem; background: rgba(255, 255, 255, 0.05); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-color); color: var(--subtle-text-color); text-decoration: none; transition: all 0.3s ease; }
.tag:hover { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.3); }

/* --- 返回顶部按钮 --- */
.back-to-top { position: fixed; bottom: 30px; right: 30px; background-color: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: white; width: 45px; height: 45px; text-align: center; line-height: 45px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); font-size: 20px; text-decoration: none; transition: all 0.3s ease; z-index: 999; }
.back-to-top:hover { background-color: rgba(255, 255, 255, 0.2); transform: scale(1.1); }

/* --- 筛选容器与按钮 --- */
.filter-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 60px; }
.filter-btn { font-family: 'Noto Sans SC', sans-serif; font-size: 1.1rem; font-weight: 400; color: var(--subtle-text-color); background-color: transparent; border: 1px solid var(--border-color); padding: 14px 28px; border-radius: 30px; cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.filter-btn:hover { background-color: rgba(255, 255, 255, 0.05); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.filter-btn.active { background-color: var(--glow-color); color: #fff; border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }

/* --- 移动端优化 --- */
@media (max-width: 768px) {
    .container {
        width: 95%;
        margin: 20px auto;
    }
    h1 {
        font-size: 2.5em;
        margin-bottom: 30px;
    }
    .item-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* === 新增：为用户名过长的情况添加省略号处理 === */
    #user-info {
        max-width: 150px; /* 限制最大宽度 */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block; /* 确保 max-width 生效 */
        box-sizing: border-box;
    }

    #username-display, #usertype-display {
        display: inline; /* 确保它们在同一行 */
    }
}