/* resources/css/modules/wiki.css
   Wiki 栏目专属样式。
   公共部分（布局、卡片、侧边栏、TOC、相关列表、meta表格、条目头部、精选网格）
   已提取至：
     - layout/grid.css      → .wiki-layout 三栏布局
     - components/card.css  → .wiki-card / .wiki-sidebar-* / .wiki-cat-list /
                               .wiki-toc-list / .wiki-related-list / .wiki-meta-table /
                               .wiki-entry-header / .wiki-featured-grid / .author-avatar
   本文件只保留 wiki 专属内容。
*/

/* ══════════════════════════════════════════
   一、语言版本切换
   ══════════════════════════════════════════ */

.wiki-entry-langs-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.wiki-lang-pill {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--tblr-border-color);
    color: var(--tblr-secondary);
}

.wiki-lang-pill strong {
    font-weight: 500;
    color: var(--tblr-body-color);
    margin-right: 3px;
}

.wiki-entry-lang-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0.625rem 0.875rem;
    background: var(--tblr-bg-surface-secondary);
    border-radius: var(--tblr-border-radius);
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
}

.wiki-entry-lang-label {
    color: var(--tblr-secondary);
}

.wiki-entry-lang-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--tblr-border-color);
    color: var(--tblr-primary);
    text-decoration: none;
    transition: background 0.12s;
}

.wiki-entry-lang-btn:hover {
    background: var(--tblr-bg-surface);
}

/* ══════════════════════════════════════════
   二、质量标签
   ══════════════════════════════════════════ */

.wiki-quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    margin-bottom: 4px;
}

.wiki-quality-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wiki-badge--featured {
    background: #eaf3de;
    color: #3b6d11;
    border: 1px solid #c0dd97;
}
.wiki-badge--featured .wiki-quality-dot {
    background: #639922;
}

.wiki-badge--standard {
    background: rgba(var(--tblr-primary-rgb), 0.12);
    color: var(--tblr-primary);
    border: 1px solid rgba(var(--tblr-primary-rgb), 0.32);
}
.wiki-badge--standard .wiki-quality-dot {
    background: var(--tblr-primary);
}

.wiki-badge--draft {
    background: rgba(var(--tblr-orange-rgb), 0.12);
    color: var(--tblr-orange);
    border: 1px solid rgba(var(--tblr-orange-rgb), 0.32);
}
.wiki-badge--draft .wiki-quality-dot {
    background: var(--tblr-orange);
}

.wiki-badge--pending {
    background: rgba(var(--tblr-secondary-rgb), 0.12);
    color: var(--tblr-secondary);
    border: 1px solid rgba(var(--tblr-secondary-rgb), 0.32);
}
.wiki-badge--pending .wiki-quality-dot {
    background: var(--tblr-secondary);
}

/* ══════════════════════════════════════════
   三、标签
   ══════════════════════════════════════════ */

.wiki-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 1rem;
    border-top: 1px solid var(--tblr-border-color);
    margin-top: 1.5rem;
}

.wiki-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--tblr-border-color);
    color: var(--tblr-secondary);
    text-decoration: none;
    transition: background 0.12s;
}

.wiki-tag:hover {
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color);
}

/* ══════════════════════════════════════════
   四、首页组件
   ══════════════════════════════════════════ */

.wiki-today-banner {
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.wiki-today-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tblr-border-radius);
    background: #e1f5ee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.wiki-today-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tblr-secondary);
    margin-bottom: 4px;
}

.wiki-today-title {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--tblr-body-color);
}

.wiki-today-snippet {
    font-size: 0.875rem;
    color: var(--tblr-secondary);
    line-height: 1.6;
}

.wiki-today-link {
    font-size: 0.8125rem;
    color: var(--tblr-primary);
    text-decoration: none;
    margin-top: 10px;
    display: inline-block;
}

/* ══════════════════════════════════════════
   五、term-ref 行内术语标记
   ══════════════════════════════════════════ */

.term-ref {
    font-style: italic;
    color: var(--tblr-primary);
    border-bottom: 1px dotted var(--tblr-primary);
    cursor: pointer;
}

/* ══════════════════════════════════════════
   六、Term Popover（桌面）
   ══════════════════════════════════════════ */

.wiki-term-popover.popover {
    max-width: 280px;
    font-size: 0.8125rem;
    border: 0.5px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg);
    box-shadow: none;
}

