/* =========================================
   1. 基础重置与通用变量
   ========================================= */
:root {
    --primary-color: #4a90e2;    /* 遇见学习 主题蓝 */
    --accent-color: #f5a623;     /* 强调橙色 */
    --text-dark: #333;
    --text-light: #666;
    --bg-gray: #f8f9fa;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 保证 padding 不撑开盒子 */
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-gray);
}
nav ul {
    list-style: none;      /* 移除列表圆点 */
    margin: 0;
    padding: 0;
    display: flex;         /* 关键：让列表项横向排列 */
    align-items: center;   /* 垂直居中 */
    gap: 15px;             /* 按钮之间的间距，代替 margin 更方便 */
}


nav ul li a {
    text-decoration: none; /* 移除下划线 */
    color: #333;           /* 文字颜色 */
    background-color: #f0f2f5; /* 浅灰色背景，类似你图中的样式 */
    padding: 8px 16px;     /* 内边距：控制按钮的大小 */
    border-radius: 4px;    /* 圆角 */
    display: inline-block; /* 关键：让 padding 和宽高生效 */
    white-space: nowrap;   /* 关键：强制文字不换行，防止变成长条状 */
    transition: background-color 0.3s; /* 增加鼠标悬停过渡动画 */
}

/* 鼠标悬停效果 */
nav ul li a:hover {
    background-color: #e2e8f0;
    color: #007bff;
}
img { max-width: 100%; border-radius: 8px; }
hr { border: 0; height: 1px; background: #eee; margin: 20px 0; }

/* =========================================
   2. 头部导航 (Header)
   ========================================= */
header {
    background: var(--white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1 {
    font-size: 1.4rem;
    color: var(--primary-color);
}
.logo p {
    font-size: 0.8rem;
    color: var(--text-light);
}

nav ul {
    display: flex;
    gap: 20px;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* =========================================
   导航栏右侧登录注册按钮
   ========================================= */
.user-auth {
    display: flex;
    align-items: center;
    gap: 12px; /* 两个按钮之间的间距 */
}

/* 共有基础样式 */
.auth-link {
    text-decoration: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px; /* 圆角 */
    transition: all 0.3s ease; /* 平滑过渡动画 */
    display: inline-block;
}

/* 登录按钮：幽灵按钮风格 (Ghost Button) */
.login-btn {
    color: #4a90e2;
    border: 1px solid #4a90e2;
    background-color: transparent;
}

.login-btn:hover {
    background-color: rgba(74, 144, 226, 0.05); /* 淡淡的蓝色背景反馈 */
    transform: translateY(-1px); /* 向上微动 */
}

/* 注册按钮：实色按钮风格 (Solid Button) */
.register-btn {
    background-color: #4a90e2;
    color: white;
    border: 1px solid #4a90e2;
    /* 增加一个柔和的阴影 */
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.15);
}

.register-btn:hover {
    background-color: #357abd; /* 悬停颜色深一点 */
    border-color: #357abd;
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.25);
    transform: translateY(-2px); /* 悬停时浮起感 */
}

/* 点击时的按下效果 */
.auth-link:active {
    transform: translateY(0);
    box-shadow: none;
}

/* 手机端适配：如果导航栏太挤，可以稍微缩小按钮 */
@media (max-width: 768px) {
    .auth-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* =========================================
   3. 巨幕区域 (Hero Section)
   ========================================= */
.hero {
    padding: 60px 5%;
    text-align: center;
    background: linear-gradient(rgba(74, 144, 226, 0.1), rgba(255, 255, 255, 0));
}

.hero h2 { font-size: 2rem; margin-bottom: 15px; color: #222; }

.hero form {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.hero input {
    width: 350px;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 30px;
    outline: none;
}

.hero input:focus { border-color: var(--primary-color); }

.hero button {
    padding: 12px 25px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
}

/* =========================================
   4. 分类与笔记网格
   ========================================= */
.categories, .featured-notes, .features {
    padding: 20px 5%;
}

.categories h3, .featured-notes h3, .features h3 {
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.categories ul {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.categories a {
    background: #eef5ff;
    padding: 8px 20px;
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* 笔记列表布局：电脑端一行三个 */
.featured-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.featured-notes h3 { width: 100%; }

.note-card {
    background: var(--white);
    flex: 1 1 calc(33.333% - 20px); /* 电脑端 3 列 */
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.note-card:hover { transform: translateY(-5px); }

.note-card h4 { margin: 12px 0 5px; font-size: 1.1rem; }
.note-card p { color: var(--text-light); font-size: 0.9rem; }

.note-card button {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

/* =========================================
   5. 响应式适配 (核心部分)
   ========================================= */

/*  */

/* 手机端适配 (宽度小于 768px) */
@media (max-width: 768px) {
    header {
        flex-direction: column; /* 导航垂直排列 */
        gap: 15px;
        text-align: center;
    }

    nav ul {
        font-size: 0.85rem;
        gap: 10px;
    }

    .hero h2 { font-size: 1.5rem; }

    .hero form {
        flex-direction: column;
        padding: 0 20px;
    }

    .hero input { width: 100%; }

    .note-card {
        flex: 1 1 100%; /* 手机端一行只占一个 */
    }

    .features {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
}
/* =========================================
   6.微信二维码
   ========================================= */
/* 弹窗遮罩 */
.pay-mask {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); /* 半透明背景 */
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

/* 弹窗主体 */
.pay-popup {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    width: 300px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 10px; right: 10px;
    border: none; background: none;
    font-size: 24px; cursor: pointer; color: #999;
}

/* 二维码容器 */
#qrcode-canvas {
    margin: 20px auto;
    padding: 10px;
    border: 1px solid #eee;
    width: 200px; height: 200px;
}

.price-display { font-size: 18px; font-weight: bold; color: #e91e63; margin: 10px 0; }
.pay-tip { font-size: 14px; color: #666; }

/* 等待动画 */
.loading-dots:after {
    content: ' .';
    animation: dots 1.5s steps(5, end) infinite;
}
@keyframes dots { 0%, 20% { content: ' .'; } 40% { content: ' ..'; } 60% { content: ' ...'; } }


/* =========================================
   7. 页脚 (Footer)
   ========================================= */
footer {
    background: #333;
    color: #d83b3b;
    padding: 40px 5%;
    text-align: center;
    margin-top: 50px;
}

footer ul {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.9rem;
}
footer ul li a {
    color: #9b82f6;

}

footer a:hover { color: var(--white); }



footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #2f2f2f;
    color: #ffffff;
    text-align: center;
    padding: 14px 0;
    z-index: 999;
}

/* 底部链接样式 */
footer a {
    color: #aaaaaa;
    text-decoration: none;
    margin: 0 6px;
}

footer a:hover {
    color: #ffffff;
}

/* 防止页面内容被 footer 遮挡 */
body {
    padding-bottom: 120px; /* 稍大于 footer 实际高度 */
}

/* 为了让付费资料“混”在里面时一眼就能看出来，建议添加以下样式 */
/* 付费块的特殊样式 */
.data-block.premium {
    border: 2px solid #ffca28; /* 金色边框 */
    background-color: #fffdf5;
    position: relative;
    overflow: hidden;
}

/* 价格标签 */
.price-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff5252;
    color: white;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 0 0 0 10px;
    font-weight: bold;
}

/* 搜索框美化建议 */
.search-section {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}