/* ==========================================================================
   Donghua Theme - Main Stylesheet v2.1.0
   OKanime Portal Edition — Light / Dark Theming, Swiper, Boxed Layout, & Universal UI
   ========================================================================== */

/* ── Reset & Fundamentals ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body.donghua-portal-body {
    background: var(--page-gradient, var(--bg-page));
    color: var(--text-primary);
    font-family: var(--font-arabic);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--brand-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Theme Transition Control (Motion Safe) ───────────────────────────────── */
html.theme-transitioning,
html.theme-transitioning body,
html.theme-transitioning .site-wrapper,
html.theme-transitioning .site-header,
html.theme-transitioning .top-bar-header,
html.theme-transitioning .main-content,
html.theme-transitioning .portal-section,
html.theme-transitioning .donghua-card,
html.theme-transitioning .episode-row-item,
html.theme-transitioning .sidebar-widget,
html.theme-transitioning .sub-slider-bar,
html.theme-transitioning .site-footer,
html.theme-transitioning input,
html.theme-transitioning textarea,
html.theme-transitioning select,
html.theme-transitioning .quick-tag,
html.theme-transitioning .specs-card,
html.theme-transitioning .donghua-story-box,
html.theme-transitioning .episodes-index-section,
html.theme-transitioning .download-section-box,
html.theme-transitioning .episode-staff-card,
html.theme-transitioning .episode-comments-section,
html.theme-transitioning .episodes-scroll-sidebar,
html.theme-transitioning .server-tab-btn,
html.theme-transitioning .ep-nav-btn {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease !important;
    transition-delay: 0s !important;
}

/* Strictly exclude media elements & video player from transitions */
html.theme-transitioning img,
html.theme-transitioning video,
html.theme-transitioning iframe,
html.theme-transitioning canvas,
html.theme-transitioning .player-aspect-ratio,
html.theme-transitioning #main-video-frame,
html.theme-transitioning .swiper-wrapper,
html.theme-transitioning .swiper-slide {
    transition: none !important;
}

/* Accessibility: Support prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── WordPress Admin Bar Compatibility ─────────────────────────────────────── */
body.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}
@media screen and (max-width: 600px) {
    /* Keep the toolbar at the viewport origin, outside the positioned body. */
    body.admin-bar.donghua-portal-body #wpadminbar {
        position: fixed;
    }
}

/* ── Canonical Site Wrapper & Containers (1560px Max Width) ─────────────── */
.site-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    box-sizing: border-box;
}

.main-content {
    flex: 1 0 auto;
    width: 100%;
    background: transparent;
}

.container,
.site-container {
    width: 100%;
    max-width: var(--site-container-max, 1560px);
    margin-inline: auto;
    padding-inline: var(--site-gutter, 24px);
    box-sizing: border-box;
}

.site-container-wide {
    width: 100%;
    max-width: var(--site-wide-max, 1560px);
    margin-inline: auto;
    padding-inline: var(--site-gutter, 24px);
    box-sizing: border-box;
}

.site-container-reading,
.reading-container {
    width: 100%;
    max-width: var(--site-reading-max, 860px);
    margin-inline: auto;
    padding-inline: var(--site-gutter, 24px);
    box-sizing: border-box;
}

/* ── 1. Top Bar Header (Small Elegant Bar) ─────────────────────────────────── */
.top-bar-header {
    background: var(--bg-topbar);
    color: var(--text-muted);
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 20px;
}

.top-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-bar-start {
    display: flex;
    align-items: center;
    gap: 14px;
}

.top-bar-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #b0b4c3;
    font-weight: 500;
}

.top-bar-tagline {
    color: #6d7180;
    font-size: 11.5px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-user-greeting {
    color: #d0d3de;
    font-size: 12px;
}

.top-user-greeting strong {
    color: #ffffff;
}

.top-auth-link {
    color: #b0b4c3;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.top-auth-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.top-register {
    color: var(--brand-primary);
}

.top-register:hover {
    color: #ffffff;
    background: var(--brand-primary);
}

.top-logout {
    color: var(--color-danger);
}

.top-sep {
    color: #3b3e4a;
    font-size: 11px;
}

/* ── 2. Main Header (Clean Baseline Hook — Unified In premium.css) ─────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ── 3. Hero Slider is canonically maintained in premium.css ───────────────── */

/* ── 4. Sub-Slider Action Bar ─────────────────────────────────────────────── */
.sub-slider-bar {
    background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
}

.sub-slider-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Search Box */
.subbar-search {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.subbar-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.subbar-search-icon {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.subbar-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 7px 34px 7px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.subbar-search-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.subbar-search-input::placeholder {
    color: var(--text-muted);
}

/* Floating Live Search Dropdown */
.live-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px var(--shadow-color);
    z-index: 1001;
    max-height: 380px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-thumb {
    width: 38px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.search-meta-info h5 {
    font-size: 13px;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.search-meta-badges {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Quick Tags */
.subbar-quick-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-tag {
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-tag);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: var(--transition);
}

.quick-tag:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

.tag-schedule {
    color: var(--accent-gold-dark);
}

.tag-ongoing {
    color: var(--accent-green);
}

/* Social Buttons */
.subbar-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-icon-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.discord-icon {
    background: #5865f2;
}

.discord-icon:hover {
    background: #4752c4;
    transform: translateY(-1px);
}

.telegram-icon {
    background: #229ed9;
}

.telegram-icon:hover {
    background: #1c88bd;
    transform: translateY(-1px);
}

/* ── 5. Main Portal 2-Column Layout ───────────────────────────────────────── */
.portal-main-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 26px;
    padding: 24px 20px;
    align-items: start;
    background: var(--bg-boxed);
}

.portal-primary-content {
    min-width: 0;
}

.portal-sidebar {
    min-width: 0;
}

/* ── Section Titles & Headers ─────────────────────────────────────────────── */
.portal-section {
    margin-bottom: var(--space-2xl, 48px);
}

.portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: var(--space-md, 16px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-accent-dot {
    width: 4px;
    height: 18px;
    background: var(--brand-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.portal-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.portal-section-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.section-view-all {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand-primary);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--brand-primary-soft);
    background: var(--brand-primary-soft);
    white-space: nowrap;
    transition: var(--transition);
}

.section-view-all:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

/* ── 6. Latest Episodes (Option B: Table / Rows Style) ─────────────────────── */
.episodes-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.episodes-rows-list {
    display: flex;
    flex-direction: column;
}

.episode-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card);
    transition: var(--transition);
}

.episode-row-item:nth-child(even) {
    background: var(--bg-card-alt);
}

.episode-row-item:last-child {
    border-bottom: none;
}

.episode-row-item:hover {
    background: var(--brand-primary-soft);
    border-right: 3px solid var(--brand-primary);
    padding-right: 11px;
}

.row-num-badge {
    background: var(--brand-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.row-num-badge .halka-prefix {
    font-size: 10.5px;
    font-family: var(--font-arabic);
}

.row-work-info {
    flex: 1;
    min-width: 0;
}

.row-work-title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-work-title a {
    color: var(--text-primary);
}

.row-work-title a:hover {
    color: var(--brand-primary);
}

.row-sub-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.row-anim-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.row-anim-badge.badge-3d {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.row-anim-badge.badge-2d {
    background: rgba(2, 136, 209, 0.15);
    color: var(--accent-blue);
}

.row-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.row-action {
    flex-shrink: 0;
}

.row-watch-btn {
    background: var(--bg-card);
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.row-watch-btn:hover {
    background: var(--brand-primary);
    color: #ffffff;
}

/* ── 7. Donghua Cards Grid & Card System ─────────────────────────────────── */
.donghua-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.archive-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

@media (min-width: 1440px) {
    .archive-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.donghua-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-card);
}

.donghua-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(148, 163, 184, 0.22);
}

.card-poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--bg-surface-alt);
    border-top-left-radius: 36px;
}

.card-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

.donghua-card:hover .card-poster-img {
    transform: scale(1.03);
}

/* Empty Poster Placeholder (Zero Layout Shift - 2:3 Ratio) */
.card-poster-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: 2 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-alt);
    color: var(--text-muted);
    border-top-left-radius: 36px;
    padding: 12px;
    text-align: center;
    gap: 8px;
    box-sizing: border-box;
}

.placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.7;
}