.wiki-term-popover .popover-arrow {
    display: none;
}
.wiki-term-popover .popover-body {
    padding: 0;
}

.wiki-popover-word {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 0.9375rem;
    font-style: italic;
    font-weight: 600;
    color: var(--tblr-primary);
    padding: 10px 14px;
    border-bottom: 0.5px solid var(--tblr-border-color);
}

.wiki-popover-meaning {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tblr-body-color);
    padding: 8px 14px 4px;
}

.wiki-popover-summary {
    font-size: 0.8125rem;
    color: var(--tblr-secondary);
    line-height: 1.55;
    padding: 0 14px 12px;
}

/* ══════════════════════════════════════════
   七、Term Drawer（移动端，所有阅读页公用）
   ══════════════════════════════════════════ */

.wiki-term-drawer {
    border-radius: 1rem 1rem 0 0;
    max-height: 55vh;
}

.wiki-term-drawer .offcanvas-header {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.wiki-drawer-word {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 1.125rem;
    font-style: italic;
    font-weight: 600;
    color: var(--tblr-primary);
}

.wiki-drawer-meaning {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--tblr-body-color);
    margin-top: 2px;
}

.wiki-drawer-summary {
    font-size: 0.9375rem;
    color: var(--tblr-body-color);
    line-height: 1.65;
}

.wiki-drawer-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--tblr-primary);
    text-decoration: none;
}

.wiki-term-card-word {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 0.9375rem;
    font-style: italic;
    font-weight: 600;
    color: var(--tblr-primary);
    padding: 8px;
    margin-bottom: 8px;
    border-bottom: 0.5px solid var(--tblr-border-color);
}

.wiki-term-card-meaning {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tblr-body-color);
    margin-bottom: 5px;
}

.wiki-term-card-summary {
    font-size: 0.8125rem;
    color: var(--tblr-secondary);
    line-height: 1.55;
}

/* Skeleton */
.wiki-term-skeleton-word,
.wiki-term-skeleton-line {
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: wiki-skeleton-shimmer 1.2s infinite;
    border-radius: 4px;
}

.wiki-term-skeleton-word {
    height: 18px;
    width: 120px;
    margin-bottom: 8px;
}
.wiki-term-skeleton-line {
    height: 13px;
    width: 100%;
    margin-bottom: 6px;
}
.wiki-term-skeleton-line.short {
    width: 60%;
}

@keyframes wiki-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ══════════════════════════════════════════
   八、正文排版（.wiki-content-body）
   ══════════════════════════════════════════ */

.wiki-content-body {
    font-family: 'Noto Serif', Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.875;
    color: var(--tblr-body-color);
    word-break: break-word;
    overflow-wrap: break-word;
}

.wiki-content-body p {
    margin-top: 0;
    margin-bottom: 1.125em;
}

.wiki-content-body h1,
.wiki-content-body h2,
.wiki-content-body h3,
.wiki-content-body h4,
.wiki-content-body h5,
.wiki-content-body h6 {
    font-family: 'Noto Serif', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--tblr-body-color);
    margin-top: 2em;
    margin-bottom: 0.6em;
    scroll-margin-top: 80px;
}

.wiki-content-body h1 {
    font-size: 1.375rem;
    padding-bottom: 0.4em;
    border-bottom: 2px solid var(--tblr-border-color);
}
.wiki-content-body h2 {
    font-size: 1.25rem;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--tblr-border-color);
}
.wiki-content-body h3 {
    font-size: 1.0625rem;
}
.wiki-content-body h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tblr-secondary);
}

.wiki-content-body strong,
.wiki-content-body b {
    font-weight: 600;
}
.wiki-content-body em,
.wiki-content-body i {
    font-style: italic;
}

