/* ============================================
   Portfolio - Professional Western Design
   ============================================ */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-lighter: #dbeafe;
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    /* 只对这几个属性做过渡，不要写 all。
       all 会把 width / height / top / font-size 这类布局属性也纳入动画，
       任何一次布局变化（响应式断点、内容增删、滚动加 class）都会拖出
       0.3 秒的位移过程，看起来就是页面在抖。
       下面这几个属性都只走合成或绘制阶段，不触发重排。 */
    --transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                  background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                  border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                  box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                  opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                  transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-cjk: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --container-max: 1200px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    color: var(--gray-700);
    line-height: 1.7;
    background-color: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Section */
section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header .section-label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
    padding: 6px 16px;
    background: var(--primary-lighter);
    border-radius: 999px;
}

.section-header h2 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.2;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary);
}

.nav-cta {
    padding: 10px 24px;
    background: var(--dark);
    color: white !important;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.nav-cta:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-cta::after {
    display: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content .hero-greeting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 8px 18px;
    border-radius: 999px;
    margin-bottom: 24px;
}

.hero-content .hero-greeting .pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2.4s ease-in-out infinite;
    flex-shrink: 0;
}

/* 只做透明度呼吸，不再缩放。
   原来 scale(1.2) 会让圆点忽大忽小、边缘反复重绘，在小尺寸上格外显眼。 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* 系统开了「减少动态效果」时，首屏的循环动画全部停掉 */
@media (prefers-reduced-motion: reduce) {
    .hero-content .hero-greeting .pulse-dot,
    .hero-badge {
        animation: none !important;
    }
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-content h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content .hero-role {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
    /* 高度写死，别让打字机删空文字时容器塌陷。
       原来没有这两行，文字删到空的那一瞬间高度变 0，
       下方整块内容会跟着上跳——页面每两秒闪一下就是这么来的。 */
    min-height: 2.25rem;
    line-height: 2.25rem;
    /* 宽度由内部的隐形占位撑住，文字增删时不再横向回流 */
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* 打字机的文字本体 */
.hero-content .hero-role .hero-role-text {
    display: inline-block;
}

/* 闪烁光标。用 opacity 做动画，不触发布局重排 */
.hero-content .hero-role .hero-role-caret {
    display: inline-block;
    width: 2px;
    height: 1.35rem;
    margin-left: 3px;
    background: var(--primary, currentColor);
    animation: caretBlink 1s step-end infinite;
    flex-shrink: 0;
}

@keyframes caretBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* 用最长的那条角色名占住宽度，本身不可见也不参与交互。
   放在文档流里让父元素量到宽度，再用 height:0 抹掉它对高度的影响。 */
.hero-content .hero-role .hero-role-sizer {
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .hero-content .hero-role .hero-role-caret { animation: none; }
}

.hero-content .hero-tagline {
    font-size: 1.125rem;
    color: var(--gray-500);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--dark);
    border: 2px solid var(--gray-200);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-dark {
    background: var(--dark);
    color: white;
}

.btn-dark:hover {
    background: var(--gray-800);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-stats {
    display: flex;
    gap: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

.hero-stat .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
    /* 数字用等宽字形。计数动画从 1 位数涨到 2 位数时字宽会变，
       hero-stats 是 flex 布局，宽度一变旁边的统计项就跟着横向挪 —— 又是一处抖动。 */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    display: inline-block;
}

.hero-stat .stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    border: 1px solid var(--gray-100);
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: 20px;
    bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0.1;
}

.hero-card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.hero-card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.hero-card-title {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.hero-card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 24px;
}

.hero-card-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.hero-card-info-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.hero-card-socials {
    display: flex;
    gap: 12px;
}

.hero-card-socials a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition);
}

.hero-card-socials a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.hero-card-socials svg {
    width: 20px;
    height: 20px;
}

/* Floating badges */
.hero-badge {
    position: absolute;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    animation: float 6s ease-in-out infinite;
    /* 提前提升为独立合成层，浮动动画只在 GPU 上跑，不反复触发重绘。
       周期从 3s 放慢到 6s、幅度从 10px 收到 5px——原来三个标签错着相位
       同时大幅上下窜，视觉上就是一直在晃。 */
    will-change: transform;
    backface-visibility: hidden;
}

.hero-badge .badge-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

/* badge 图标改用内联 SVG（原来是 emoji/符号字符，字体缺字时会显示成方块或叉号） */
.hero-badge .badge-icon svg {
    width: 17px;
    height: 17px;
    display: block;
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -5px, 0); }
}

.hero-badge-1 {
    top: -30px;
    right: -20px;
    animation-delay: 0s;
}

