* {
    box-sizing: border-box;
}

:root {
    --xq-bg: #f8fafc;
    --xq-card: #ffffff;
    --xq-ink: #0f172a;
    --xq-text: #334155;
    --xq-muted: #64748b;
    --xq-faint: #94a3b8;
    --xq-soft: #f1f5f9;
    --xq-line: #e2e8f0;
    --xq-line-soft: #f1f5f9;
}

body.xq-theme {
    margin: 0;
    min-height: 100vh;
    background: var(--xq-bg);
    color: var(--xq-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

.xq-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-right: 32px;
    padding-left: 32px;
}

.xq-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--xq-line);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px);
}

.xq-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.xq-logo {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.xq-logo img {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.xq-logo strong {
    color: var(--xq-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.xq-nav,
.xq-nav ul {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.xq-nav li {
    list-style: none;
}

.xq-nav a {
    color: var(--xq-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color .18s ease;
}

.xq-nav a:hover {
    color: var(--xq-ink);
}

.xq-search {
    position: relative;
    flex: 1 1 320px;
    max-width: 448px;
}

.xq-search input {
    width: 100%;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 999px;
    outline: none;
    background: var(--xq-soft);
    color: var(--xq-ink);
    padding: 0 48px 0 16px;
    font-size: 14px;
}

.xq-search input::placeholder {
    color: var(--xq-faint);
}

.xq-search input:focus {
    border-color: #cbd5e1;
    background: #fff;
}

.xq-search button {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #020617;
    color: #fff;
    cursor: pointer;
}

.xq-search svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.xq-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.xq-ghost,
.xq-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.xq-ghost {
    color: var(--xq-muted);
}

.xq-primary {
    background: #020617;
    color: #fff;
    box-shadow: 0 10px 18px rgba(2, 6, 23, .12);
    transition: transform .18s ease, background .18s ease;
}

.xq-primary:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.xq-page {
    padding: 32px 0 0;
}

.xq-layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
}

.xq-sidebar {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.xq-sidebar-left,
.xq-sidebar-right {
    grid-column: span 3;
}

.xq-main {
    display: grid;
    grid-column: span 6;
    gap: 16px;
}

.xq-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
}

.xq-page-layout {
    max-width: 1080px;
}

.xq-widget,
.xq-section-head,
.xq-archive-hero,
.xq-panel,
.xq-product-card,
.xq-detail,
.xq-page-card {
    border: 1px solid var(--xq-line);
    border-radius: 16px;
    background: var(--xq-card);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.xq-widget {
    padding: 20px;
}

.xq-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--xq-faint);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.xq-widget-title::before {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .1);
    content: "";
}

.xq-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.xq-stats div {
    border: 1px solid var(--xq-line-soft);
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
}

.xq-stats strong,
.xq-stats span {
    display: block;
}

.xq-stats strong {
    color: var(--xq-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

.xq-stats span {
    margin-top: 4px;
    color: var(--xq-muted);
    font-size: 13px;
    font-weight: 500;
}

.xq-feed {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
}

.xq-feed li {
    position: relative;
    display: flex;
    gap: 12px;
    list-style: none;
    padding-bottom: 16px;
}

.xq-feed li + li {
    padding-top: 2px;
}

.xq-feed li:not(:last-child)::after {
    position: absolute;
    top: 34px;
    bottom: 0;
    left: 15px;
    width: 1px;
    background: var(--xq-line);
    content: "";
}

.xq-avatar {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #fff;
    border-radius: 999px;
    background: linear-gradient(135deg, #e0f2fe, #f1f5f9);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.xq-feed p {
    margin: 0;
    color: var(--xq-muted);
    font-size: 14px;
    line-height: 1.45;
}

.xq-feed strong,
.xq-feed b {
    color: var(--xq-ink);
    font-weight: 600;
}

.xq-feed time {
    display: block;
    margin-top: 4px;
    color: var(--xq-faint);
    font-size: 13px;
}

.xq-mini-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.xq-mini-links a,
.xq-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}

.xq-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
}

.xq-section-head h1,
.xq-archive-hero h1 {
    margin: 4px 0 0;
    color: var(--xq-ink);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.xq-eyebrow,
.xq-muted,
.xq-sort,
.xq-panel-head span {
    color: var(--xq-faint);
    font-size: 13px;
}

.xq-tabs {
    display: inline-flex;
    gap: 4px;
    border-radius: 999px;
    background: var(--xq-soft);
    padding: 4px;
}

.xq-tabs a {
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--xq-muted);
    font-size: 13px;
    font-weight: 600;
}

.xq-tabs a.active {
    background: var(--xq-card);
    color: var(--xq-ink);
    box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
}

.xq-product-list {
    display: grid;
    gap: 12px;
}

.xq-product-card {
    display: grid;
    grid-template-columns: 32px 64px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.xq-product-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    transform: translateY(-1px);
}

.xq-rank {
    color: #cbd5e1;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.xq-product-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--xq-line-soft);
    border-radius: 14px;
    background: radial-gradient(circle at 30% 20%, #ffffff, transparent 26%), linear-gradient(135deg, #e0f2fe, #dbeafe 45%, #f8fafc);
    color: #0f172a;
    font-size: 24px;
    font-weight: 800;
}

.xq-product-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xq-product-body h2 {
    margin: 0;
    color: var(--xq-ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.xq-product-body p {
    margin: 5px 0 8px;
    color: var(--xq-muted);
    font-size: 14px;
    line-height: 1.55;
}

.xq-product-meta {
    display: flex;
    gap: 14px;
    color: var(--xq-faint);
    font-size: 13px;
}

.xq-meta-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.xq-meta-icon::before {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
    content: "";
}

.xq-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.xq-like-count {
    display: grid;
    place-items: center;
    min-width: 34px;
    min-height: 34px;
    border-radius: 10px;
    background: var(--xq-soft);
    color: var(--xq-muted);
    font-size: 13px;
    font-weight: 700;
}

.xq-panel,
.xq-archive-hero,
.xq-empty,
.xq-page-card,
.xq-detail {
    padding: 24px;
}

.xq-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.xq-panel-head h2 {
    margin: 0;
    font-size: 20px;
}

.xq-article-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.xq-article-card {
    display: block;
    min-height: 150px;
    border: 1px solid var(--xq-line);
    border-radius: 14px;
    background: #fbfdff;
    padding: 16px;
}

.xq-article-card span {
    color: var(--xq-faint);
    font-size: 12px;
}

.xq-article-card strong {
    display: block;
    margin: 8px 0;
    line-height: 1.45;
}

.xq-article-card p {
    margin: 0;
    color: var(--xq-muted);
    font-size: 14px;
    line-height: 1.6;
}

.xq-archive-hero {
    display: grid;
    gap: 8px;
}

.xq-archive-hero p {
    margin: 0;
    color: var(--xq-muted);
    line-height: 1.7;
}

.xq-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.xq-topic-card {
    display: block;
    border: 1px solid var(--xq-line);
    border-radius: 14px;
    background: #fbfdff;
    padding: 16px;
}

.xq-topic-card strong,
.xq-topic-card span {
    display: block;
}

.xq-topic-card span {
    margin-top: 8px;
    color: var(--xq-faint);
    font-size: 13px;
}

.xq-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
}

.xq-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid var(--xq-line);
    border-radius: 10px;
    background: var(--xq-card);
    padding: 0 12px;
}

.xq-pagination .current {
    background: var(--xq-ink);
    color: #fff;
}

.xq-detail {
    display: grid;
    gap: 24px;
}

.xq-detail-head {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.xq-detail-icon {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(135deg, #e0f2fe, #eef2ff);
    color: #2563eb;
    font-size: 34px;
    font-weight: 800;
}

.xq-detail-icon img,
.xq-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xq-detail-head h1 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.2;
}

.xq-detail-head p {
    margin: 0;
    color: var(--xq-muted);
    font-size: 17px;
    line-height: 1.7;
}

.xq-detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.xq-detail-actions span {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    min-height: 38px;
    border-radius: 12px;
    background: var(--xq-soft);
    color: var(--xq-muted);
    font-weight: 700;
}

.xq-screenshot {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--xq-line);
    border-radius: 18px;
    background: var(--xq-soft);
}

.xq-screenshot img {
    display: block;
    max-height: 520px;
}

.xq-screenshot figcaption {
    padding: 10px 14px;
    color: var(--xq-faint);
    font-size: 13px;
}

.xq-detail-section h2,
.xq-detail-meta h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.xq-content {
    color: var(--xq-text);
    line-height: 1.85;
}

.xq-content p:first-child {
    margin-top: 0;
}

.xq-detail-meta dl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0;
}

.xq-detail-meta dl div {
    border-radius: 14px;
    background: var(--xq-soft);
    padding: 14px;
}

.xq-detail-meta dt {
    color: var(--xq-faint);
    font-size: 12px;
}

.xq-detail-meta dd {
    margin: 6px 0 0;
    font-weight: 700;
}

.xq-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.xq-tags a {
    border-radius: 999px;
    background: #ecfdf5;
    color: #166534;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.xq-empty {
    border: 1px dashed var(--xq-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .7);
    text-align: center;
}

.xq-footer {
    margin-top: 40px;
    border-top: 1px solid var(--xq-line);
    background: #fff;
    padding: 34px 0;
}

.xq-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 28px;
}

.xq-footer h3,
.xq-footer h4 {
    margin: 0 0 12px;
}

.xq-footer p,
.xq-footer a {
    color: var(--xq-muted);
    line-height: 1.8;
}

.xq-footer a {
    display: block;
}

@media (max-width: 1180px) {
    .xq-header-inner {
        gap: 14px;
    }

    .xq-search {
        display: none;
    }

    .xq-sidebar-left {
        display: none;
    }

    .xq-main {
        grid-column: span 8;
    }

    .xq-sidebar-right {
        grid-column: span 4;
    }
}

@media (max-width: 900px) {
    .xq-container {
        padding-right: 20px;
        padding-left: 20px;
    }

    .xq-header-inner {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .xq-nav {
        order: 4;
        width: 100%;
        overflow-x: auto;
    }

    .xq-layout,
    .xq-detail-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .xq-main,
    .xq-sidebar-right {
        grid-column: auto;
    }

    .xq-sidebar {
        position: static;
        max-height: none;
    }

    .xq-sidebar-right {
        display: none;
    }

    .xq-product-card {
        grid-template-columns: 28px 54px minmax(0, 1fr);
    }

    .xq-product-icon {
        width: 54px;
        height: 54px;
        border-radius: 13px;
    }

    .xq-like-count {
        display: none;
    }

    .xq-section-head,
    .xq-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .xq-article-row,
    .xq-topic-grid,
    .xq-detail-meta dl,
    .xq-footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .xq-container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .xq-logo strong {
        font-size: 18px;
    }

    .xq-actions {
        gap: 6px;
    }

    .xq-ghost,
    .xq-primary {
        height: 36px;
        padding: 0 12px;
    }

    .xq-product-card {
        gap: 10px;
        padding: 12px;
    }

    .xq-product-body h2 {
        font-size: 16px;
    }

    .xq-product-body p {
        font-size: 14px;
    }

    .xq-detail-head {
        grid-template-columns: 1fr;
    }

    .xq-detail-head h1 {
        font-size: 28px;
    }
}
