/* ============================================================
   BQLinux 首页 · 深色玻璃拟态 (Glassmorphism) 主题
   仅作用于首页；其它页面仍用 style.css / csdn-style.css
   ============================================================ */

:root {
    --bg-0: #05060c;
    --bg-1: #0a0d1a;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-strong: rgba(255, 255, 255, 0.075);
    --glass-hover: rgba(255, 255, 255, 0.10);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #e8ecf6;
    --text-dim: #9aa3b8;
    --text-faint: #6b7488;
    --cyan: #38e1ff;
    --violet: #9b7bff;
    --green: #3ddc97;
    --amber: #ffc857;
    --pink: #ff7ab6;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ---------- 背景：网格 + 极光光晕 ---------- */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    contain: strict;
    background-image:
        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: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
            mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
    pointer-events: none;
}

.orb {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    will-change: transform;
    contain: layout style paint;
    opacity: 0.55;
    pointer-events: none;
    animation: float 24s ease-in-out infinite;
    transform: translateZ(0);
}
.orb-a { width: 520px; height: 520px; top: -160px; left: -120px; background: radial-gradient(circle, #1f6feb, transparent 65%); }
.orb-b { width: 460px; height: 460px; top: 120px; right: -160px; background: radial-gradient(circle, #7b3ff2, transparent 65%); animation-delay: -6s; }
.orb-c { width: 420px; height: 420px; bottom: -180px; left: 35%; background: radial-gradient(circle, #0e7490, transparent 65%); animation-delay: -12s; }

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(40px, 30px, 0) scale(1.08); }
    66%      { transform: translate3d(-30px, -25px, 0) scale(0.95); }
}

/* ---------- 水印层（bqlinux.cn 平铺） ---------- */
.wm-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
    opacity: 0.055;
}
.wm-layer span {
    position: absolute;
    font-size: 24px;
    font-weight: 700;
    color: #d7dced;
    white-space: nowrap;
    transform: rotate(-30deg);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    letter-spacing: 1px;
}
/* 内容层压在水印之上 */
.g-hero, .g-wrap, .g-footer { position: relative; z-index: 1; }

/* ---------- 通用玻璃卡片 ---------- */
.glass {
    background: var(--glass);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- 顶部导航 ---------- */
.g-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 20px;
    background: rgba(5, 6, 12, 0.55);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--line);
}

.g-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.g-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text);
}
.g-brand .mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(56, 225, 255, 0.28), rgba(155, 123, 255, 0.28));
    border: 1px solid var(--line-strong);
    box-shadow: 0 0 18px rgba(56, 225, 255, 0.22);
}
.g-brand b {
    background: linear-gradient(92deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.g-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex: 1;
}
.g-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.93rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.22s ease;
    white-space: nowrap;
}
.g-menu a:hover {
    color: var(--text);
    background: var(--glass-strong);
    box-shadow: inset 0 0 0 1px var(--line);
}
.g-menu a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(56, 225, 255, 0.20), rgba(155, 123, 255, 0.20));
    box-shadow: inset 0 0 0 1px rgba(56, 225, 255, 0.32), 0 0 18px rgba(56, 225, 255, 0.14);
}
.g-menu a.accent { color: var(--amber); }
.g-menu a.logout { color: var(--text-faint); font-size: 0.86rem; }
.g-menu a.logout:hover { color: #ff9dbb; }
.g-menu a.accent:hover { color: #ffd98a; }

.g-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.g-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 14px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.g-search:focus-within {
    border-color: rgba(56, 225, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.10);
}
.g-search input {
    width: 168px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
}
.g-search input::placeholder { color: var(--text-faint); }
.g-search button {
    width: 30px; height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(56, 225, 255, 0.24), rgba(155, 123, 255, 0.24));
    color: var(--text);
    font-size: 0.85rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.g-search button:hover { transform: scale(1.08); filter: brightness(1.2); }

.g-time {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.76rem;
    color: var(--text-faint);
    white-space: nowrap;
}

.g-burger {
    display: none;
    width: 38px; height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--text);
    font-size: 1.05rem;
    cursor: pointer;
}

/* ---------- Hero ---------- */
.g-hero {
    max-width: 1400px;
    margin: 26px auto 0;
    padding: 44px 34px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 130% at 8% 0%, rgba(56, 225, 255, 0.16), transparent 55%),
        radial-gradient(110% 120% at 92% 10%, rgba(155, 123, 255, 0.16), transparent 55%),
        var(--glass);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.g-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.05) 48%, transparent 62%);
    pointer-events: none;
}
.g-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.6px;
    color: var(--cyan);
    background: rgba(56, 225, 255, 0.10);
    border: 1px solid rgba(56, 225, 255, 0.25);
    margin-bottom: 18px;
}
.g-eyebrow .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.g-eyebrow .dot { will-change: opacity; }