.hero-badge-1 .badge-icon {
    background: var(--primary);
}

.hero-badge-2 {
    bottom: 20px;
    left: -40px;
    animation-delay: 1s;
}

.hero-badge-2 .badge-icon {
    background: var(--success);
}

.hero-badge-3 {
    bottom: -30px;
    right: 20px;
    animation-delay: 2s;
}

.hero-badge-3 .badge-icon {
    background: var(--accent);
}

/* ============================================
   About Section
   ============================================ */
.about {
    background: var(--gray-50);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-text h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.about-text p {
    font-size: 1.0625rem;
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
}

.about-highlight {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.about-highlight-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.about-highlight-icon svg {
    width: 24px;
    height: 24px;
}

.about-highlight h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.about-highlight p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

/* Info card */
.info-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--gray-100);
}

.info-card-header {
    padding: 32px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    color: white;
}

.info-card-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-card-header p {
    font-size: 0.875rem;
    opacity: 0.7;
}

.info-card-body {
    padding: 32px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .info-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.info-row .info-value {
    font-size: 0.9375rem;
    color: var(--dark);
    font-weight: 600;
}

/* ============================================
   Skills Section
   ============================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.skill-category {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.skill-category-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.skill-category-icon svg {
    width: 22px;
    height: 22px;
}

.skill-category h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark);
}

.skill-item {
    margin-bottom: 20px;
}

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

.skill-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-item-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
}

.skill-item-percent {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
    font-family: var(--font-mono);
}

.skill-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

/* ============================================
   Projects Section
   ============================================ */
.projects {
    background: var(--gray-50);
}

.project-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.project-filter {
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
}

.project-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.project-filter.active {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 32px;
}

.project-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
    cursor: pointer;
}

.project-card:hover {
    /* 只留阴影。抬升交给 JS 的倾斜效果统一处理（它的 transform 里已含 -8px 位移）。
       原来这里也写 transform，和 JS 写的行内 transform 争夺同一属性，
       鼠标在卡片边缘进出时两者反复覆盖，卡片会抽一下。 */
    box-shadow: var(--shadow-2xl);
}

/* 没有精细指针（触屏 / 平板）时 JS 不做倾斜，这时由 CSS 负责抬升手感 */
@media (hover: hover) and (pointer: coarse) {
    .project-card:hover { transform: translate3d(0, -8px, 0); }
}

.project-card-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 无配图时的 SVG 占位图标。
   原来这里是 emoji（.project-emoji），但 emoji 靠系统字体渲染，
   字体里没有对应字形就会画成方块或叉号，所以换成内联 SVG。 */
.project-card-image .project-placeholder {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card-image .project-placeholder svg {
    width: 100%;
    height: 100%;
    display: block;
}

.project-card:hover .project-card-image .project-placeholder {
    transform: scale(1.08) translateY(-2px);
}

.project-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-card-overlay {
    opacity: 1;
}

.project-card-overlay a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    transition: var(--transition);
}

.project-card-overlay a:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.project-card-overlay svg {
    width: 22px;
    height: 22px;
}

.project-card-body {
    padding: 28px;
}

.project-card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.project-card-body p {
    font-size: 0.9375rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 4px 12px;
    border-radius: 999px;
}

/* 精选作品跨两列。
   注意：只有当栅格实际排得下 2 列时才生效，否则单个精选作品会被拉成
   超宽的一条，右边留一大片空白。用 :not(:only-child) 兜住"只有一个作品"的情况。 */
.project-card.featured:not(:only-child) {
    grid-column: span 2;
}

.project-card.featured .project-card-image {
    height: 280px;
}

/* 唯一一个作品时不跨列，避免卡片被拉伸到整行宽度 */
.projects-grid > .project-card:only-child {
    max-width: 560px;
}

/* ============================================
   Resume / Experience Section
   ============================================ */
.resume-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.resume-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    padding-bottom: 48px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    z-index: 1;
    transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
    background: var(--primary);
    transform: scale(1.2);
}

