/* ========================================
   郑旭飞作品集 - 工程蓝图风格
   ======================================== */

/* 自定义字体 - 素心石毛草体 */
@font-face {
    font-family: 'suxinshi maocao';
    src: url('../assets/fonts/SuXinShiMaoCao.woff2') format('woff2'),
         url('../assets/fonts/SuXinShiMaoCao.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* 主色调 - 工程蓝 */
    --primary-blue: #2B5797;
    --primary-dark: #1a3a5c;
    --primary-light: #3d7bc7;
    
    /* 背景色 */
    --bg-dark: #1a2634;
    --bg-blueprint: #2B5797;
    --bg-white: #ffffff;
    --bg-gray: #f5f7fa;
    
    /* 文字色 */
    --text-white: #ffffff;
    --text-dark: #1a2634;
    --text-gray: #6b7280;
    --text-light: rgba(255, 255, 255, 0.7);
    
    /* 线条色 */
    --line-light: rgba(255, 255, 255, 0.08);
    --line-accent: rgba(255, 255, 255, 0.2);
    
    /* 尺寸 */
    --header-height: 70px;
    --max-content-width: 1200px;
    
    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   基础重置
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

/* ========================================
   密码保护层
   ======================================== */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.password-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--line-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-light) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    pointer-events: none;
}

.password-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid var(--line-light);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-header {
    text-align: center;
    margin-bottom: 32px;
}

.lock-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border-radius: 50%;
    color: var(--text-white);
}

.lock-icon svg {
    width: 100%;
    height: 100%;
}

.password-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.password-header p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.password-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.password-input-group input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line-light);
    border-radius: 10px;
    color: var(--text-white);
    outline: none;
    transition: var(--transition-fast);
}

.password-input-group input::placeholder {
    color: var(--text-light);
}

.password-input-group input:focus {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.15);
}

.password-input-group button {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border: none;
    border-radius: 10px;
    color: var(--text-white);
    cursor: pointer;
    transition: var(--transition-fast);
}

.password-input-group button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(43, 87, 151, 0.4);
}

.password-input-group button svg {
    width: 24px;
    height: 24px;
}

.password-error {
    text-align: center;
    color: #ff6b6b;
    font-size: 0.85rem;
    min-height: 20px;
}

/* ========================================
   顶部导航栏
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: var(--transition-normal);
}

.header-inner {
    max-width: var(--max-content-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Barlow', sans-serif;
}

.logo-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 1px;
}

.logo-divider {
    color: var(--primary-blue);
    font-weight: 300;
}

.logo-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-gray);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-buttons {
    display: flex;
    gap: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    background: var(--bg-gray);
    border-color: rgba(0, 0, 0, 0.2);
}

.nav-btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--text-white);
}

.nav-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ========================================
   Hero 开场区域
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-height) + 20px) 24px 120px;
    background: var(--bg-blueprint);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 蓝图网格背景 */
.blueprint-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--line-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-light) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* 蓝图装饰线条 */
.blueprint-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--line-accent) 2px, transparent 2px),
        linear-gradient(90deg, var(--line-accent) 2px, transparent 2px);
    background-size: 200px 200px;
    opacity: 0.3;
}

/* 额外装饰 - 角落标记 */
.hero-bg::before,
.hero-bg::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--line-accent);
    opacity: 0.5;
}

.hero-bg::before {
    top: 60px;
    left: 60px;
    border-right: none;
    border-bottom: none;
}

.hero-bg::after {
    bottom: 60px;
    right: 60px;
    border-left: none;
    border-top: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin-top: -80px;
    animation: fadeIn 1s ease 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero-title {
    margin-bottom: -12px;
}

.hero-title-cn {
    display: block;
    font-family: 'suxinshi maocao';
    font-size: clamp(4rem, 14vw, 9rem);
    font-weight: 400;
    color: var(--text-white);
    letter-spacing: 20px;
    /* text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3); */
}

/* Hero 机械线框图 */
.hero-machine {
    position: absolute;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 110%;
    max-width: 1100px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.hero-machine img {
    width: 100%;
    height: auto;
    filter: brightness(1.1);
}

.hero-name {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 16px;
    letter-spacing: 8px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-white);
    margin-bottom: 28px;
    letter-spacing: 2px;
}

.hero-subtitle span {
    display: inline-block;
    padding: 6px 18px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    margin-top: -12px;
}

.hero-major {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 16px;
    letter-spacing: 2px;
    opacity: 0.9;
}

.hero-school {
    font-size: 1rem;
    color: var(--text-light);
    letter-spacing: 2px;
    opacity: 0.85;
}

/* Hero 底部渐变遮罩 */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 280px;
    background: linear-gradient(to top, rgba(43, 87, 151, 1) 0%, rgba(43, 87, 151, 0.85) 30%, rgba(43, 87, 151, 0.4) 60%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-white);
    animation: fadeIn 1s ease 1s both;
    z-index: 2;
}