.g-hero h1 {
    font-size: clamp(1.9rem, 4.2vw, 3.1rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.18;
    margin-bottom: 14px;
}
.g-hero h1 span {
    background: linear-gradient(92deg, #7fe9ff 0%, #9b7bff 55%, #ff7ab6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.g-hero p.sub {
    color: var(--text-dim);
    max-width: 620px;
    font-size: 1.02rem;
}

.g-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}
.g-stat {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.g-stat b {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1.15rem;
    color: #fff;
    margin-right: 6px;
}
.g-stat span { font-size: 0.82rem; color: var(--text-faint); }

/* ---------- 主体三栏 ---------- */
.g-wrap {
    max-width: 1400px;
    margin: 26px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start;
}

.g-col { display: flex; flex-direction: column; gap: 18px; }

.g-card {
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.g-card:hover {
    transform: translateY(-3px) translateZ(0);
    border-color: var(--line-strong);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}
.g-card h3 {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 分类列表 */
.g-cat { list-style: none; }
.g-cat li { margin-bottom: 4px; }
.g-cat a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 10px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.g-cat a:hover {
    color: var(--text);
    background: var(--glass-strong);
    transform: translateX(3px);
}
.g-cat a span {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.76rem;
    color: var(--cyan);
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(56, 225, 255, 0.10);
    border: 1px solid rgba(56, 225, 255, 0.18);
}

/* 排行榜 */
.g-rank { list-style: none; counter-reset: r; }
.g-rank li {
    counter-increment: r;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}
.g-rank li:last-child { border-bottom: none; }
.g-rank li::before {
    content: counter(r);
    flex: 0 0 20px;
    height: 20px;
    margin-top: 3px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    color: var(--text-faint);
    background: var(--glass-strong);
    border: 1px solid var(--line);
}
.g-rank li:nth-child(1)::before { color: #fff; background: linear-gradient(135deg, var(--cyan), var(--violet)); border-color: transparent; }
.g-rank li:nth-child(2)::before { color: #fff; background: linear-gradient(135deg, #7c8aa5, #5a6478); border-color: transparent; }
.g-rank li:nth-child(3)::before { color: #fff; background: linear-gradient(135deg, #c08457, #8a5a35); border-color: transparent; }
.g-rank a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.g-rank a:hover { color: var(--cyan); }

/* 关于本站 */
.g-about p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 8px; }
.g-about .dim { color: var(--text-faint); font-size: 0.85rem; }

/* 友情链接 / 工具 */
.g-links { list-style: none; }
.g-links li { margin-bottom: 6px; }
.g-links a {
    display: block;
    padding: 8px 11px;
    border-radius: 10px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.89rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.g-links a:hover {
    color: #fff;
    background: var(--glass-strong);
    border-color: var(--line);
    transform: translateX(3px);
}
.g-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-tool {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    color: var(--text);
    text-decoration: none;
    background: var(--glass);
    border: 1px solid var(--line);
    transition: all 0.22s ease;
}
.g-tool:hover {
    color: #fff;
    border-color: rgba(56, 225, 255, 0.4);
    box-shadow: 0 0 18px rgba(56, 225, 255, 0.16);
    transform: translateY(-2px);
}

/* ---------- 文章卡片 ---------- */
.g-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 2px;
    font-size: 1.06rem;
    font-weight: 700;
}
.g-section-title::before {
    content: "";
    width: 4px; height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--cyan), var(--violet));
    box-shadow: 0 0 12px rgba(56, 225, 255, 0.5);
}
.g-section-title small {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-faint);
}

.g-posts { display: flex; flex-direction: column; gap: 16px; }

.g-post {
    position: relative;
    padding: 22px 24px;
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(.22,.8,.3,1), border-color 0.28s ease, box-shadow 0.28s ease;
}
.g-post::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--cyan), var(--violet));
    opacity: 0;
    transition: opacity 0.28s ease;
}
.g-post:hover {
    transform: translateY(-5px) translateZ(0);
    border-color: var(--line-strong);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.6);
}
.g-post:hover::before { opacity: 1; }

