@import url('./common.css');

.chr-encyclopedia {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid var(--chr-border);
    max-width: 100%;
    animation: chr-fade-up 0.7s ease 0.2s both;
}

.chr-ency-header {
    margin-bottom: 28px;
}

.chr-ency-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.chr-ency-title-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: color-mix(in srgb, var(--chr-accent) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--chr-accent) 35%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--chr-accent) 20%, transparent);
}

.chr-ency-title {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    margin: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 16px color-mix(in srgb, var(--chr-accent) 30%, transparent);
}

.chr-ency-sub {
    margin: 0 0 0 56px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.5;
}

.chr-ency-tabs-wrap {
    margin-top: 22px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chr-ency-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.chr-ency-tab {
    position: relative;
    padding: 10px 20px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.5) !important;
    border-radius: 10px !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.chr-ency-tab:hover:not(.is-active) {
    color: rgba(255, 255, 255, 0.88) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--chr-border) !important;
    transform: translateY(-1px);
}

.chr-ency-tab.is-active {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--chr-accent) 35%, transparent),
        color-mix(in srgb, var(--chr-accent) 15%, transparent)
    ) !important;
    color: #fff !important;
    border-color: color-mix(in srgb, var(--chr-accent) 45%, transparent) !important;
    box-shadow:
        0 0 20px color-mix(in srgb, var(--chr-accent) 22%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chr-ency-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--chr-accent);
    box-shadow: 0 0 8px var(--chr-accent);
}

.chr-ency-panel {
    display: none;
    animation: chr-fade-up 0.4s ease;
    margin-top: 24px;
}

.chr-ency-panel.is-active {
    display: block;
}

.chr-card-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.chr-entity-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, border-color 0.25s;
}

.chr-entity-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    border-color: color-mix(in srgb, var(--chr-accent) 35%, transparent);
}

.chr-entity-card img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid var(--chr-border);
}

.chr-entity-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: #fff;
}

.chr-entity-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
}

/* 传说装备 Tab：名称使用游戏传说品质橙色 */
.chr-ency-panel[data-panel="legendaries"] .chr-entity-card strong {
    color: #ff8000;
}

.chr-ency-panel[data-panel="legendaries"] .chr-entity-card:hover {
    border-color: color-mix(in srgb, #ff8000 35%, transparent);
}

.chr-entity-card-text {
    padding: 18px;
}

.chr-ch-ref {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--chr-accent);
}

.chr-overview-gallery,
.chr-playguide,
.chr-mini-timeline,
.chr-firstkills {
    margin-bottom: 32px;
}

.chr-overview-gallery h3,
.chr-playguide h3,
.chr-mini-timeline h3,
.chr-firstkills h3,
.chr-ency-panel > h3 {
    font-size: 1rem;
    margin: 0 0 14px;
    color: var(--chr-accent);
}

.chr-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 8px;
}

.chr-visual-grid--maps {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.chr-visual-grid--raids {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.chr-visual-grid--mounts {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.chr-visual-card {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.chr-visual-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
    border-color: color-mix(in srgb, var(--chr-accent) 35%, transparent);
}

.chr-visual-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.chr-visual-card--mount img {
    aspect-ratio: 1;
    object-fit: contain;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.chr-visual-card-body {
    padding: 14px 16px 16px;
}

.chr-visual-card-body strong {
    display: block;
    font-size: 14px;
    color: #fff;
    margin-bottom: 6px;
}

.chr-visual-card-body p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
}

.chr-fk-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chr-fk-preview-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--chr-border);
    background: rgba(255, 255, 255, 0.02);
    font-size: 13px;
}

.chr-fk-preview-item strong {
    grid-column: 2;
    color: #fff;
}

.chr-fk-date {
    color: var(--chr-accent);
    font-size: 12px;
    white-space: nowrap;
}

.chr-fk-guild {
    grid-column: 2;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.chr-fk-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chr-fk-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    align-items: center;
}

.chr-fk-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--chr-border);
}