.scroll-indicator span {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    animation: bounce 2s ease infinite;
}

.scroll-arrow svg {
    width: 100%;
    height: 100%;
    stroke: var(--text-light);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

/* ========================================
   作品展示区域
   ======================================== */
.portfolio {
    background: var(--bg-gray);
    padding: 60px 0;
}

.portfolio-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 24px;
}

.portfolio-item {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: var(--bg-white);
    transition: var(--transition-normal);
}

.portfolio-item:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.portfolio-item:last-child {
    margin-bottom: 0;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.portfolio-item img.loaded {
    opacity: 1;
}

/* 懒加载占位符 */
.portfolio-item img:not(.loaded) {
    min-height: 400px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: var(--bg-dark);
    padding: 40px 24px;
    text-align: center;
}

.footer p {
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 1px;
}

/* ========================================
   弹窗组件
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

/* 二维码弹窗专用样式 */
#qr-modal .modal-content {
    max-width: 400px;
    padding: 20px 20px 24px;
}

#qr-modal .modal-header {
    margin-bottom: 12px;
}

#qr-modal .modal-header h3 {
    font-size: 1.2rem;
}

.modal-content-large {
    max-width: 800px;
}

/* 简历弹窗 */
.modal-content-resume {
    max-width: 700px;
    max-height: 85vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content-resume .modal-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.resume-images {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
    margin-right: -8px;
}

/* 简历弹窗内滚动条样式 */
.resume-images::-webkit-scrollbar {
    width: 6px;
}

.resume-images::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.resume-images::-webkit-scrollbar-thumb {
    background: #c1c8d0;
    border-radius: 3px;
}

.resume-images::-webkit-scrollbar-thumb:hover {
    background: #a8b0ba;
}

.resume-images img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 12px;
    border-radius: 4px;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.resume-images img:last-child {
    margin-bottom: 0;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border: none;
    border-radius: 50%;
    color: var(--text-gray);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: #e5e7eb;
    color: var(--text-dark);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* 二维码容器 */
.qr-code-container {
    display: flex;
    justify-content: center;
}

.qr-code-container img {
    max-width: 320px;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
}

.qr-placeholder {
    width: 240px;
    height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    color: var(--text-gray);
}

.qr-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.qr-placeholder p {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.qr-placeholder small {
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.4;
    opacity: 0.7;
}

/* 简历容器 */
.resume-container {
    margin-bottom: 24px;
}

.resume-container iframe {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.resume-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    color: var(--text-gray);
}

.resume-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.resume-placeholder p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.resume-placeholder small {
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.4;
    opacity: 0.7;
}

.resume-actions {
    text-align: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    background: var(--primary-blue);
    border: none;
    border-radius: 10px;
    color: var(--text-white);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(43, 87, 151, 0.3);
}

.btn-download svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .header-inner {
        padding: 0 16px;
    }
    
    .hero-machine {
        bottom: 5%;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        padding: 10px 12px;
    }
    
    .hero {
        padding: calc(var(--header-height) + 20px) 16px 80px;
    }
    
    .hero-tags {
        flex-direction: column;
        align-items: center;
    }
    
    .portfolio-container {
        padding: 0 16px;
    }
    
    .modal-content {
        padding: 24px;
        margin: 10px;
    }
    
    .modal-content-large {
        max-width: 100%;
    }
    
    .password-container {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .hero-title-cn {
        letter-spacing: 4px;
    }
    
    .hero-name {
        letter-spacing: 3px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .portfolio-item img:not(.loaded) {
        min-height: 250px;
    }
}

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-gray);
}

::-webkit-scrollbar-thumb {
    background: #c1c8d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8b0ba;
}

/* ========================================
   工具类
   ======================================== */
.hidden {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
}

/* ========================================
   密码验证弹窗（用于微信/简历）
   ======================================== */
/* 密码验证弹窗 */
#password-modal .modal-content {
    max-width: 420px;
    padding: 32px 36px;
    overflow: visible;
}

.password-modal-content {
    text-align: center;
}

.password-modal-content .lock-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border-radius: 50%;
    color: var(--text-white);
}

.password-modal-content .lock-icon svg {
    width: 100%;
    height: 100%;
}

.password-modal-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.password-modal-content p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 24px;
}

.password-modal-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.password-modal-input input {
    width: 100%;
    align-self: stretch;
    padding: 12px 20px;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 50px;
    color: var(--text-dark);
    outline: none;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.password-modal-input input::placeholder {
    color: #999;
}

.password-modal-input input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(43, 87, 151, 0.1);
}

.password-modal-input button {
    width: auto;
    padding: 10px 32px;
    margin-top: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    background: var(--primary-blue);
    border: none;
    border-radius: 50px;
    color: var(--text-white);
    cursor: pointer;
    transition: var(--transition-fast);
}

.password-modal-input button:hover {
    background: var(--primary-dark);
}

.password-modal-error {
    color: #ef4444;
    font-size: 0.85rem;
    min-height: 20px;
}