.placeholder-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Golden Score Badge (Top Left of Poster) */
.card-score-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 21, 28, 0.90);
    border: 1px solid rgba(214, 168, 75, 0.35);
    color: var(--brand-gold);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-rating);
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 3;
    backdrop-filter: blur(4px);
}

/* Status Dot Badge (Top Right of Poster) */
.card-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 21, 28, 0.88);
    border: 1px solid var(--border-color);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    z-index: 3;
    color: var(--text-secondary);
}

.card-status-badge .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-success);
}

.card-status-badge.status-مكتمل .status-dot {
    background: var(--color-info);
}

/* Hover Overlay */
.card-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 16, 20, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.donghua-card:hover .card-hover-overlay {
    opacity: 1;
}

.play-btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 12px var(--brand-primary-soft);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.donghua-card:hover .play-btn-circle {
    transform: scale(1);
}

.hover-action-text {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.65);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Card Typography & Structured Metadata */
.card-content {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.card-title a {
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a:hover {
    color: var(--brand-primary);
}

.card-sub-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.card-roman-title {
    font-family: var(--font-code);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.card-year-tag {
    font-family: var(--font-code);
}

.card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.card-meta-tag {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
}

.card-meta-tag.ep-meta {
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
    border-color: transparent;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.card-year-tag {
    font-weight: 600;
}

/* ── 8. News Grid ─────────────────────────────────────────────────────────── */
.news-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.news-portal-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    gap: 12px;
    padding: 10px;
    transition: var(--transition);
}

.news-portal-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--brand-primary);
}

.news-thumb-wrap {
    width: 100px;
    height: 75px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #1a1b22;
}

.news-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
}

.news-text-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-item-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
}

.news-item-title a {
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item-title a:hover {
    color: var(--brand-primary);
}

.news-item-excerpt {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item-date {
    font-size: 10.5px;
    color: var(--text-muted);
}

/* ── 9. Sidebar Widgets ───────────────────────────────────────────────────── */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-card);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.widget-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 40px;
    height: 2px;
    background: var(--brand-primary);
}

.widget-icon {
    font-size: 16px;
}

.widget-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Ranked Works */
.ranked-works-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ranked-work-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.ranked-work-row:last-child {
    border-bottom: none;
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 900;
    background: var(--border-color);
    color: var(--text-primary);
    flex-shrink: 0;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #8a8a8a 100%);
    color: #ffffff;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #9c551c 100%);
    color: #ffffff;
}

