/* ========================================
   人物图鉴页面样式
   ======================================== */

/* 页面头部 */
.page-header {
    padding: 120px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, 
        rgba(26, 77, 109, 0.3) 0%, 
        transparent 100%);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.page-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* 筛选标签 */
.filter-section {
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 60px;
    z-index: 100;
    background: rgba(10, 25, 41, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg-dark);
}

/* 主要内容区 */
.characters-main {
    padding: var(--spacing-lg) 0;
}

/* 区域标题 */
.section-subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.subtitle-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    color: var(--color-accent);
}

.section-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
}

/* 人物展示区 */
.character-showcase {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* 人物档案卡片 */
.character-profile {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-normal);
}

.character-profile:hover {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 角色颜色主题 */
.character-profile[data-role="dragon"] {
    border-left: 4px solid var(--color-dragon);
}

.character-profile[data-role="hero"] {
    border-left: 4px solid var(--color-hero);
}

.character-profile[data-role="wizard"] {
    border-left: 4px solid var(--color-wizard);
}

.character-profile[data-role="princess"] {
    border-left: 4px solid var(--color-princess);
}

/* 档案头部 */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
}

.profile-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--color-accent);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.avatar-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2.5rem;
}

.character-profile[data-role="dragon"] .avatar-icon {
    background: linear-gradient(135deg, var(--color-dragon) 0%, #5a2040 100%);
    color: #ffd4e5;
}

.character-profile[data-role="hero"] .avatar-icon {
    background: linear-gradient(135deg, var(--color-hero) 0%, #2a4a5a 100%);
    color: #d4e5ff;
}

.character-profile[data-role="wizard"] .avatar-icon {
    background: linear-gradient(135deg, var(--color-wizard) 0%, #3a2a5a 100%);
    color: #e5d4ff;
}

.character-profile[data-role="princess"] .avatar-icon {
    background: linear-gradient(135deg, var(--color-princess) 0%, #5a4a4a 100%);
    color: #fff5f5;
}

.profile-title {
    flex-grow: 1;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.character-name {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.character-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* 档案内容 */
.profile-content {
    padding: var(--spacing-md);
}

.profile-section {
    margin-bottom: var(--spacing-md);
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-section h4 i {
    width: 24px;
}

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    font-size: 1rem;
    color: var(--text-primary);
}

.status-deceased {
    color: #ff6b6b;
}

.status-transformed {
    color: var(--color-light);
}

/* 特质标签 */
.trait-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trait {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.trait:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--color-accent);
}

/* 故事文本 */
.story-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: justify;
}

.story-text:last-child {
    margin-bottom: 0;
}

/* 命运框 */
.fate-box {
    background: rgba(139, 58, 98, 0.15);
    border: 1px solid rgba(139, 58, 98, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.fate-box p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

/* 引用框 */
.profile-quote {
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.1) 0%, 
        rgba(212, 175, 55, 0.05) 100%);
    border-left: 3px solid var(--color-accent);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-md);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.profile-quote i {
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    display: block;
}

.profile-quote p {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

/* ========================================
   辅助角色卡片
   ======================================== */
.support-characters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    align-items: stretch;
}

.support-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: var(--transition-normal);
}

.support-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-5px);
}

.support-icon {
    display: none;
}

.support-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.support-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.support-title {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.support-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

.support-fate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.fate-label {
    background: rgba(139, 58, 98, 0.3);
    color: #ff9ebc;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ========================================
   人物关系图
   ======================================== */
.relationship-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.relationship-chart {
    margin-top: var(--spacing-lg);
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    margin: 0 auto;
}

.relation-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.relation-lines line {
    stroke-width: 2;
    fill: none;
}

.line-family {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-dasharray: 5, 5;
}

.line-friend {
    stroke: #4ade80;
    stroke-width: 3;
}

.line-sibling {
    stroke: var(--color-light);
    stroke-width: 3;
}

.line-conflict {
    stroke: #ff6b6b;
    stroke-width: 3;
    stroke-dasharray: 10, 5;
}

.relation-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(10, 25, 41, 0.9);
    border: 2px solid var(--color-accent);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    transition: var(--transition-normal);
    cursor: pointer;
    z-index: 10;
}

.relation-node:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.relation-node i {
    font-size: 1.2rem;
    color: var(--color-accent);
}

.center-node {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-accent);
    color: var(--color-bg-dark);
    font-weight: bold;
}

.center-node:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.node-rene {
    top: 10%;
    left: 15%;
    border-color: var(--color-dragon);
}

.node-rene i {
    color: var(--color-dragon);
}

.node-alain {
    top: 10%;
    right: 15%;
    border-color: var(--color-hero);
}

.node-alain i {
    color: var(--color-hero);
}

.node-jakob {
    bottom: 10%;
    left: 15%;
    border-color: var(--color-wizard);
}

.node-jakob i {
    color: var(--color-wizard);
}

.node-mary {
    bottom: 10%;
    right: 15%;
    border-color: var(--color-princess);
}

.node-mary i {
    color: var(--color-princess);
}

/* 图例 */
.relation-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: var(--spacing-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legend-line {
    width: 30px;
    height: 3px;
    border-radius: 2px;
}

.legend-line.family {
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.3) 0px,
        rgba(255, 255, 255, 0.3) 5px,
        transparent 5px,
        transparent 10px
    );
}