.wiki-content-body a {
    color: var(--tblr-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.12s;
}
.wiki-content-body a:hover {
    border-bottom-color: var(--tblr-primary);
}

.wiki-content-body blockquote {
    margin: 1.5em 0;
    padding: 0.875rem 1.125rem;
    border-left: 3px solid var(--tblr-border-color-dark, #adb5bd);
    background: var(--tblr-bg-surface-secondary);
    border-radius: 0 var(--tblr-border-radius) var(--tblr-border-radius) 0;
    font-size: 0.9375rem;
    line-height: 1.75;
}

.wiki-content-body blockquote p {
    margin-bottom: 0.5em;
}
.wiki-content-body blockquote p:last-child {
    margin-bottom: 0;
}
.wiki-content-body blockquote cite {
    display: block;
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    font-style: normal;
    color: var(--tblr-secondary);
}

.wiki-content-body ul,
.wiki-content-body ol {
    padding-left: 1.5em;
    margin-bottom: 1.125em;
}
.wiki-content-body li {
    margin-bottom: 0.375em;
    line-height: 1.75;
}

.wiki-content-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1.5em;
}
.wiki-content-body th {
    font-family: 'Noto Serif', Georgia, serif;
    font-weight: 600;
    font-size: 0.8125rem;
    text-align: left;
    padding: 8px 12px;
    background: var(--tblr-bg-surface-secondary);
    border-bottom: 2px solid var(--tblr-border-color);
    color: var(--tblr-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wiki-content-body td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--tblr-border-color);
    vertical-align: top;
}
.wiki-content-body tr:last-child td {
    border-bottom: none;
}

.wiki-content-body code {
    font-family: var(
        --tblr-font-monospace,
        'SFMono-Regular',
        Consolas,
        monospace
    );
    font-size: 0.875em;
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: 4px;
    padding: 1px 5px;
}

.wiki-content-body hr {
    border: none;
    border-top: 1px solid var(--tblr-border-color);
    margin: 2em 0;
}
.wiki-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--tblr-border-radius);
    margin: 0.75em 0;
}
.wiki-content-body figure {
    margin: 1.5em 0;
    text-align: center;
}
.wiki-content-body figcaption {
    font-size: 0.8125rem;
    color: var(--tblr-secondary);
    margin-top: 0.5em;
    font-style: italic;
}

/* ══════════════════════════════════════════
   九、Wiki 首页
   ══════════════════════════════════════════ */

.wiki-home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 300px);
    padding: 3rem 1.5rem;
}

.wiki-home-wheel {
    margin-bottom: 1.5rem;
}
.wiki-home-wheel-img {
    width: 120px;
    height: auto;
    opacity: 0.85;
    transition: transform 0.3s ease;
}
.wiki-home-wheel-img:hover {
    transform: scale(1.05);
}

.wiki-home-title {
    text-align: center;
    margin-bottom: 2rem;
}
.wiki-home-title h1 {
    font-family: 'Noto Serif', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    margin-bottom: 0.5rem;
}

.wiki-home-search {
    width: 100%;
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

.wiki-home-hot-tags {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
}
.wiki-hot-tag {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: 20px;
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
    text-decoration: none;
    margin: 2px;
    transition:
        background 0.12s,
        color 0.12s;
}
.wiki-hot-tag:hover {
    background: var(--wp-brand-light);
    border-color: var(--wp-brand);
    color: var(--wp-brand-dark);
}

.wiki-home-languages {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
}
.wiki-home-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    color: var(--tblr-secondary);
    font-size: 0.875rem;
}
.wiki-home-divider::before,
.wiki-home-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--tblr-border-color);
}

.wiki-language-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.wiki-language-tag {
    display: inline-block;
    padding: 0.4rem 1.125rem;
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: 30px;
    color: var(--tblr-body-color);
    font-size: 0.875rem;
    text-decoration: none;
    transition:
        background 0.12s,
        border-color 0.12s;
}
.wiki-language-tag:hover {
    background: var(--wp-brand-light);
    border-color: var(--wp-brand);
    color: var(--wp-brand-dark);
}
.wiki-language-tag.active {
    background: var(--wp-brand);
    border-color: var(--wp-brand);
    color: #fff;
}
.wiki-language-tag.active:hover {
    background: var(--wp-brand-dark);
    border-color: var(--wp-brand-dark);
}

.wiki-home-stats {
    text-align: center;
    font-size: 0.875rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tblr-border-color);
    width: 100%;
    max-width: 640px;
}

@media (max-width: 768px) {
    .wiki-home-container {
        min-height: calc(100vh - 200px);
        padding: 2rem 1rem;
    }
    .wiki-home-wheel-img {
        width: 90px;
    }
    .wiki-home-title h1 {
        font-size: 1.75rem;
    }
    .wiki-language-tag {
        padding: 0.35rem 0.875rem;
        font-size: 0.8125rem;
    }
}

