/* ===== 未来星辅导家教 - 公共样式 ===== */

* {
    font-family: 'Noto Sans SC', sans-serif;
}

:root {
    --primary: #1a56a8;
    --primary-dark: #0f3d7a;
    --primary-light: #3b7dd8;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    color: #1f2937;
    background: #ffffff;
}

/* ===== 渐变与背景 ===== */
.gradient-primary {
    background: linear-gradient(135deg, #1a56a8 0%, #2563eb 50%, #3b82f6 100%) !important;
}

.gradient-hero {
    background: linear-gradient(135deg, #0f3d7a 0%, #1a56a8 40%, #2563eb 100%) !important;
}

.hero-pattern {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(255,255,255,0.06) 0%, transparent 45%) !important;
}

/* 确保Hero区域文字在蓝色背景上清晰可见 */
.gradient-hero h1,
.gradient-hero h2,
.gradient-hero h3,
.gradient-hero p,
.gradient-hero span {
    color: inherit;
}

.text-gradient {
    background: linear-gradient(135deg, #1a56a8, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 卡片与按钮 ===== */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(26, 86, 168, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #1a56a8, #2563eb);
    transition: all 0.3s ease;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f3d7a, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(26, 86, 168, 0.4);
}

.btn-outline {
    border: 2px solid white;
    transition: all 0.3s ease;
    background: transparent;
    color: white;
    cursor: pointer;
}

.btn-outline:hover {
    background: white;
    color: #1a56a8;
}

/* ===== 导航链接 ===== */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1a56a8;
    transition: width 0.3s ease;
}

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

.nav-link.active {
    color: #1a56a8;
    font-weight: 600;
}

/* ===== 动画 ===== */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* ========== 表单字段错误样式 ========== */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    background-color: #fef2f2 !important;
    animation: field-shake 0.45s cubic-bezier(.36,.07,.19,.97);
}
.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
@keyframes field-shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}

/* ========== 固定宽高比容器 ========== */
.aspect-5-4 { aspect-ratio: 5 / 4; }
/* 教师照片统一 6:7（= 600×700 竖版，与上传裁剪输出尺寸一致） */
.aspect-6-7 { aspect-ratio: 6 / 7; }

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 标题装饰 ===== */
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a56a8, #3b82f6);
    margin: 16px auto 0;
    border-radius: 2px;
}

.section-title-left::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1a56a8, #3b82f6);
    margin: 16px 0 0;
    border-radius: 2px;
}

/* ===== 痛点卡片 ===== */
.pain-card {
    position: relative;
    overflow: hidden;
}

.pain-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1a56a8, #3b82f6);
}

/* ===== 优势图标 ===== */
.advantage-icon {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

/* ===== 教师卡片 ===== */
.teacher-card img {
    transition: transform 0.5s ease;
}

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

/* ===== 多行文本省略（简介最多 3/4 行） ===== */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 课程标签 ===== */
.course-tag {
    transition: all 0.3s ease;
    cursor: pointer;
}

.course-tag:hover,
.course-tag.active {
    background: #1a56a8 !important;
    color: white !important;
    transform: translateY(-2px);
}

/* ===== 统计数字 ===== */
.stats-number {
    background: linear-gradient(135deg, #1a56a8, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 表单 ===== */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #1a56a8 !important;
    box-shadow: 0 0 0 3px rgba(26, 86, 168, 0.1);
}

/* ===== 移动端菜单 ===== */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.open {
    max-height: 600px;
}

/* ===== 返回顶部 ===== */
.scroll-top {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== 装饰圆 ===== */
.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(26, 86, 168, 0.1), rgba(59, 130, 246, 0.05));
}

/* ===== 页面Banner ===== */
.page-banner {
    padding-top: 18px;
    padding-bottom: 28px;
    position: relative;
    overflow: hidden;
}

/* 强制Banner内文字为白色，确保在蓝色背景上清晰可见 */
.page-banner h1,
.page-banner h2,
.page-banner h3,
.page-banner p,
.page-banner span {
    color: #ffffff !important;
}

.page-banner p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 二级页Banner紧凑布局：总高约120px，字体相应缩小 */
.page-banner h1,
.page-banner h2,
.page-banner h3 {
    font-size: 20px !important;
    line-height: 1.3;
    margin-bottom: 4px;
    font-weight: 700;
}

.page-banner p {
    font-size: 12px !important;
    line-height: 1.5;
    margin-bottom: 0;
    letter-spacing: 0.3px;
}

/* Banner底部波浪装饰 */
.page-banner > div:last-child svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 24px;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.page-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    padding-left: 16px;
    position: relative;
    letter-spacing: 0.5px;
}

