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

.chr-hero {
    position: relative;
    padding: 48px 40px;
    margin-bottom: 40px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    backdrop-filter: blur(20px);
    animation: chr-fade-up 0.55s ease both;
}

.chr-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--chr-accent) 18%, transparent) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--chr-accent) 25%, transparent) 0%, transparent 55%);
    pointer-events: none;
}

.chr-hero-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    right: -100px;
    top: -150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--chr-accent) 0%, transparent 65%);
    opacity: 0.15;
    animation: chr-pulse-glow 5s ease-in-out infinite;
}

.chr-hero-inner {
    position: relative;
}

.chr-hero-sub {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--chr-accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.chr-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 16px;
}

.chr-hero-meta span {
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--chr-border);
}

.chr-story-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px 36px;
    align-items: start;
}

.chr-story-layout.chr-story-layout--with-nav {
    grid-template-columns: 220px minmax(0, 1fr) 280px;
}

.chr-story-main {
    min-width: 0;
}

.chr-story-body {
    max-width: none;
}

.chr-story-aside {
    position: sticky;
    top: calc(var(--chr-site-header, 50px) + 22px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    animation: chr-fade-up 0.65s ease 0.15s both;
}

.chr-aside-card {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    backdrop-filter: blur(16px);
}

.chr-aside-card h3 {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--chr-accent);
}

.chr-aside-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

.chr-aside-meta span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chr-aside-meta strong {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.chr-aside-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chr-aside-links a {
    display: block;
    padding: 7px 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.chr-aside-links a:hover {
    background: color-mix(in srgb, var(--chr-accent) 10%, transparent);
    border-color: var(--chr-border);
    color: #fff;
}

.chr-aside-timeline li {
    margin-bottom: 10px;
    padding-left: 12px;
    border-left: 2px solid var(--chr-border);
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.6);
}

.chr-aside-timeline li strong {
    display: block;
    color: var(--chr-accent);
    font-size: 11px;
    margin-bottom: 2px;
}

.chr-aside-jump {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    background: color-mix(in srgb, var(--chr-accent) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--chr-accent) 35%, transparent);
    transition: background 0.2s;
}

.chr-aside-jump:hover {
    background: color-mix(in srgb, var(--chr-accent) 28%, transparent);
    color: #fff;
}

.chr-prose .chr-subheading {
    font-size: 1.1rem;
    margin: 1.75em 0 0.75em;
    color: #fff;
}

.chr-table-wrap {
    margin: 16px 0 20px;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--chr-border);
    background: color-mix(in srgb, var(--chr-accent) 4%, rgba(12, 8, 18, 0.6));
}

.chr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    line-height: 1.5;
}

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

.chr-table th {
    font-weight: 600;
    color: var(--chr-accent);
    background: color-mix(in srgb, var(--chr-accent) 10%, transparent);
    white-space: nowrap;
}

.chr-table tbody tr:last-child td {
    border-bottom: none;
}

.chr-table tbody tr:hover td {
    background: color-mix(in srgb, var(--chr-accent) 6%, transparent);
}

.chr-chapter-nav {
    position: sticky;
    top: calc(var(--chr-site-header, 50px) + 22px);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--chr-border);
    background: var(--chr-glass);
    backdrop-filter: blur(16px);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    animation: chr-fade-up 0.6s ease 0.1s both;
}

.chr-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--chr-accent);
    margin: 0 0 14px;
    font-weight: 700;
}

.chr-chapter-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chr-chapter-nav li {
    margin-bottom: 2px;
}

.chr-chapter-nav a {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    border-radius: 8px;
    border-left: 2px solid transparent;
    line-height: 1.4;
    transition: all 0.2s;
}

.chr-chapter-nav a:hover,
.chr-chapter-nav a.is-active {
    background: color-mix(in srgb, var(--chr-accent) 12%, transparent);
    color: #fff;
    border-left-color: var(--chr-accent);
}

.chr-nav-jump {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--chr-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

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

.chr-nav-jump a:hover {
    text-decoration: underline;
}

.chr-prose {
    font-size: 16px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.82);
}

.chr-prose p {
    margin: 0 0 1.25em;
}

.chr-section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--chr-accent);
    margin: 0 0 14px;
    font-weight: 700;
}

.chr-bridge {
    margin-bottom: 36px;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--chr-border);
    background: rgba(255, 255, 255, 0.02);
}

.chr-recap {
    margin-bottom: 36px;
    padding: 20px 24px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 30%, transparent);
    background: color-mix(in srgb, var(--chr-accent) 8%, transparent);
}

.chr-recap summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--chr-accent);
    font-size: 15px;
    list-style: none;
}

.chr-recap summary::-webkit-details-marker {
    display: none;
}

.chr-chapter {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--chr-border);
    scroll-margin-top: calc(var(--chr-site-header, 50px) + 38px);
}

.chr-chapter:last-of-type {
    border-bottom: none;
}

.chr-chapter-num {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--chr-accent);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.chr-chapter-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin: 0 0 22px;
    color: #fff;
    line-height: 1.35;
}