.g-post-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.g-tag {
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}
.g-tag.ai      { color: var(--pink);   background: rgba(255, 122, 182, 0.12); border-color: rgba(255, 122, 182, 0.28); }
.g-tag.en      { color: var(--cyan);   background: rgba(56, 225, 255, 0.12);  border-color: rgba(56, 225, 255, 0.28); }
.g-tag.docker  { color: var(--green);  background: rgba(61, 220, 151, 0.12);  border-color: rgba(61, 220, 151, 0.28); }
.g-tag.linux   { color: var(--amber);  background: rgba(255, 200, 87, 0.12);  border-color: rgba(255, 200, 87, 0.28); }
.g-tag.sql     { color: var(--violet); background: rgba(155, 123, 255, 0.12); border-color: rgba(155, 123, 255, 0.28); }
.g-tag.time    { color: var(--text-faint); font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.75rem; margin-left: auto; }

.g-post h3 {
    font-size: 1.22rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}
.g-post h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}
.g-post h3 a:hover {
    color: #fff;
    background: linear-gradient(92deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}
.g-post p {
    color: var(--text-dim);
    font-size: 0.93rem;
    margin-bottom: 14px;
}
.g-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-faint);
}
.g-meta span { display: inline-flex; align-items: center; gap: 5px; }
.g-meta .author { color: var(--cyan); }

/* ---------- 页脚 ---------- */
.g-footer {
    max-width: 1400px;
    margin: 34px auto 0;
    padding: 26px 20px 34px;
    text-align: center;
    font-size: 0.86rem;
    color: var(--text-faint);
    border-top: 1px solid var(--line);
}
.g-footer a { color: var(--text-dim); text-decoration: none; }
.g-footer a:hover { color: var(--cyan); }
.g-footer p { margin-bottom: 8px; }
.g-footer img { vertical-align: middle; height: 20px; }
.g-footer .beian { color: var(--text-faint); text-decoration: none; margin: 0 8px; }
.g-footnav {
    padding: 10px 14px;
    display: inline-block;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.g-footnav a { color: var(--text-dim); text-decoration: none; margin: 0 2px; }
.g-footnav a:hover { color: var(--cyan); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
    .g-wrap { grid-template-columns: minmax(0, 1fr) 280px; }
    .g-col-left { display: none; }
}
@media (max-width: 900px) {
    .g-wrap { grid-template-columns: minmax(0, 1fr); }
    .g-col-right { display: none; }
    .g-burger { display: grid; place-items: center; }
    .g-menu {
        position: absolute;
        left: 16px; right: 16px; top: 62px;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px;
        border-radius: var(--radius);
        background: rgba(10, 13, 26, 0.94);
        backdrop-filter: blur(20px);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
        display: none;
    }
    .g-menu.open { display: flex; }
    .g-menu a { padding: 11px 14px; }
    .g-search { display: none; }
    .g-time { display: none; }
    .g-hero { padding: 32px 22px; margin-top: 18px; }
}
@media (max-width: 560px) {
    .g-stats { gap: 8px; }
    .g-stat { padding: 8px 13px; }
    .g-post { padding: 18px; }
}

/* 尊重减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- 返回顶部按钮 ---------- */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 32px;
    z-index: 90;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(10, 13, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--cyan);
    font-size: 1.3rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
                background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: rgba(56, 225, 255, 0.15);
    box-shadow: 0 0 18px rgba(56, 225, 255, 0.25);
    border-color: rgba(56, 225, 255, 0.4);
}
@media (max-width: 900px) {
    .back-to-top { right: 16px; bottom: 20px; width: 40px; height: 40px; font-size: 1.1rem; }
}