.legend-line.friend {
    background: #4ade80;
}

.legend-line.sibling {
    background: var(--color-light);
}

.legend-line.conflict {
    background: repeating-linear-gradient(
        90deg,
        #ff6b6b 0px,
        #ff6b6b 10px,
        transparent 10px,
        transparent 15px
    );
}

/* ========================================
   人物关系图 - 纯CSS实现连线
   ======================================== */
.relation-graph {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 420px;
    margin: 2rem auto;
    background: 
        radial-gradient(ellipse at center, rgba(125, 211, 252, 0.04) 0%, transparent 60%),
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.02) 0%, transparent 40%);
    border-radius: 20px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    box-shadow: 0 0 40px rgba(125, 211, 252, 0.06);
}

/* CSS连线层 */
.relation-lines-css {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* 基础连线样式 */
.css-line {
    position: absolute;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

/* 左侧竖线：雷内-雅各布（挚友）绿色 */
.line-left {
    left: 15%;
    top: 18%;
    width: 3px;
    height: 64%;
    background: linear-gradient(180deg, #22c55e, #16a34a);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    border-radius: 2px;
}

/* 右侧竖线：阿兰-玛丽安（兄妹）紫色 */
.line-right {
    right: 15%;
    top: 18%;
    width: 3px;
    height: 64%;
    background: linear-gradient(180deg, #a855f7, #7c3aed);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
    border-radius: 2px;
}

/* 顶部横线：雷内-阿兰（决裂）红色虚线 */
.line-top {
    top: 18%;
    left: 15%;
    width: 70%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #ef4444 0px,
        #ef4444 12px,
        transparent 12px,
        transparent 20px
    );
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    border-radius: 2px;
}

/* 中心到四角的虚线 */
.line-center-tl,
.line-center-tr,
.line-center-bl,
.line-center-br {
    position: absolute;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        rgba(125, 211, 252, 0.4) 0px,
        rgba(125, 211, 252, 0.4) 6px,
        transparent 6px,
        transparent 12px
    );
    transform-origin: left center;
}

/* 中心(50%, 50%)到雷内(15%, 18%) */
.line-center-tl {
    left: 50%;
    top: 50%;
    width: 180px;
    transform: rotate(-155deg);
}

/* 中心(50%, 50%)到阿兰(85%, 18%) */
.line-center-tr {
    left: 50%;
    top: 50%;
    width: 180px;
    transform: rotate(-25deg);
}

/* 中心(50%, 50%)到雅各布(15%, 82%) */
.line-center-bl {
    left: 50%;
    top: 50%;
    width: 180px;
    transform: rotate(155deg);
}

/* 中心(50%, 50%)到玛丽安(85%, 82%) */
.line-center-br {
    left: 50%;
    top: 50%;
    width: 180px;
    transform: rotate(25deg);
}

/* 节点基础样式 */
.rel-node {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.1rem;
    background: linear-gradient(145deg, rgba(18, 38, 58, 0.95), rgba(10, 25, 41, 0.98));
    border-radius: 14px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rel-node:hover {
    transform: scale(1.08);
    z-index: 20;
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(212, 175, 55, 0.25);
}

.rel-node i {
    font-size: 1.3rem;
    color: var(--color-accent);
}

.rel-node span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rel-node small {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.75;
}

/* 中心节点 */
.rel-node.node-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.9), rgba(180, 145, 35, 0.95));
    border-color: rgba(255, 215, 100, 0.6);
    box-shadow: 0 4px 25px rgba(212, 175, 55, 0.35);
}

