/* ==========================================================================
   自定义首页样式（layout: home）
   亮/暗色通过 .night-mode 祖先类切换，与主题 h2o-ac 的机制保持一致
   ========================================================================== */

.hp-page {
    --hp-accent: #4a90e2;
    --hp-accent-soft: #eaf2fd;
    --hp-card-bg: #ffffff;
    --hp-card-border: rgba(74, 144, 226, 0.12);
    --hp-text: #2c3a4b;
    --hp-text-muted: #6b7a8d;
    --hp-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    --hp-shadow-hover: 0 8px 24px rgba(74, 144, 226, 0.18);
}

.night-mode .hp-page {
    --hp-accent: #81bbff;
    --hp-accent-soft: rgba(129, 187, 255, 0.12);
    --hp-card-bg: #262a33;
    --hp-card-border: rgba(255, 255, 255, 0.08);
    --hp-text: #d4dae3;
    --hp-text-muted: #9aa5b3;
    --hp-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    --hp-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ---------- Hero ---------- */
.hp-hero {
    position: relative;
    padding: 110px 20px 64px;
    text-align: center;
    color: #fff;
    background: linear-gradient(140deg, #3d7cc9 0%, #5a9be6 45%, #8ec2f5 100%);
    overflow: hidden;
}

.hp-hero::before,
.hp-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.hp-hero::before {
    width: 420px;
    height: 420px;
    top: -180px;
    right: -120px;
}

.hp-hero::after {
    width: 300px;
    height: 300px;
    bottom: -140px;
    left: -100px;
}

/* 语言切换（正文开头，弱化显示） */
.hp-lang {
    margin: 0 0 26px;
    font-size: 0.8rem;
    text-align: right;
    color: var(--hp-text-muted);
}

.hp-lang p {
    margin: 0;
}

.hp-lang p::before {
    content: "🌐 ";
}

.hp-lang b {
    display: none;
}

.hp-lang a {
    color: var(--hp-accent);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.hp-lang a:hover {
    opacity: 0.8;
}

.hp-avatar {
    width: 128px;
    height: 128px;
    margin: 0 auto 18px;
    border-radius: 50%;
    padding: 4px;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 24px rgba(29, 74, 128, 0.35);
}

.hp-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.hp-name {
    margin: 0 0 8px;
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.hp-badgeline {
    margin: 0 0 8px;
}

.hp-badge {
    display: inline-block;
    padding: 3px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
}

.hp-quote {
    margin: 8px 0 2px;
    font-size: 1rem;
    font-style: italic;
    opacity: 0.92;
}

.hp-tagline {
    margin: 0 0 18px;
    font-size: 1.05rem;
    opacity: 0.95;
}

.hp-hobbies {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 26px;
}

.hp-hobbies .hp-chip {
    padding: 5px 14px;
    font-size: 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
}

.hp-socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hp-social {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    font-size: 0.92rem;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.25s ease;
}

.hp-social:hover {
    background: #fff;
    color: #3d7cc9;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(29, 74, 128, 0.3);
}

.hp-social svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* ---------- 主体区 ---------- */
.hp-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 48px 20px 20px;
}

.hp-section {
    margin-bottom: 56px;
    color: var(--hp-text);
}

.hp-h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--hp-text);
}

.hp-h2::before {
    content: "";
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--hp-accent), #8ec2f5);
}

/* ---------- 时间线 ---------- */
.hp-timeline {
    position: relative;
    padding-left: 30px;
}

.hp-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--hp-accent), rgba(74, 144, 226, 0.1));
}

.hp-tl-item {
    position: relative;
    margin-bottom: 18px;
}

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

.hp-tl-dot {
    position: absolute;
    left: -29px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.night-mode .hp-page .hp-tl-dot {
    border-color: #1b1e24;
}

.hp-tl-dot.work {
    background: var(--hp-accent);
}

.hp-tl-dot.edu {
    background: #3fb984;
}

.hp-tl-card {
    background: var(--hp-card-bg);
    border: 1px solid var(--hp-card-border);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: var(--hp-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hp-tl-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hp-shadow-hover);
}

.hp-tl-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.hp-tl-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
}

.hp-tl-type.work {
    color: var(--hp-accent);
    background: var(--hp-accent-soft);
}

.hp-tl-type.edu {
    color: #2e9266;
    background: rgba(63, 185, 132, 0.14);
}

.night-mode .hp-page .hp-tl-type.edu {
    color: #5fd3a1;
}

.hp-tl-date {
    font-size: 0.82rem;
    color: var(--hp-text-muted);
}