.rank-thumb {
    width: 38px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: #14151a;
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.rank-meta {
    flex: 1;
    min-width: 0;
}

.rank-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.rank-title a {
    color: var(--text-primary);
}

.rank-title a:hover {
    color: var(--brand-primary);
}

.rank-score-pill {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Schedule Widget */
.schedule-widget-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.btn-schedule-action {
    display: block;
    text-align: center;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-schedule-action:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}

/* Community Widget */
.widget-community-card {
    background: linear-gradient(135deg, #1f2334 0%, #131520 100%);
    border: 1px solid rgba(88, 101, 242, 0.3);
    color: #ffffff;
}

.community-badge {
    background: #5865f2;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
}

.community-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 6px;
    color: #ffffff;
}

.community-desc {
    font-size: 12px;
    color: #b0b4c8;
    line-height: 1.6;
    margin-bottom: 14px;
}

.btn-discord-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #5865f2;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

.btn-discord-action:hover {
    background: #4752c4;
    color: #ffffff;
}

/* ── 10. Universal Forms, Inputs, Textarea, Select ────────────────────────── */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
textarea,
select {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

/* ── 11. Pagination & Nav Links ───────────────────────────────────────────── */
.pagination,
.nav-links {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin: 28px 0 16px;
    flex-wrap: wrap;
}

.nav-links a,
.nav-links span {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}

.nav-links .current,
.nav-links a:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

/* ── 12. Empty States, 404 & Alerts ───────────────────────────────────────── */
.empty-state-box,
.page-404-wrapper {
    background: var(--bg-surface-alt);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 35px 16px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 6px;
    display: block;
}

.empty-state-text {
    font-size: 13px;
}

.donghua-alert,
.notice-box {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-right: 4px solid var(--brand-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ── 13. Comments Form & List ─────────────────────────────────────────────── */
.comments-area {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.comment-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.comment-body {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.comment-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.comment-author .fn {
    font-weight: 700;
    color: var(--text-primary);
}

.comment-content {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.comment-respond {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.comment-reply-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.comment-form p {
    margin-bottom: 12px;
}

.comment-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
}

.form-submit input[type="submit"] {
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.form-submit input[type="submit"]:hover {
    background: var(--brand-primary-hover);
}

/* ── 14. Site Footer (Prestigious Dark Footer) ────────────────────────────── */
.site-footer {
    background: var(--bg-footer);
    color: #a0a4b4;
    border-top: 1px solid var(--border-color);
    padding: 40px 24px 0;
}

.footer-container {
    width: 100%;
    max-width: var(--site-container-max);
    margin: 0 auto;
}

.footer-grid-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1.3fr;
    gap: 32px;
    padding-bottom: 35px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 12px;
    direction: ltr !important;
}

.footer-logo-link .logo-white {
    color: #ffffff !important;
}

.footer-desc {
    font-size: 12.5px;
    line-height: 1.7;
    color: #8a8e9e;
    margin-bottom: 10px;
}

.footer-dmca-note {
    font-size: 11px;
    color: #5d606f;
    line-height: 1.6;
}

.footer-col-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.footer-col-title::after {
    display: none;
}

.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-list li a {
    font-size: 12.5px;
    color: #9296a6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.footer-list li a::before {
    content: '‹';
    color: var(--brand-primary);
    font-size: 14px;
}

.footer-list li a:hover {
    color: #ffffff;
    padding-right: 4px;
}

.footer-community-text {
    font-size: 12px;
    color: #8a8e9e;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.social-btn {
    background: #181920;
    border: 1px solid #262832;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: #c0c3d4;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.social-btn:hover {
    transform: translateY(-1px);
    color: #ffffff;
}

.discord-btn:hover { background: #5865f2; border-color: #5865f2; }
.telegram-btn:hover { background: #229ed9; border-color: #229ed9; }
.twitter-btn:hover  { background: #1da1f2; border-color: #1da1f2; }

.footer-bottom-bar {
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #616474;
}

.footer-copy-text strong {
    color: #a0a4b4;
}

.back-to-top-btn {
    background: #1a1b22;
    border: 1px solid #282a36;
    color: #a0a4b4;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.back-to-top-btn:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}

/* ── 15. Archive, Search & Schedule Page Theming ─────────────────────────── */
.archive-donghua-page,
.search-results-page,
.schedule-page-container {
    padding: 24px 20px;
}

.archive-header,
.search-header,
.schedule-page-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-color);
}

.archive-title,
.search-title,
.schedule-main-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.archive-description,
.schedule-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.search-term-highlight {
    color: var(--brand-primary);
}

.archive-filter-bar {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 22px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}

.no-results-box,
.no-search-results {
    background: var(--bg-surface-alt);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    grid-column: 1 / -1;
    color: var(--text-muted);
}

.no-results-box h3,
.no-search-results h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* Schedule Page Layout */
.schedule-days-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.schedule-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.schedule-day-header {
    background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
}

.day-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-primary);
}

.schedule-day-entries {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.schedule-item-row:last-child {
    border-bottom: none;
}

.schedule-poster-mini {
    width: 36px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.schedule-poster-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.schedule-entry-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.schedule-entry-title:hover {
    color: var(--brand-primary);
}

/* Weekly schedule: compact rows, explicit status, and a scrollable RTL day rail. */
.schedule-page-container { max-width: 1120px; margin-inline: auto; }
.schedule-page-header { padding: 22px 0 18px; }
.schedule-eyebrow { display: block; color: var(--brand-primary); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.schedule-main-title { font-size: clamp(22px, 3vw, 30px); margin: 0 0 7px; }
.schedule-subtitle { margin: 0; line-height: 1.7; }
.schedule-week-count { margin: 9px 0 0; color: var(--text-secondary); font-size: 12px; }
.schedule-day-rail { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; padding: 2px 1px 12px; margin-bottom: 12px; }
.schedule-day-tab { min-width: 88px; min-height: 52px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-card); color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 700; }
.schedule-day-tab small { color: var(--brand-primary); font-size: 10px; }
.schedule-day-tab.is-today { border-color: var(--brand-primary); }
.schedule-day-tab.is-active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.schedule-day-tab.is-active small { color: #fff; }
.schedule-day-tab:focus-visible, .schedule-filter-tab:focus-visible, .schedule-follow-button:focus-visible, .schedule-watch-btn:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.schedule-filter-row { display: flex; gap: 8px; margin: 0 0 16px; }
.schedule-filter-tab { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--bg-card); color: var(--text-secondary); text-decoration: none; font-size: 13px; font-weight: 700; }
.schedule-filter-tab.is-active { color: var(--brand-primary); border-color: var(--brand-primary); }
.schedule-day-panel { border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-card); overflow: hidden; }
.schedule-day-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--bg-surface-alt); border-bottom: 1px solid var(--border-color); }
.schedule-day-panel-heading h2 { margin: 0; color: var(--text-primary); font-size: 16px; }
.schedule-day-panel-heading > span { color: var(--text-muted); font-size: 12px; }
.schedule-item-list { padding: 0 16px; }
.schedule-item-row { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.schedule-item-row:last-child { border-bottom: 0; }
.schedule-poster-mini { width: 48px; height: 64px; flex: 0 0 48px; border-radius: 7px; background: var(--bg-surface-alt); }
.schedule-poster-mini img { display: block; }
.schedule-info-block { min-width: 0; flex: 1 1 auto; }
.schedule-work-title { margin: 0 0 5px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.schedule-work-title a { color: var(--text-primary); text-decoration: none; }
.schedule-work-title a:hover { color: var(--brand-primary); }
.schedule-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--text-muted); font-size: 12px; }
.schedule-item-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.schedule-status { color: var(--text-secondary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.schedule-status.is-released { color: #18845b; }
.schedule-watch-btn, .schedule-follow-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.schedule-watch-btn { color: var(--brand-primary); border-color: var(--brand-primary); }
.schedule-follow-button.is-following { color: #18845b; border-color: #18845b; }
.schedule-follow-button[disabled] { opacity: .65; cursor: progress; }
.schedule-empty-day { min-height: 154px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 24px; text-align: center; color: var(--text-muted); }
.schedule-empty-day p, .schedule-empty-day h3 { margin: 0; font-size: 14px; }
.schedule-empty-day a { color: var(--brand-primary); font-weight: 700; }
.schedule-empty-icon { color: var(--brand-primary); font-size: 24px; }
.schedule-live-feedback { min-height: 20px; color: var(--text-muted); font-size: 12px; }
@media (max-width: 600px) {
    .schedule-page-container { padding-inline: 14px; }
    .schedule-day-tab { min-width: 82px; }
    .schedule-item-list { padding-inline: 12px; }
    .schedule-item-row { gap: 9px; align-items: flex-start; }
    .schedule-poster-mini { width: 44px; height: 60px; flex-basis: 44px; }
    .schedule-item-actions { max-width: 112px; gap: 5px; }
    .schedule-status { width: 100%; text-align: end; }
    .schedule-watch-btn, .schedule-follow-button { min-height: 44px; padding-inline: 8px; font-size: 11px; }
}

/* ==========================================================================
   Donghua Encyclopedia (موسوعة الدونغهوا) Styles
   ========================================================================== */

/* ── 1. Encyclopedia Portal Header & Hero ─────────────────────────────────── */
.encyclopedia-hero-banner {
    background: linear-gradient(135deg, rgba(20, 22, 30, 0.98) 0%, rgba(13, 14, 18, 0.96) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 36px 20px 28px;
    position: relative;
}

.encyclopedia-donghua-hero {
    background-size: cover;
    background-position: center 25%;
    border-bottom: 1px solid var(--border-color);
    padding: 36px 20px 28px;
    position: relative;
}

.enc-hero-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.enc-hero-badge {
    display: inline-block;
    background: var(--brand-primary-soft);
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.enc-portal-main-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.enc-portal-main-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

/* Specialized Donghua Hero */
.enc-dh-hero-inner {
    position: relative;
    z-index: 2;
}

.enc-dh-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.enc-dh-breadcrumbs a {
    color: var(--text-secondary);
}

.enc-dh-breadcrumbs a:hover {
    color: var(--brand-primary);
}

.enc-dh-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.badge-portal-tag {
    background: var(--brand-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 6px;
}

.enc-portal-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.enc-dh-en-title {
    color: #b0b4c3;
    font-size: 15px;
    font-family: var(--font-code);
    margin-top: 2px;
}

.enc-portal-desc {
    color: #d6d9e6;
    font-size: 13.5px;
    margin-top: 4px;
}

.enc-dh-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-enc-primary {
    background: var(--brand-primary);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px var(--brand-primary-soft);
    transition: var(--transition);
}

.btn-enc-primary:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-2px);
}

.btn-enc-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.btn-enc-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── 2. Live Search Box ───────────────────────────────────────────────────── */
.enc-search-wrapper {
    position: relative;
    max-width: 680px;
    margin: 18px auto 20px;
}

.enc-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.enc-search-form:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 6px 24px var(--brand-primary-soft);
}

.enc-search-icon {
    padding: 0 14px;
    font-size: 18px;
    color: var(--text-muted);
}

.enc-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-arabic);
    font-size: 15px;
    padding: 13px 4px;
}

.enc-search-btn {
    background: var(--brand-primary);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 0 24px;
    height: 48px;
    cursor: pointer;
    transition: var(--transition);
}

.enc-search-btn:hover {
    background: var(--brand-primary-hover);
}

.enc-live-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
    text-align: right;
}

.enc-dropdown-list {
    display: flex;
    flex-direction: column;
}

.enc-dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.enc-dropdown-item:last-child {
    border-bottom: none;
}

.enc-dropdown-item:hover {
    background: var(--bg-surface-alt);
    border-right: 3px solid var(--brand-primary);
    padding-right: 11px;
}

.enc-res-thumb-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-surface-alt);
}

.enc-res-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.enc-res-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
}

.enc-res-info {
    flex: 1;
    min-width: 0;
}

.enc-res-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.enc-res-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enc-res-sub {
    font-size: 11.5px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    margin-top: 1px;
}

.enc-res-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.enc-res-dh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--brand-primary);
    font-weight: 600;
    margin-top: 3px;
}

.enc-dropdown-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.enc-dropdown-empty .icon {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

/* ── 3. Alphabetical Filter Bar ───────────────────────────────────────────── */
.enc-alphabet-filter-bar {
    margin-top: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.alphabet-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.alphabet-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.alphabet-english {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-subtle);
}

.lang-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 4px;
}

.letter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.letter-link:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.letter-link.active {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
}

/* ── 4. Sub-Header Filter Bar (Categories & Sort) ─────────────────────────── */
.encyclopedia-filter-nav {
    background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
}

.enc-filter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.enc-categories-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.enc-pill-item {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: 20px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.enc-pill-item:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.enc-pill-item.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.enc-pill-item .pill-count {
    font-size: 10.5px;
    opacity: 0.8;
}

.enc-sort-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.enc-sort-box select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--font-arabic);
}

/* ── 5. Main Content Layout & Term of Day ─────────────────────────────────── */
.enc-content-layout {
    padding: 24px 20px 40px;
}

.enc-term-of-day-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border-color);
    border-right: 4px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
}

