/* ================================================================
   Rivulet Lab · 二级页面通用样式（导航页 / 新闻页）
   复用主站设计令牌：#1456F0 主色、Inter / Google Sans Flex 字体
   ================================================================ */

:root {
    --page-primary: #1456F0;
    --page-primary-hover: #3B7AF8;
    --page-ink: #0D0D0D;
    --page-text: #6e7380;
    --page-muted: #9ca0ab;
    --page-line: #eceef3;
    --page-soft: #f7f8fb;
    --page-radius: 18px;
    --page-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 页面骨架 ---------- */
html {
    scroll-behavior: smooth;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.page-wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- 页头（无 header，导航统一由 iq-bar / mobile-nav 承担） ---------- */
.page-hero {
    position: relative;
    padding: 92px 0 44px;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    left: -10%;
    top: 40%;
    width: 120%;
    height: 60px;
    background: rgba(20, 86, 240, 0.03);
    transform: rotate(-8deg);
    pointer-events: none;
}

.page-hero .page-wrap {
    position: relative;
    z-index: 1;
}

.page-desc code {
    padding: 2px 7px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.86em;
    color: var(--page-primary);
    background: rgba(20, 86, 240, 0.07);
    border-radius: 6px;
}

/* 页头元素：模糊淡入 */
.eyebrow,
.page-title,
.page-desc,
.page-meta {
    animation: page-rise 0.85s var(--page-ease) both;
}

.page-title { animation-delay: 0.08s; }
.page-desc { animation-delay: 0.16s; }
.page-meta { animation-delay: 0.24s; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--page-primary);
    margin-bottom: 18px;
}

.eyebrow::before {
    content: '';
    width: 18px;
    height: 1.5px;
    background: var(--page-primary);
}

.page-title {
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #000;
    margin-bottom: 16px;
}

.page-desc {
    font-size: 1rem;
    font-weight: 300;
    color: var(--page-text);
    line-height: 1.8;
    max-width: 620px;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--page-text);
    background: var(--page-soft);
    border: 1px solid var(--page-line);
    border-radius: 999px;
}

.meta-chip i {
    color: var(--page-primary);
    font-size: 11px;
}

/* ---------- 工具条：搜索 + 分类筛选 ---------- */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 500;
    padding: 14px 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--page-line);
}

.toolbar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.tool-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
}

.tool-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--page-muted);
    pointer-events: none;
}

.tool-search input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 38px;
    font-family: inherit;
    font-size: 14px;
    color: #111;
    background: var(--page-soft);
    border: 1px solid transparent;
    border-radius: 999px;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.tool-search input:focus {
    border-color: rgba(20, 86, 240, 0.45);
    background: #fff;
}

.tool-search input::placeholder {
    color: var(--page-muted);
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #fff;
    border: 1px solid var(--page-line);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s var(--page-ease);
    white-space: nowrap;
}

.chip:hover {
    border-color: rgba(20, 86, 240, 0.4);
    color: var(--page-primary);
}

.chip.on {
    background: var(--page-primary);
    border-color: var(--page-primary);
    color: #fff;
}

/* ---------- 新闻列表 ---------- */
.news-list {
    padding: 34px 0 90px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    display: grid;
    grid-template-columns: 132px 1fr auto;
    gap: 26px;
    align-items: center;
    padding: 26px 28px;
    background: #fff;
    border: 1px solid var(--page-line);
    border-radius: var(--page-radius);
    cursor: pointer;
    transition: transform 0.45s var(--page-ease), box-shadow 0.45s ease, border-color 0.3s ease;
    opacity: 0;
    filter: blur(12px);
    transform: translateY(24px);
    animation: page-rise 0.7s var(--page-ease) forwards;
}

.news-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 50px rgba(20, 86, 240, 0.08);
    border-color: rgba(20, 86, 240, 0.25);
}

.news-item.hidden {
    display: none;
}

