/* ============================================
   王大可个人主页 — 单页版
   Hero 首屏 + 滚动查看全部内容
   ============================================ */

/* ---------- 设计令牌 ---------- */
:root {
    --bg:           #0b0f14;
    --bg-elevated:  #131920;
    --bg-card:      #161d27;
    --bg-card-hover:#1c2533;
    --border:       rgba(255,255,255,0.06);
    --text:         #e8edf4;
    --text-dim:     #8899aa;
    --text-muted:   #5a6a7a;
    --accent:       #ff4757;
    --accent-soft:  rgba(255,71,87,0.12);
    --accent-glow:  rgba(255,71,87,0.25);
    --green:        #2ed573;
    --blue:         #3742fa;
    --purple:       #a55eea;
    --orange:       #ff6348;
    --cyan:         #18dcff;
    --radius:       16px;
    --radius-sm:    10px;
    --radius-xs:    6px;
    --max-w:        880px;
    --ease:         cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* 自定义滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }


/* ============================================
   HERO 首屏（100vh 占满视口）
   ============================================ */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 80px 24px 60px;
    overflow: hidden;
}

/* 背景层 */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(255,71,87,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(55,66,250,0.05) 0%, transparent 70%),
        linear-gradient(160deg, #0b0f14 0%, #10161e 50%, #0d1118 100%);
}

/* 网格纹理 */
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* 头像 */
.avatar {
    display: inline-block;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.12);
    box-shadow: 0 0 0 6px var(--accent-soft), 0 20px 60px rgba(0,0,0,0.5);
    object-fit: cover;
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px var(--accent-glow), 0 24px 70px rgba(0,0,0,0.6);
}

.hero-name {
    margin-top: 24px;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.hero-bio {
    margin-top: 8px;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--text-dim);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* 社交链接 */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 20px;
    transition: all .3s var(--ease);
}
.social-link:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* 滚动提示箭头 */
.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid rgba(255,255,255,0.25);
    border-bottom: 2px solid rgba(255,255,255,0.25);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.4; }
    50% { transform: rotate(45deg) translate(5px, 5px); opacity: 1; }
}


/* ============================================
   主内容区
   ============================================ */
.main-content {
    position: relative;
    z-index: 1;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 20px 24px 60px;
}

/* Hero 与内容区之间的分隔线 */
.main-content::before {
    content: '';
    display: block;
    width: 1px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
}

.section {
    margin-bottom: 56px;
}

.section-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-left: 14px;
    position: relative;
}
.section-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: var(--accent);
}


/* ============================================
   HELLO WORLD 卡片
   ============================================ */
.hello-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 16px 64px rgba(0,0,0,0.4);
    min-height: 320px;
}

.hello-text {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #131920 0%, #1a2233 100%);
    padding: 40px;
    border-radius: var(--radius) 0 0 var(--radius);
}

.hello-heading {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--orange) 50%, #ffc048 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: helloGradient 5s ease-in-out infinite;
}
@keyframes helloGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hello-photo {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
}
.hello-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}
.hello-card:hover .hello-photo img {
    transform: scale(1.06);
}

.hello-location {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #1a2233 0%, #131920 100%);
    padding: 24px;
}
.hello-location .iconfont {
    font-size: clamp(1.2rem, 3vw, 2rem);
    letter-spacing: 3px;
    color: var(--text-dim);
}


/* ============================================
   技能
   ============================================ */
.skill-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 36px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.skill {
    text-align: center;
    width: 110px;
    transition: transform .3s var(--ease);
}
.skill:hover { transform: translateY(-8px); }

.skill svg {
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.3));
}

.skill text {
    font-size: 15px;
    font-weight: 700;
    fill: var(--text);
    text-anchor: middle;
    dominant-baseline: middle;
    transform: rotate(90deg);
    transform-origin: center;
}

.skill-name {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: .5px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 10;
}

.circle-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1.5s var(--ease);
    filter: drop-shadow(0 0 8px currentColor);
}

.c-cpp   { stroke: var(--purple); }
.arm     { stroke: var(--orange); }
.git     { stroke: var(--blue); }
.python  { stroke: var(--cyan); }
.other   { stroke: var(--green); }