.totd-badge-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.totd-star {
    color: var(--accent-gold);
    font-size: 14px;
}

.totd-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-gold);
}

.totd-type {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-gold);
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 3px;
}

.totd-inner-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.totd-content {
    flex: 1;
}

.totd-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.totd-title a {
    color: var(--text-primary);
}

.totd-title a:hover {
    color: var(--brand-primary);
}

.totd-subtitles {
    font-size: 12.5px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    margin-bottom: 8px;
}

.totd-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.btn-totd-read {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-totd-read:hover {
    color: var(--brand-primary-hover);
    transform: translateX(-3px);
}

.totd-thumb-wrap {
    width: 140px;
    height: 110px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.totd-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── 6. Entries Grid & Encyclopedia Card ──────────────────────────────────── */
.enc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 8px;
}

.enc-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.enc-results-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.encyclopedia-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.encyclopedia-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.encyclopedia-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card-hover);
}

.enc-card-link-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.enc-card-thumb {
    position: relative;
    width: 100%;
    height: 140px;
    background: var(--bg-surface-alt);
    overflow: hidden;
}

.enc-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.encyclopedia-card:hover .enc-thumb-img {
    transform: scale(1.05);
}

.enc-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-surface-alt) 0%, var(--bg-card) 100%);
}

.enc-thumb-placeholder .placeholder-icon {
    font-size: 32px;
    color: var(--text-muted);
    opacity: 0.6;
}

.enc-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 16, 20, 0.8) 0%, rgba(15, 16, 20, 0.1) 70%);
}

.enc-badge-type {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: var(--brand-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.enc-badge-level {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 2;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Badge Color Variations */
.enc-badge-cultivation-realms { background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%); }
.enc-badge-characters { background: #0288d1; }
.enc-badge-treasures, .enc-badge-weapons { background: #8e24aa; }
.enc-badge-sects, .enc-badge-clans { background: #2e7d32; }
.enc-badge-spirit-beasts { background: #e65100; }
.enc-badge-power-systems { background: var(--brand-primary); }
.enc-badge-realms, .enc-badge-kingdoms { background: #3949ab; }

.enc-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.enc-card-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 2px;
}

.enc-card-subtitles {
    font-size: 11.5px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enc-sub-sep {
    margin: 0 4px;
    color: var(--text-muted);
}

.enc-card-excerpt {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
    flex: 1;
}

.enc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
}

.enc-card-dh-tag {
    color: var(--brand-primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enc-card-general-tag {
    color: var(--text-muted);
}

.enc-card-views {
    color: var(--text-muted);
}

/* Empty State */
.enc-empty-state {
    text-align: center;
    padding: 48px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.enc-empty-state .empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
    color: var(--text-muted);
}

.enc-empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.enc-empty-state p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 16px;
}

/* ── 7. Single Entry Page (single-encyclopedia.php) ───────────────────────── */
.single-encyclopedia-page {
    background: var(--bg-surface);
}

.enc-single-hero {
    background: linear-gradient(135deg, rgba(20, 22, 30, 0.98) 0%, rgba(13, 14, 18, 0.96) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 20px;
}

.enc-hero-inner {
    max-width: var(--dh-boxed-width);
    margin: 0 auto;
}

.enc-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.enc-breadcrumbs a {
    color: var(--text-secondary);
}

.enc-breadcrumbs a:hover {
    color: var(--brand-primary);
}

.enc-single-badges-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.badge-enc-type {
    background: var(--brand-primary);
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
}

.badge-enc-status {
    background: rgba(46, 125, 50, 0.25);
    border: 1px solid #4caf50;
    color: #81c784;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.badge-enc-level {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.badge-enc-importance {
    color: var(--accent-gold);
    font-size: 12px;
    letter-spacing: 1px;
}

.enc-main-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.enc-foreign-titles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-secondary);
    font-family: var(--font-code);
}

.enc-alt-names-row {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.enc-alt-names-row .label {
    font-weight: 700;
    margin-left: 4px;
}

/* ── 8. Single Entry Layout (Grid & Sidebar) ──────────────────────────────── */
.enc-body-container {
    padding: 24px 20px 40px;
}

.enc-body-grid {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 24px;
}

.enc-content-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* Summary Box */
.enc-summary-box {
    background: var(--bg-card);
    border-right: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.summary-icon {
    color: var(--brand-primary);
    font-size: 16px;
}

.summary-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--brand-primary);
}

.summary-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Cultivation Realm Interactive Pathway */
.enc-cultivation-pathway-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.decor-dot {
    width: 8px;
    height: 8px;
    background: var(--brand-primary);
    border-radius: 50%;
}

.section-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
}

.cultivation-flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.pathway-step {
    flex: 1;
    min-width: 160px;
    max-width: 240px;
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.current-label {
    color: var(--accent-gold);
    font-weight: 700;
}

.step-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: var(--transition);
    min-height: 70px;
}

.step-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.step-ar {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.step-en {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-code);
    margin-top: 2px;
}

.pathway-current .active-card {
    background: linear-gradient(135deg, var(--brand-primary-soft) 0%, rgba(212, 175, 55, 0.08) 100%);
    border: 2px solid var(--brand-primary);
    box-shadow: 0 4px 15px var(--brand-primary-soft);
}

.step-ar-main {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.step-en-main {
    font-size: 12px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    margin-top: 2px;
}

.substages-pills-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}

.substage-pill {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
}

.pathway-arrow {
    font-size: 22px;
    color: var(--brand-primary);
    font-weight: 800;
    user-select: none;
}

.step-card-empty {
    opacity: 0.5;
    font-size: 12px;
    color: var(--text-muted);
    cursor: default;
}

.realm-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.realm-lifespan-card {
    grid-column: 1 / -1;
}

.realm-spec-card {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.spec-head {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.spec-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Full Article Prose */
.enc-full-article-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.enc-prose-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.enc-prose-content p {
    margin-bottom: 16px;
}

.enc-prose-content h2,
.enc-prose-content h3 {
    color: var(--text-primary);
    font-weight: 800;
    margin: 24px 0 12px;
}

.enc-prose-content ul,
.enc-prose-content ol {
    margin: 0 20px 16px 0;
}

.enc-prose-content li {
    margin-bottom: 6px;
}

/* Relationships Section */
.enc-relationships-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.relationships-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.relation-item-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: var(--transition);
}

.relation-item-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.rel-relation-badge {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.rel-body {
    flex: 1;
    min-width: 0;
}

.rel-header-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rel-type-tag {
    font-size: 10px;
    color: var(--text-muted);
}

.rel-entry-title {
    font-size: 14px;
    font-weight: 700;
}

.rel-entry-title a {
    color: var(--text-primary);
}

.rel-entry-title a:hover {
    color: var(--brand-primary);
}

.rel-en-subtitle {
    font-size: 11px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    display: block;
    margin-top: 1px;
}

.rel-short-text {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.45;
    margin-top: 4px;
}

/* Sources Box */
.enc-sources-citation-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 12.5px;
}

.sources-head {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-link {
    color: var(--accent-blue);
}

.source-notes {
    color: var(--text-muted);
    margin-top: 4px;
}

/* Prev / Next Navigation */
.enc-entry-navigation {
    margin-top: 8px;
}

.enc-nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.enc-nav-btn {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.enc-nav-btn:hover {
    border-color: var(--brand-primary);
    background: var(--bg-surface-alt);
}

.nav-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.nav-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

/* ── 9. Sidebar Specs Card (enc-sidebar-column) ───────────────────────────── */
.enc-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.enc-specs-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

.specs-thumb-wrap {
    width: 100%;
    height: 220px;
    background: var(--bg-surface-alt);
    overflow: hidden;
}

.specs-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.specs-placeholder-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-surface-alt) 0%, var(--bg-card) 100%);
    color: var(--text-muted);
    gap: 8px;
}

.specs-card-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.specs-card-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-primary);
}

.specs-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-code);
}

.specs-data-list {
    list-style: none;
    padding: 8px 16px 14px;
    margin: 0;
}

.specs-data-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
    gap: 10px;
}

