/* =========================================
   ★ 全局防溢出 & 基础重置
   ========================================= */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
*, *::before, *::after { box-sizing: border-box; }

.page-hero, .article-section, .prev-next-nav, .bottom-recommend {
    max-width: 100%;
    box-sizing: border-box;
}

/* =========================================
   ★ Hero区：对齐 + 间距 + 折叠交互
   ========================================= */
.page-hero {
    position: relative;
    width: 100%;
    padding: 0 24px;
    margin-bottom: 32px;
}
.page-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}
.page-hero-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* 面包屑 + 触发按钮 */
.crumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 3;
}
.crumb-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-secondary);
}
.crumb-path a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
.crumb-path a:hover { color: var(--jade); }

.crumb-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}
.crumb-trigger:hover {
    color: var(--jade);
    border-color: var(--jade);
    background: var(--jade-dim);
}
.trigger-text {
    display: inline-block;
    font-weight: 600;
    letter-spacing: 1px;
}
.trigger-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.page-hero.expanded .trigger-icon {
    transform: rotate(180deg);
}

/* 折叠区动画 */
.hero-collapse {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    width: 100%;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                margin-top 0.3s ease;
    margin-top: 0;
}
.page-hero.expanded .hero-collapse {
    max-height: 500px;
    opacity: 1;
    margin-top: 16px;
}

/* 折叠内容样式 */
.hero-extra-content {
    padding: 14px 18px;
    background: rgba(255,255,255,0.025);
    border-radius: 8px;
    border-left: 3px solid var(--jade);
    width: 100%;
    box-sizing: border-box;
}
.hero-intro {
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-secondary);
    opacity: 0.75;
    margin: 0;
    word-break: break-word;
}

/* =========================================
   ★ 文章头部：标题 + 元信息（正文区内）
   ========================================= */
.article-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-dim);
}
.article-header .page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 14px;
}
.title-cursor {
    color: var(--jade);
    animation: blink 1s step-end infinite;
    margin-left: 4px;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.article-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}
.article-meta-bar .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.article-meta-bar .tag-pill {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gold);
    background: var(--gold-dim);
    border: 1px solid rgba(255,215,0,0.2);
}

/* =========================================
   ★ 正文排版
   ========================================= */
.article-section {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 24px;
}
.article-container {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    padding: 36px 40px;
    overflow-x: hidden;
    max-width: 100%;
}
.article-cover {
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
}
.article-cover img {
    width: 100%;
    height: auto;
    display: block;
}
.article-content {
    font-size: 15px;
    line-height: 2;
    color: var(--text-primary);
    word-break: break-word;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px auto !important;
    border: 1px solid var(--border-dim);
    display: block !important;
    float: none !important;
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-content img:hover {
    box-shadow: 0 8px 30px rgba(0,229,255,0.15);
    transform: scale(1.01);
}
.article-content p,
.article-content blockquote {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.4em;
}
.article-content h2, .article-content h3 {
    color: var(--jade);
    margin: 2em auto 0.8em;
    font-weight: 700;
    max-width: 860px;
}
.article-content h2 { font-size: 22px; border-left: 3px solid var(--jade); padding-left: 14px; }
.article-content h3 { font-size: 18px; }
.article-content a { color: var(--jade); border-bottom: 1px dashed rgba(0,229,255,0.3); transition: all 0.3s; }
.article-content a:hover { border-bottom-style: solid; text-shadow: 0 0 8px var(--jade-dim); }
.article-content blockquote {
    padding: 16px 20px;
    border-left: 3px solid var(--gold);
    background: var(--gold-dim);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.article-content pre, .article-content code {
    background: rgba(0,229,255,0.05);
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
}
.article-content pre {
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px auto;
    max-width: 860px;
    display: block;
}
.article-content code { padding: 2px 6px; }
.article-content ul, .article-content ol {
    margin: 16px auto;
    padding-left: 24px;
    max-width: 860px;
}
.article-content li { margin-bottom: 8px; }
.article-content table {
    width: 100%;
    max-width: 860px;
    margin: 20px auto;
    border-collapse: collapse;
    font-size: 13px;
    display: block;
    overflow-x: auto;
}
.article-content th, .article-content td { padding: 10px 14px; border: 1px solid var(--border-dim); text-align: left; }
.article-content th { background: var(--jade-dim); color: var(--jade); font-weight: 600; }

/* 文章标签 */
.article-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-dim);
}
.article-tags .tags-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--jade);
    font-family: var(--font-mono);
    letter-spacing: 1px;
    flex-shrink: 0;
}
.article-tags a {
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-dim);
    transition: all 0.3s;
    text-decoration: none;
}
.article-tags a:hover { color: var(--jade); border-color: var(--jade); background: var(--jade-dim); transform: translateY(-2px); }