.chr-fk-body {
    flex: 1;
    min-width: 0;
}

.chr-fk-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.chr-fk-head strong {
    font-size: 15px;
    color: #fff;
}

.chr-fk-diff {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.chr-fk-raid {
    margin: 0 0 8px;
    font-size: 13px;
}

.chr-fk-raid a {
    color: var(--chr-accent);
    text-decoration: none;
}

.chr-fk-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.chr-fk-guild-name {
    color: #fff;
    font-weight: 600;
}

.chr-fk-time {
    color: var(--chr-accent);
}

.chr-fk-region {
    padding: 1px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.chr-fk-raids {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.chr-fk-raid {
    border-radius: 16px;
    border: 1px solid var(--chr-border);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    overflow: hidden;
}

.chr-fk-raid-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--chr-border);
    background: rgba(0, 0, 0, 0.2);
}

.chr-fk-raid-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--chr-border);
    flex-shrink: 0;
}

.chr-fk-raid-info {
    flex: 1;
    min-width: 0;
}

.chr-fk-raid-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
}

.chr-fk-raid-title a {
    color: #fff;
    text-decoration: none;
}

.chr-fk-raid-title a:hover {
    color: var(--chr-accent);
}

.chr-fk-raid-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chr-fk-progress-track {
    flex: 1;
    max-width: 200px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.chr-fk-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--chr-accent), #c77dff);
    transition: width 0.4s ease;
}

.chr-fk-progress-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.chr-fk-raid-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid var(--chr-border);
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.chr-fk-raid-toggle:hover {
    color: var(--chr-accent);
    background: rgba(157, 78, 221, 0.12);
    border-color: rgba(157, 78, 221, 0.35);
}

.chr-fk-raid-toggle-icon {
    display: block;
    line-height: 1;
    transition: transform 0.2s ease;
}

.chr-fk-raid-toggle-icon::before {
    content: '▼';
    font-size: 10px;
}

.chr-fk-raid.is-collapsed .chr-fk-raid-toggle-icon {
    transform: rotate(-90deg);
}

.chr-fk-raid.is-collapsed .chr-fk-raid-head {
    border-bottom: none;
}

.chr-fk-raid.is-collapsed .chr-fk-raid-body {
    display: none;
}

.chr-fk-boss-list {
    margin: 0;
    padding: 8px 0;
    list-style: none;
}

.chr-fk-boss-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chr-fk-boss-row:last-child {
    border-bottom: none;
}

.chr-fk-boss-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chr-fk-boss-row.is-pending {
    opacity: 0.72;
}

.chr-fk-boss-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--chr-border);
    flex-shrink: 0;
}

.chr-fk-boss-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chr-fk-boss-main strong {
    font-size: 15px;
    color: #fff;
}

.chr-fk-topkills {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chr-fk-topkill {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
}

.chr-fk-topkill:first-child {
    background: rgba(157, 78, 221, 0.1);
    border-color: rgba(157, 78, 221, 0.25);
}

.chr-fk-rank {
    font-weight: 700;
    color: var(--chr-accent);
    font-size: 12px;
}

.chr-fk-topkill-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
}

.chr-fk-topkill .chr-fk-guild-name {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.chr-fk-topkill .chr-fk-server {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.chr-fk-topkill .chr-fk-region {
    font-size: 11px;
}

.chr-fk-topkill .chr-fk-time {
    color: var(--chr-accent);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.chr-fk-boss-kill {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
}

.chr-fk-server {
    color: rgba(255, 255, 255, 0.45);
}

.chr-fk-boss-pending {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    text-align: right;
    white-space: nowrap;
}

.chr-fk-footnote {
    margin: 16px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
}

@media (max-width: 720px) {
    .chr-fk-raid-head {
        flex-wrap: wrap;
    }

    .chr-fk-topkill {
        grid-template-columns: 32px 1fr;
        gap: 6px 10px;
    }

    .chr-fk-topkill .chr-fk-time {
        grid-column: 2;
    }
}

.chr-playguide,
.chr-mini-timeline,
.chr-firstkills {
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--chr-border);
    background: rgba(255, 255, 255, 0.02);
}

.chr-link-sm {
    font-size: 12px;
    font-weight: normal;
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.5);
}

.chr-mini-timeline ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.chr-mini-timeline li {
    margin-bottom: 12px;
    padding-left: 16px;
    border-left: 2px solid var(--chr-border);
    font-size: 14px;
    line-height: 1.5;
}

.chr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.chr-table th,
.chr-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--chr-border);
    text-align: left;
}