.specs-data-list li:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-muted);
    font-weight: 600;
}

.spec-value {
    color: var(--text-primary);
    font-weight: 700;
    text-align: left;
}

.spec-link {
    color: var(--brand-primary);
}

/* Connected Donghua Mini Cards */
.enc-sidebar-donghua-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.donghua-box-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 6px;
}

.box-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.donghua-mini-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-donghua-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.mini-thumb-link {
    width: 44px;
    height: 60px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.mini-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-info {
    flex: 1;
    min-width: 0;
}

.mini-title {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-title a {
    color: var(--text-primary);
}

.mini-title a:hover {
    color: var(--brand-primary);
}

.mini-en {
    font-size: 10.5px;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-links-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
}

.mini-watch-btn {
    color: var(--brand-primary);
    font-weight: 700;
}

.mini-enc-link {
    color: var(--accent-gold);
    font-weight: 600;
}

/* ── 10. Donghua Page (single-donghua.php) Encyclopedia Section ────────────── */
.donghua-encyclopedia-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.enc-sec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.view-all-enc-btn {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand-primary);
    transition: var(--transition);
}

.view-all-enc-btn:hover {
    color: var(--brand-primary-hover);
    transform: translateX(-3px);
}

.donghua-enc-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.donghua-enc-mini-card {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.donghua-enc-mini-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.enc-mini-type {
    font-size: 10px;
    font-weight: 700;
    align-self: flex-start;
    padding: 1px 6px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.enc-mini-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enc-mini-en {
    font-size: 10.5px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Phase 2: Dedicated Donghua Encyclopedia Hub & Relationship Graph Styles
   ========================================================================== */

.dedicated-encyclopedia-page {
    position: relative;
    padding-bottom: 50px;
}

.dh-enc-hero {
    background-color: var(--bg-surface);
    background-size: cover;
    background-position: center top;
    border-bottom: 1px solid var(--border-subtle);
    padding: 30px 0 40px;
    position: relative;
}

.dh-enc-hero-container {
    position: relative;
    z-index: 2;
}

.dh-enc-breadcrumbs {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dh-enc-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.dh-enc-breadcrumbs a:hover {
    color: var(--brand-primary);
}

.dh-enc-breadcrumbs .current {
    color: var(--text-primary);
    font-weight: 700;
}

.dh-enc-hero-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.dh-enc-poster-wrap {
    flex: 0 0 190px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: var(--bg-surface-alt);
}

.dh-enc-poster-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.dh-enc-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
}

.dh-enc-info-wrap {
    flex: 1;
    min-width: 0;
}

.dh-enc-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.dh-enc-portal-tag {
    background: var(--brand-primary-soft);
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary-hover);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.dh-enc-status-badge,
.dh-enc-year-badge {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
}

.dh-enc-score-badge {
    background: rgba(230, 169, 37, 0.15);
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}

.dh-enc-hero .dh-enc-title {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.25;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.dh-enc-subtitle-en {
    font-size: 14px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    margin-bottom: 14px;
}

.dh-enc-hero .dh-enc-hero-desc {
    font-size: 13.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 20px;
    max-width: 820px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.dh-enc-hero .dh-enc-breadcrumbs a {
    color: rgba(255, 255, 255, 0.75);
}

.dh-enc-hero .dh-enc-breadcrumbs a:hover {
    color: var(--brand-primary);
}

.dh-enc-hero .dh-enc-breadcrumbs .current {
    color: #ffffff;
}

.dh-enc-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.dh-stat-item {
    background: rgba(17, 18, 24, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    backdrop-filter: blur(4px);
}

.dh-stat-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-primary-hover);
}

.dh-stat-lbl {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 2px;
}

.dh-enc-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dh-btn-primary {
    background: var(--brand-primary);
    color: #ffffff !important;
    border: 1px solid var(--brand-primary);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: var(--transition);
}

.dh-btn-primary:hover {
    background: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 93, 103, 0.16);
}

.dh-enc-hero .dh-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: var(--transition);
}

.dh-enc-hero .dh-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-1px);
}

.dh-enc-hero .dh-btn-ghost {
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.85);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: var(--transition);
}

.dh-enc-hero .dh-btn-ghost:hover {
    border-color: var(--brand-primary);
    color: #ffffff;
}

/* ── Relationship Graph Section ────────────────────────────────────────── */
.dh-graph-section {
    margin-top: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
}

.dh-graph-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.dh-graph-focal-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switcher-lbl {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.dh-select-input {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.dh-select-input:focus {
    border-color: var(--brand-primary);
}

.dh-graph-viewport {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 26px 20px;
    position: relative;
    overflow: hidden;
}

.dh-graph-network-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dh-graph-central-node {
    background: var(--bg-surface);
    border: 2px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 18px 28px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 16px rgba(36, 93, 103, 0.12);
    max-width: 340px;
    width: 100%;
    z-index: 2;
}

.central-node-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-primary);
    display: block;
    margin-bottom: 4px;
}

.central-node-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0;
}

.central-node-en {
    font-size: 12px;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-code);
}

.central-node-link {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none;
}

.central-node-link:hover {
    text-decoration: underline;
}

.dh-graph-connector-spine {
    width: 2px;
    height: 36px;
    background: linear-gradient(to bottom, var(--brand-primary), var(--border-accent));
    margin: 0 auto;
}

.dh-graph-branches-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin-top: 6px;
}

.dh-graph-branch-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
}

