:root {
    --brand: #9b2cff;
    --brand-deep: #5b16b8;
    --brand-soft: #f6edff;
    --ink: #1c1b22;
    --muted: #7b7785;
    --line: #eee8f4;
    --card: #ffffff;
    --bg: #f4f1f8;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(70, 20, 110, 0.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(170, 0, 255, 0.16), transparent 60%),
        radial-gradient(700px 360px at -10% 0%, rgba(255, 120, 180, 0.12), transparent 55%),
        var(--bg);
    color: var(--ink);
    line-height: 1.65;
}
a { color: var(--brand-deep); text-decoration: none; }
img { max-width: 100%; }
.wrapper { width: 1180px; max-width: 100%; margin: 0 auto; padding: 0 20px; }
.site { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 24px rgba(50, 10, 80, 0.05);
}
.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0 10px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    min-width: 220px;
}
.logo:hover { text-decoration: none; }
.logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(145deg, #ff4fd8, var(--brand) 55%, #5a1bff);
    box-shadow: 0 8px 18px rgba(155, 44, 255, 0.35);
}
.logo strong { display: block; font-size: 1.15rem; line-height: 1.15; }
.logo small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.search-form {
    flex: 1;
    display: flex;
    max-width: 520px;
    margin-left: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.search-form input {
    flex: 1;
    border: 0;
    outline: none;
    padding: 11px 18px;
    font-size: 14px;
    background: transparent;
}
.search-form button {
    border: 0;
    margin: 4px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
}
.top-nav { padding-bottom: 8px; }
.top-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0 0 6px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.top-nav > ul > li > a,
.top-nav > ul > li > span {
    display: block;
    padding: 8px 14px;
    border-radius: 999px;
    color: #3d3946;
    font-size: 14px;
    cursor: pointer;
}
.top-nav > ul > li > a:hover,
.top-nav > ul > li > span:hover { background: var(--brand-soft); text-decoration: none; }
.top-nav li.current > a {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    font-weight: 600;
}
.top-nav li { position: relative; }
.top-nav .sub {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(640px, 78vw);
    max-height: 420px;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(40, 10, 70, 0.16);
    padding: 12px;
    z-index: 30;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}
.top-nav .has-sub:hover .sub,
.top-nav .has-sub.open .sub { display: grid; }
.top-nav .sub li a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: #333;
    font-size: 13px;
}
.top-nav .sub li a:hover { background: var(--brand-soft); text-decoration: none; }

.main-content { flex: 1; padding: 28px 20px 10px; }
.page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.page-hero h1 { margin: 0; font-size: 1.7rem; letter-spacing: -0.03em; }
.eyebrow {
    margin: 0 0 4px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
}
.page-hero .count { margin: 0; color: var(--muted); font-size: 14px; }

.b2-gap {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.post-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,.8);
    transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(110, 20, 170, 0.12); }
