/* ========================================
   徐发富个人网站 - 折页风格
   中间重点显示，左右折叠效果
   ======================================== */

:root {
    /* 主色调 - 科技蓝紫 */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    
    /* 背景 */
    --bg-dark: #0a0f1a;
    --bg-card: #151b2b;
    --bg-light: #1e2538;
    
    /* 文字 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-dark: linear-gradient(180deg, #0a0f1a 0%, #151b2b 100%);
    
    /* 阴影 */
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 自定义文本选中样式 */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

::-moz-selection {
    background: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

/* ========================================
   折页容器
   ======================================== */
.book-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
    background: radial-gradient(ellipse at center, #1a1f35 0%, #0a0f1a 100%);
}

/* ========================================
   面板基础样式
   ======================================== */
.panel {
    position: absolute;
    top: 50%;
    height: 90vh;
    width: 45vw;
    max-width: 700px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.panel::-webkit-scrollbar {
    width: 4px;
}

.panel::-webkit-scrollbar-track {
    background: transparent;
}

.panel::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 2px;
}

.panel-content {
    padding: 2rem;
    min-height: 100%;
}

/* 当前激活的面板 - 居中重点显示 */
.panel.active {
    transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    left: 50% !important;
    top: 50%;
    opacity: 1;
    z-index: 100;
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

/* 左侧面板 - 封面 */
.panel-left {
    background: var(--gradient-dark);
    transform: translate(-120%, -50%) scale(0.85) rotateY(25deg);
    left: 50%;
    top: 50%;
    opacity: 0.6;
    z-index: 50;
}

/* 非激活状态的左侧面板禁用交互 */
.panel-left:not(.active) {
    pointer-events: none;
}

.panel-left.active {
    transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    opacity: 1;
}

.panel-left::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--primary), transparent);
    opacity: 0.3;
}

/* 右侧面板 */
.panel-right {
    background: var(--bg-card);
    transform: translate(20%, -50%) scale(0.85) rotateY(-25deg);
    left: 50%;
    top: 50%;
    opacity: 0.6;
    z-index: 40;
}

/* 非激活状态的右侧面板禁用交互 */
.panel-right:not(.active) {
    pointer-events: none;
}

/* 左侧相邻页面 - 只显示上一张 */
.panel.prev {
    transform: translate(-90%, -50%) scale(0.82) rotateY(30deg);
    opacity: 0.7;
    z-index: 50;
    filter: brightness(0.85);
    pointer-events: none;
}