.dh-graph-branch-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.branch-relation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 8px;
    align-self: flex-start;
}

.branch-relation-badge.rel-incoming {
    background: rgba(59, 130, 246, 0.15);
    color: #0284c7;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.branch-relation-badge.rel-outgoing {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
    border: 1px solid var(--brand-primary);
}

.branch-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.branch-node-type {
    font-size: 11px;
    color: var(--text-muted);
}

.branch-dir-badge {
    font-size: 10px;
    color: var(--text-muted);
}

.branch-node-title {
    font-size: 15px;
    font-weight: 700;
    margin: 2px 0;
}

.branch-node-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.branch-node-title a:hover {
    color: var(--brand-primary);
}

.branch-node-en {
    font-size: 11px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    display: block;
    margin-bottom: 10px;
}

.btn-pivot-graph {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
    width: 100%;
}

.btn-pivot-graph:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

.dh-graph-empty-state,
.dh-empty-full-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.empty-desc,
.empty-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Cultivation Pathway Section ───────────────────────────────────────── */
.dh-cultivation-pathway-section {
    margin-top: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
}

.dh-pathway-desktop-track {
    overflow-x: auto;
    padding: 14px 4px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) var(--bg-surface-alt);
}

.dh-pathway-desktop-track::-webkit-scrollbar {
    height: 6px;
}

.dh-pathway-desktop-track::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 3px;
}

.dh-pathway-scroll-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 100%;
}

.dh-pathway-node-card {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    min-width: 220px;
    max-width: 250px;
    flex: 0 0 auto;
    position: relative;
    transition: var(--transition);
}

.dh-pathway-node-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.dh-pathway-order-pill {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent-gold);
    background: rgba(230, 169, 37, 0.12);
    border-radius: 12px;
    padding: 2px 8px;
    display: inline-block;
    margin-bottom: 6px;
}

.dh-pathway-node-title {
    font-size: 15px;
    font-weight: 700;
    margin: 2px 0 4px;
}

.dh-pathway-node-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.dh-pathway-node-title a:hover {
    color: var(--brand-primary);
}

.dh-pathway-node-en {
    font-size: 11px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    display: block;
    margin-bottom: 8px;
}

.dh-pathway-substages-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.substage-pill {
    font-size: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--text-secondary);
}

.dh-pathway-explore-link {
    font-size: 11.5px;
    color: var(--brand-primary);
    font-weight: 700;
    text-decoration: none;
}

.dh-pathway-explore-link:hover {
    text-decoration: underline;
}

.dh-pathway-flow-arrow {
    font-size: 22px;
    color: var(--accent-gold);
    flex: 0 0 auto;
    user-select: none;
}

.dh-pathway-mobile-timeline {
    display: none;
}

/* ── Category Tabs & Directory Section ─────────────────────────────────── */
.dh-entries-section {
    margin-top: 36px;
    margin-bottom: 50px;
}

.dh-enc-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 24px;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 12px;
}

.dh-tab-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.dh-tab-btn:hover {
    border-color: var(--brand-primary);
    color: var(--text-primary);
}

.dh-tab-btn.is-active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}

.dh-tab-btn .tab-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 6px;
    border-radius: 10px;
}

.dh-tab-btn.is-active .tab-count {
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
}

.dh-tab-empty-notice {
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.notice-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.notice-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.notice-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.dh-card-wrapper.is-hidden {
    display: none !important;
}

/* ── Single Donghua Stats Summary ──────────────────────────────────────── */
.donghua-enc-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}

.enc-stat-pill {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.enc-stat-pill:hover {
    border-color: var(--brand-primary);
    color: var(--text-primary);
}

.enc-stat-pill .pill-val {
    font-weight: 800;
    color: var(--brand-primary);
}

/* ── Single Encyclopedia Direction Badges ──────────────────────────────── */
.rel-relation-badge.rel-badge-incoming {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.rel-relation-badge.rel-badge-outgoing {
    background: var(--brand-primary-soft) !important;
    color: var(--brand-primary) !important;
    border: 1px solid var(--brand-primary) !important;
}

.rel-dir-tag {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 6px;
}

/* ==========================================================================
   Phase 5 — Encyclopedia Knowledge Hub Redesign (.enc5-*)
   ========================================================================== */

/* ── Container & Width Enhancement ───────────────────────────────────────── */
body.post-type-archive-encyclopedia .site-wrapper {
    width: min(1280px, calc(100% - 32px)) !important;
    max-width: 1280px !important;
    margin: 18px auto 35px;
}

body.post-type-archive-encyclopedia .container {
    max-width: 1240px;
    padding: 0 20px;
    margin-inline: auto;
}

.enc5-hub-page {
    background: var(--bg-surface);
    min-height: 70vh;
}

/* ── 1. Hero Section ─────────────────────────────────────────────────────── */
.enc5-hero-wrapper {
    background: linear-gradient(160deg, var(--bg-surface) 0%, var(--bg-surface-alt) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 20px 18px;
    position: relative;
    overflow: hidden;
}

.enc5-hero-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 50% -10%, var(--brand-primary-soft) 0%, transparent 70%);
    pointer-events: none;
}

.enc5-hero-container {
    max-width: 1040px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.enc5-hero-badge-wrap {
    margin-bottom: 6px;
}

.enc5-hero-badge {
    display: inline-block;
    background: var(--brand-primary-soft);
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.enc5-hero-main-title {
    font-size: 30px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 4px 0 6px;
}

.enc5-hero-sub-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 16px;
    line-height: 1.5;
}

/* Big Search Bar */
.enc5-search-container {
    position: relative;
    max-width: 720px;
    margin: 0 auto 12px;
}

.enc5-search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.enc5-search-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 6px 24px var(--brand-primary-soft);
}

.enc5-search-lens {
    padding: 0 14px;
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.enc5-search-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-arabic);
    font-size: 14.5px;
    padding: 12px 4px;
}

.enc5-search-submit {
    background: var(--brand-primary);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 0 24px;
    height: 46px;
    cursor: pointer;
    font-family: var(--font-arabic);
    transition: background 0.2s;
    flex-shrink: 0;
}

.enc5-search-submit:hover {
    background: var(--brand-primary-hover);
}