.rel-node.node-center i,
.rel-node.node-center span {
    color: var(--color-bg-dark);
}

.rel-node.node-center:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.node-glow-ring {
    position: absolute;
    inset: -12px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.15); }
}

/* 四角色节点位置 */
.rel-node.node-rene {
    top: 18%;
    left: 15%;
    transform: translate(-50%, -50%);
    border-color: var(--color-dragon);
}
.rel-node.node-rene i { color: var(--color-dragon); }
.rel-node.node-rene:hover { transform: translate(-50%, -50%) scale(1.08); }

.rel-node.node-alain {
    top: 18%;
    right: 15%;
    transform: translate(50%, -50%);
    border-color: var(--color-hero);
}
.rel-node.node-alain i { color: var(--color-hero); }
.rel-node.node-alain:hover { transform: translate(50%, -50%) scale(1.08); }

.rel-node.node-jakob {
    bottom: 18%;
    left: 15%;
    transform: translate(-50%, 50%);
    border-color: var(--color-wizard);
}
.rel-node.node-jakob i { color: var(--color-wizard); }
.rel-node.node-jakob:hover { transform: translate(-50%, 50%) scale(1.08); }

.rel-node.node-mary {
    bottom: 18%;
    right: 15%;
    transform: translate(50%, 50%);
    border-color: var(--color-princess);
}
.rel-node.node-mary i { color: var(--color-princess); }
.rel-node.node-mary:hover { transform: translate(50%, 50%) scale(1.08); }

/* 关系标签 */
.rel-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(10, 25, 41, 0.9);
    border-radius: 16px;
    z-index: 15;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.rel-label:hover {
    transform: scale(1.1);
}