/* 左侧非相邻页面 - 完全隐藏 */
.panel.prev-prev,
.panel.prev ~ .panel.prev {
    transform: translate(-150%, -50%) scale(0.6) rotateY(45deg);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

/* 右侧相邻页面 - 只显示下一张 */
.panel.next {
    transform: translate(-10%, -50%) scale(0.82) rotateY(-30deg);
    opacity: 0.7;
    z-index: 50;
    filter: brightness(0.85);
    pointer-events: none;
}

/* 右侧非相邻页面 - 完全隐藏 */
.panel.next-next,
.panel.next ~ .panel.next {
    transform: translate(50%, -50%) scale(0.6) rotateY(-45deg);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

/* ========================================
   封面页
   ======================================== */
.cover-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    padding: 1rem 0;
}

.cover-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    align-self: flex-start;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.cover-name {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.cover-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cover-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.cover-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cover-stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-text {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-brief {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

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

.contact-brief .contact-item svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.cover-nav-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    animation: pulse 2s infinite;
}

.arrow-icon {
    width: 18px;
    height: 18px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
}

/* ========================================
   页面头部
   ======================================== */
.page-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.page-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   专业技能页面
   ======================================== */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.skill-category-card {
    background: rgba(30, 37, 56, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 0.875rem;
    transition: all 0.3s ease;
}

.skill-category-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.skill-icon {
    font-size: 1.25rem;
}

.skill-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.skill-content {
    padding-left: 1.75rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.skill-tag {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 1rem;
}

.skill-tag.expert {
    background: rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
}

.skill-tag.proficient {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-light);
}

.skill-tag.familiar {
    background: rgba(100, 116, 139, 0.3);
    color: var(--text-secondary);
}

.skill-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.other-skills {
    background: rgba(30, 37, 56, 0.4);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.other-skills h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.other-skills p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========================================
   工作经历页面
   ======================================== */
.experience-card {
    background: rgba(30, 37, 56, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.experience-card.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(30, 37, 56, 0.8) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.exp-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.exp-company {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.exp-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.15);
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
}

.exp-highlights {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    min-width: 80px;
}

.highlight-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
}

.highlight-text {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
}

.exp-content {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.exp-content.compact ul {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.exp-section h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.375rem;
}

.exp-section ul,
.exp-content ul {
    list-style: none;
    padding-left: 0;
}

.exp-section li,
.exp-content li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 1rem;
    position: relative;
    margin-bottom: 0.25rem;
}

.exp-section li::before,
.exp-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* ========================================
   工作经历扩展样式
   ======================================== */
.exp-related-skills {
    background: rgba(30, 37, 56, 0.4);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-top: 1rem;
}

.exp-related-skills h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
}

.exp-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exp-skill-tag {
    padding: 0.375rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* 项目成果展示 */
.project-showcase {
    background: rgba(30, 37, 56, 0.4);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-top: 1rem;
}

.project-showcase h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
}

.project-item {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    padding: 0.875rem;
    border-left: 3px solid var(--primary);
}

.project-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.375rem;
}

.project-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 技术栈展示 */
.tech-stack-showcase {
    background: rgba(30, 37, 56, 0.4);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-top: 1rem;
}

.tech-stack-showcase h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tech-categories {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tech-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tech-cat-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 60px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1;
}

.tech-item {
    padding: 0.25rem 0.5rem;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-light);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
}

/* ========================================
   荣誉与联系页面
   ======================================== */
.awards-section {
    margin-bottom: 1.25rem;
}

.awards-section h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.awards-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.award-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(30, 37, 56, 0.6);
    padding: 0.875rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.award-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.award-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.award-year {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.award-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.award-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 0;
    margin-top: 0.25rem;
}

.self-evaluation {
    margin-bottom: 1.25rem;
}

.self-evaluation h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.evaluation-content {
    background: rgba(30, 37, 56, 0.6);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 0.75rem;
}

.evaluation-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.evaluation-content p:last-child {
    margin-bottom: 0;
}

.traits-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trait-tag {
    padding: 0.375rem 0.75rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 1rem;
}

.contact-section-full {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.contact-section-full h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.contact-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.contact-info-large {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.contact-item-large {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.contact-item-large svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.contact-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.contact-cta svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1200px) {
    .panel {
        width: 50vw;
    }
}

@media (max-width: 768px) {
    .panel {
        width: 85vw;
        height: 85vh;
    }
    
    .panel-left {
        transform: translate(-110%, -50%) scale(0.8) rotateY(20deg);
    }
    
    .panel.prev {
        transform: translate(-120%, -50%) scale(0.7) rotateY(30deg);
    }
    
    .panel-right {
        transform: translate(10%, -50%) scale(0.8) rotateY(-20deg);
    }
    
    .panel.next {
        transform: translate(20%, -50%) scale(0.7) rotateY(-30deg);
    }
    
    .cover-name {
        font-size: 2.25rem;
    }
    
    .panel-content {
        padding: 1.5rem;
    }
    
    .exp-highlights {
        gap: 0.5rem;
    }
    
    .highlight-item {
        min-width: 60px;
        padding: 0.375rem 0.5rem;
    }
    
    .contact-info-large {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .cover-name {
        font-size: 1.875rem;
    }
    
    .cover-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .page-title {
        font-size: 1.125rem;
    }
    
    .skill-category-card {
        padding: 0.75rem;
    }
    
    .exp-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========================================
   动画
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel.active .skill-category-card,
.panel.active .experience-card,
.panel.active .award-item,
.panel.active .evaluation-content,
.panel.active .exp-related-skills,
.panel.active .project-showcase,
.panel.active .tech-stack-showcase {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.panel.active .skill-category-card:nth-child(1) { animation-delay: 0.1s; }
.panel.active .skill-category-card:nth-child(2) { animation-delay: 0.15s; }
.panel.active .skill-category-card:nth-child(3) { animation-delay: 0.2s; }
.panel.active .skill-category-card:nth-child(4) { animation-delay: 0.25s; }
.panel.active .skill-category-card:nth-child(5) { animation-delay: 0.3s; }
.panel.active .skill-category-card:nth-child(6) { animation-delay: 0.35s; }

.panel.active .exp-related-skills { animation-delay: 0.4s; }
.panel.active .project-showcase { animation-delay: 0.45s; }
.panel.active .tech-stack-showcase { animation-delay: 0.5s; }

/* ========================================
   逐行阅读效果
   ======================================== */
.reading-line {
    position: relative;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    transition: all 0.3s ease;
    animation: readingPulse 1.5s ease-in-out;
}

.reading-line::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: lineIndicator 1.5s ease-in-out;
}

@keyframes readingPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    25% {
        transform: scale(1.02);
        text-shadow: 0 0 25px rgba(99, 102, 241, 0.6), 0 0 40px rgba(99, 102, 241, 0.3);
    }
    50% {
        transform: scale(1.02);
        text-shadow: 0 0 30px rgba(99, 102, 241, 0.8), 0 0 50px rgba(99, 102, 241, 0.4);
    }
    75% {
        transform: scale(1.02);
        text-shadow: 0 0 25px rgba(99, 102, 241, 0.6), 0 0 40px rgba(99, 102, 241, 0.3);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
}

@keyframes lineIndicator {
    0%, 100% {
        opacity: 0.5;
        box-shadow: 0 0 10px var(--primary);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary-light);
    }
}