.breadcrumb::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 13px;
    background: linear-gradient(180deg, #93c5fd, #3b82f6);
    border-radius: 2px;
}

.breadcrumb a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb svg {
    width: 13px;
    height: 13px;
    opacity: 0.6;
}

.breadcrumb span {
    color: #ffffff;
    font-weight: 700;
}

/* Banner 上的分类标签（on-dark：半透明白底 + 白字，在深蓝 Banner 上清晰可见；不受分类配色影响） */
.page-banner-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* ===== 侧边栏 ===== */
.sidebar-menu {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: #4b5563;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s;
}

.sidebar-menu a:last-child {
    border-bottom: none;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #eff6ff;
    color: #1a56a8;
    padding-left: 24px;
}

.sidebar-menu a.active {
    font-weight: 600;
    border-left: 3px solid #1a56a8;
}

/* ===== 时间线 ===== */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #1a56a8, #3b82f6, #dbeafe);
}

.timeline-item {
    position: relative;
    padding-bottom: 32px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 3px solid #1a56a8;
    box-shadow: 0 0 0 4px rgba(26, 86, 168, 0.1);
}

/* ===== 筛选标签 ===== */
.filter-tag {
    padding: 8px 20px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.filter-tag:hover,
.filter-tag.active {
    background: #1a56a8;
    color: white;
}

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

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a:hover {
    border-color: #1a56a8;
    color: #1a56a8;
}

.pagination .active {
    background: #1a56a8;
    border-color: #1a56a8;
    color: white;
}

/* ===== 联系信息卡片 ===== */
.contact-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26, 86, 168, 0.15);
}

.contact-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

/* ===== 文章卡片 ===== */
.article-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(26, 86, 168, 0.15);
}

.article-card-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.article-card-body {
    padding: 24px;
}

/* ===== 服务流程 ===== */
.process-step {
    text-align: center;
    position: relative;
}

.process-step-number {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a56a8, #2563eb);
    color: white;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(26, 86, 168, 0.3);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .page-banner {
        padding-top: 14px;
        padding-bottom: 24px;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline-item::before {
        left: -24px;
        width: 12px;
        height: 12px;
    }
}

/* ===== 富文本文章内容排版（替代 @tailwindcss/typography）=====
   覆盖 #articleContent 内所有 WangEditor / 富文本编辑器输出的常见元素，
   确保 h1-h6 标题层级、加粗、斜体、字体大小、颜色等样式正确渲染。 */
#articleContent,
.article-content {
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
#articleContent > *:first-child,
.article-content > *:first-child { margin-top: 0; }
#articleContent > *:last-child,
.article-content > *:last-child { margin-bottom: 0; }

#articleContent h1,
#articleContent h2,
#articleContent h3,
#articleContent h4,
#articleContent h5,
#articleContent h6,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #111827;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}
#articleContent h1, .article-content h1 { font-size: 28px; border-bottom: 2px solid #e5e7eb; padding-bottom: 8px; }
#articleContent h2, .article-content h2 { font-size: 24px; }
#articleContent h3, .article-content h3 { font-size: 20px; }
#articleContent h4, .article-content h4 { font-size: 18px; }
#articleContent h5, .article-content h5 { font-size: 16px; }
#articleContent h6, .article-content h6 { font-size: 15px; }

#articleContent p,
.article-content p {
    margin-top: 0;
    margin-bottom: 15px;
}

#articleContent strong,
#articleContent b,
.article-content strong,
.article-content b { font-weight: 700; }

/* 兜底：WangEditor 中用 &lt;p&gt;&lt;strong&gt; 做的章节标题（如"四、命题趋势..."）渲染为 h3 级标题
   :not([style]) —— 作者在编辑器里手动设过字号/颜色时不覆盖，以接口返回的真实样式为准 */
#articleContent p > strong:first-child:not([style]),
#articleContent p > strong:only-child:not([style]),
.article-content p > strong:first-child:not([style]),
.article-content p > strong:only-child:not([style]) {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: inherit;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.4;
}
/* 注：纯文本 &lt;p&gt; 章节标题（如"五、..."无任何标签）由 sanitizeArticleContent JS 层
   识别并添加 .article-section-title 类，此处统一渲染为 h3 级标题 */
#articleContent p.article-section-title,
.article-content p.article-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.4;
}

#articleContent em,
#articleContent i,
.article-content em,
.article-content i { font-style: italic; }

#articleContent ul,
#articleContent ol,
.article-content ul,
.article-content ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 2em;
}
#articleContent li,
.article-content li { margin-bottom: 0.35em; }
#articleContent ul li,
.article-content ul li { list-style-type: disc; }
#articleContent ol li,
.article-content ol li { list-style-type: decimal; }