/* ── 追加到 resources/css/wiki.css 末尾 ── */

/* ── 二级分类大块容器 ── */
.wiki-subcat-block {
    padding: 0;
}

.wiki-subcat-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem 0.875rem;
    border-bottom: 1px solid var(--tblr-border-color);
}

.wiki-subcat-block-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tblr-body-color);
}

.wiki-subcat-block-more {
    font-size: 0.8125rem;
    color: var(--tblr-primary);
    text-decoration: none;
}

.wiki-subcat-block-more:hover {
    text-decoration: underline;
}

/* ── 单个二级分类 ── */
.wiki-subcat {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--tblr-border-color);
}

.wiki-subcat:last-child {
    border-bottom: none;
}

.wiki-subcat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.625rem;
}

.wiki-subcat-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--tblr-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wiki-subcat-count {
    font-size: 0.6875rem;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid var(--tblr-border-color);
    border-radius: 20px;
    padding: 1px 7px;
}

/* ── 词条列表 (flex wrap) ── */
.wiki-subcat-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
}

/* ── 单个术语链接 ── */
.wiki-term-link {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--tblr-border-radius);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.1s;
    color: var(--tblr-primary);
}

.wiki-term-link:hover {
    background: var(--tblr-bg-surface-secondary);
    text-decoration: none;
    color: var(--tblr-primary);
}

.wiki-term-link-word {
    font-style: italic;
    color: var(--tblr-secondary);
}

.wiki-term-link-zh {
    font-size: 0.8125rem;
}

/* =========================
   Wiki Term Link States
   典范条目 featured（蓝色 + 星标）
   规范条目 standard（蓝色）
   草稿 draft（橙色）
   待定 pending（灰色 + 删除线）
   ========================= */

/* 通用链接颜色继承 */
.wiki-term-link--featured,
.wiki-term-link--standard,
.wiki-term-link--draft,
.wiki-term-link--pending {
    position: relative;
}

.wiki-term-link--featured:hover,
.wiki-term-link--standard:hover,
.wiki-term-link--draft:hover,
.wiki-term-link--pending:hover {
    color: inherit;
}

/* =========================
   典范条目 Featured
   ========================= */
.wiki-term-link--featured {
    color: var(--tblr-green);
}

.wiki-term-link--featured::before {
    content: '★';
    display: inline-block;
    margin-right: 0.2em;
    font-size: 0.75em;
    vertical-align: middle;
    opacity: 0.9;
}

/* 若想改圆点可用：
content: "●";
*/

/* =========================
   规范条目 Standard
   ========================= */
.wiki-term-link--standard {
    color: var(--tblr-primary);
}

/* =========================
   草稿 Draft
   ========================= */
.wiki-term-link--draft {
    color: var(--tblr-orange);
}

/* =========================
   待定 Pending
   （保持原有效果）
   ========================= */
.wiki-term-link--pending {
    color: var(--tblr-secondary);
}

.wiki-term-link--pending .wiki-term-link-word {
    text-decoration: line-through;
    text-decoration-color: var(--tblr-border-color-dark, #adb5bd);
}

.wiki-quality-filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.wiki-quality-filter-item span:last-child {
    font-size: 0.75rem;
    color: var(--tblr-secondary);
    margin-left: auto;
    flex-shrink: 0;
}

/* ── 条目操作按钮 ── */
.wiki-entry-card {
    position: relative;
}

.wiki-entry-actions {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    display: flex;
    gap: 4px;
}

.wiki-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--tblr-border-radius);
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    color: var(--tblr-secondary);
    cursor: pointer;
    text-decoration: none;
    transition:
        background 0.12s,
        color 0.12s;
}

.wiki-action-btn:hover {
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color);
}

/* ── 微信二维码弹窗 ── */
.wiki-wechat-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiki-wechat-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.wiki-wechat-modal-box {
    position: relative;
    background: var(--tblr-bg-surface);
    border-radius: var(--tblr-border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wiki-wechat-modal-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.wiki-wechat-modal-desc {
    font-size: 0.8125rem;
    color: var(--tblr-secondary);
    margin-bottom: 1rem;
}

.wiki-wechat-qr img {
    border-radius: var(--tblr-border-radius);
}

.wiki-wechat-modal-close {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--tblr-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.wiki-other-versions {
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--tblr-border-color);
}