/* Quick Stats Bar */
.enc5-quick-stats {
    display: inline-flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 30px;
    padding: 4px 16px;
    gap: 12px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

.enc5-stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.enc5-stat-digit {
    font-size: 17px;
    font-weight: 900;
    color: var(--brand-primary);
    line-height: 1;
}

.enc5-stat-text {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.enc5-stat-divider {
    color: var(--border-color);
    font-size: 12px;
}

/* ── 2. Category Chips (Under Search) ────────────────────────────────────── */
.enc5-category-chips-bar {
    margin-bottom: 12px;
}

.enc5-chips-scroll {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.enc5-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.enc5-chip-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px var(--brand-primary-soft);
}

.enc5-chip-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff !important;
    box-shadow: 0 3px 12px var(--brand-primary-soft);
}

.enc5-chip-btn .chip-icon {
    font-size: 13px;
}

.enc5-chip-btn .chip-count {
    font-size: 10.5px;
    background: var(--bg-surface-alt);
    color: var(--brand-primary);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.enc5-chip-btn.active .chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ── 3. Compact Alphabet Bar ─────────────────────────────────────────────── */
.enc5-alphabet-compact-bar {
    display: inline-block;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px 12px;
}

.enc5-alpha-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.enc5-alpha-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    padding: 0 3px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: all 0.15s ease;
}

.enc5-alpha-link:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.enc5-alpha-link.active {
    background: var(--brand-primary);
    color: #fff !important;
    font-weight: 700;
    border-color: var(--brand-primary);
}

.enc5-alpha-all {
    padding: 0 8px;
    font-weight: 700;
}

.enc5-alpha-sep {
    color: var(--border-color);
    font-size: 13px;
    margin: 0 3px;
}

.enc5-alpha-lang-badge {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-left: 2px;
}

.enc5-alpha-arabic,
.enc5-alpha-english {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

/* ── 4. Donghua Works Showcase Section ───────────────────────────────────── */
.enc5-works-showcase-section {
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.enc5-section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.enc5-title-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.enc5-title-icon {
    color: var(--brand-primary);
    font-size: 15px;
}

.enc5-sec-heading {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.enc5-sec-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.enc5-flagship-work-card {
    display: flex;
    align-items: stretch;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-card);
}

.enc5-flagship-work-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.enc5-flagship-poster-wrap {
    width: 120px;
    min-width: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: var(--bg-surface-alt);
}

.enc5-flagship-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.enc5-flagship-poster-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--accent-gold);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid var(--accent-gold);
}

.enc5-flagship-content-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.enc5-flagship-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.enc5-badge-work-tag {
    background: var(--brand-primary);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
}

.enc5-flagship-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-surface-alt);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4caf50;
}

.enc5-flagship-name {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}

.enc5-flagship-name a {
    color: inherit;
    transition: color 0.2s;
}

.enc5-flagship-name a:hover {
    color: var(--brand-primary);
}

.enc5-flagship-foreign-names {
    font-size: 13.5px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    display: flex;
    align-items: center;
    gap: 6px;
}

.enc5-fn-en { color: var(--accent-gold); }
.enc5-fn-sep { color: var(--border-color); }
.enc5-fn-zh { color: var(--text-muted); }

.enc5-flagship-description {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 2px 0 6px;
}

.enc5-flagship-cats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 12px;
}

.enc5-mini-pill {
    font-size: 11.5px;
    color: var(--text-secondary);
    background: var(--bg-surface-alt);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.enc5-btn-explore-work {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-primary);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 700;
    padding: 9px 22px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px var(--brand-primary-soft);
    text-decoration: none;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.enc5-btn-explore-work:hover {
    background: var(--brand-primary-hover);
    transform: translateX(-3px);
}

.enc5-btn-arrow {
    transition: transform 0.2s;
}

.enc5-btn-explore-work:hover .enc5-btn-arrow {
    transform: translateX(-3px);
}

/* ── 5. High Density Grid Cards Section ──────────────────────────────────── */
.enc5-grid-cards-section {
    padding: 28px 0 44px;
}

.enc5-grid-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 12px;
}

.enc5-grid-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.enc5-entries-total-badge {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.enc5-grid-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.enc5-sort-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.enc5-sort-dropdown {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 12.5px;
    font-family: var(--font-arabic);
    cursor: pointer;
    outline: none;
}

.enc5-knowledge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.enc5-knowledge-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: var(--shadow-card);
}

.enc5-knowledge-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card-hover);
}

.enc5-kcard-thumb {
    height: 165px;
    position: relative;
    overflow: hidden;
    background: var(--bg-surface-alt);
}

.enc5-kcard-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.enc5-knowledge-card:hover .enc5-kcard-img {
    transform: scale(1.05);
}

.enc5-kcard-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-surface-alt) 0%, var(--bg-card) 100%);
}

.enc5-kcard-ph-icon {
    font-size: 46px;
    opacity: 0.55;
}

.enc5-kcard-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 16, 22, 0.88) 0%, rgba(15, 16, 22, 0.15) 70%);
}

