/* assets/css/style.css - 首页优化版 */

/* --- 全局变量 --- */
:root {
    --primary: #ff9a9e;
    --primary-hover: #ff758c;
    --accent: #a18cd1;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.9);
    --text-main: #2d3436;
    --radius: 16px;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    /* 默认背景，如果开启 Bing 会被覆盖 */
    background: url('https://images.unsplash.com/photo-1516542076529-1ea3854896f2?q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 背景遮罩 */
body::after {
    content: ''; position: fixed; inset: 0;
    background: linear-gradient(to bottom, rgba(255,240,245,0.2), rgba(162,210,255,0.2));
    z-index: -1; pointer-events: none;
    backdrop-filter: blur(3px);
}

/* --- 导航栏 --- */
header {
    padding: 15px 5%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.logo {
    font-family: 'Fredoka One', cursive; font-size: 24px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-decoration: none;
}
nav ul { list-style: none; display: flex; gap: 20px; align-items: center; margin: 0; padding: 0; }
nav a { text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 15px; transition: 0.3s; display: flex; align-items: center; gap: 5px; }
nav a:hover { color: var(--primary); }

/* 用户区 */
.nav-user-area { display: flex; gap: 10px; align-items: center; border-left: 2px solid #eee; padding-left: 20px; margin-left: 10px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); object-fit: cover; }
.btn-login { padding: 6px 15px; border: 1px solid var(--primary); border-radius: 20px; color: var(--primary); font-size: 13px; text-decoration: none; }
.btn-reg { padding: 6px 15px; background: var(--primary); border-radius: 20px; color: white; font-size: 13px; text-decoration: none; }
.btn-logout { color: #ff7675; font-size: 13px; text-decoration: none; }

/* --- Hero 区域 --- */
.hero { text-align: center; padding: 80px 20px 60px; animation: floatIn 0.8s ease-out; }
.hero .avatar { width: 110px; height: 110px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.9); object-fit: cover; margin-bottom: 15px; transition: 0.5s; box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.hero .avatar:hover { transform: rotate(15deg) scale(1.1); }
.hero h1 { font-size: 2.2rem; color: #fff; text-shadow: 0 4px 10px rgba(0,0,0,0.2); margin-bottom: 10px; }
.hero p { background: rgba(255,255,255,0.3); padding: 6px 20px; border-radius: 50px; color: #fff; backdrop-filter: blur(5px); display: inline-block; font-size: 15px; }

/* --- 信息栏 (优化重点) --- */
.info-bar {
    max-width: 900px; /* 稍微收窄，更聚拢 */
    margin: -40px auto 40px; 
    padding: 0 20px;
    display: grid; 
    grid-template-columns: 1fr 1fr; /* PC端两列等分 */
    gap: 25px;
    position: relative; z-index: 10;
}

.info-widget {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: var(--radius); 
    padding: 20px 30px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    transition: 0.3s;
}
.info-widget:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }

.widget-icon {
    width: 54px; height: 54px; border-radius: 50%;
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.widget-text h4 { margin: 0 0 4px 0; font-size: 13px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.widget-text div { font-weight: 800; font-size: 18px; color: #2d3436; font-family: 'Fredoka One', sans-serif; }

/* --- 卡片通用 --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 30px; width: 100%; }
.card { background: var(--glass-bg); border: var(--glass-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: 0.4s; height: 100%; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.03); }
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(255, 154, 158, 0.2); border-color: #fff; }
.card-img-wrap { aspect-ratio: 16/9; overflow: hidden; position: relative; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s; }
.card:hover .card-img { transform: scale(1.08); }
.card-content { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.card h3 { margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333; font-size: 18px; }
.card p { font-size: 14px; color: #666; line-height: 1.6; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-grow: 1; }
.btn-card { display: block; text-align: center; padding: 12px; background: linear-gradient(to right, var(--primary), #fad0c4); color: white; text-decoration: none; border-radius: 10px; margin-top: auto; font-weight: bold; transition: 0.3s; box-shadow: 0 4px 10px rgba(255,154,158,0.3); }
.btn-card:hover { opacity: 0.95; transform: translateY(-2px); }

/* 页脚 & 动画 */
footer { text-align: center; padding: 40px; color: rgba(255,255,255,0.9); font-size: 13px; margin-top: auto; }
@keyframes floatIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- 移动端深度适配 --- */
@media (max-width: 768px) {
    /* 导航 */
    header { padding: 15px 20px; flex-direction: column; gap: 15px; }
    nav ul { flex-wrap: wrap; justify-content: center; gap: 15px; }
    .nav-user-area { margin: 0; padding: 0; border: none; width: 100%; justify-content: center; margin-top: 5px; }

    /* Hero */
    .hero { padding: 60px 20px 40px; }
    .hero h1 { font-size: 1.8rem; }

    /* 信息栏 (改为紧凑网格) */
    .info-bar {
        grid-template-columns: 1fr 1fr; /* 强制一行两个 */
        gap: 15px;
        padding: 0 15px;
        margin-top: -20px;
    }
    
    .info-widget {
        flex-direction: column; /* 图标在文字上方 */
        text-align: center;
        padding: 15px 10px;
        gap: 10px;
    }
    
    .widget-icon { width: 45px; height: 45px; font-size: 20px; margin: 0 auto; }
    .widget-text h4 { font-size: 12px; margin-bottom: 2px; }
    .widget-text div { font-size: 14px; }

    /* 卡片 */
    .container { padding: 0 15px 60px; grid-template-columns: 1fr; gap: 20px; }
}