.thumb-link { position: relative; display: block; aspect-ratio: 16/10; background: #efeaf5; overflow: hidden; }
.post-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.post-card:hover .post-thumb { transform: scale(1.06); }
.post-thumb.placeholder {
    background:
        linear-gradient(135deg, rgba(155,44,255,.18), rgba(255,79,216,.12)),
        #efeaf5;
}
.cat-float {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 1;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(20, 8, 32, 0.62);
    color: #fff !important;
    font-size: 12px;
    backdrop-filter: blur(6px);
}
.cat-float:hover { text-decoration: none; color: #fff; }
.post-info { padding: 12px 14px 14px; }
.post-info h2 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 650;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}
.post-info h2 a { color: var(--ink); }
.post-info h2 a:hover { color: var(--brand-deep); text-decoration: none; }
.meta { margin: 0; color: var(--muted); font-size: 12px; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 28px 0 8px;
}
.pagination a, .pagination span.gap {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    color: #444;
    border: 1px solid var(--line);
}
.pagination a:hover { border-color: #ddc6ff; color: var(--brand-deep); text-decoration: none; }
.pagination a.current {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    border-color: transparent;
}
.pagination span.gap { border: 0; background: transparent; color: var(--muted); }

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}
.article-main { min-width: 0; }
.crumb { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand-deep); }
.single-article {
    background: #fff;
    border-radius: 20px;
    padding: 28px 32px 36px;
    box-shadow: var(--shadow);
}
.article-header h1 {
    margin: 0 0 14px;
    font-size: 1.85rem;
    line-height: 1.35;
    letter-spacing: -0.03em;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.article-meta span, .article-meta a.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 12px;
}
.entry-content { color: #2a2730; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.entry-content p { margin: 0 0 1em; }
.entry-content a { color: var(--brand-deep); }
.entry-content blockquote {
    margin: 0 0 22px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #fbf7ff, #fff);
    border: 1px solid #f0e6fb;
    border-left: 4px solid var(--brand);
    border-radius: 14px;
}
.entry-content blockquote p { margin: 0; }
.entry-content .wp-block-group,
.entry-content .is-layout-flex {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 18px;
}
.entry-content figure { margin: 0; }
.entry-content img {
    width: 100%;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    display: block;
    background: #f6f3fa;
}
.entry-content > img,
.entry-content > p > img { margin: 8px auto; }
.entry-content .download-list,
.entry-content .download-rights,
.entry-content .download-button-box,
.entry-content .down-ready { display: none !important; }
.related { margin-top: 22px; }
.related h2 { margin: 0 0 12px; font-size: 1.1rem; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.related-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.related-card img, .related-card .ph { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: #efeaf5; }
.related-card p { margin: 0; padding: 10px 12px 12px; font-size: 13px; line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card:hover { text-decoration: none; }

.footer {
    margin-top: 36px;
    padding: 28px 20px 32px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.footer a { color: var(--brand-deep); }
.empty-tip { text-align: center; padding: 64px 16px; color: var(--muted); background: #fff; border-radius: var(--radius); }

@media (max-width: 1024px) {
    .b2-gap, .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
    .top-nav { display: none; padding-bottom: 12px; }
    .top-nav.open { display: block; }
    .top-nav > ul { flex-direction: column; align-items: stretch; }
    .top-nav .sub { position: static; width: auto; max-height: none; box-shadow: none; display: none; }
    .top-nav .has-sub.open .sub { display: grid; grid-template-columns: 1fr 1fr; }
    .logo small { display: none; }
    .search-form { max-width: none; }
    .b2-gap, .related-grid, .entry-content .wp-block-group, .entry-content .is-layout-flex { grid-template-columns: 1fr 1fr; }
    .single-article { padding: 18px 16px 24px; }
    .article-header h1 { font-size: 1.35rem; }
    .page-hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
    .b2-gap, .related-grid { grid-template-columns: 1fr; }
    .entry-content .wp-block-group, .entry-content .is-layout-flex { grid-template-columns: 1fr; }
    .topbar { flex-wrap: wrap; }
    .search-form { order: 3; flex-basis: 100%; }
}

.hero-slider {
    position: relative;
    height: 380px;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 22px;
    background: #1b1024;
    box-shadow: var(--shadow);
}
.hero-slider .slides, .hero-slider .slide { height: 100%; }
.hero-slider .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .45s ease;
    pointer-events: none;
}
.hero-slider .slide.active { opacity: 1; pointer-events: auto; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-mask {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 54px 24px 22px;
    background: linear-gradient(transparent, rgba(18, 6, 28, .82));
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.slide-mask em {
    align-self: flex-start;
    font-style: normal;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
}
.slide-mask strong {
    font-size: 1.35rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: #2a1238;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
}
.slider-btn.prev { left: 14px; }
.slider-btn.next { right: 14px; }
.slider-dots {
    position: absolute;
    right: 18px;
    bottom: 16px;
    display: flex;
    gap: 6px;
    z-index: 2;
}
.slider-dots button {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: 99px;
    background: rgba(255,255,255,.45);
    padding: 0;
    cursor: pointer;
}
.slider-dots button.active { width: 22px; background: #fff; }

.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.block-head h2 { margin: 0; font-size: 1.15rem; }
.tag-cloud, .random-block, .rank-card {
    background: #fff;
    border-radius: 18px;
    padding: 16px 18px 18px;
    box-shadow: var(--shadow);
}
.tag-cloud { margin-bottom: 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    line-height: 1;
}
.tags a:hover { background: #ead8ff; text-decoration: none; }
.tags i { font-style: normal; color: #a07bc4; font-size: 11px; }

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}
.home-main { min-width: 0; }
.home-main .b2-gap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-main .hero-slider { margin-bottom: 18px; }
.home-side { display: flex; flex-direction: column; gap: 14px; }
.side-card {
    background: #fff;
    border-radius: 18px;
    padding: 16px 16px 14px;
    box-shadow: var(--shadow);
}
.side-card h2 { margin: 0 0 12px; font-size: 1.02rem; }
.stats-card .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats-card .stat-row span { background: var(--brand-soft); border-radius: 12px; padding: 10px 4px; color: var(--muted); font-size: 12px; }
.stats-card .stat-row b { display: block; color: var(--brand-deep); font-size: 1.15rem; line-height: 1.2; }
.text-list { list-style: none; margin: 0; padding: 0; }
.text-list li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f3eef8; }
.text-list a { color: var(--ink); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-list a:hover { color: var(--brand-deep); text-decoration: none; }
.text-list small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.post-nav a { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); color: var(--ink); min-height: 72px; }
.post-nav a.next { text-align: right; }
.post-nav small { display: block; color: var(--brand); font-size: 12px; margin-bottom: 4px; }
.post-nav a:hover { text-decoration: none; color: var(--brand-deep); }
.rank-card { position: static; }
.rank-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.rank-card ol { list-style: none; margin: 0; padding: 0; }
.rank-card li + li { margin-top: 10px; }
.rank-card a {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--ink);
}
.rank-card a:hover { text-decoration: none; color: var(--brand-deep); }
.rank-card img, .rank-ph {
    width: 54px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
    background: #efeaf5;
}
.rank-card b {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}
.rank-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.rank-no {
    width: 18px;
    flex: none;
    font-weight: 800;
    color: #b9b3c4;
    font-size: 14px;
}
.rank-card li:nth-child(1) .rank-no { color: #e0a106; }
.rank-card li:nth-child(2) .rank-no { color: #8d97a8; }
.rank-card li:nth-child(3) .rank-no { color: #c47a45; }

.random-block { margin-top: 22px; }
.random-block button {
    border: 0;
    background: var(--brand-soft);
    color: var(--brand-deep);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 650;
}
.random-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.random-card {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: #f6f2fa;
    color: #fff;
    min-height: 150px;
}
.random-card img, .random-card .ph { width: 100%; height: 168px; object-fit: cover; display: block; background: #efeaf5; }
.random-card em {
    position: absolute;
    left: 8px;
    top: 8px;
    font-style: normal;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(20, 8, 32, .62);
}
.random-card p {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    padding: 28px 10px 10px;
    background: linear-gradient(transparent, rgba(16, 6, 24, .8));
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.random-card:hover { text-decoration: none; }

@media (max-width: 1024px) {
    .home-layout, .article-layout { grid-template-columns: 1fr; }
    .home-main .b2-gap, .random-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-slider { height: 260px; }
    .post-nav { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .random-grid, .home-main .b2-gap { grid-template-columns: 1fr; }
    .slide-mask strong { font-size: 1.05rem; }
}