.timeline-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.timeline-date {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.timeline-duration {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-left: 8px;
    font-family: var(--font-mono);
}

.timeline-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.timeline-content .timeline-org {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.timeline-content p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.7;
}

/* Resume download bar */
.resume-download {
    text-align: center;
    margin-bottom: 64px;
}

.resume-download-bar {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    background: white;
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

.resume-download-bar .resume-info {
    text-align: left;
}

.resume-download-bar .resume-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.resume-download-bar .resume-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    background: var(--gray-50);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 48px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.contact-info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.contact-info-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.contact-info-item:last-child {
    padding-bottom: 0;
}

.contact-info-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.contact-info-icon svg {
    width: 22px;
    height: 22px;
}

.contact-info-item .info-text {
    font-size: 0.9375rem;
}

.contact-info-item .info-text .info-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.contact-info-item .info-text .info-value {
    font-size: 0.9375rem;
    color: var(--dark);
    font-weight: 600;
}

.contact-socials {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.contact-socials a {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition);
}

.contact-socials a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.contact-socials svg {
    width: 22px;
    height: 22px;
}

/* Contact form */
.contact-form-wrap {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

.contact-form-wrap h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.contact-form-wrap > p {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--dark);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

.form-error {
    display: none;
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 6px;
}

.form-group.has-error .form-control {
    border-color: var(--danger);
}

.form-group.has-error .form-error {
    display: block;
}

.form-alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    display: none;
}

.form-alert.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.form-alert.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--dark);
    color: var(--gray-400);
    padding: 64px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-brand .nav-logo {
    color: white;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 0.9375rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    font-size: 0.9375rem;
    color: var(--gray-400);
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--primary-light);
    padding-left: 4px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

.footer-bottom .footer-socials {
    display: flex;
    gap: 12px;
}

.footer-bottom .footer-socials a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
}

.footer-bottom .footer-socials a:hover {
    background: var(--primary);
    color: white;
}