/* 统一的“模糊淡入”动画 */
@keyframes page-rise {
    from {
        opacity: 0;
        transform: translateY(24px);
        filter: blur(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* 统一的“模糊淡入”动画（横向） */
@keyframes page-rise-x {
    from {
        opacity: 0;
        transform: translateX(-24px);
        filter: blur(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

.news-date {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
}

.news-date .d-day {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #000;
    line-height: 1;
}

.news-date .d-ym {
    font-size: 12px;
    font-weight: 500;
    color: var(--page-muted);
    letter-spacing: 0.06em;
}

.news-main {
    min-width: 0;
}

.news-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    margin-bottom: 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--page-primary);
    background: rgba(20, 86, 240, 0.07);
    border-radius: 999px;
}

.news-title {
    font-size: 19px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.02em;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-summary {
    font-size: 13.5px;
    color: var(--page-text);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--page-primary);
    background: rgba(20, 86, 240, 0.06);
    font-size: 13px;
    transition: transform 0.3s var(--page-ease), background 0.3s ease;
    flex-shrink: 0;
}

.news-item:hover .news-arrow {
    transform: translateX(3px);
    background: rgba(20, 86, 240, 0.14);
}

/* ---------- 空态 / 加载 ---------- */
.state-box {
    padding: 70px 24px;
    text-align: center;
    color: var(--page-text);
}

.state-box .state-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--page-primary);
    background: rgba(20, 86, 240, 0.07);
}

.state-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.state-box p {
    font-size: 14px;
    line-height: 1.8;
    max-width: 460px;
    margin: 0 auto;
}

.state-box code {
    padding: 2px 7px;
    font-size: 12.5px;
    background: var(--page-soft);
    border: 1px solid var(--page-line);
    border-radius: 6px;
    color: var(--page-primary);
}

.skeleton {
    height: 118px;
    border-radius: var(--page-radius);
    background: linear-gradient(100deg, #f4f5f8 30%, #eef0f5 45%, #f4f5f8 60%);
    background-size: 300% 100%;
    animation: page-shimmer 1.4s ease-in-out infinite;
}

@keyframes page-shimmer {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}

/* ---------- 新闻正文浮层 ---------- */
.article-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(10, 12, 20, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.article-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.article-sheet {
    position: absolute;
    top: 0;
    right: 0;
    width: min(760px, 100%);
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(40px);
    filter: blur(10px);
    opacity: 0.4;
    transition: transform 0.5s var(--page-ease), filter 0.5s var(--page-ease), opacity 0.5s var(--page-ease);
    box-shadow: -30px 0 80px rgba(0, 0, 0, 0.12);
}

.article-overlay.open .article-sheet {
    transform: translateX(0);
    filter: blur(0);
    opacity: 1;
}

.md-loading {
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    color: var(--page-muted);
}

.article-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 26px;
    border-bottom: 1px solid var(--page-line);
    flex-shrink: 0;
}

.article-bar .bar-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--page-primary);
}

.article-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--page-soft);
    color: #333;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.article-close:hover {
    background: rgba(20, 86, 240, 0.1);
    color: var(--page-primary);
    transform: rotate(90deg);
}

.article-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 40px 26px 90px;
}

.article-head {
    max-width: 660px;
    margin: 0 auto 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--page-line);
}

.article-head h1 {
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.2;
    color: #000;
    margin: 12px 0 16px;
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12.5px;
    color: var(--page-muted);
}

.article-info i {
    color: var(--page-primary);
    margin-right: 5px;
}

/* ---------- Markdown 排版 ---------- */
.md-body {
    max-width: 660px;
    margin: 0 auto;
    font-size: 15.5px;
    line-height: 1.85;
    color: #2b2f38;
    word-wrap: break-word;
}

.md-body > *:first-child { margin-top: 0; }

.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.md-body h5,
.md-body h6 {
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
    color: #000;
    letter-spacing: -0.025em;
    line-height: 1.35;
    margin: 1.9em 0 0.7em;
    scroll-margin-top: 90px;
}

.md-body h1 { font-size: 1.75rem; font-weight: 800; }
.md-body h2 {
    font-size: 1.4rem;
    font-weight: 800;
    padding-top: 1em;
    border-top: 1px solid var(--page-line);
}
.md-body h3 { font-size: 1.15rem; font-weight: 700; }
.md-body h4 { font-size: 1rem; font-weight: 700; color: var(--page-primary); }

.md-body p {
    margin: 0 0 1.15em;
}

.md-body a {
    color: var(--page-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(20, 86, 240, 0.3);
    transition: border-color 0.25s ease;
}

.md-body a:hover {
    border-color: var(--page-primary);
}

.md-body strong { color: #000; font-weight: 700; }

.md-body em { font-style: normal; color: var(--page-primary); opacity: 0.9; }

.md-body del { color: var(--page-muted); }

.md-body ul,
.md-body ol {
    margin: 0 0 1.2em;
    padding-left: 1.4em;
}

.md-body li {
    margin-bottom: 0.45em;
}

.md-body li::marker {
    color: var(--page-primary);
    font-weight: 600;
}

.md-body blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--page-primary);
    color: var(--page-text);
}

.md-body blockquote p:last-child { margin-bottom: 0; }

