/* =========================================================
   Gathering Waves Projects - Global Styles
   ========================================================= */

:root {
    --gw-gradient-1: #4f46e5;   /* indigo */
    --gw-gradient-2: #ec4899;   /* pink */
    --gw-gradient-3: #06b6d4;   /* cyan */
    --gw-gradient-4: #f59e0b;   /* amber */
    --gw-card-bg: rgba(255, 255, 255, 0.78);
    --gw-card-border: rgba(255, 255, 255, 0.45);
    --gw-text: #1f2937;
    --gw-text-muted: #4b5563;
    --gw-nav-bg: rgba(255, 255, 255, 0.18);
    --gw-nav-bg-hover: rgba(255, 255, 255, 0.32);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--gw-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    /* 多层径向渐变叠加，背景尺寸放大到 4 倍，靠 background-position 动画做缓慢流动 */
    background:
        radial-gradient(at 20% 20%, var(--gw-gradient-1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, var(--gw-gradient-2) 0px, transparent 50%),
        radial-gradient(at 0% 70%, var(--gw-gradient-3) 0px, transparent 50%),
        radial-gradient(at 80% 80%, var(--gw-gradient-4) 0px, transparent 50%),
        linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
    background-size: 400% 400%, 400% 400%, 400% 400%, 400% 400%, 100% 100%;
    background-attachment: fixed;
    animation: gwGradientShift 28s ease-in-out infinite;
}

/* 整体色调会随时间在冷色 / 暖色 / 冷色之间缓慢漂移 */
@keyframes gwGradientShift {
    0% {
        background-position:
            0% 0%,
            100% 0%,
            0% 100%,
            100% 100%,
            0% 0%;
        filter: hue-rotate(0deg);
    }
    25% {
        background-position:
            100% 50%,
            0% 50%,
            50% 0%,
            50% 100%,
            0% 0%;
        filter: hue-rotate(40deg);
    }
    50% {
        background-position:
            100% 100%,
            0% 0%,
            100% 50%,
            0% 50%,
            0% 0%;
        filter: hue-rotate(120deg);
    }
    75% {
        background-position:
            0% 100%,
            100% 100%,
            50% 50%,
            50% 0%,
            0% 0%;
        filter: hue-rotate(200deg);
    }
    100% {
        background-position:
            0% 0%,
            100% 0%,
            0% 100%,
            100% 100%,
            0% 0%;
        filter: hue-rotate(360deg);
    }
}

/* =========================================================
   Layout
   ========================================================= */

.gw-page {
    /* 保留左右各 15% 空白 */
    padding: 96px 15% 64px;
    min-height: 100vh;
}

@media (max-width: 992px) {
    .gw-page {
        padding: 96px 8% 48px;
    }
}

@media (max-width: 576px) {
    .gw-page {
        padding: 88px 5% 32px;
    }
}

/* =========================================================
   Floating top-right navbar
   ========================================================= */

.gw-nav {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 1080;
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--gw-nav-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow:
        0 6px 24px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.gw-nav:hover {
    background: var(--gw-nav-bg-hover);
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

.gw-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.gw-nav__link:hover,
.gw-nav__link:focus {
    color: #1e1b4b;
    background-color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transform: translateY(-1px);
    outline: none;
}

.gw-nav__link.is-active {
    color: #1e1b4b;
    background-color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 576px) {
    .gw-nav {
        top: 12px;
        right: 12px;
        padding: 6px 8px;
    }
    .gw-nav__link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* =========================================================
   Main content card
   ========================================================= */

.gw-card {
    background: var(--gw-card-bg);
    border: 1px solid var(--gw-card-border);
    border-radius: 24px;
    padding: 56px clamp(28px, 5vw, 64px);
    box-shadow:
        0 30px 60px -20px rgba(15, 23, 42, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gw-card__eyebrow {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.gw-card__title {
    margin: 0 0 24px 0;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    background: linear-gradient(120deg, #4338ca 0%, #db2777 60%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.gw-card__lead {
    margin: 0;
    color: var(--gw-text-muted);
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
}

.gw-card__lead + .gw-card__lead {
    margin-top: 1.2em;
}

/* =========================================================
   FAQ section (inside the main card)
   ========================================================= */

.gw-faq {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid rgba(31, 41, 55, 0.12);
}

.gw-faq__heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px 0;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 700;
    color: #1e1b4b;
}

.gw-faq__heading::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(180deg, #4338ca, #db2777);
}

.gw-faq__eyebrow {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gw-faq__item {
    padding: 22px 0;
    border-bottom: 1px dashed rgba(31, 41, 55, 0.14);
    transition: background-color 0.25s ease, border-radius 0.25s ease, padding 0.25s ease;
}

.gw-faq__item:last-child {
    border-bottom: none;
    padding-bottom: 6px;
}

.gw-faq__item:hover {
    background-color: rgba(67, 56, 202, 0.05);
    border-radius: 12px;
    padding-left: 14px;
    padding-right: 14px;
}

.gw-faq__q,
.gw-faq__a {
    margin: 0;
    line-height: 1.75;
    color: var(--gw-text);
}

.gw-faq__q {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1.05rem;
    font-weight: 700;
}

.gw-faq__a {
    margin-top: 10px;
    padding-left: 36px;
    color: var(--gw-text-muted);
    font-size: 0.98rem;
    font-weight: 400;
}

.gw-faq__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.gw-faq__badge--q {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 10px -4px rgba(67, 56, 202, 0.55);
}

.gw-faq__badge--a {
    background: rgba(67, 56, 202, 0.12);
    color: #4338ca;
}

/* 通用空页面卡片 */
.gw-empty {
    text-align: center;
    padding: 96px clamp(28px, 5vw, 64px);
}

.gw-empty__title {
    margin: 0 0 12px 0;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: #1e1b4b;
}

.gw-empty__hint {
    margin: 0;
    color: var(--gw-text-muted);
    font-size: 1rem;
}

.gw-empty__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding: 10px 20px;
    border-radius: 999px;
    background: linear-gradient(120deg, #4338ca, #db2777);
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 10px 24px -8px rgba(67, 56, 202, 0.55);
}

.gw-empty__back:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(67, 56, 202, 0.7);
}

/* =========================================================
   Footer
   ========================================================= */

.gw-footer {
    margin-top: 32px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

/* 用户系统设置为「减少动态效果」时关闭渐变动画，避免引起不适 */
@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
    }
}

/* =========================================================
   Wiki page
   ========================================================= */

/* 百科页用更窄的左右留白，给两栏布局留出空间 */
.gw-page--wiki {
    padding: 96px 8% 64px;
}

@media (max-width: 1200px) {
    .gw-page--wiki {
        padding: 96px 5% 48px;
    }
}

@media (max-width: 768px) {
    .gw-page--wiki {
        padding: 88px 4% 32px;
    }
}

/* ---- 搜索栏：所有词条之上 ---- */
.gw-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px clamp(18px, 2.5vw, 24px);
    margin-bottom: 20px;
    background: var(--gw-card-bg);
    border: 1px solid var(--gw-card-border);
    border-radius: 24px;
    box-shadow:
        0 24px 50px -22px rgba(15, 23, 42, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.gw-search:focus-within {
    box-shadow:
        0 24px 50px -22px rgba(15, 23, 42, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 0 0 3px rgba(99, 102, 241, 0.28);
}

.gw-search__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4338ca 0%, #db2777 55%, #f59e0b 100%);
    color: #ffffff;
    font-size: 0.98rem;
    box-shadow:
        0 8px 18px -8px rgba(67, 56, 202, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.gw-search__input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--gw-text);
    font: inherit;
    font-size: 1rem;
    padding: 4px 0;
    /* 去掉浏览器默认的 search input 外观（含 X 按钮），用我们自己的 */
    -webkit-appearance: none;
    appearance: none;
}

.gw-search__input::placeholder {
    color: var(--gw-text-muted);
    opacity: 0.75;
}

.gw-search__input::-webkit-search-decoration,
.gw-search__input::-webkit-search-cancel-button,
.gw-search__input::-webkit-search-results-button,
.gw-search__input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.gw-search__clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--gw-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.gw-search__clear:hover {
    background-color: rgba(31, 41, 55, 0.1);
    color: #1e1b4b;
}

.gw-search__clear:focus-visible {
    outline: none;
    background-color: rgba(31, 41, 55, 0.12);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.gw-search__clear[hidden] {
    display: none;
}

/* 搜索栏在侧边栏里的紧凑版：缩外边距、缩圆角、缩图标，与栏目列表更协调 */
.gw-sidebar .gw-search {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 18px;
}

.gw-sidebar .gw-search__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.gw-sidebar .gw-search__input {
    font-size: 0.95rem;
    padding: 2px 0;
}

.gw-sidebar .gw-search__clear {
    width: 28px;
    height: 28px;
    font-size: 1rem;
}

/* 搜索结果中的栏目分组小标题 */
.gw-search-group + .gw-search-group {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px dashed rgba(31, 41, 55, 0.14);
}

.gw-search-group__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #1e1b4b;
}

.gw-search-group__title > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-size: 0.88rem;
}

.gw-search-group__count {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.08);
    color: var(--gw-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* 搜索时无任何命中：右侧内容区与左侧空态 */
.gw-state--no-results {
    text-align: center;
    padding: 60px 24px;
}

.gw-state--no-results .bi {
    font-size: 2.4rem;
    color: rgba(31, 41, 55, 0.35);
    margin-bottom: 8px;
    display: inline-block;
}

.gw-state--no-results .gw-state__msg {
    margin: 0;
    color: var(--gw-text);
    font-size: 1.05rem;
    font-weight: 600;
}

.gw-state--no-results .gw-state__hint {
    margin: 6px 0 0 0;
    color: var(--gw-text-muted);
    font-size: 0.9rem;
}

/* 搜索无命中时左侧栏目的占位提示 */
.gw-categories__empty {
    padding: 16px 14px;
    color: var(--gw-text-muted);
    font-size: 0.88rem;
    text-align: center;
    border-radius: 14px;
    background: rgba(31, 41, 55, 0.04);
}

/* 标题栏在搜索模式下的强调 */
.gw-titlebar.is-searching .gw-titlebar__title {
    background: linear-gradient(120deg, #4338ca 0%, #6366f1 60%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---- 标题栏：顶部全宽 ---- */
.gw-titlebar {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 24px clamp(20px, 3vw, 36px);
    margin-bottom: 24px;
    background: var(--gw-card-bg);
    border: 1px solid var(--gw-card-border);
    border-radius: 28px;
    box-shadow:
        0 24px 50px -22px rgba(15, 23, 42, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.gw-titlebar:hover {
    box-shadow:
        0 30px 60px -22px rgba(15, 23, 42, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gw-titlebar__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, #4338ca 0%, #db2777 55%, #f59e0b 100%);
    color: #ffffff;
    font-size: 1.55rem;
    line-height: 1;
    box-shadow:
        0 12px 26px -10px rgba(67, 56, 202, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.gw-titlebar__text {
    flex: 1;
    min-width: 0;
}

.gw-titlebar__crumb {
    display: inline-block;
    margin-bottom: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.gw-titlebar__title {
    margin: 6px 0 0 0;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    background: linear-gradient(120deg, #4338ca 0%, #db2777 60%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    word-break: break-word;
}

.gw-titlebar__meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gw-titlebar__count {
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: #1e1b4b;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.08);
}

@media (max-width: 576px) {
    .gw-titlebar {
        flex-wrap: wrap;
    }
    .gw-titlebar__icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        border-radius: 16px;
    }
    .gw-titlebar__meta {
        width: 100%;
    }
}

/* ---- 下方两栏网格：25% / 1fr ---- */
.gw-wiki {
    display: grid;
    grid-template-columns: minmax(0, 25fr) minmax(0, 65fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 768px) {
    .gw-wiki {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* ---- 左侧：百科栏目列表 ---- */
.gw-sidebar {
    position: sticky;
    top: 24px;
    padding: 24px 22px;
    background: var(--gw-card-bg);
    border: 1px solid var(--gw-card-border);
    border-radius: 24px;
    box-shadow:
        0 24px 50px -22px rgba(15, 23, 42, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.gw-sidebar__head {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(31, 41, 55, 0.14);
}

.gw-sidebar__label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gw-text-muted);
}

.gw-sidebar__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e1b4b;
}

.gw-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gw-categories__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: var(--gw-text);
    cursor: pointer;
    user-select: none;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.gw-categories__item:hover {
    background-color: rgba(67, 56, 202, 0.1);
    transform: translateX(3px);
}

.gw-categories__item:focus-visible {
    outline: none;
    background-color: rgba(67, 56, 202, 0.12);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.gw-categories__item.is-active {
    background: linear-gradient(120deg, rgba(67, 56, 202, 0.95), rgba(219, 39, 119, 0.85));
    color: #ffffff;
    box-shadow: 0 12px 24px -10px rgba(67, 56, 202, 0.6);
    transform: translateX(0);
}

.gw-categories__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-size: 0.98rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.gw-categories__item.is-active .gw-categories__icon {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.gw-categories__name {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gw-categories__count {
    flex-shrink: 0;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.08);
    color: var(--gw-text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.gw-categories__item.is-active .gw-categories__count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* ---- 右侧：内容列表 ---- */
.gw-content {
    padding: 28px clamp(22px, 2.5vw, 32px);
    background: var(--gw-card-bg);
    border: 1px solid var(--gw-card-border);
    border-radius: 24px;
    box-shadow:
        0 24px 50px -22px rgba(15, 23, 42, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.gw-content__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(31, 41, 55, 0.14);
}

.gw-content__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e1b4b;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.gw-content__title::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(180deg, #4338ca, #db2777);
}

.gw-content__filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gw-content__filter-label {
    font-size: 0.8rem;
    color: var(--gw-text-muted);
}

.gw-content__filter-pill {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.gw-content__filter-pill:hover {
    background: rgba(79, 70, 229, 0.2);
}

.gw-entries {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gw-entries.is-swapping {
    opacity: 0;
    transform: translateY(6px);
}

.gw-entry {
    padding: 20px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.gw-entry:hover {
    background-color: rgba(255, 255, 255, 0.82);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
    box-shadow:
        0 16px 32px -18px rgba(15, 23, 42, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.gw-entry__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.gw-entry__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e1b4b;
    letter-spacing: 0.01em;
}

/* 内容 + 右侧图片的横向布局 */
.gw-entry__body {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.gw-entry__content {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--gw-text-muted);
    font-size: 0.95rem;
    line-height: 1.78;
    /* 允许 JSON 里用 \n 换行 */
    white-space: normal;
    word-break: break-word;
}

/* 右侧图片：固定尺寸 + 圆角 + 兜底背景 */
.gw-entry__image {
    flex-shrink: 0;
    width: 200px;
    height: 140px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.06);
    box-shadow: 0 6px 18px -10px rgba(15, 23, 42, 0.35);
}

.gw-entry__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 备注：黄边 + 浅黄底 */
.gw-entry__notes {
    margin-top: 14px;
    padding: 12px 16px;
    border: 1px solid #facc15;        /* 黄色边框 */
    background: #fef9c3;              /* 浅黄色背景 */
    border-radius: 12px;
    color: #713f12;
    font-size: 0.9rem;
    line-height: 1.7;
    word-break: break-word;
}

@media (max-width: 576px) {
    .gw-sidebar,
    .gw-content {
        padding: 20px 18px;
        border-radius: 20px;
    }
    .gw-entry {
        padding: 16px 18px;
        border-radius: 16px;
    }
    /* 窄屏：图片独占一行，避免与正文挤在一起 */
    .gw-entry__body {
        flex-direction: column;
    }
    .gw-entry__image {
        width: 100%;
        height: 180px;
    }
}

/* ---- 骨架屏 / 加载中 / 错误状态 ---- */
@keyframes gwShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.gw-categories__skeleton {
    height: 52px;
    margin-bottom: 6px;
    border-radius: 16px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0.7)  50%,
        rgba(255, 255, 255, 0.35) 100%
    );
    background-size: 200% 100%;
    animation: gwShimmer 1.4s ease-in-out infinite;
    list-style: none;
}

.gw-categories__skeleton:last-child {
    margin-bottom: 0;
}

.gw-entry__skeleton {
    height: 132px;
    border-radius: 18px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0.7)  50%,
        rgba(255, 255, 255, 0.35) 100%
    );
    background-size: 200% 100%;
    animation: gwShimmer 1.4s ease-in-out infinite;
}

.gw-entry__skeleton + .gw-entry__skeleton {
    margin-top: 14px;
}

.gw-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 18px;
    text-align: center;
    color: var(--gw-text-muted);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px dashed rgba(31, 41, 55, 0.18);
}

.gw-state i {
    font-size: 1.8rem;
    color: #6366f1;
    opacity: 0.85;
}

.gw-state--error i {
    color: #db2777;
}

.gw-state--empty i {
    color: #06b6d4;
}

.gw-state__msg {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e1b4b;
}

.gw-state__hint {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--gw-text-muted);
    white-space: pre-line;
}

.gw-state__hint code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(67, 56, 202, 0.1);
    color: #4338ca;
    font-size: 0.85em;
}

@media (prefers-reduced-motion: reduce) {
    .gw-categories__skeleton,
    .gw-entry__skeleton {
        animation: none;
    }
}

/* =========================================================
   Image lightbox (wiki entry thumbnails)
   点击词条缩略图放大显示，点击任意位置关闭
   ========================================================= */

.gw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;             /* 高于顶部导航 1080 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;      /* 关闭时不拦截点击 */
    transition: opacity 0.2s ease-out;
}

.gw-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
    cursor: zoom-out;
}

/* 白底容器：内边距形成图片四周的白边，四个角做圆弧 */
.gw-lightbox__frame {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    max-width: min(90vw, 960px);   /* 宽上限：视口宽的 90% 且不超过 960px */
    max-height: 90vh;              /* 高上限：视口高的 90% */
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    cursor: zoom-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gw-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 80vh;              /* 在 frame 90vh 之内再留出余量 */
    width: auto;
    height: auto;
    object-fit: contain;           /* 完整显示，不裁剪 */
    border-radius: 12px;
}

@media (max-width: 576px) {
    .gw-lightbox {
        padding: 12px;
    }
    .gw-lightbox__frame {
        padding: 12px;
        border-radius: 16px;
        max-height: 95vh;
    }
    .gw-lightbox__img {
        max-height: 85vh;
        border-radius: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gw-lightbox {
        transition: none;
    }
}