.enc5-kcard-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.enc5-badge-blue   { background: #0288d1; }
.enc5-badge-gold   { background: linear-gradient(135deg, #d4af37, #b8962e); }
.enc5-badge-green  { background: #2e7d32; }
.enc5-badge-purple { background: #8e24aa; }
.enc5-badge-orange { background: #e64a19; }
.enc5-badge-indigo { background: #3949ab; }
.enc5-badge-amber  { background: #e65100; }
.enc5-badge-slate  { background: #546e7a; }

.enc5-kcard-level-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.enc5-kcard-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 7px;
}

.enc5-kcard-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
}

.enc5-kcard-title a {
    color: var(--text-primary);
    transition: color 0.18s;
}

.enc5-kcard-title a:hover {
    color: var(--brand-primary);
}

.enc5-kcard-subtitles {
    font-size: 12.5px;
    color: var(--accent-gold);
    font-family: var(--font-code);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enc5-kcard-en { color: var(--accent-gold); }
.enc5-kcard-sep { color: var(--border-color); margin: 0 3px; }
.enc5-kcard-zh { color: var(--text-muted); }

.enc5-kcard-excerpt {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 2px 0 10px;
    flex: 1;
}

.enc5-kcard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    margin-top: auto;
    font-size: 12px;
}

.enc5-kcard-work-tag {
    color: var(--brand-primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.enc5-kcard-work-tag:hover {
    opacity: 0.85;
}

.enc5-kcard-general-tag {
    color: var(--text-muted);
    font-size: 11.5px;
}

.enc5-kcard-link-btn {
    color: var(--brand-primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.18s;
}

.enc5-kcard-link-btn:hover {
    color: var(--brand-primary-hover);
    transform: translateX(-3px);
}

.enc5-empty-state-box {
    text-align: center;
    padding: 50px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.enc5-empty-icon {
    font-size: 44px;
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.enc5-empty-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.enc5-empty-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.enc5-btn-reset {
    display: inline-block;
    background: var(--brand-primary);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s;
}

.enc5-btn-reset:hover {
    background: var(--brand-primary-hover);
}

/* ── 7. Responsive Media Queries ─────────────────────────────────────────── */
@media (max-width: 960px) {
    .enc5-hero-main-title { font-size: 28px; }
    .enc5-knowledge-grid { grid-template-columns: repeat(2, 1fr); }
    .enc5-flagship-work-card { gap: 16px; padding: 18px; }
    .enc5-flagship-poster-wrap { width: 120px; min-width: 120px; }
}

@media (max-width: 680px) {
    .enc5-hero-wrapper { padding: 22px 14px 16px; }
    .enc5-hero-main-title { font-size: 22px; }
    .enc5-hero-sub-desc { font-size: 13px; margin-bottom: 12px; }
    .enc5-quick-stats { gap: 10px; padding: 4px 12px; margin-bottom: 10px; }
    .enc5-stat-digit { font-size: 15px; }
    .enc5-knowledge-grid { grid-template-columns: 1fr; }
    .enc5-flagship-work-card { flex-direction: column; padding: 14px; gap: 14px; }
    .enc5-flagship-poster-wrap { width: 100%; height: 180px; min-width: auto; }
    .enc5-flagship-name { font-size: 20px; }
    .enc5-grid-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .enc5-chips-scroll { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .enc5-chip-btn { white-space: nowrap; }
    .enc5-alphabet-compact-bar { width: 100%; overflow-x: auto; padding: 5px 8px; -webkit-overflow-scrolling: touch; }
    .enc5-alpha-group { flex-wrap: nowrap; justify-content: flex-start; }
    .enc5-alpha-arabic, .enc5-alpha-english { flex-wrap: nowrap; }
}

/* ==========================================================================
   Central SVG Icon Helper Styling
   ========================================================================== */
.dh-svg-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
    stroke-width: 2;
    transition: transform var(--transition), color var(--transition), stroke var(--transition);
}

.btn .dh-svg-icon,
.filter-btn .dh-svg-icon,
.top-auth-link .dh-svg-icon {
    margin-inline-end: 6px;
}

/* ==========================================================================
   Accessible Mobile Navigation Drawer & Backdrop
   ========================================================================== */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.mobile-nav-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.mobile-nav-open {
    overflow: hidden !important;
}

/* Mobile Navigation Drawer styles are canonically handled in premium.css */


/* ==========================================================================
   Modern Standard WP Comments System
   ========================================================================== */
.comments-area {
    margin-top: 36px;
    padding: 24px 20px 32px;
    background: var(--bg-card, #141519);
    border: 1px solid var(--border-color, #232530);
    border-radius: var(--radius-md);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--brand-primary);
}

.comments-title .dh-svg-icon {
    color: var(--brand-primary);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dh-comment-item {
    list-style: none;
}

.dh-comment-card {
    background: var(--bg-surface, #181920);
    border: 1px solid var(--border-color, #232530);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    transition: var(--transition);
}

.dh-comment-card:hover {
    border-color: var(--border-light, #2e3240);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.dh-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.dh-comment-author-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dh-comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border-color);
    object-fit: cover;
    background: var(--bg-surface-alt);
    flex-shrink: 0;
}

.dh-comment-meta-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dh-comment-author-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dh-comment-author-name a {
    color: inherit;
}

.dh-comment-author-name a:hover {
    color: var(--brand-primary);
}

.dh-role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    line-height: 1.3;
}

.dh-role-admin {
    background: var(--brand-primary);
    color: #ffffff;
}

.dh-role-member {
    background: var(--bg-surface-alt, #232530);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.dh-comment-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dh-comment-body {
    font-size: 14.5px;
    line-height: 1.68;
    color: var(--text-secondary);
    word-break: break-word;
    margin-bottom: 12px;
}

.dh-comment-body p:last-child {
    margin-bottom: 0;
}

.dh-comment-moderation {
    display: block;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius-sm);
    color: #e6b422;
    font-size: 13px;
}

.dh-comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle, #21232c);
}

.dh-comment-reply-btn,
.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-alt, #1c1d25);
    border: 1px solid var(--border-color, #282a36);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    min-height: 32px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.dh-comment-reply-btn:hover,
.comment-reply-link:hover,
.dh-comment-reply-btn:focus-visible,
.comment-reply-link:focus-visible {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

.comment-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.comment-edit-link:hover {
    color: var(--text-primary);
}

/* Nested Replies */
.comment-list .children {
    list-style: none;
    padding: 0;
    margin: 12px 28px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 2px solid var(--border-subtle, #232530);
    padding-right: 14px;
}

@media (max-width: 768px) {
    .comment-list .children {
        margin: 10px 8px 0 0;
        padding-right: 8px;
        border-right-width: 1px;
    }
}

/* Comment Form / Composer */
.comment-respond {
    background: var(--bg-surface, #181920);
    border: 1px solid var(--border-color, #232530);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    margin-top: 24px;
}

.comment-reply-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

#cancel-comment-reply-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--site-accent-text);
    background: var(--bg-surface-alt);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.dh-composer-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.dh-composer-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.dh-composer-user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.comment-form-comment {
    position: relative;
    margin-bottom: 14px;
}

.comment-form-comment label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.comment-form-comment textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    background: var(--input-bg, #111216);
    border: 1px solid var(--border-color, #2b2e3b);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
    box-sizing: border-box;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.dh-char-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.dh-char-counter.is-limit {
    color: var(--brand-primary);
    font-weight: 700;
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 12px;
}

.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    max-width: 400px;
    height: 42px;
    padding: 0 12px;
    background: var(--input-bg, #111216);
    border: 1px solid var(--border-color, #2b2e3b);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    box-sizing: border-box;
}

.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.form-submit {
    margin-top: 14px;
    margin-bottom: 0;
}

.form-submit input[type="submit"],
.submit-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 24px;
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
}

.form-submit input[type="submit"]:hover,
.submit-btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 14px var(--brand-primary-soft);
    transform: translateY(-1px);
}

.form-submit input[type="submit"]:focus-visible,
.submit-btn-primary:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ==========================================================================
   Modern Branded 404 Experience Styles
   ========================================================================== */
.dh-404-hero {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(21, 23, 30, 0.6) 0%, rgba(14, 15, 19, 0.95) 100%);
    border-bottom: 1px solid var(--border-color);
}

.dh-404-badge-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

.dh-404-glitch-digit {
    font-family: var(--font-heading);
    font-size: clamp(80px, 14vw, 150px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #ff8a80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 24px var(--brand-primary-soft));
}

.dh-404-title {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.dh-404-desc {
    max-width: 580px;
    margin: 0 auto 28px;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.dh-404-search-box {
    max-width: 520px;
    margin: 0 auto 32px;
}

.dh-404-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 4px 6px 4px 18px;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.dh-404-search-form:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-primary-soft);
}

.dh-404-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    padding: 8px 10px;
}

.dh-404-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    min-height: 40px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.dh-404-search-btn:hover {
    background: var(--brand-primary-hover);
}

.dh-404-quick-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.dh-404-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    min-height: 44px;
    background: var(--bg-surface-alt, #1d1f27);
    border: 1px solid var(--border-color, #2b2e3b);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.dh-404-link-btn:hover,
.dh-404-link-btn:focus-visible {
    background: var(--brand-primary-soft);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    outline: none;
}

.dh-404-recommendations-section {
    padding: 40px 0 60px;
}

.dh-404-sec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.dh-404-sec-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Visual Identity: Single Donghua Component Accents ──────────────────── */
.story-decor {
    background: var(--brand-primary) !important;
}

.ep-count-pill {
    background: var(--brand-primary) !important;
}

.episode-pill-link:hover,
.episode-pill-link:focus-visible {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.btn-hero-watch,
.btn-watch-primary {
    background: var(--brand-primary) !important;
}

.btn-hero-watch:hover,
.btn-watch-primary:hover {
    background: var(--brand-primary-hover) !important;
}

.user-action-ribbon .btn-user-list.active {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.user-action-ribbon .btn-user-list:hover {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.okanime-big-button {
    background: var(--brand-primary) !important;
    box-shadow: 0 4px 16px var(--brand-primary-soft) !important;
}

.okanime-big-button:hover {
    background: var(--brand-primary-hover) !important;
    box-shadow: 0 6px 22px var(--brand-primary-soft) !important;
    transform: translateY(-2px) !important;
}

/* Real source quality switching, scoped to the existing episode player. */
.watch-quality-control{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 0;min-width:0}
.watch-quality-control select{max-width:100%;min-height:44px;background:var(--bg-surface);color:var(--text-primary);border:1px solid var(--border-color);border-radius:6px;padding:8px 12px}
.watch-quality-control small{color:var(--text-secondary);overflow-wrap:anywhere}
.watch-quality-upgrade{max-width:min(420px,calc(100vw - 32px));box-sizing:border-box;background:var(--bg-surface);color:var(--text-primary);border:1px solid var(--border-color);border-radius:8px;padding:24px}
.watch-quality-upgrade a,.watch-quality-upgrade button{display:inline-block;max-width:100%;min-height:44px;padding:8px 12px;background:var(--accent);color:var(--text-primary);border:1px solid var(--border-color);border-radius:6px}
.watch-quality-upgrade::backdrop{background:rgba(0,0,0,.65)}