.md-body hr {
    margin: 2.4em 0;
    border: none;
    border-top: 1px solid var(--page-line);
}

.md-body code {
    padding: 2px 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.86em;
    color: var(--page-primary);
    background: rgba(20, 86, 240, 0.07);
    border-radius: 5px;
}

.md-body .md-code {
    margin: 1.6em 0;
    padding: 18px 20px;
    background: #0f1420;
    border-radius: 14px;
    overflow-x: auto;
}

.md-body .md-code code {
    padding: 0;
    font-size: 0.85em;
    line-height: 1.7;
    color: #d7e0f5;
    background: none;
}

.md-body img {
    display: block;
    max-width: 100%;
    margin: 1.6em auto;
    border-radius: 12px;
}

.md-table-wrap {
    margin: 1.6em 0;
    overflow-x: auto;
}

.md-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.md-body th,
.md-body td {
    padding: 10px 14px;
    border: 1px solid var(--page-line);
    text-align: left;
}

.md-body th {
    background: var(--page-soft);
    font-weight: 600;
    color: #000;
}

/* ---------- 导航页 ---------- */
.nav-section {
    padding: 34px 0 24px;
}

.nav-group-title {
    animation: page-rise-x 0.8s var(--page-ease) both;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--page-primary);
    margin-bottom: 18px;
}

.nav-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--page-line);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 16px;
    margin-bottom: 46px;
}

.nav-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--page-line);
    border-radius: var(--page-radius);
    transition: transform 0.45s var(--page-ease), box-shadow 0.45s ease, border-color 0.3s ease;
    animation: page-rise 0.7s var(--page-ease) both;
}

.nav-card:nth-child(1) { animation-delay: 0.04s; }
.nav-card:nth-child(2) { animation-delay: 0.10s; }
.nav-card:nth-child(3) { animation-delay: 0.16s; }
.nav-card:nth-child(4) { animation-delay: 0.22s; }
.nav-card:nth-child(5) { animation-delay: 0.28s; }
.nav-card:nth-child(n + 6) { animation-delay: 0.34s; }

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 44px rgba(20, 86, 240, 0.09);
    border-color: rgba(20, 86, 240, 0.25);
}

.nav-card.hidden { display: none; }

.nav-card .card-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--page-primary);
    background: rgba(20, 86, 240, 0.07);
    transition: background 0.3s ease;
}

.nav-card:hover .card-icon {
    background: rgba(20, 86, 240, 0.14);
}

.nav-card .card-body { min-width: 0; }

.nav-card .card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.02em;
    margin-bottom: 5px;
}

.nav-card .card-title i.jump {
    font-size: 10px;
    color: var(--page-muted);
}

.nav-card .card-desc {
    font-size: 13px;
    line-height: 1.65;
    color: var(--page-text);
    margin-bottom: 8px;
}

.nav-card .card-url {
    font-size: 11.5px;
    color: var(--page-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 页脚 ---------- */
.mini-footer {
    margin-top: auto;
    padding: 34px 0 40px;
    background: var(--page-ink);
    color: rgba(255, 255, 255, 0.45);
}

.mini-footer .page-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
}

.mini-footer .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
}

.mini-footer .brand img { width: 22px; }

.mini-footer .links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mini-footer .links a:hover { color: #fff; }

.mini-footer .copy { color: rgba(255, 255, 255, 0.25); font-size: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .news-item {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 22px 20px;
    }
    .news-title { white-space: normal; }
    .news-arrow { display: none; }
    .news-date {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }
    .news-date .d-day { font-size: 20px; }
}

@media (max-width: 767px) {
    /* 为底部药丸导航预留安全空间（含 iPhone 安全区） */
    .mini-footer {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 104px);
    }
    .news-list { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 104px); }
    .nav-section { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
}

@media (max-width: 720px) {
    .page-wrap { padding: 0 18px; }
    .page-hero { padding: 68px 0 30px; }
    .toolbar { top: 0; }
    .article-scroll { padding: 28px 20px 70px; }
    .nav-grid { grid-template-columns: 1fr; }
    .mini-footer .page-wrap { flex-direction: column; text-align: center; }
}

/* iq-bar / mobile-nav 已在 css/style.css 中定义；正文浮层打开时让位 */
body.article-open .iq-bar {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateX(-50%) translateY(14px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

body.article-open .mobile-nav {
    opacity: 0 !important;
    pointer-events: none;
    transform: translateY(120%);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* 正文内容模糊淡入 */
.md-body.enter,
.article-head.enter {
    animation: page-rise 0.65s var(--page-ease) both;
}
