/* 心灵港湾心理咨询中心 - 样式文件 */

/* ===== 基础样式 ===== */
:root {
    --primary: #7B68EE;      /* 柔和紫色 - 主色 */
    --primary-dark: #6A5ACD;
    --primary-light: #9370DB;
    --secondary: #20B2AA;    /* 青绿色 - 辅助色 */
    --accent: #FF6B6B;       /* 珊瑚红 - 强调色 */
    --warm: #F4A460;         /* 暖橙色 */
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #F8F6FC;          /* 浅紫背景 */
    --bg-white: #fff;
    --border: #E8E8E8;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

ul { list-style: none; }

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

/* ===== 头部样式 ===== */
.header {
    background: white;
    box-shadow: 0 2px 20px var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
    color: var(--accent);
}

.nav ul {
    display: flex;
    gap: 35px;
}

.nav a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding: 5px 0;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.nav a:hover,
.nav a.active {
    color: var(--primary);
}

/* Mobile-only nav member links - hidden on desktop */
.nav-member-item {
    display: none;
}

/* 咨询师登录在顶部导航栏隐藏（只保留右上角图标入口） */
.nav ul .nav-counselor-login {
    display: none;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== 右上角会员入口（登录/注册、会员中心、咨询师中心）=====
 * 纯文字链接，不用按钮框：默认灰色，hover 与选中（当前就在会员/咨询师页面）时变主色。 */
.nav-user-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 2px;
    border-radius: 4px;
    transition: color .2s;
}
.nav-user-link i { font-size: 17px; }
.nav-user-link:hover,
.nav-user-link.active {
    color: var(--primary);
}
.nav-user-link.active { font-weight: 600; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

/* ===== 主内容区 ===== */
.main {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* ===== Hero 轮播区 ===== */
.hero {
    position: relative;
    height: 600px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></svg>') repeat;
    background-size: 100px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 40px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hero .btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero .btn-outline {
    border-color: white;
    color: white;
}

.hero .btn-outline:hover {
    background: white;
    color: var(--primary);
}

/* ===== Banner轮播 ===== */
.banner-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.banner-slide.active {
    opacity: 1;
}

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

.banner-content {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    padding: 0 40px;
}

.banner-content h2 {
    font-size: 42px;
    margin-bottom: 15px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 25px;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

/* ===== Banner轮播增强 ===== */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}
.slider-arrow:hover { background: rgba(255,255,255,0.6); color: var(--primary); }
.slider-prev { left: 20px; }
.slider-next { right: 20px; }
.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.slider-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
}
.slider-dot.active { background: white; transform: scale(1.2); }

/* ===== Section样式 ===== */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 36px;
    color: var(--text);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-title p {
    color: var(--text-light);
    font-size: 16px;
    margin-top: 20px;
}

/* ===== 服务卡片 ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    border-radius: var(--radius);
    padding: 35px;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(123, 104, 238, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
}

.service-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
}

.service-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.service-price {
    font-size: 24px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 15px;
}

.service-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: normal;
}

/* ===== 咨询师卡片 ===== */
.counselors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.counselor-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
    transition: var(--transition);
}

.counselor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(123, 104, 238, 0.15);
}

.counselor-photo {
    height: 280px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.counselor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.counselor-photo i {
    font-size: 80px;
    color: white;
}

.counselor-info {
    padding: 25px;
    text-align: center;
}

.counselor-info h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.counselor-title {
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 10px;
}

.counselor-specialty {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.counselor-specialty span {
    background: var(--bg);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-light);
}

.counselor-experience {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 案例卡片 ===== */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.case-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 5px 20px var(--shadow);
    border-left: 4px solid var(--primary);
}

/* 案例封面图（与文章卡片的 article-image 视觉一致） */
.case-image {
    margin: -30px -30px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    line-height: 0;
}

.case-image img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.case-card:hover .case-image img {
    transform: scale(1.05);
}

.case-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
}

.btn-sm {
    padding: 7px 18px !important;
    font-size: 13px !important;
}

.case-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text);
}

.case-card .category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
}

/* 分类 + 会员可见等级徽标同一行（徽标紧跟分类之后） */
.case-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.case-head .category,
.case-head .level-tag { margin-bottom: 0; }

