﻿/* ============================================================
   影界故事 FREEINU · 人物档案样式
   Swiss International · 黑白红 · 直角 · 网格 · 左对齐
   ============================================================ */

.chars-page { padding-top: var(--nav-h); }

.chars-head { padding: 48px 0 30px; background: var(--white); border-bottom: 1px solid var(--black); }

.chars-head .container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.chars-title {
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--black);
    line-height: 1.1;
}
.chars-title .en {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 10px;
}
.chars-sub { color: var(--gray-text); font-size: 14px; margin-top: 12px; }

/* 关系网络图 */
.relation-map { padding: 70px 0 30px; background: var(--white); }

.rm-canvas-wrap {
    position: relative;
    background: var(--white);
    border: 1px solid var(--black);
    overflow: hidden;
    min-height: 420px;
}

#relationCanvas { display: block; width: 100%; height: 500px; }

.rm-hint {
    position: absolute;
    bottom: 12px; left: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-text);
}

/* 人物卡片网格 */
.chars-grid-section { padding: 60px 0 110px; background: var(--white); }

.char-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.char-card {
    position: relative;
    border: 1px solid var(--black);
    background: var(--white);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.char-card:hover { border-color: var(--red); background: var(--gray-hover); }

/* 立绘容器：固定高度 + object-fit contain，底部对齐 */
.char-card .cc-img {
    height: 300px;
    background: var(--white);
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--black);
}

.char-card .cc-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
}

.char-card .cc-img.noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 500;
    color: var(--gray-line);
}

.char-card .cc-tier {
    position: absolute;
    top: 10px; right: 10px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    background: var(--black);
    color: var(--white);
}

.char-card .cc-body { padding: 20px 22px 24px; }

.char-card .cc-faction {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 8px;
}

.char-card .cc-name { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--black); margin-bottom: 2px; }
.char-card .cc-en { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-text); margin-bottom: 12px; }

.char-card .cc-summary {
    font-size: 13.5px;
    color: var(--black);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.char-card .cc-traits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.char-card .cc-trait { font-size: 11px; padding: 3px 9px; border: 1px solid var(--black); color: var(--black); }

/* 人物详情弹层 */
.char-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.6);
}

.char-modal.open { display: flex; }

.char-modal .cm-panel {
    width: min(880px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--black);
    animation: fadeInUp 0.15s var(--ease);
}

.cm-close {
    position: sticky;
    top: 14px;
    float: right;
    margin-right: 14px;
    z-index: 5;
    width: 38px; height: 38px;
    background: var(--black);
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}
.cm-close:hover { background: var(--red); }

.cm-head {
    display: flex;
    gap: 28px;
    padding: 26px 30px 22px;
    background: var(--white);
    border-bottom: 1px solid var(--black);
}

.cm-head .cm-img {
    width: 140px;
    height: 180px;
    flex-shrink: 0;
    background: var(--white);
    overflow: hidden;
    border: 1px solid var(--black);
}
.cm-head .cm-img img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
.cm-head .cm-img.noimg { display: flex; align-items: center; justify-content: center; font-size: 52px; font-weight: 500; color: var(--gray-line); }

.cm-head .cm-info { flex: 1; min-width: 0; }

.cm-faction { font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.cm-name { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; color: var(--black); }
.cm-en { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-text); margin: 4px 0 12px; }
.cm-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--black); }
.cm-meta .m-item strong { color: var(--gray-text); font-weight: 500; margin-right: 4px; }
.cm-quote { margin-top: 14px; font-size: 14px; font-weight: 500; color: var(--red); }

.cm-body { padding: 22px 30px 32px; }
.cm-body h4 { font-size: 16px; font-weight: 500; margin: 22px 0 10px; color: var(--black); }
.cm-body h4:first-child { margin-top: 0; }
.cm-body p { font-size: 14.5px; line-height: 1.8; color: var(--black); margin-bottom: 12px; }
.cm-body ul { padding-left: 20px; margin-bottom: 12px; }
.cm-body li { font-size: 14.5px; line-height: 1.8; color: var(--black); margin-bottom: 6px; }

/* 关系标签 */
.cm-relations { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.cm-rel { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--black); }
.cm-rel .rel-target { font-weight: 500; color: var(--black); cursor: pointer; white-space: nowrap; }
.cm-rel .rel-target:hover { color: var(--red); }
.cm-rel .rel-arrow { color: var(--gray-text); }
.cm-rel .rel-note { font-size: 13.5px; color: var(--black); }

/* 响应式 */
@media (max-width: 860px) {
    .char-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .char-card .cc-img { height: 240px; }
    .cm-head { flex-direction: column; }
    .cm-head .cm-img { width: 110px; height: 150px; }
    #relationCanvas { height: 400px; }
}

@media (max-width: 560px) {
    .char-grid { grid-template-columns: 1fr; }
}