#articleContent blockquote,
.article-content blockquote {
    margin: 1.2em 0;
    padding: 12px 20px;
    border-left: 4px solid #1a56a8;
    background-color: #f0f7ff;
    color: #4b5563;
    font-style: italic;
}

#articleContent img,
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

#articleContent table,
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 15px;
}
#articleContent th,
#articleContent td,
.article-content th,
.article-content td {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: left;
}
#articleContent th,
.article-content th {
    background-color: #f9fafb;
    font-weight: 700;
    color: #111827;
}

#articleContent hr,
.article-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2em 0;
}

#articleContent a,
.article-content a {
    color: #1a56a8;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#articleContent a:hover,
.article-content a:hover { color: #0f3d7a; }

#articleContent code,
.article-content code {
    background-color: #f3f4f6;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', monospace;
}

#articleContent pre,
.article-content pre {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
}
#articleContent pre code,
.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* ===== UEditor 富文本额外元素兜底排版 =====
   UEditor 输出的富文本会以 <span style="..."> 内联形式携带字号/颜色/对齐等样式，
   内联样式优先级天然高于下方标签选择器，因此这里只补齐"没有内联样式的结构性元素"，
   绝不使用 font-size: ... !important，否则会覆盖后台编辑时设置的字号。 */
#articleContent figure,
.article-content figure { margin: 1.5em 0; text-align: center; }
#articleContent figcaption,
.article-content figcaption { margin-top: 8px; font-size: 13px; color: #9ca3af; }
#articleContent sup,
#articleContent sub,
.article-content sup,
.article-content sub { font-size: 0.75em; line-height: 0; vertical-align: super; }
#articleContent sub,
.article-content sub { vertical-align: sub; }
#articleContent video,
#articleContent audio,
.article-content video,
.article-content audio { max-width: 100%; display: block; margin: 1em auto; }
/* 表格单元格内的段落：去掉默认外边距，避免行高被撑开 */
#articleContent td p,
#articleContent th p,
.article-content td p,
.article-content th p { margin: 0; }
/* 图片浮动：文字环绕时给右侧留出间距 */
#articleContent img[style*="float"],
.article-content img[style*="float"] { margin: 0.5em 1em 0.5em 0; }
#articleContent img[style*="right"],
.article-content img[style*="right"] { margin: 0.5em 0 0.5em 1em; }
/* UEditor 表格可能带 width 属性/内联宽度，窄屏下强制不超出容器（保持 table 布局，不变 block） */
#articleContent table,
.article-content table { table-layout: auto; }
#articleContent table img,
.article-content table img { max-width: 100%; }

/* UEditor 输出的字号/颜色以 <span style="..."> 内联形式存在，优先级天然高于上面的
   标签选择器，无需额外声明即可生效（含新增的 17px / 18px）。
   ⚠️ 后续维护：不要在 #articleContent 下写 font-size: ... !important，否则会覆盖后台设置的字号。 */

/* ===== 隐藏滚动条 ===== */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}


/* PC端：导航栏全宽自适应（避免超宽屏露白）；banner 区固定 1900×500px（与设计稿一致，用户图按 object-cover 强制此规格） */
@media (min-width: 768px) {
    .navbar-fixed-xl {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        transform: none !important;
    }
    .banner-fixed-xl {
        /* 宽≥1900px 时固定 1900×500；窗口<1900px 时收缩跟随视口（避免课程面板/内容错位溢出） */
        width: min(1900px, 100vw) !important;
        height: 500px !important;
        max-width: 100vw !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* banner 内图强制适配容器（即便用户上传尺寸不合规格，也按 1900×500 显示，可能裁剪） */
    #bannerSlides,
    #bannerSlides .carousel-slide {
        width: 100% !important;
        height: 100% !important;
    }
}
