/* ==================== 基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0a;
    --card-bg: #111;
    --text: #e6e6e6;
    --text-dim: rgba(255,255,255,0.5);
    --highlight: #00bcd4;
    --glow: rgba(0,188,212,0.15);
    --border: rgba(255,255,255,0.06);
}

html { font-size: clamp(14px, 1.1vw, 20px); }
html, body { height: 100%; overflow: hidden; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
}

/* ==================== 画布 ==================== */
#stars-canvas { position: fixed; inset: 0; z-index: 0; }
#meteor-canvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ==================== 第一页：Hero ==================== */
.page-hero {
    position: absolute; inset: 0; z-index: 10;
    transition: transform .7s cubic-bezier(.4,0,.2,1), opacity .7s ease;
}
.page-hero.exit { transform: translateY(-100%); opacity: 0; }

.hero {
    position: relative; z-index: 2; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 2rem;
}

.motto {
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.3em; margin-bottom: 2.5rem;
    position: relative; padding: 0 2rem;
}
.motto::before, .motto::after {
    content: ''; position: absolute; top: 50%;
    width: 40px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,188,212,0.4), transparent);
}
.motto::before { right: 100%; }
.motto::after { left: 100%; }

.typewriter-cursor {
    display: inline-block; width: 2px; height: 1em;
    background: var(--highlight); margin-left: 2px;
    animation: blink .8s infinite; vertical-align: text-bottom;
}
@keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