.chr-table th {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chr-cg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.chr-cg-card {
    border: 1px solid var(--chr-border) !important;
    padding: 0 !important;
    background: var(--chr-glass) !important;
    cursor: pointer;
    text-align: left;
    color: inherit !important;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

.chr-cg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.chr-cg-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.chr-cg-card span {
    display: block;
    padding: 12px 14px;
    font-size: 13px;
}

.chr-ency-empty {
    padding: 32px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.chr-feature-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.chr-feature-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
}

.chr-feature-hero {
    position: relative;
    aspect-ratio: 21 / 9;
    max-height: 280px;
    overflow: hidden;
}

.chr-feature-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chr-feature-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px 24px;
    background: linear-gradient(to top, rgba(8, 6, 14, 0.92) 0%, rgba(8, 6, 14, 0.2) 70%, transparent 100%);
}

.chr-feature-hero-overlay h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: #fff;
}

.chr-feature-hero--no-img {
    aspect-ratio: auto;
    max-height: none;
}

.chr-feature-hero--no-img .chr-feature-hero-overlay {
    position: relative;
    background: color-mix(in srgb, var(--chr-accent) 10%, rgba(8, 6, 14, 0.88));
    padding: 18px 24px;
}

.chr-feature-badge {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
}

.chr-feature-badge--new {
    background: color-mix(in srgb, var(--chr-accent) 35%, transparent);
    color: var(--chr-accent);
    border: 1px solid color-mix(in srgb, var(--chr-accent) 50%, transparent);
}

.chr-feature-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.chr-feature-body {
    padding: 22px 24px 26px;
}

.chr-feature-lead {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.82);
}

.chr-feature-prose {
    margin-bottom: 16px;
}

.chr-feature-prose p {
    margin: 0 0 12px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.72);
}

.chr-feature-unlock {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
}

.chr-feature-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.chr-feature-tags-label {
    font-size: 12px;
    color: var(--chr-accent);
    margin-right: 4px;
}

.chr-feature-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

.chr-feature-racials,
.chr-feature-specs {
    margin: 0 0 16px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.68);
}

.chr-feature-racials li,
.chr-feature-specs li {
    margin-bottom: 6px;
}

.chr-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.chr-ency-loading {
    grid-column: 1 / -1;
    margin: 24px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
}

.chr-ency-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--chr-border);
}

.chr-ency-pagination-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

.chr-ency-pagination-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chr-ency-page-btn {
    min-width: 36px;
    padding: 7px 12px !important;
    border: 1px solid var(--chr-border) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chr-ency-page-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--chr-accent) 14%, transparent) !important;
    border-color: color-mix(in srgb, var(--chr-accent) 40%, transparent) !important;
    color: #fff !important;
}

.chr-ency-page-btn.is-active {
    background: color-mix(in srgb, var(--chr-accent) 22%, transparent) !important;
    border-color: color-mix(in srgb, var(--chr-accent) 55%, transparent) !important;
    color: #fff !important;
    cursor: default;
}

.chr-ency-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .chr-ency-sub {
        margin-left: 0;
    }
    .chr-ency-tabs-wrap {
        overflow: hidden;
    }
    .chr-ency-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .chr-card-grid-sm {
        grid-template-columns: 1fr;
    }
}