.footer-bottom .footer-socials svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Back to top
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    transform: translateY(-4px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   Animations
   ============================================ */
/* 入场动画。
   注意这里的隐藏状态挂在 .js-anim 下面（由 <head> 里的内联脚本加上）。
   原来是无条件 opacity:0，一旦 JS 被拦、报错或加载慢，整页内容就永久是白的；
   现在没有 JS 时这些规则不生效，内容直接可见。 */
.js-anim .fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-anim .fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.js-anim .fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-anim .fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.js-anim .fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-anim .fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 首屏（hero）不参与"滚动到才显示"这一套。
   它本来就在视口里，等 JS 跑完再滑进来会造成刷新瞬间先空白后跳动。
   这里直接用 CSS 动画接管，页面一解析就开始播，无需等任何脚本。 */
.hero .fade-in-left,
.hero .fade-in-right,
.js-anim .hero .fade-in-left,
.js-anim .hero .fade-in-right {
    opacity: 1;
    transform: none;
    transition: none;
}

.hero .fade-in-left  { animation: heroIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero .fade-in-right { animation: heroIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both; }

@keyframes heroIn {
    from { opacity: 0; transform: translate3d(0, 16px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .js-anim .fade-in-up,
    .js-anim .fade-in-left,
    .js-anim .fade-in-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero .fade-in-left,
    .hero .fade-in-right {
        animation: none;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-grid {
        gap: 48px;
    }

    .project-card.featured,
    .project-card.featured:not(:only-child) {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-100);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-cta {
        width: 100%;
        text-align: center;
    }

    section {
        padding: 64px 0;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .hero {
        padding-top: 100px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-role {
        font-size: 1.25rem !important;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .hero-visual {
        order: -1;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-highlights {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .resume-timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-dot {
        left: 2px;
    }

    .resume-download-bar {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .hero-stat .stat-number {
        font-size: 1.5rem;
    }

    .contact-form-wrap {
        padding: 24px;
    }
}

/* ============================================
   Resume subheadings
   ============================================ */
.resume-subhead {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.01em;
    margin-bottom: 32px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.resume-subhead::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.resume-subhead-edu {
    margin-top: 72px;
}

/* ============================================
   Language switcher (navbar)
   ============================================ */
.lang-switch {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-600);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
}

.lang-current:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-lighter);
}

.lang-current svg {
    flex-shrink: 0;
}

.lang-caret {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.65;
}

.lang-switch.open .lang-current {
    border-color: var(--primary);
    color: var(--primary);
}

.lang-switch.open .lang-caret {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 178px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 200;
}

.lang-switch.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu .lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-menu .lang-option::after {
    display: none;
}

.lang-menu .lang-option:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.lang-menu .lang-option.active {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-weight: 600;
}

/* 国旗改用内联 SVG（原来是 emoji，Windows 字体不含国旗字形，会显示成方框或叉号） */
.lang-flag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    width: 20px;
    height: 14px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.09);
}

.lang-flag svg {
    width: 100%;
    height: 100%;
    display: block;
}

.lang-name {
    flex: 1;
}

.lang-check {
    color: var(--primary);
    flex-shrink: 0;
}

/* Footer language list */
.footer-langs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-langs a.active {
    color: var(--primary-light);
    font-weight: 600;
}

/* ============================================
   CJK typography adjustments
   ============================================ */
body.lang-cjk {
    font-family: var(--font-cjk);
    line-height: 1.85;
    letter-spacing: 0.01em;
}

body.lang-cjk h1,
body.lang-cjk h2,
body.lang-cjk h3,
body.lang-cjk h4 {
    letter-spacing: 0;
    font-weight: 800;
}

body.lang-cjk .hero-content h1 {
    line-height: 1.28;
}

body.lang-cjk .section-header h2 {
    letter-spacing: 0;
}

body.lang-cjk .section-tag,
body.lang-cjk .footer-col h4,
body.lang-cjk .skill-category h3 {
    letter-spacing: 0.06em;
}

body.lang-cjk .btn,
body.lang-cjk .nav-cta {
    letter-spacing: 0.02em;
}

body.lang-cjk .timeline-content p,
body.lang-cjk .about-text p,
body.lang-cjk .project-card p {
    line-height: 1.9;
}

body.lang-cjk .nav-links {
    gap: 26px;
}

/* Italian / longer labels: keep nav from crowding */
html[data-lang="it"] .nav-links {
    gap: 24px;
}

html[data-lang="it"] .nav-links a {
    font-size: 0.9rem;
}

/* ============================================
   Language switcher responsive
   ============================================ */
@media (max-width: 900px) {
    .nav-links {
        gap: 20px;
    }

    body.lang-cjk .nav-links,
    html[data-lang="it"] .nav-links {
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .lang-switch {
        width: 100%;
    }

    .lang-current {
        width: 100%;
        justify-content: center;
    }

    .lang-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        min-width: 0;
        width: 100%;
        margin-top: 8px;
        display: none;
    }

    .lang-switch.open .lang-menu {
        display: block;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   作品配图 + 项目详情浮层
   ============================================ */

/* 有真实配图时去掉渐变底与网点纹理，让图片占满 */
.project-card-image.has-photo {
    background: var(--gray-100, #f1f2f6);
}
.project-card-image.has-photo::before {
    display: none;
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-card-image img {
    transform: scale(1.06);
}

/* 「查看设计过程」按钮 */
.project-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: gap 0.25s ease, color 0.2s ease;
}
.project-more:hover {
    gap: 11px;
    color: var(--accent, var(--primary));
}
.project-more svg {
    flex-shrink: 0;
}

/* 浮层容器 */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.project-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 28, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.project-modal-panel {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 18, 28, 0.32);
    transform: translateY(22px) scale(0.985);
    transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
}
.project-modal.is-open .project-modal-panel {
    transform: translateY(0) scale(1);
}
.project-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-700, #3b4252);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}
.project-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

/* 浮层内容排版 */
.pd-cover {
    width: 100%;
    max-height: 380px;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: var(--gray-100, #f1f2f6);
}
.pd-cover img {
    width: 100%;
    height: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
}
.pd-inner > .pd-title {
    margin: 0;
    padding: 32px 40px 0;
    font-size: 1.85rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 40px 0;
}
.pd-body {
    padding: 22px 40px 8px;
}
.pd-body p {
    margin: 0 0 18px;
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--gray-600, #4b5563);
}
.pd-body p:last-child {
    margin-bottom: 0;
}
.pd-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 40px 36px;
}

/* 浮层打开时锁定背景滚动 */
body.modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .project-modal {
        padding: 0;
    }
    .project-modal-panel {
        max-height: 100vh;
        border-radius: 0;
    }
    .pd-cover {
        border-radius: 0;
        max-height: 240px;
    }
    .pd-cover img {
        max-height: 240px;
    }
    .pd-inner > .pd-title {
        padding: 26px 22px 0;
        font-size: 1.45rem;
    }
    .pd-tags {
        padding: 14px 22px 0;
    }
    .pd-body {
        padding: 18px 22px 4px;
    }
    .pd-links {
        padding: 12px 22px 30px;
    }
}

/* ==========================================================================
   空状态提示
   作品还没上传时，别让栅格区留一片空白，给一句友好的占位文案。
   ========================================================================== */
.projects-empty {
    grid-column: 1 / -1;
    padding: 60px 24px;
    text-align: center;
    color: var(--gray-500, #6b7280);
    font-size: 1.02rem;
    background: var(--gray-50, #f9fafb);
    border: 1px dashed var(--gray-300, #d1d5db);
    border-radius: 16px;
}

/* ==========================================================================
   「正在寻找机会」状态指示
   原来用 ● 字符，字体缺字会变成方块或叉号，改成 CSS 画的圆点 + 呼吸动画。
   ========================================================================== */
.info-value.status-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--success, #10b981);
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    animation: statusPulse 2.2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.06); }
}

@media (prefers-reduced-motion: reduce) {
    .status-dot { animation: none; }
}