.chr-key-points {
    margin-top: 28px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--chr-border);
    background: rgba(0, 0, 0, 0.2);
}

.chr-kp-label {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--chr-accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chr-key-points ul {
    margin: 0;
    padding-left: 18px;
}

.chr-key-points li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.7);
}

.chr-empty-story {
    padding: 48px 32px;
    text-align: center;
    border-radius: 16px;
    border: 1px dashed var(--chr-border);
    margin-bottom: 36px;
}

.chr-entity {
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    transition: color 0.2s, border-color 0.2s;
}

.chr-entity:hover {
    border-bottom-style: solid;
}

.chr-entity-npc { color: #8ec5ff; }
.chr-entity-instance { color: #ffb86c; }
.chr-entity-quest { color: #a8e6a3; }
.chr-entity-item { color: #ffd866; }
.chr-entity-map { color: #7fdbda; }

.chr-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: chr-fade-up 0.3s ease;
}

.chr-modal.is-open {
    display: flex;
}

.chr-modal-inner {
    position: relative;
    width: min(920px, 94vw);
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--chr-border);
}

.chr-modal-inner iframe,
.chr-modal-inner .chr-video-native {
    width: 100%;
    height: 100%;
    border: 0;
}

.chr-modal-inner .chr-video-native {
    display: none;
    object-fit: contain;
    background: #000;
}

.chr-modal-inner iframe {
    display: block;
}

.chr-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.chr-timeline-page .chr-timeline-list {
    list-style: none;
    padding: 0;
    margin: 32px 0;
    border-left: 2px solid var(--chr-accent);
}

.chr-timeline-item {
    padding: 20px 0 20px 28px;
    position: relative;
    animation: chr-fade-up 0.5s ease both;
}

.chr-timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 26px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--chr-accent);
    box-shadow: 0 0 12px var(--chr-accent);
}

.chr-tl-time {
    font-size: 12px;
    color: var(--chr-accent);
    font-weight: 600;
}

/* §4.8 版本橙装主体区 */
.chr-legendaries {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chr-legendaries-overview {
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.82);
}

.chr-legendary-spotlight {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chr-legendary-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    border-left: 4px solid #ff8000;
}

.chr-legendary-card-inner {
    padding: 16px 18px 18px;
}

.chr-legendary-card.chr-quality-artifact {
    border-left-color: #e6cc80;
}

.chr-legendary-card.chr-quality-epic {
    border-left-color: #a335ee;
}

.chr-legendary-card-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 0;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.chr-legendary-card-head:hover {
    opacity: 0.92;
}

.chr-legendary-card-head img {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.chr-legendary-card-meta {
    flex: 1;
    min-width: 0;
}

.chr-legendary-name {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
    color: #ff8000;
}

.chr-quality-artifact .chr-legendary-name {
    color: #e6cc80;
}

.chr-quality-epic .chr-legendary-name {
    color: #a335ee;
}

.chr-legendary-role {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
}

.chr-legendary-acquire {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.48);
}

.chr-legendary-body {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 14px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
}

.chr-legendary-body p {
    margin: 0 0 0.9em;
}

.chr-legendary-body p:last-child {
    margin-bottom: 0;
}

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

.chr-aside-legendary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
    line-height: 1.35;
    transition: background 0.2s ease;
}

.chr-aside-legendary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chr-aside-legendary img {
    flex-shrink: 0;
    border-radius: 6px;
}

.chr-aside-legendary.chr-quality-legendary span {
    color: #ff8000;
}

.chr-aside-legendary.chr-quality-artifact span {
    color: #e6cc80;
}

.chr-aside-legendary.chr-quality-epic span {
    color: #a335ee;
}

@media (max-width: 960px) {
    .chr-story-layout,
    .chr-story-layout.chr-story-layout--with-nav {
        grid-template-columns: 1fr;
    }
    .chr-story-aside {
        display: none;
    }
    .chr-chapter-nav {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        width: 52px;
        height: 52px;
        padding: 0;
        overflow: hidden;
        border-radius: 50%;
        z-index: 100;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }
    .chr-chapter-nav.is-open {
        width: auto;
        height: auto;
        max-height: 55vh;
        border-radius: 14px;
        padding: 18px;
        bottom: 80px;
        right: 16px;
        left: 16px;
    }
    .chr-chapter-nav .chr-nav-title,
    .chr-chapter-nav ul,
    .chr-chapter-nav .chr-nav-jump {
        display: none;
    }
    .chr-chapter-nav.is-open .chr-nav-title,
    .chr-chapter-nav.is-open ul,
    .chr-chapter-nav.is-open .chr-nav-jump {
        display: block;
    }
    .chr-chapter-nav::after {
        content: '☰';
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        font-size: 20px;
        color: #fff;
    }
    .chr-chapter-nav.is-open::after {
        display: none;
    }
    .chr-hero {
        padding: 32px 24px;
    }
    .chr-legendary-card-inner {
        padding: 14px 14px 16px;
    }
}
