/* ============================================================
   QuickQ 主题公用样式：导航、页脚、文章列表、文章详情、分页
   断点：手机 < 768px ｜ 笔记本 / 平板 768px - 1279px ｜ 电脑 ≥ 1280px
   ============================================================ */

:root {
    --qq-primary: #2171ff;
    --qq-primary-light: #4f9bff;
    --qq-bg: #000;
    --qq-bg-deep: #011022;
    --qq-bg-menu: #001021;
    --qq-bg-card: rgba(15, 26, 48, 0.55);
    --qq-text: #fff;
    --qq-text-muted: rgba(255, 255, 255, 0.7);
    --qq-text-dim: rgba(255, 255, 255, 0.45);
    --qq-border: rgba(255, 255, 255, 0.1);
    --qq-header-h: 80px;
    --qq-font: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
    background: var(--qq-bg);
}

body.qq-layout {
    background: var(--qq-bg);
    color: var(--qq-text);
}

body.ko-layout {
    font-family: 'Inter', var(--qq-font);
}

/* ---------- 导航 ---------- */
.qq-header,
.qq-header *,
.qq-footer,
.qq-footer * {
    box-sizing: border-box;
}

.qq-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 899;
    font-family: var(--qq-font);
    line-height: 1.5;
}

.qq-header a {
    color: inherit;
    text-decoration: none;
}

.qq-header img {
    display: block;
    max-width: 100%;
}

.qq-header__bar {
    background: rgba(0, 0, 0, 0.565);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background 0.3s;
}

.qq-header.is-scrolled .qq-header__bar {
    background: rgba(0, 0, 0, 0.8);
}

.qq-header__inner {
    display: flex;
    align-items: center;
    width: 95.8333%;
    max-width: 1920px;
    height: var(--qq-header-h);
    margin: 0 auto;
    padding: 0 40px;
}

.qq-logo {
    flex-shrink: 0;
    transition: transform 0.3s;
}

.qq-logo:hover {
    transform: translateX(8px);
}

.qq-logo img {
    width: 192px;
    height: auto;
}

.qq-nav {
    display: flex;
    flex: 0 1 620px;
    margin-left: 100px;
    color: #fff;
    font-size: 14px;
}

.qq-nav__item {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.qq-nav__link {
    display: block;
    width: 100%;
    line-height: var(--qq-header-h);
    text-align: center;
    white-space: nowrap;
    transition: color 0.2s;
}

.qq-nav__link:hover,
.qq-nav__link.is-active,
.qq-nav__drop:hover > .qq-nav__link {
    color: var(--qq-primary);
}

.qq-nav__menu {
    position: absolute;
    top: var(--qq-header-h);
    left: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 160px;
    padding: 8px;
    background: var(--qq-bg-menu);
    border-radius: 2px;
    line-height: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.qq-nav__drop:hover .qq-nav__menu,
.qq-nav__drop:focus-within .qq-nav__menu {
    opacity: 1;
    pointer-events: auto;
}

.qq-nav__menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.qq-nav__menu a:hover {
    background: #031a33;
    border-color: #193cb8;
    color: var(--qq-primary);
}

.qq-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.qq-nav__icon img {
    width: 100%;
}

.qq-nav__menu a:hover .qq-nav__icon img {
    filter: brightness(0) saturate(100%) invert(35%) sepia(39%) saturate(4214%) hue-rotate(209deg) brightness(99%) contrast(104%);
}

.qq-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    padding: 9px 26px;
    border-radius: 9999px;
    background: var(--qq-primary);
    color: #fff !important;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 0 0 2px rgba(0, 209, 255, 0.25), 0 6px 20px rgba(33, 113, 255, 0.35);
    transition: transform 0.2s, opacity 0.2s;
}

.qq-header__cta:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

.qq-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 8px;
    background: none;
    border: 0;
    cursor: pointer;
}

.qq-burger span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

.qq-header-spacer {
    height: var(--qq-header-h);
}

/* 移动端抽屉 */
.qq-drawer {
    position: fixed;
    inset: 0;
    z-index: 1999;
    visibility: hidden;
    pointer-events: none;
}

.qq-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.qq-drawer__mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.qq-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--qq-bg-deep);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.3s;
}

.qq-drawer.is-open .qq-drawer__mask {
    opacity: 1;
}

.qq-drawer.is-open .qq-drawer__panel {
    transform: none;
}

.qq-drawer__head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding: 0 24px;
    background: var(--qq-bg-deep);
    border-bottom: 1px solid var(--qq-border);
}

.qq-drawer__head img {
    width: 150px;
}

.qq-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.qq-drawer__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.qq-drawer__nav {
    padding: 8px 0;
}

.qq-drawer__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.qq-drawer__link i {
    color: var(--qq-text-dim);
    font-size: 13px;
    transition: transform 0.3s;
}

.qq-drawer__link:hover,
.qq-drawer__link:active {
    background: rgba(255, 255, 255, 0.05);
}

.qq-drawer__link.is-active {
    color: var(--qq-primary);
}

.qq-drawer__toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.qq-drawer__sub {
    max-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    transition: max-height 0.3s;
}