.hero-title {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700; margin-bottom: 1.2rem;
    opacity: 0; transform: translateY(30px);
}
.hero-title.show { animation: fadeUp .8s ease forwards; }
.hero-title .name {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #00bcd4);
    background-size: 300% 300%;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; animation: gradShift 4s ease infinite;
}
@keyframes gradShift {
    0% { background-position: 0 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.hero-sub {
    font-size: clamp(0.85rem, 2vw, 1.3rem);
    color: rgba(255,255,255,0.55); margin-bottom: .5rem;
    opacity: 0; transform: translateY(20px);
}
.hero-sub.show { animation: fadeUp .8s ease forwards; }
.hero-sub .role { color: var(--highlight); font-weight: 600; }
.hero-sub .sep {
    display: inline-block; width: 1px; height: 1em;
    background: rgba(255,255,255,0.2); margin: 0 .6rem; vertical-align: middle;
}

.hero-tags {
    display: flex; gap: .6rem; margin-top: 2rem;
    flex-wrap: wrap; justify-content: center; opacity: 0;
}
.hero-tags.show { animation: fadeUp .8s ease forwards; }
.hero-tag {
    padding: .4rem 1rem; border: 1px solid rgba(0,188,212,0.25);
    border-radius: 20px; font-size: .78rem;
    color: rgba(255,255,255,0.6); background: rgba(0,188,212,0.04);
    animation: float var(--d,3s) ease-in-out infinite;
    animation-delay: var(--t,0s);
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

.enter-btn {
    position: absolute; bottom: 2.5rem;
    display: flex; flex-direction: column;
    align-items: center; gap: .5rem;
    cursor: pointer; opacity: 0;
    -webkit-tap-highlight-color: transparent;
}
.enter-btn.show { animation: fadeIn 1s ease forwards; }
.enter-btn span { font-size: .7rem; color: rgba(255,255,255,0.3); letter-spacing: .2em; }
.enter-arrow {
    width: 20px; height: 20px;
    border-right: 2px solid rgba(255,255,255,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.3);
    transform: rotate(45deg); animation: bounceD 1.5s ease-in-out infinite;
}
@keyframes bounceD {
    0%,100% { transform: rotate(45deg) translate(0,0); }
    50% { transform: rotate(45deg) translate(4px,4px); }
}

/* ==================== 第二页：正文 ==================== */
.page-content {
    position: absolute; inset: 0; z-index: 5;
    transform: translateY(30px); opacity: 0;
    transition: transform .7s cubic-bezier(.4,0,.2,1) .1s, opacity .6s ease .15s;
    pointer-events: none; overflow: hidden;
}
.page-content.active { transform: translateY(0); opacity: 1; pointer-events: auto; }

.back-hero {
    position: fixed; top: 1rem; left: 1rem; z-index: 30;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    border-radius: 8px; padding: .35rem .7rem;
    color: var(--text-dim); font-size: .75rem; cursor: pointer;
    backdrop-filter: blur(10px); transition: all .3s;
    opacity: 0; pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}
.back-hero.visible { opacity: 1; pointer-events: auto; }
.back-hero:hover { color: var(--highlight); border-color: rgba(0,188,212,0.3); }

/* ==================== 单列居中 ==================== */
.layout {
    height: 100%; overflow-y: auto;
    padding: 2.5rem 1.5rem 4rem;
}
.layout-inner {
    max-width: min(90vw, 960px);
    margin: 0 auto;
}

/* ==================== 个人信息卡 ==================== */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative; overflow: hidden;
}
.profile-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--highlight), #764ba2, #f093fb, var(--highlight));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.profile-top { display: flex; gap: 1.2rem; align-items: center; }

.avatar {
    width: 4.5rem; height: 4.5rem; border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; border: 2px solid var(--border);
    box-shadow: 0 0 20px var(--glow); margin-bottom: 1rem;
}
.profile-body { flex: 1; min-width: 0; }
.profile-name { font-size: 1.4rem; font-weight: 700; margin-bottom: .2rem; }
.profile-name .dim { font-size: .8rem; font-weight: 400; color: var(--text-dim); }
.profile-role { color: var(--highlight); font-size: .9rem; margin-bottom: .3rem; }
.profile-motto { font-size: .75rem; color: rgba(255,255,255,0.3); font-style: italic; margin-bottom: .8rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.pmeta {
    font-size: .7rem; padding: .2rem .55rem; border-radius: 4px;
    background: rgba(255,255,255,0.04); color: var(--text-dim); border: 1px solid var(--border);
}

.left-divider { width: 100%; height: 1px; background: var(--border); margin: .5rem 0 1.2rem; }

.summary-text { font-size: .85rem; color: rgba(255,255,255,0.6); margin-bottom: 1.5rem; }
.summary-text strong { color: var(--text); }

/* ==================== 区块标签 ==================== */
.section-label {
    font-size: .7rem; font-weight: 600; color: var(--highlight);
    letter-spacing: .15em; text-transform: uppercase;
    margin-bottom: 1rem;
}

/* ==================== 工作经历卡片 ==================== */
.exp-card {
    display: flex; gap: 1.2rem; align-items: flex-start;
    padding: 1.2rem; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: .8rem; cursor: pointer;
    transition: border-color .3s, transform .2s;
    -webkit-tap-highlight-color: transparent;
}
.exp-card:hover { border-color: rgba(0,188,212,0.2); transform: translateX(4px); }

.exp-dot {
    width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid var(--highlight); flex-shrink: 0; margin-top: .35rem;
}
.exp-card:first-child .exp-dot { background: var(--highlight); box-shadow: 0 0 8px var(--glow); }

.exp-body { flex: 1; min-width: 0; }
.exp-company { font-size: 1rem; font-weight: 600; margin-bottom: .15rem; }
.exp-meta { font-size: .75rem; color: var(--text-dim); margin-bottom: .4rem; }
.exp-summary { font-size: .85rem; color: rgba(255,255,255,0.55); }
.exp-arrow { color: var(--text-dim); font-size: .8rem; flex-shrink: 0; margin-top: .3rem; }

.section-gap { height: 2rem; }

/* ==================== 行布局 ==================== */
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .6rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }

.collab-card {
    display: flex; gap: .8rem; align-items: center;
    padding: .8rem 1rem; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 10px;
    text-decoration: none; color: var(--text);
    transition: border-color .3s, transform .2s;
}
a.collab-card:hover { border-color: rgba(0,188,212,0.25); transform: translateY(-2px); }

.cc-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.cc-icon svg { width: 20px; height: 20px; fill: currentColor; }
.cc-info { flex: 1; min-width: 0; }
.cc-info h5 { font-size: .8rem; font-weight: 600; }
.cc-info p { font-size: .7rem; color: var(--text-dim); }
.cc-info .lnk { font-size: .68rem; color: var(--highlight); }

.email-strip {
    margin-top: 1rem; text-align: center; padding: 1rem;
    background: linear-gradient(135deg, rgba(0,188,212,0.05), rgba(118,75,162,0.05));
    border: 1px solid rgba(0,188,212,0.12); border-radius: 10px;
}
.email-strip a {
    color: var(--highlight); font-size: .9rem; font-weight: 600;
    text-decoration: none; display: block; margin-bottom: .2rem;
}
.email-strip span { font-size: .68rem; color: var(--text-dim); }

/* ==================== 详情页覆盖层 ==================== */
.detail-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity .3s;
}
.detail-overlay.open { opacity: 1; pointer-events: auto; }

