/* ============================================================
   FlowPix — 黑色科技主题（覆盖 style.css）
   移除本文件在 layout.php 中的引用即可恢复原浅色样式
   ============================================================ */

:root {
    --primary: #ffffff;
    --primary-light: #ffffff;
    --violet: #8a8a8a;
    --bg: #000000;
    --bg-card: #0a0a0a;
    --bg-card-hover: #101010;
    --text: #e6e6e6;
    --text-strong: #ffffff;
    --text-muted: #8c8c8c;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.22);
    --radius: 14px;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 18px 48px rgba(0, 0, 0, 0.7);
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', monospace;
    --brand: #c5f135;
    --brand-hover: #d6f86a;
    --brand-soft: rgba(197, 241, 53, 0.12);
    --brand-line: rgba(197, 241, 53, 0.45);
    color-scheme: dark;
}

/* 栏目自带的彩色统一压成黑白 */
[style*="--accent"] { --accent: #e6e6e6 !important; }

/* === 底色：纯黑 + 极淡网格 === */
body {
    background-color: var(--bg);
    color: var(--text);
    background-image:
        radial-gradient(900px 480px at 78% -8%, rgba(197, 241, 53, 0.07), transparent 65%),
        radial-gradient(1000px 520px at 30% -12%, rgba(255, 255, 255, 0.05), transparent 65%),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: auto, auto, 44px 44px, 44px 44px;
    background-attachment: fixed;
}
a { color: var(--text-strong); }
a:hover { color: var(--text-strong); }
::selection { background: var(--brand); color: #000; }

/* === 顶栏 === */
.site-header {
    background: rgba(0, 0, 0, 0.78);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.logo { color: var(--text-strong); letter-spacing: 0; }
.logo span { color: var(--brand); }
.nav-link { color: var(--text-muted); }
.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-strong);
    box-shadow: inset 0 0 0 1px var(--border);
}
/* 导航「AI 工作流工具」：品牌绿 */
.nav-tool {
    background: var(--brand);
    color: #000 !important;
    box-shadow: 0 0 18px rgba(197, 241, 53, 0.25);
    animation: none;
}
.nav-tool svg { stroke: #000 !important; animation: none; }
.nav-tool::after { display: none; }
.nav-tool:hover, .nav-tool.active {
    background: var(--brand-hover);
    color: #000 !important;
    box-shadow: 0 0 0 4px var(--brand-soft), 0 0 24px rgba(197, 241, 53, 0.35);
    transform: translateY(-1px);
}
.lang-switcher .lang-link {
    border-color: var(--border);
    color: var(--text-muted);
    background: transparent;
}
.lang-switcher .lang-link:hover {
    border-color: var(--border-strong);
    color: var(--text-strong);
}
.lang-switcher .lang-link.active {
    background: transparent;
    border-color: var(--brand-line);
    color: var(--brand);
}
.menu-toggle { color: var(--text); }

/* === Hero === */
.hero { padding: 72px 0 48px; }
.hero h1 { color: var(--text-strong); letter-spacing: -0.5px; }
.hero-highlight {
    background: linear-gradient(120deg, #e6ff9a 0%, var(--brand) 55%, #8fd400 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
.hero-desc { color: var(--text-muted); }
.hero-banner {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.hero-banner:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.hero-banner-label {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.02em;
}

/* === 卡片：栏目 / 文章 / 侧栏 === */
.category-card,
.article-card,
.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.category-card { color: var(--text); position: relative; overflow: hidden; }
.category-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}
.category-card:hover,
.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.category-card:hover::before { opacity: 1; }
.category-card h2 { color: var(--text-strong); }
.category-card p, .card-body p, .card-footer { color: var(--text-muted); }
.card-icon {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
    transition: color 0.25s, background 0.25s, box-shadow 0.25s;
}
.category-card:hover .card-icon {
    color: var(--brand);
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px var(--brand-line);
}
.card-count, .card-category, .article-category {
    font-family: var(--mono);
    letter-spacing: 0.06em;
}
.card-category, .article-category { color: var(--text-muted); }
.card-image { display: block; overflow: hidden; }
.card-image img { transition: transform 0.4s ease, filter 0.4s ease; }
.article-card:hover .card-image img { transform: scale(1.04); }
.card-body > time {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
    letter-spacing: 0.04em;
}
.card-body h3 a { color: var(--text-strong); }
.card-body h3 a:hover { color: var(--brand); text-decoration: none; }
.article-card:hover .card-category { color: var(--brand); }

.section-title {
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: "";
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: var(--brand);
    box-shadow: 0 0 10px rgba(197, 241, 53, 0.5);
}

/* === 面包屑 / 栏目页头 === */
.breadcrumb ol { color: var(--text-muted); font-family: var(--mono); font-size: 13px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-strong); }
.category-header h1 { color: var(--text-strong); }
.category-desc { color: var(--text-muted); }

/* === 文章页 === */
.article-header h1 { color: var(--text-strong); }
.article-meta { color: var(--text-muted); font-family: var(--mono); font-size: 13px; }
.article-cover img {
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.article-body { color: #cfcfcf; }
.article-body h2 {
    color: var(--text-strong);
    border-top: 1px solid var(--border);
    position: relative;
}
.article-body h2::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--brand);
}
.article-body h3 { color: var(--text); }
.article-body strong { color: var(--text-strong); }
.article-body a {
    color: var(--text-strong);
    text-decoration: underline;
    text-decoration-color: var(--brand-line);
    text-underline-offset: 4px;
}
.article-body a:hover { color: var(--brand); text-decoration-color: var(--brand); }
.article-body p[data-snippet] {
    padding: 14px 18px;
    border-radius: 10px;
    background: rgba(197, 241, 53, 0.04);
    border: 1px solid var(--border);
    border-left: 2px solid var(--brand);
}
.article-body table {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.article-body th, .article-body td { border: 0; border-bottom: 1px solid var(--border); }
.article-body tr:last-child td { border-bottom: 0; }
.article-body th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-strong);
    font-size: 14px;
}
.article-body tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.article-body blockquote {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--brand);
    color: var(--text);
}
.article-body code {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
    font-family: var(--mono);
}
.article-body pre {
    background: #050505;
    border: 1px solid var(--border);
}
.article-body img, .ai-image img { border: 1px solid var(--border); }
.ai-image figcaption { color: var(--text-muted); }

/* 侧栏 */
.sidebar-section h3 {
    color: var(--text-strong);
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
}
.related-list li { border-bottom-color: var(--border); }
.related-list a { color: var(--text); }
.related-list a:hover .related-title { color: var(--brand); }
.related-list time { color: var(--text-muted); font-family: var(--mono); }

/* === 分页 / 按钮 === */
.page-link {
    border-color: var(--border);
    color: var(--text);
    background: transparent;
    font-family: var(--mono);
}
.page-link:hover {
    border-color: var(--brand-line);
    color: var(--brand);
}
.page-link.active {
    background: var(--brand);
    color: #000;
    border-color: var(--brand);
}
.btn { background: var(--brand); color: #000; }
.btn:hover { background: var(--brand-hover); color: #000; }

/* === 404 / 关于 / 空状态 === */
.error-page h1 {
    font-family: var(--mono);
    color: var(--text-strong);
    background: linear-gradient(120deg, #e6ff9a 0%, var(--brand) 60%, #8fd400 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.error-page p, .empty-state { color: var(--text-muted); }
.about-page h1, .about-page h2 { color: var(--text-strong); }
.about-page p, .about-page li { color: #cfcfcf; }
.about-page strong { color: var(--text-strong); }
.about-tagline { color: var(--text-muted); }

/* === 友链 / 页脚 === */
.friend-links-list a { color: var(--text-muted); }
.friend-links-list a:hover { color: var(--text-strong); }
.site-footer {
    background: #000;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}
.footer-nav h4 { font-family: var(--mono); color: var(--text-strong); }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--brand); }
.footer-bottom { border-top-color: var(--border); font-family: var(--mono); }

/* === 移动端菜单 === */
@media (max-width: 768px) {
    .main-nav {
        background: rgba(0, 0, 0, 0.96);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    body { background-attachment: scroll; }
}

/* ============================================================
   版式：首页
   ============================================================ */

.hero-split {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
    align-items: center;
    text-align: left;
    padding: 72px 0 64px;
}
.hero-split h1 {
    font-size: clamp(28px, 3.1vw, 42px);
    line-height: 1.28;
    margin: 20px 0 16px;
}
.hero-split .hero-desc {
    margin: 0;
    max-width: 520px;
    font-size: 17px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.16em;
}
.hero-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 10px var(--brand);
    animation: tech-blink 2s ease-in-out infinite;
}
@keyframes tech-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.hero-btn:hover { text-decoration: none; transform: translateY(-2px); }
.hero-btn-primary {
    background: var(--brand);
    color: #000;
    box-shadow: 0 0 24px rgba(197, 241, 53, 0.25);
}
.hero-btn-primary:hover {
    background: var(--brand-hover);
    color: #000;
    box-shadow: 0 0 32px rgba(197, 241, 53, 0.4);
}
.hero-btn-ghost {
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-strong);
}
.hero-btn-ghost:hover { border-color: #ffffff; color: #ffffff; }
.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.hero-stat strong {
    display: block;
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-strong);
}
.hero-stat span {
    font-size: 13px;
    color: var(--text-muted);
}
.hero-split .hero-banner {
    margin: 0;
    max-width: none;
    border-color: var(--border-strong);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(197, 241, 53, 0.08);
}
.hero-split .hero-banner-label {
    top: 14px;
    right: 14px;
    bottom: auto;
    left: auto;
    z-index: 3;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid var(--border-strong);
    font-size: 12px;
    text-shadow: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hero-split .hero-banner::before,
.hero-split .hero-banner::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 2;
    pointer-events: none;
}
.hero-split .hero-banner::before {
    top: 10px;
    left: 10px;
    border-top: 2px solid var(--brand);
    border-left: 2px solid var(--brand);
}
.hero-split .hero-banner::after {
    right: 10px;
    bottom: 10px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
}

/* 栏目卡片：三列 + 编号 + 大数字 */
.category-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 64px;
}
.category-card { padding: 26px 26px 22px; }
.card-index {
    position: absolute;
    top: 18px;
    right: 22px;
    font-family: var(--mono);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.08);
    transition: color 0.25s;
}
.category-card:hover .card-index { color: var(--brand-line); }
.card-count {
    display: block;
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px dashed var(--border);
    color: var(--text-muted);
    font-weight: 500;
}
.card-count strong {
    font-size: 20px;
    color: var(--text-strong);
    margin-right: 4px;
}

/* 最新文章：首篇 2×2 头条 */
.latest-articles .article-grid {
    grid-template-columns: repeat(3, 1fr);
}
.latest-articles .article-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
}
.latest-articles .article-card:first-child .card-image {
    flex: 1 1 auto;
    min-height: 260px;
    position: relative;
}
.latest-articles .article-card:first-child .card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.latest-articles .article-card:first-child .card-body {
    padding: 28px 30px;
}
.latest-articles .article-card:first-child h3 {
    font-size: 26px;
    line-height: 1.35;
}
.latest-articles .article-card:first-child .card-body p {
    font-size: 15px;
}
.latest-articles .article-card:first-child .card-category::before {
    content: "FEATURED · ";
    color: var(--brand);
}

/* ============================================================
   版式：文章页
   ============================================================ */

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 200;
    pointer-events: none;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: var(--brand);
    box-shadow: 0 0 12px rgba(197, 241, 53, 0.7);
}
.article-body h2 { scroll-margin-top: 90px; }
.article-toc {
    margin-bottom: 18px;
}
.article-toc ol {
    list-style: none;
    counter-reset: toc;
}
.article-toc li {
    counter-increment: toc;
    margin-bottom: 4px;
}
.article-toc a {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.article-toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}
.article-toc a:hover {
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
.article-toc a.active {
    color: var(--brand);
    background: var(--brand-soft);
    border-left-color: var(--brand);
}
.article-toc a.active::before { color: var(--brand); }
.article-sidebar {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
}

@media (max-width: 900px) {
    .hero-split {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 44px 0 40px;
    }
    .category-cards { grid-template-columns: repeat(2, 1fr); }
    .latest-articles .article-grid { grid-template-columns: repeat(2, 1fr); }
    .latest-articles .article-card:first-child { grid-row: auto; }
}
@media (max-width: 768px) {
    .article-toc { display: none; }
    .article-sidebar { max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
    .hero-stats { gap: 24px; }
    .hero-stat strong { font-size: 22px; }
    .latest-articles .article-grid { grid-template-columns: 1fr; }
    .latest-articles .article-card:first-child { grid-column: auto; }
    .latest-articles .article-card:first-child h3 { font-size: 20px; }
}
@media (max-width: 480px) {
    .category-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .card-image img, .category-card::before { transition: none; }
    .hero-badge-dot { animation: none; }
}