.case-content {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.case-result {
    background: #F0FFF0;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--secondary);
}

.case-result h4 {
    color: var(--secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.case-result p {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== 文章卡片 ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
    transition: var(--transition);
    position: relative;
}

/* ---- 内容锁（付费等级）----
 * 列表页策略：付费内容照常显示封面、标题与摘要，**不加锁背景遮罩**，
 * 等级信息统一由卡片上的 .level-tag 徽标表达（避免出现两处「XX会员可见」）。
 * 若整篇隐藏，访客会以为站内没有这类内容，反而失去购买动机；
 * 正文解锁与升级引导放在详情页（.content-lock* / .lock-cta）。 */
/* ===== 会员可见等级徽标（与卡片分类同样的胶囊圆角矩形，仅用等级色区分） ===== */
.level-tag {
    display: inline-block;
    /* 兜底底色：即使 --tag-color 缺失（等级数据异常）也要有色，
       正常路径下内联 style 的 background 优先级更高，会覆盖这里。 */
    background: var(--tag-color, #7B68EE);
    background-color: var(--tag-color, #7B68EE);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}
/* 卡片可读时徽标仍显示（告知该内容属于哪个等级专区），不可读时更醒目 */
.case-card.is-locked .level-tag,
.article-card.is-locked .level-tag { font-weight: 700; }
/* 徽标独立成行右对齐，避免破坏 .article-meta 的 space-between 两端对齐 */
.article-meta .level-tag,
.case-meta .level-tag { margin-left: auto; }
.case-meta .level-tag { margin-right: 0; }

.lock-badge { color: #fff; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.article-card.is-locked .article-content > p { filter: blur(0); color: var(--text-light); }
/* 注：列表页已去掉锁背景遮罩与截断摘要，.locked-summary / .lock-mask 随之移除；
   会员等级完全由卡片上的 .level-tag 徽标表达，升级引导统一在详情页 .lock-cta。 */
.lock-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 12px;
    padding: 7px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), #764ba2);
    color: #fff !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .15s;
}
.lock-cta:hover { transform: scale(1.04); }
.level-tip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 8px;
    padding: 15px 22px;
    background: linear-gradient(135deg, #fffaf0, #fff4e0);
    border: 1px solid #ffe0a3;
    border-radius: 12px;
}
.level-tip > i { color: #f39c12; font-size: 22px; flex-shrink: 0; }
.level-tip p { margin: 0; font-size: 13.5px; color: #8a6d1f; line-height: 1.8; }
.level-tip a { color: #d35400; font-weight: 700; text-decoration: none; margin-left: 4px; }
.level-tip a:hover { text-decoration: underline; }

/* 详情页正文锁 */
.content-lock { position: relative; }
.content-lock-fade {
    position: relative;
    max-height: 260px;
    overflow: hidden;
}
.content-lock-fade::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0; height: 180px;
    background: linear-gradient(180deg, rgba(255,255,255,0), var(--bg, #fff) 88%);
}
.content-lock-cta {
    position: relative;
    margin-top: -60px;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 14px;
    padding: 26px 28px;
    text-align: center;
    box-shadow: 0 8px 28px rgba(102,126,234,.16);
}
.content-lock-cta .lock-icon { font-size: 32px; color: var(--primary); display: block; margin-bottom: 10px; }
.content-lock-cta h4 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.content-lock-cta p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-light); line-height: 1.85; }
.content-lock-cta .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lock-preview-tip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: var(--text-light);
    background: #f5f6fa; padding: 4px 12px; border-radius: 14px; margin-bottom: 16px;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(123, 104, 238, 0.15);
}

.article-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 25px;
}

.article-category {
    display: inline-block;
    background: var(--bg);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 12px;
}

.article-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-content h3 a:hover {
    color: var(--primary);
}

.article-content p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 预约表单 ===== */
.booking-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 80px 0;
}

.booking-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.booking-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== 页脚 ===== */
.footer {
    background: #2C2C54;
    color: white;
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h3 {
    font-size: 22px;
    margin-bottom: 20px;
}

.footer-col h3 i {
    color: var(--accent);
    margin-right: 10px;
}

.footer-col h4 {
    font-size: 16px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

.footer-col p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-col ul li a:hover {
    color: var(--primary-light);
}

.footer-col ul li i {
    width: 20px;
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.social-links a:hover {
    background: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 分页信息（当前页 / 总页数 / 总条数） */
.page-info {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 6px;
    color: var(--text-muted, #999);
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pagination { flex-wrap: wrap; }
    .page-info { width: 100%; justify-content: center; height: auto; padding-top: 6px; }
    .case-image { margin: -30px -30px 20px; }
}

/* ===== 统计数字 ===== */
.stats-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
    color: white;
}

.stat-item h3 {
    font-size: 48px;
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 16px;
    opacity: 0.9;
}

/* ===== 文章详情 & 测试卡片 ===== */
/* (样式在响应式区域前统一声明) */

/* ===== 测试卡片 ===== */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.test-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 5px 20px var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(123, 104, 238, 0.15);
}

.test-icon {
    font-size: 50px;
    color: var(--primary);
    margin-bottom: 20px;
}

.test-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.test-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.test-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ===== 服务详情页 ===== */
.service-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.service-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 6px 0;
    }
    .nav.show {
        display: block;
    }
    .nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    .nav ul li {
        width: 100%;
    }
    .nav ul li a {
        display: block;
        padding: 8px 16px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 13px;
    }
    .nav ul li:last-child a {
        border-bottom: none;
    }
    .nav-member-item {
        display: list-item;
    }
    /* 手机端导航菜单里显示咨询师登录 */
    .nav ul .nav-counselor-login {
        display: list-item;
    }
    /* 手机端隐藏右上角小图标，只保留 hamburger 菜单里的入口 */
    .header-right > .nav-counselor-login {
        display: none;
    }
    .nav-member-item a {
        font-weight: 600;
    }
    /* 已移除「退出登录」项，此分隔线规则不再需要（原本用于区分会员中心与退出两行） */
    .header .container {
        position: relative;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .logo a {
        font-size: 18px;
    }
    .logo i {
        font-size: 22px;
    }
    /* 手机端隐藏右上角会员入口，只保留 hamburger 菜单与底部导航里的入口 */
    .header-right .btn,
    .header-right .nav-user-link {
        display: none;
    }
    .header-right .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 28px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .service-flow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 微信二维码弹窗 ===== */
.wechat-qr-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.wechat-qr-popup.active {
    display: flex;
}
.wechat-qr-popup-inner {
    position: relative;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: qrFadeIn 0.3s ease;
}
@keyframes qrFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.wechat-qr-popup-inner img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
}
.wechat-qr-popup-inner p {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}
.wechat-qr-close {
    position: absolute;
    top: 8px;
    right: 14px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}
.wechat-qr-close:hover {
    color: #333;
}

.social-links .wechat-btn {
    position: relative;
    cursor: pointer;
}
.social-links .wechat-btn:hover {
    color: #07C160;
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* ==========================================================================
   手机端底部导航栏（首页 / 案例 / 知识 / 咨询 / 我）
   - 仅 <=768px 生效，桌面端完全隐藏（它是移动端专属导航，与顶部 nav 互补）
   - fixed 固定在视口底部，用 padding-bottom 补位避免遮住页脚内容
   - z-index 高于 header 与微信浮层，保证始终可点
   ========================================================================== */
.mnav {
    display: none;                 /* 桌面端隐藏 */
}

@media (max-width: 768px) {
    .mnav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        height: calc(58px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);   /* iPhone 底部指示条 */
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid #eceef4;
        box-shadow: 0 -2px 14px rgba(0, 0, 0, .06);
    }
    .mnav-item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 58px;
        text-decoration: none;
        color: #9aa0ad;
        font-size: 11px;
        line-height: 1;
        transition: color .2s;
        -webkit-tap-highlight-color: transparent;
    }
    .mnav-item i {
        font-size: 19px;
        line-height: 1;
        transition: transform .2s;
    }
    .mnav-item span {
        font-size: 11px;
        letter-spacing: .2px;
        white-space: nowrap;
    }
    /* 选中态：主色 + 图标轻微放大，与顶部 nav 的 active 视觉呼应 */
    .mnav-item.active {
        color: var(--primary);
        font-weight: 600;
    }
    .mnav-item.active i {
        transform: scale(1.1);
    }
    /* 按压反馈（移动端触感） */
    .mnav-item:active i {
        transform: scale(.9);
    }

    /* 给 fixed 底栏留出空间，防止遮住页脚最后一行。
     * 注意：后台（admin/）与咨询师工作台（counselor/）也加载本样式表但**没有**底栏，
     * 若无差别地给 body 加padding-bottom，它们底部会凭空多出一段空白。
     * 因此统一由 mobile_nav.php 输出 body.has-mnav 这个标记来触发补位。 */
    body.has-mnav {
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    }

    /* 微信「复制备注」等弹出层要盖在底栏之上 */
    .wechat-qr-popup {
        z-index: 10001;
    }
}

/* ==========================================================================
   手机端双列紧凑布局
   背景：手机上 auto-fit + minmax(260~350px) 算下来只能排1 列，
        服务/咨询师/分类条占掉整屏，一屏看不到几项。
        以下在 <=768px 强制改 2 列并压缩卡片内边距，字号与图标同步缩小。
   注意：这里只改布局密度，不改配色与视觉风格。
   ========================================================================== */
@media (max-width: 768px) {

    /* ---------- 首页：我们的服务 ---------- */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .services-grid .service-card {
        padding: 16px 14px;
        border-radius: 10px;
    }
    .services-grid .service-icon {
        width: 46px;
        height: 46px;
        font-size: 22px;
        margin-bottom: 10px;
    }
    .services-grid .service-card h3 {
        font-size: 15px;
        margin-bottom: 6px;
    }
    .services-grid .service-card p {
        font-size: 13px;
        line-height: 1.55;
        margin-bottom: 8px;
    }

    /* ---------- 首页 & counselors.php：咨询师团队 ---------- */
    .counselors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .counselors-grid .counselor-card {
        border-radius: 10px;
        overflow: hidden;
    }
    .counselors-grid .counselor-photo,
    .counselors-grid .counselor-image {
        height: 130px;
    }
    .counselors-grid .counselor-info {
        padding: 12px 12px 14px;
    }
    .counselors-grid .counselor-info h3 {
        font-size: 15px;
        margin-bottom: 4px;
    }
    .counselors-grid .counselor-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    /* ---------- 为什么选择我们（数字统计） ---------- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .stat-item h3 {
        font-size: 32px;
        margin-bottom: 4px;
    }
    .stat-item p {
        font-size: 14px;
    }

    /* ---------- 案例 / 心理知识：手机端单列 ----------
     * 这两个类名被首页（成功案例、心理知识区块）、列表页（cases.php /
     * articles.php）共用，这里改一次全站生效。
     * 之前是2 列，但摘要 150 字 + 等级徽标挤在 ~170px 宽的列里，
     * 标题要断三四行、正文被压成细长条，观感很差。
     * 注意实际类名是 .case-content / .article-content / .level-tag——
     * 旧写法里的 .case-info / .article-info / .level-badge 在 HTML 中并不存在。 */
    .cases-grid,
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .cases-grid .case-card,
    .articles-grid .article-card {
        border-radius: 10px;
    }
    /* 单列后宽度富余，字号回到舒适区间（原来 2 列时压到15/13px） */
    .cases-grid .case-card {
        padding: 20px;
    }
    /* 封面用负 margin 顶到卡片边缘，卡片 padding 变了这里必须同步，否则封面错位 */
    .cases-grid .case-image {
        margin: -20px -20px 16px;
    }
    .cases-grid .case-card h3 {
        font-size: 17px;
        line-height: 1.45;
        margin-bottom: 8px;
    }
    .cases-grid .case-content {
        font-size: 14.5px;
        line-height: 1.7;
    }
    .articles-grid .article-content {
        padding: 16px 16px 18px;
    }
    .articles-grid .article-card h3 {
        font-size: 17px;
        line-height: 1.45;
        margin-bottom: 8px;
    }
    .articles-grid .article-card p {
        font-size: 14.5px;
        line-height: 1.7;
    }
    /* 封面按 16:9 铺满：单列时约 345px 宽，194px 高刚好不裁切 */
    .cases-grid .case-image img {
        height: 194px;
    }
    .articles-grid .article-image {
        height: 194px;
    }
    /* 徽标在单列下有足够空间，保持一行不换行 */
    .cases-grid .level-tag,
    .articles-grid .level-tag {
        white-space: nowrap;
    }

    /* ---------- 分类筛选条：紧凑单行可横滚 ---------- */
    .category-filter {
        gap: 6px;
        padding: 8px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .category-filter::-webkit-scrollbar {
        display: none;
    }
    .category-filter a,
    .category-filter span {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 14px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    /* ---------- 心理测试 ---------- */
    .tests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .tests-grid .test-card {
        padding: 18px 14px;
    }
    .tests-grid .test-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
    .tests-grid .test-card h3 {
        font-size: 15px;
    }
    .tests-grid .test-meta {
        gap: 12px;
        font-size: 12px;
    }
}

/* ---------- 咨询师详情页头部：手机上压紧，别占满首屏 ---------- */
@media (max-width: 768px) {
    .cd-header {
        gap: 14px !important;
        align-items: flex-start !important;
    }
    .cd-header-photo {
        width: 92px !important;
        height: 92px !important;
        border-width: 3px !important;
    }
    .cd-header-photo-empty {
        font-size: 34px !important;
    }
    .cd-header-body {
        min-width: 0 !important;   /*允许文字收缩，否则会撑破 2列窄屏 */
    }
    .cd-header h1 {
        font-size: 20px !important;
        margin-bottom: 3px !important;
    }
    .cd-header-title {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    .cd-header-meta {
        gap: 8px 14px !important;
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }
    .cd-header-specialty {
        gap: 5px !important;
    }
    .cd-header-specialty span {
        font-size: 12px !important;
        padding: 3px 10px !important;
    }
    .cd-header-cta {
        margin-top: 12px !important;
    }
    .cd-header-cta .btn {
        padding: 9px 20px !important;
        font-size: 14px !important;
    }
}

/* ---------- 极窄屏（iPhone SE 等约 320px）：再收一档避免溢出 ---------- */
@media (max-width: 360px) {
    .services-grid,
    .counselors-grid,
    .cases-grid,
    .articles-grid,
    .tests-grid,
    .stats-grid {
        gap: 8px;
    }
    .services-grid .service-card h3,
    .counselors-grid .counselor-info h3,
    .cases-grid .case-info h3,
    .articles-grid .article-info h3,
    .tests-grid .test-card h3 {
        font-size: 14px;
    }
    .stats-grid .stat-item h3 {
        font-size: 26px;
    }
}

/* ==========================================================================
   首页「为什么选择我们」与「咨询流程」
   原来是写在标签上的内联 grid-template-columns —— 内联样式的优先级高于
   任何媒体查询，导致手机端永远改不动。这里改回类名，列数交给 CSS 控制。
   ========================================================================== */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    /* 为什么选择我们：手机上 2 列 */
    .why-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .why-grid > div {
        padding: 14px 8px !important;
    }
    .why-grid > div > div:first-child {
        width: 52px !important;
        height: 52px !important;
        margin-bottom: 10px !important;
        font-size: 22px !important;
    }
    .why-grid h3,
    .why-grid h4 {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }
    .why-grid p {
        font-size: 12.5px !important;
        line-height: 1.55 !important;
    }

    /* 咨询流程：4 步在手机上排 2×2，比挤成 4 列一屏看得清 */
    .flow-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 12px;
    }
    .flow-grid > div > div:first-child {
        width: 52px !important;
        height: 52px !important;
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }
    .flow-grid h4 {
        font-size: 15px !important;
    }
    .flow-grid p {
        font-size: 12.5px !important;
        line-height: 1.5 !important;
    }
}

/* ==========================================================================
   咨询师详情页头部
   原为整块内联样式（字号/头像尺寸都写在标签上），手机端无法压缩；
   现改为类名，桌面端保持原样，手机端在上面的媒体查询里收紧。
   ========================================================================== */
.cd-header {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cd-header-avatar {
    flex-shrink: 0;
}

.cd-header-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid rgba(255,255,255,0.3);
    background: #fff;
}

.cd-header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cd-header-photo-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 60px;
}

.cd-header-body {
    flex: 1;
    min-width: 280px;
}

.cd-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.cd-header-title {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.cd-header-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.cd-header-specialty {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cd-header-specialty span {
    background: rgba(255,255,255,0.2);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 14px;
}

.cd-header-cta {
    margin-top: 25px;
}

.cd-header-cta .btn {
    background: #fff;
    color: var(--primary);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
}

/* ==========================================================================
   分类筛选条（services / cases / articles 共用）
   原为内联 style 居中+换行，手机端太占高度。改为类名后：
   桌面端保持居中换行；手机端单行横滚，一屏能看到全部类别。
   ========================================================================== */
.category-filter {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

/* ==========================================================================
   移动端覆盖（必须放在文件末尾）
   同优先级下，后出现的规则胜出。上面的 .category-filter / .cd-header 基础样式
   写在媒体查询之后，会把移动端的收紧效果覆盖掉，这里再压一次。
   ========================================================================== */
@media (max-width: 768px) {
    .category-filter {
        display: flex;
        gap: 6px;
        padding: 8px 0;
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;          /* 强制单行横滚，不换行 */
        justify-content: flex-start;
    }
    .category-filter::-webkit-scrollbar {
        display: none;
    }
    .category-filter a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 6px 13px;
        font-size: 13px;
        border-radius: 14px;
    }
}

/* ==========================================================================
   分类折叠（services / cases / articles 共用）
   手机端分类一行放不下时，只显示一条「分类筛选」折叠条（当前分类 + 箭头），
   点一下展开全部分类，再点收起。桌面端折叠条隐藏，分类照旧居中换行铺开。
   ========================================================================== */
.category-filter-toggle {
    display: none;
}

@media (max-width: 768px) {
    .category-filter-wrap {
        margin-bottom: 20px;
    }
    /* 折叠条本体：一行、整行可点 */
    .category-filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 10px 14px;
        font-size: 14px;
        font-family: inherit;
        color: var(--text);
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 22px;
        cursor: pointer;
        box-shadow: 0 2px 8px var(--shadow);
    }
    .category-filter-toggle .cft-label {
        color: var(--text-muted);
        font-size: 13px;
        flex: 0 0 auto;
    }
    .category-filter-toggle .cft-current {
        font-weight: 600;
        color: var(--primary);
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
    }
    .category-filter-toggle .cft-arrow {
        flex: 0 0 auto;
        font-size: 12px;
        color: var(--primary);
        transition: transform 0.25s ease;
    }
    .category-filter-wrap.is-open .category-filter-toggle {
        border-color: var(--primary);
    }
    .category-filter-wrap.is-open .category-filter-toggle .cft-arrow {
        transform: rotate(180deg);
    }
    /* 收起状态：分类列表隐藏 */
    .category-filter-wrap.is-collapsible:not(.is-open) .category-filter {
        display: none;
    }
    /* 一行就放得下（分类很少）：不折叠，列表常驻单行横滚 */
    .category-filter-wrap.is-inline:not(.is-open) .category-filter {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
        margin-bottom: 0;
    }
    .category-filter-wrap.is-inline:not(.is-open) .category-filter::-webkit-scrollbar {
        display: none;
    }
    /* 量宽度用：强制单行不换行地摊开，才能算出真实溢出量 */
    .category-filter-wrap.is-measuring .category-filter {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow: hidden;
        animation: none;
    }
    /* 展开状态：允许换行铺开，所有分类都能看到（不再横滚） */
    .category-filter-wrap.is-open .category-filter {
        display: flex;
        flex-wrap: wrap;
        overflow: visible;
        padding: 10px 0 0;
        margin-bottom: 0;
        gap: 8px;
        justify-content: flex-start;
        animation: catFilterIn 0.22s ease;
    }
    .category-filter-wrap.is-open .category-filter a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 6px 13px;
        font-size: 13px;
        border-radius: 14px;
    }
}

@keyframes catFilterIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   收藏按钮（文章详情 / 案例详情）
   ========================================================================== */
.fav-btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-light);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.fav-btn-detail:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.fav-btn-detail.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.fav-btn-detail.is-active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.fav-btn-detail:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.fav-btn-detail .fav-count {
    font-style: normal;
    font-size: 12.5px;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(123, 104, 238, .12);
    color: var(--primary);
}
.fav-btn-detail.is-active .fav-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

@media (max-width: 768px) {
    .fav-btn-detail {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* ---------- cd-header 移动端收紧（同上，须放在基础样式之后） ---------- */
@media (max-width: 768px) {
    .cd-header {
        gap: 12px;
        align-items: flex-start;
    }
    .cd-header-photo {
        width: 88px;
        height: 88px;
        border-width: 3px;
    }
    .cd-header-photo-empty {
        font-size: 32px;
    }
    .cd-header-body {
        min-width: 0;
    }
    .cd-header h1 {
        font-size: 19px;
        margin-bottom: 2px;
    }
    .cd-header-title {
        font-size: 13.5px;
        margin-bottom: 6px;
    }
    .cd-header-meta {
        gap: 6px 14px;
        font-size: 12.5px;
        margin-bottom: 8px;
    }
    .cd-header-specialty {
        gap: 5px;
    }
    .cd-header-specialty span {
        font-size: 11.5px;
        padding: 3px 9px;
    }
    .cd-header-cta {
        margin-top: 10px;
    }
    .cd-header-cta .btn {
        padding: 8px 18px;
        font-size: 13.5px;
    }
}

/* 极窄屏（iPhone SE 等约 320px）：案例/心理知识封面压低一点，避免首屏只剩一张图 */
@media (max-width: 360px) {
    .cases-grid .case-image img,
    .articles-grid .article-image {
        height: 168px;
    }
}