.rel-label.label-friend {
    left: 4%;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
}
.rel-label.label-friend i { color: #22c55e; }
.rel-label.label-friend:hover { transform: translateY(-50%) scale(1.1); }

.rel-label.label-conflict {
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
}
.rel-label.label-conflict i { color: #ef4444; }
.rel-label.label-conflict:hover { transform: translateX(-50%) scale(1.1); }

.rel-label.label-sibling {
    right: 4%;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #c084fc;
}
.rel-label.label-sibling i { color: #a855f7; }
.rel-label.label-sibling:hover { transform: translateY(-50%) scale(1.1); }

/* 图例 */
.relation-legend-new {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(10, 25, 41, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(125, 211, 252, 0.1);
}

.legend-item-new {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-line-new {
    width: 35px;
    height: 4px;
    border-radius: 2px;
}

.legend-line-new.family {
    background: linear-gradient(90deg, rgba(125, 211, 252, 0.5), rgba(125, 211, 252, 0.2));
}

.legend-line-new.friend {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.legend-line-new.sibling {
    background: linear-gradient(90deg, #a855f7, #7c3aed);
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
}

.legend-line-new.conflict {
    background: repeating-linear-gradient(90deg, #ef4444 0px, #ef4444 6px, transparent 6px, transparent 10px);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

/* 响应式 - 关系图 */
@media (max-width: 768px) {
    .relation-graph {
        height: 360px;
        max-width: 100%;
        margin: 1.5rem auto;
    }
    
    .rel-node {
        padding: 0.6rem 0.9rem;
    }
    
    .rel-node i { font-size: 1.1rem; }
    .rel-node span { font-size: 0.9rem; }
    .rel-node small { font-size: 0.65rem; }
    
    .rel-label {
        font-size: 0.65rem;
        padding: 0.3rem 0.55rem;
    }
    
    .line-center-tl,
    .line-center-tr,
    .line-center-bl,
    .line-center-br {
        width: 140px;
    }
    
    .relation-legend-new {
        gap: 1rem;
        padding: 0.8rem 1rem;
    }
    
    .legend-item-new { font-size: 0.75rem; }
    .legend-line-new { width: 25px; height: 3px; }
}

@media (max-width: 480px) {
    .relation-graph {
        height: 300px;
    }
    
    .rel-node {
        padding: 0.5rem 0.7rem;
        border-radius: 10px;
    }
    
    .rel-node i { font-size: 0.9rem; }
    .rel-node span { font-size: 0.8rem; }
    .rel-node small { display: none; }
    
    .rel-label {
        font-size: 0.6rem;
        padding: 0.25rem 0.45rem;
    }
    
    .rel-label.label-friend { left: 2%; }
    .rel-label.label-sibling { right: 2%; }
    
    .line-left, .line-right { width: 2px; }
    .line-top { height: 2px; }
    
    .line-center-tl,
    .line-center-tr,
    .line-center-bl,
    .line-center-br {
        width: 100px;
    }
}

/* ========================================
   角色分区
   ======================================== */
.character-section {
    margin-bottom: var(--spacing-xl);
}

.character-section:last-child {
    margin-bottom: 0;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .page-header {
        padding: 100px 0 40px;
    }
    
    .filter-section {
        padding: 1rem 0;
    }
    
    .filter-tabs {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .characters-main {
        padding: 2rem 0;
    }
    
    .section-subtitle {
        font-size: 1.4rem;
    }
    
    .subtitle-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin: 0 auto;
        width: 70px;
        height: 70px;
    }
    
    .avatar-icon {
        font-size: 1.5rem;
    }
    
    .character-name {
        font-size: 1.3rem;
    }
    
    .profile-content {
        padding: 1.5rem;
    }
    
    .profile-section h4 {
        font-size: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .story-text {
        font-size: 0.9rem;
    }
    
    .support-characters {
        grid-template-columns: 1fr;
    }
    
    .support-card {
        padding: 1.2rem;
    }
    
    .support-info h3 {
        font-size: 1.1rem;
    }
    
    .support-title {
        font-size: 0.8rem;
    }
    
    .support-desc {
        font-size: 0.85rem;
    }
    
    .chart-container {
        max-width: 100%;
        height: 300px;
    }
    
    .relation-node {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 90px 0 30px;
    }
    
    .page-title {
        font-size: 1.6rem;
    }
    
    .page-desc {
        font-size: 0.85rem;
        padding: 0 15px;
    }
    
    .filter-section {
        padding: 0.8rem 0;
    }
    
    .filter-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        padding: 0 10px;
    }
    
    .filter-btn {
        text-align: center;
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .characters-main {
        padding: 1.5rem 0;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .subtitle-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .section-intro {
        font-size: 0.85rem;
        padding: 0 10px;
    }
    
    /* 角色卡片 */
    .character-section {
        margin-bottom: var(--spacing-md);
    }
    
    .profile-card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .profile-header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .profile-avatar {
        width: 55px;
        height: 55px;
    }
    
    .avatar-icon {
        font-size: 1.2rem;
    }
    
    .character-name {
        font-size: 1.15rem;
    }
    
    .character-subtitle {
        font-size: 0.75rem;
    }
    
    .profile-content {
        padding: 1rem;
    }
    
    .profile-section {
        margin-bottom: 1rem;
    }
    
    .profile-section h4 {
        font-size: 0.9rem;
        gap: 6px;
        margin-bottom: 0.6rem;
    }
    
    .profile-section h4 i {
        width: 18px;
        font-size: 0.8rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .info-item {
        padding: 0.6rem;
    }
    
    .info-item .label {
        font-size: 0.7rem;
    }
    
    .info-item .value {
        font-size: 0.85rem;
    }
    
    .story-text {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    .trait-tags {
        justify-content: center;
        gap: 0.4rem;
    }
    
    .trait-tags span {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .profile-quote {
        padding: 0.8rem;
        margin-top: 1rem;
    }
    
    .profile-quote p {
        font-size: 0.9rem;
    }
    
    /* 辅助角色 */
    .support-characters {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .support-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .support-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .support-info h3 {
        font-size: 1rem;
    }
    
    .support-title {
        font-size: 0.75rem;
    }
    
    .support-desc {
        font-size: 0.8rem;
    }
    
    .support-fate {
        margin-top: 0.6rem;
        padding-top: 0.6rem;
    }
    
    .fate-label {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
    
    /* 人物关系图 */
    .chart-container {
        height: 250px;
        padding: 0.5rem;
    }
    
    .relation-node {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    .page-title {
        font-size: 1.4rem;
    }
    
    .character-name {
        font-size: 1.05rem;
    }
    
    .profile-content {
        padding: 0.8rem;
    }
    
    .info-item .value {
        font-size: 0.8rem;
    }
    
    .support-card {
        padding: 0.8rem;
    }
}