.qq-drawer__toggle[aria-expanded="true"] + .qq-drawer__sub {
    max-height: 400px;
}

.qq-drawer__sub a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #fff;
    font-size: 14px;
}

.qq-drawer__sub .qq-nav__icon {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.qq-drawer__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px;
    padding: 14px;
    border-radius: 9999px;
    background: var(--qq-primary);
    color: #fff !important;
    font-size: 16px;
}

body.qq-drawer-open {
    overflow: hidden;
}

/* ---------- 页脚 ---------- */
.qq-footer {
    max-width: 1920px;
    margin: 0 auto;
    padding: 12px 0 0;
    background: var(--qq-bg);
    color: #fff;
    font-family: var(--qq-font);
    font-weight: 300;
    line-height: 1.5;
}

.qq-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.qq-footer a:hover {
    color: var(--qq-primary);
}

.qq-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 83.3333%;
    margin: 0 auto;
}

.qq-footer__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25%;
}

.qq-footer__logo img {
    display: block;
    height: 80px;
    width: auto;
}

.qq-footer__links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    width: 50%;
    margin-left: 32px;
    padding: 64px 0;
    font-size: 14px;
}

.qq-footer__links ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.qq-footer__title {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
}

.qq-footer__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 16px 64px;
    font-size: 12px;
    text-align: center;
}

.qq-footer__bottom p {
    margin: 0;
}

.qq-footer__notice {
    display: inline-block;
    padding: 4px 14px;
    border: 1px solid var(--qq-border);
    border-radius: 9999px;
    color: var(--qq-text-muted);
    letter-spacing: 2px;
}

/* ---------- quickq.io 页面：桌面 / 手机两套布局（与原站一致，640px 切换） ---------- */
.qq-h5 {
    display: none;
}

@media (max-width: 640px) {
    .qq-pc {
        display: none;
    }

    .qq-h5 {
        display: block;
    }
}

/* 轮播（替代原站 swiper-element） */
.qq-swiper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.qq-swiper-track {
    display: flex;
    transition: transform 0.5s ease;
}

.qq-swiper-slide {
    flex: 0 0 100%;
    max-width: 100%;
}

.qq-swiper-fade .qq-swiper-track {
    display: grid;
}

.qq-swiper-fade .qq-swiper-slide {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.qq-swiper-fade .qq-swiper-slide.is-active {
    opacity: 1;
}

.qq-swiper-fade .qq-swiper-slide img {
    display: block;
    width: clamp(400px, 26.042vw, 500px);
    max-width: 100%;
    height: auto;
}

/* ---------- 响应式：笔记本 / 平板 ---------- */
@media (max-width: 1279px) {
    .qq-header__inner {
        padding: 0 16px;
    }

    .qq-logo img {
        width: 160px;
    }

    .qq-nav {
        margin-left: 32px;
        flex-basis: 560px;
    }

    .qq-header__cta {
        padding: 8px 18px;
    }
}

@media (max-width: 1023px) {
    .qq-footer__logo {
        display: none;
    }

    .qq-footer__links {
        width: 100%;
        margin-left: 0;
    }

    .qq-nav {
        margin-left: 20px;
    }

    .qq-nav__link {
        padding: 0 6px;
    }

    .qq-header__cta i {
        display: none;
    }
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 767px) {
    .qq-header__bar {
        width: 95.8333%;
        margin: 5vw auto 0;
        border: 1px solid var(--qq-primary);
        border-radius: 9999px;
        background: rgba(13, 13, 13, 0.4);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(2px);
        transform: translateZ(0);
    }

    .qq-header__inner {
        width: 83.3333%;
        height: 12.03vw;
        min-height: 44px;
        padding: 0;
    }

    .qq-logo img {
        width: 130px;
    }

    .qq-nav,
    .qq-header__cta {
        display: none;
    }

    .qq-burger {
        display: flex;
        margin-right: -8px;
    }

    .qq-header-spacer {
        height: calc(max(12.03vw, 44px) + 5vw);
    }

    .qq-footer {
        padding-top: 8vw;
    }

    .qq-footer__inner {
        width: 91.6667%;
    }

    .qq-footer__links {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 0 24px;
    }

    .qq-footer__bottom {
        padding: 32px 16px 40px;
    }

    .qq-crumb {
        margin-top: 16px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .qq-article {
        padding: 32px 0 24px;
    }

    .qq-article__title {
        font-size: 1.6rem;
    }

    .qq-article__meta {
        margin-bottom: 24px;
        font-size: 13px;
    }

    .qq-prose {
        font-size: 16px;
        line-height: 1.85;
    }

    .qq-prose h2 {
        font-size: 1.35rem;
    }

    .qq-prose h3 {
        font-size: 1.15rem;
    }

    .qq-prose .alignleft,
    .qq-prose .alignright {
        float: none;
        margin: 1.2em auto;
    }

    .qq-article__nav {
        grid-template-columns: 1fr;
    }

    .qq-article__nav .is-next {
        grid-column: auto;
    }

    .qq-latest {
        padding: 24px 0 48px;
    }

    .qq-latest__head h2 {
        font-size: 1.5rem;
    }
}