/* =========================================
   ★ 上下篇导航
   ========================================= */
.prev-next-nav {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.pn-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-dim);
    transition: all 0.3s ease;
    min-width: 0;
}
.pn-item:hover { border-color: var(--border-glow); box-shadow: 0 4px 20px rgba(0,229,255,0.06); }
.pn-next { text-align: right; align-items: flex-end; }
.pn-label { font-size: 10px; font-weight: 700; color: var(--jade); font-family: var(--font-mono); letter-spacing: 2px; }
.pn-item a { font-size: 14px; color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; transition: color 0.3s; display: block; text-decoration: none; }
.pn-item:hover a { color: var(--jade); }
.pn-none { font-size: 13px; color: var(--text-secondary); opacity: 0.5; }

/* =========================================
   ★ 底部推荐区 - 区块标题
   ========================================= */
.bottom-recommend {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.rec-block { display: flex; flex-direction: column; gap: 20px; }

.sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sec-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sec-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--jade);
    border-radius: 2px;
    flex-shrink: 0;
}
.sec-more {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    transition: color 0.3s;
    flex-shrink: 0;
}
.sec-more:hover { color: var(--jade); }

/* =========================================
   ★ 商家网格空状态
   ========================================= */
.m-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* =========================================
   ★ 商家卡片 - 仅保留 in.css 未覆盖的差异样式
   ========================================= */

/* ★ 核心修复：强制清除 in.css 中 .m-card-img::after 的渐变遮罩 */
.bottom-recommend .m-card-img::after {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
}

/* 图片容器合成层隔离（防止伪元素渲染异常） */
.bottom-recommend .m-card-img {
    transform: translateZ(0);
    isolation: isolate;
}

/* 徽章 & 区域标签 - 覆盖 in.css 的蓝色毛玻璃样式 */
.bottom-recommend .m-card-badge {
    top: 8px;
    right: 8px;
    left: auto;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}
.bottom-recommend .m-card-area {
    bottom: 8px;
    left: 8px;
    top: auto;
    right: auto;
    padding: 2px 8px;
    font-size: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

/* 卡片内容区差异样式 */
.bottom-recommend .m-card-body {
    padding: 14px;
    gap: 8px;
}
.bottom-recommend .m-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    white-space: normal;
    margin: 0;
}
.bottom-recommend .m-card-desc {
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* 卡片底部按钮差异样式 */
.bottom-recommend .m-card-foot {
    margin-top: auto;
    padding-top: 4px;
    border-top: none;
}
.bottom-recommend .cmd-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    clip-path: none;
}
.bottom-recommend .cmd-btn svg { width: 14px; height: 14px; }
.bottom-recommend .cmd-active {
    background: var(--jade-dim);
    border: 1px solid rgba(0,229,255,0.2);
}
.bottom-recommend .cmd-active::before { display: none; }
.bottom-recommend .cmd-inactive {
    background: var(--gold-dim);
    border: 1px solid rgba(255,215,0,0.2);
}
.bottom-recommend .cmd-inactive::before { display: none; }

/* =========================================
   ★ 底部推荐区 - 新闻列表
   ========================================= */
.news-list-simple { display: flex; flex-direction: column; gap: 2px; }
.news-simple-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    min-width: 0;
    text-decoration: none;
}
.news-simple-item:hover { background: rgba(255,255,255,0.02); border-color: var(--border-dim); }
.news-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--jade); flex-shrink: 0; }
.news-simple-title { flex: 1; font-size: 14px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.3s; }
.news-simple-item:hover .news-simple-title { color: var(--jade); }
.news-simple-date { flex-shrink: 0; font-size: 11px; color: var(--text-secondary); font-family: var(--font-mono); opacity: 0.7; }

/* =========================================
   ★ 标签无缝滚动条
   ========================================= */