.detail-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(600px, 90vw); z-index: 51;
    background: var(--bg); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform .4s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; padding: 2rem;
}
.detail-overlay.open .detail-panel { transform: translateX(0); }

/* 详情页头部 */
.detail-header {
    margin: -2rem -2rem 1.5rem;
    padding: 1.5rem 2rem 1.2rem;
    background: linear-gradient(135deg, rgba(0,188,212,0.08), rgba(118,75,162,0.06));
    border-bottom: 1px solid var(--border);
    position: relative;
}
.detail-header::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--highlight), #764ba2);
}
.detail-back {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .8rem; color: var(--text-dim); cursor: pointer;
    margin-bottom: 1rem; transition: color .2s;
    -webkit-tap-highlight-color: transparent;
}
.detail-back:hover { color: var(--highlight); }
.detail-title { font-size: 1.3rem; font-weight: 700; margin-bottom: .3rem; }
.detail-meta { font-size: .8rem; color: var(--text-dim); }

/* 项目卡片 */
.project {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    border-left: 3px solid var(--highlight);
    transition: border-color .3s;
}
.project:hover { border-color: rgba(0,188,212,0.4); }
.project h5 {
    font-size: .9rem; font-weight: 600; margin-bottom: .15rem;
}
.project-time {
    display: inline-block;
    font-size: .68rem; color: var(--highlight);
    padding: .1rem .5rem; margin-bottom: .5rem;
    background: rgba(0,188,212,0.08);
    border-radius: 4px;
}
.project-desc {
    font-size: .8rem; color: var(--text-dim);
    margin-bottom: .5rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.project ul { list-style: none; }
.project li {
    font-size: .8rem; color: rgba(255,255,255,0.6);
    padding: .3rem 0 .3rem 1.2rem; position: relative;
}
.project li::before {
    content: '▸'; position: absolute; left: 0; top: .3rem;
    color: rgba(0,188,212,0.5); font-size: .7rem;
}

/* 项目数统计 */
.detail-stats {
    display: flex; gap: 1.5rem; margin-top: .8rem;
}
.detail-stat {
    font-size: .7rem; color: var(--text-dim);
}
.detail-stat strong {
    color: var(--highlight); font-size: 1.1rem;
    margin-right: .2rem;
}

/* ==================== 自适应 ==================== */
@media (max-width: 768px) {
    .profile-top { gap: .8rem; }
    .exp-card { gap: .8rem; }
    .collab-card { padding: .8rem; gap: .6rem; }
    .detail-panel { width: 100vw; padding: 1.5rem 1.2rem; }
    .detail-header { margin: -1.5rem -1.2rem 1.2rem; padding: 1.2rem 1.2rem 1rem; }
    .row-3 { grid-template-columns: 1fr; }
    .row-2 { grid-template-columns: 1fr; }
}

/* ==================== 通用动画 ==================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