/* ============================================
   代码贡献
   ============================================ */
.contribution-card {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.stats-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 150px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-unit {
    font-size: 13px;
    color: var(--text-dim);
}


/* ============================================
   最近动态 — 时间线
   ============================================ */
.timeline {
    position: relative;
    padding-left: 28px;
}

/* 左侧竖线 */
.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), rgba(255,71,87,0.1));
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }

/* 左侧圆点 */
.timeline-dot {
    position: absolute;
    left: -28px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    z-index: 1;
    transition: all .3s var(--ease);
}
.timeline-item:hover .timeline-dot {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.2);
}

/* 内容卡片 */
.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    transition: all .3s var(--ease);
}
.timeline-item:hover .timeline-content {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(4px);
}

/* 头部 */
.timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.timeline-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.08);
    object-fit: cover;
    flex-shrink: 0;
}

.event-repo-link a {
    font-size: 14px;
    font-weight: 600;
    color: var(--cyan);
    transition: color .2s;
}
.event-repo-link a:hover {
    color: #7efff5;
    text-decoration: underline;
}

.timeline-branch {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    color: var(--text-dim);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.event-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* 描述 */
.timeline-body {
    margin-left: 38px;
}

.timeline-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
}
.timeline-desc strong {
    color: var(--text);
    font-weight: 600;
}

.timeline-commit {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    font-size: 12px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 4px;
}


/* ============================================
   页脚
   ============================================ */
.site-footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}
.site-footer p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.footer-link {
    font-size: 13px;
    color: var(--text-muted);
    transition: color .2s;
}
.footer-link:hover { color: var(--text-dim); }


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

.hello-section,
.section {
    animation: fadeUp .6s var(--ease) both;
}
.section:nth-of-type(2) { animation-delay: .06s; }
.section:nth-of-type(3) { animation-delay: .12s; }
.section:nth-of-type(4) { animation-delay: .18s; }


/* ============================================
   响应式
   ============================================ */

/* 平板 */
@media (max-width: 768px) {
    .hero { min-height: auto; padding: 100px 20px 50px; }
    .avatar { width: 100px; height: 100px; }

    .hello-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        min-height: auto;
    }
    .hello-text {
        grid-column: 1;
        grid-row: 1;
        padding: 36px 24px;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .hello-photo {
        grid-column: 1;
        grid-row: 2;
        max-height: 220px;
    }
    .hello-location {
        grid-column: 1;
        grid-row: 3;
        padding: 20px;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .skill-grid { gap: 16px; padding: 28px 16px; }
    .skill { width: 90px; }
    .skill svg { width: 90px; height: 90px; }
    .skill-name { font-size: 12px; }

    .stats-row { flex-direction: column; }
    .stat-chip { min-width: auto; }

    .main-content { padding: 16px 16px 40px; }
    .section { margin-bottom: 40px; }

    .timeline-header { gap: 8px; }
    .event-time { margin-left: 0; }
    .timeline-body { margin-left: 0; }
}

/* 手机 */
@media (max-width: 480px) {
    .hero { padding: 80px 16px 40px; }
    .avatar { width: 84px; height: 84px; border-width: 2px; }
    .hero-name { font-size: 1.7rem; }

    .social-link { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }
    .social-links { gap: 8px; }

    .hello-heading { font-size: clamp(1.6rem, 8vw, 2.5rem); }
    .hello-text { padding: 28px 16px; }

    .skill-grid { gap: 12px; padding: 24px 12px; border-radius: var(--radius-sm); }
    .skill { width: 72px; }
    .skill svg { width: 72px; height: 72px; }
    .skill-name { font-size: 11px; }

    .contribution-card { padding: 16px; border-radius: var(--radius-sm); }
    .stat-chip { padding: 8px 14px; }

    .section-heading { font-size: 1.1rem; }

    .timeline { padding-left: 22px; }
    .timeline::before { left: 4px; }
    .timeline-dot { left: -22px; width: 12px; height: 12px; }
    .timeline-content { padding: 12px 14px; }
}