.hp-tl-org {
    margin: 0 0 4px;
    font-size: 1.06rem;
    font-weight: 700;
}

.hp-tl-role {
    margin: 0;
    font-size: 0.92rem;
    color: var(--hp-text-muted);
}

/* ---------- 技术栈卡片 ---------- */
.hp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.hp-card {
    background: var(--hp-card-bg);
    border: 1px solid var(--hp-card-border);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    box-shadow: var(--hp-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.hp-card-icon {
    font-size: 1.9rem;
    margin-bottom: 10px;
}

.hp-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--hp-text);
}

.hp-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.hp-tags span {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--hp-accent);
    background: var(--hp-accent-soft);
}

/* ---------- 荣誉 ---------- */
.hp-honors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.hp-honor-group {
    background: var(--hp-card-bg);
    border: 1px solid var(--hp-card-border);
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: var(--hp-shadow);
}

.hp-honor-group h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--hp-accent);
}

.hp-honor-item {
    padding: 9px 0;
    border-bottom: 1px dashed var(--hp-card-border);
}

.hp-honor-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hp-honor-title {
    margin: 0 0 2px;
    font-size: 0.94rem;
    font-weight: 600;
}

.hp-honor-org {
    margin: 0;
    font-size: 0.82rem;
    color: var(--hp-text-muted);
}

/* ---------- 隐藏称号 ---------- */
.hp-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.hp-badge-card {
    background: var(--hp-card-bg);
    border: 1px solid var(--hp-card-border);
    border-radius: 14px;
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--hp-shadow);
    transition: transform 0.25s ease;
}

.hp-badge-card:hover {
    transform: translateY(-4px) rotate(-1.5deg);
}

.hp-badge-card .hp-badge-icon {
    font-size: 1.7rem;
    display: block;
    margin-bottom: 8px;
}

.hp-badge-card .hp-badge-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--hp-text);
}

/* ---------- 最新文章 + 标签行 ---------- */
.hp-posts {
    background: var(--hp-card-bg);
    border: 1px solid var(--hp-card-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--hp-shadow);
}

.hp-post {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 13px 20px;
    border-bottom: 1px dashed var(--hp-card-border);
    color: var(--hp-text);
    text-decoration: none;
    transition: background 0.2s ease;
}

.hp-post:last-child {
    border-bottom: none;
}

.hp-post:hover {
    background: var(--hp-accent-soft);
}

.hp-post-date {
    flex: none;
    font-size: 0.8rem;
    color: var(--hp-text-muted);
    font-variant-numeric: tabular-nums;
}

.hp-post-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-post-tags {
    flex: none;
    display: flex;
    gap: 6px;
}

.hp-post-tag {
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
}

.hp-viewall {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--hp-accent);
    text-decoration: none;
}

.hp-viewall:hover {
    text-decoration: underline;
}

.hp-tagrow {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hp-tagrow-label {
    font-size: 0.82rem;
    color: var(--hp-text-muted);
    margin-right: 4px;
}

.hp-tagchip {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--hp-card-border);
    background: var(--hp-card-bg);
    color: var(--hp-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.hp-tagchip:hover {
    color: #fff;
    background: var(--hp-accent);
    border-color: var(--hp-accent);
    transform: translateY(-2px);
}

.hp-tagchip small {
    opacity: 0.6;
    font-size: 0.72rem;
}

/* ---------- 联系 ---------- */
.hp-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.hp-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 999px;
    font-size: 0.95rem;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #3d7cc9, #5a9be6);
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.4);
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.hp-contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(74, 144, 226, 0.5);
    color: #fff;
}

.hp-contact-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* ---------- 入场动画 ---------- */
.hp-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.hp-reveal.hp-in {
    opacity: 1;
    transform: none;
}

.hp-hero .hp-anim {
    animation: hpFadeUp 0.8s ease both;
}

.hp-hero .hp-anim-1 { animation-delay: 0.05s; }
.hp-hero .hp-anim-2 { animation-delay: 0.18s; }
.hp-hero .hp-anim-3 { animation-delay: 0.32s; }
.hp-hero .hp-anim-4 { animation-delay: 0.46s; }
.hp-hero .hp-anim-5 { animation-delay: 0.60s; }

@keyframes hpFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-reveal,
    .hp-hero .hp-anim {
        transition: none;
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .hp-hero {
        padding-top: 90px;
        padding-bottom: 48px;
    }

    .hp-name {
        font-size: 1.7rem;
    }

    .hp-badges {
        grid-template-columns: repeat(2, 1fr);
    }

    .hp-main {
        padding-top: 36px;
    }

    .hp-section {
        margin-bottom: 44px;
    }
}