.bottom-tag-stream {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.tag-stream-track { width: 100%; overflow: hidden; }
.tag-stream-inner {
    display: inline-flex;
    gap: 16px;
    padding: 10px 0;
    animation: tagScroll 40s linear infinite;
    min-width: 0;
}
.tag-stream-inner:hover { animation-play-state: paused; }
.tag-stream-inner a {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-dim);
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}
.tag-stream-inner a:hover {
    color: var(--jade);
    border-color: var(--jade);
    background: var(--jade-dim);
}
@keyframes tagScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   ★ 返回顶部按钮
   ========================================= */
.back-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-dim);
    color: var(--jade);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}
.back-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top-btn:hover {
    background: var(--jade-dim);
    border-color: var(--jade);
    box-shadow: 0 0 15px var(--jade-dim);
}

/* =========================================
   ★ 响应式适配
   ========================================= */
@media(max-width: 1024px) {
    /* m-grid 列数由 in.css 控制，此处仅补充间距差异 */
}

@media(max-width: 768px) {
    .page-hero { padding: 0 16px; margin-bottom: 24px; }
    .crumb-trigger { padding: 6px 12px; font-size: 12px; }
    .trigger-text { letter-spacing: 0.5px; }
    .hero-extra-content { padding: 12px 14px; }
    .hero-intro { font-size: 12px; line-height: 1.7; }

    .article-header .page-title { font-size: 20px; }
    .article-meta-bar { gap: 10px; font-size: 11px; }

    .article-section { margin-bottom: 28px; padding: 0 16px; }
    .article-container { padding: 24px 18px; border-radius: 12px; }
    .article-content { font-size: 14px; line-height: 1.9; }
    .article-content h2 { font-size: 19px; padding-left: 10px; }
    .article-content h3 { font-size: 16px; }
    .article-tags { gap: 8px; margin-top: 24px; padding-top: 18px; }
    .article-tags a { padding: 3px 10px; font-size: 11px; }

    .prev-next-nav { grid-template-columns: 1fr; gap: 10px; padding: 0 16px; margin-bottom: 28px; }
    .pn-item { padding: 14px 16px; }
    .pn-next { text-align: left; align-items: flex-start; }
    .pn-item a { font-size: 13px; }

    .bottom-recommend { padding: 0 16px; margin-bottom: 40px; gap: 28px; }
    .sec-title { font-size: 16px; }
    .sec-title::before { height: 16px; }

    /* 手机端卡片紧凑化（仅差异部分） */
    .bottom-recommend .m-card-body { padding: 10px; gap: 6px; }
    .bottom-recommend .m-card-title { font-size: 13px; -webkit-line-clamp: 1; }
    .bottom-recommend .m-card-desc { font-size: 11px; -webkit-line-clamp: 1; }
    .bottom-recommend .cmd-btn { padding: 5px 10px; font-size: 11px; }
    .bottom-recommend .cmd-btn em { display: none; }
    .bottom-recommend .m-card-badge { font-size: 10px; padding: 1px 6px; }
    .bottom-recommend .m-card-area { font-size: 9px; padding: 1px 6px; }

    .news-simple-item { padding: 12px 14px; }
    .news-simple-title { font-size: 13px; }
    .news-simple-date { font-size: 10px; }

    .back-top-btn { bottom: 20px; right: 20px; width: 40px; height: 40px; font-size: 18px; }
}

@media(max-width: 480px) {
    .bottom-recommend .m-card-body { padding: 8px; gap: 4px; }
    .bottom-recommend .m-card-title { font-size: 12px; }
    .bottom-recommend .cmd-btn { padding: 4px 8px; font-size: 10px; gap: 4px; }
    .bottom-recommend { padding: 0 14px; gap: 24px; }
}

@media(max-width: 380px) {
    .page-hero { padding: 0 12px; margin-bottom: 20px; }
    .crumb-trigger { padding: 5px 10px; font-size: 11px; gap: 4px; }
    .hero-intro { font-size: 11px; }

    .article-section { padding: 0 12px; }
    .article-container { padding: 20px 14px; }
    .article-content { font-size: 13px; }
    .article-header .page-title { font-size: 18px; }
    .prev-next-nav { padding: 0 12px; }
    .bottom-recommend { padding: 0 12px; }

    .bottom-recommend .m-card-body { padding: 6px; gap: 3px; }
    .bottom-recommend .m-card-title { font-size: 11px; }
    .bottom-recommend .m-card-desc { display: none; }
    .bottom-recommend .cmd-btn span { font-size: 10px; }
}