/* ============================================================
   WuXiaoMu 个人作品集 — 紫色玻璃拟态
   配色来自 GitHub 头像：紫 #9B42DB、粉 #FF86F4、深紫 #4F2860
   定位：全栈开发工程师 · 适合简历展示的专业作品集
   ============================================================ */

:root {
    --color-brand:          #9B42DB;
    --color-brand-secondary:#FF86F4;
    --color-brand-cyan:     #00E8FF;
    --color-primary:        #2a1040;
    --color-primary-soft:   #3d2060;
    --color-secondary:      #654296;
    --color-muted:          #7a5a8a;
    --color-bg:             #f8f4ff;
    --color-bg-soft:        #f5efff;
    --color-bg-section:     #f0e8ff;
    --color-card:           rgba(255, 255, 255, 0.72);
    --color-card-strong:    rgba(255, 255, 255, 0.88);
    --color-article:        rgba(255, 255, 255, 0.82);
    --color-border:         rgba(155, 66, 219, 0.10);
    --color-border-soft:    rgba(155, 66, 219, 0.18);
    --color-border-hover:   rgba(155, 66, 219, 0.30);
    --color-nav-bg:         rgba(255, 255, 255, 0.68);
    --color-menu-bg:        rgba(255, 255, 255, 0.96);
    --color-viewer-bg:      rgba(248, 244, 255, 0.85);
    --glass-inner:          rgba(255, 255, 255, 0.35);
    --glass-inner-strong:   rgba(255, 255, 255, 0.50);
    --avatar-ring:          #ffffff;

    --shadow-soft:  0 8px 24px rgba(42, 16, 64, 0.06);
    --shadow-card:  0 20px 40px -28px rgba(42, 16, 64, 0.12),
                    inset 0 0 0 1px var(--glass-inner-strong);
    --shadow-glow:  0 12px 32px rgba(155, 66, 219, 0.15);
    --shadow-hover: 0 16px 40px -12px rgba(155, 66, 219, 0.22);

    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-xl: 40px;

    --font-sans:   "Inter", "Noto Sans SC", "PingFang SC", -apple-system,
                   BlinkMacSystemFont, "Segoe UI", Roboto,
                   "Microsoft YaHei", sans-serif;
    --font-averia: "Averia Gruesa Libre", cursive;
    --font-mono:   ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ============================================================
   深色主题 (data-theme="dark")
   ============================================================ */
[data-theme="dark"] {
    --color-brand:           #b473ff;
    --color-brand-secondary: #ff94f6;
    --color-primary:         #f1e9fb;
    --color-primary-soft:    #d9cce9;
    --color-secondary:       #b7a0d3;
    --color-muted:           #9c87b8;
    --color-bg:              #0e0718;
    --color-bg-soft:         #130a20;
    --color-bg-section:      #190e29;
    --color-card:            rgba(46, 27, 70, 0.55);
    --color-card-strong:     rgba(54, 32, 80, 0.72);
    --color-article:         rgba(50, 29, 76, 0.60);
    --color-border:          rgba(160, 90, 225, 0.16);
    --color-border-soft:     rgba(160, 90, 225, 0.26);
    --color-border-hover:    rgba(190, 130, 250, 0.45);
    --color-nav-bg:          rgba(20, 12, 34, 0.72);
    --color-menu-bg:         rgba(22, 13, 38, 0.97);
    --color-viewer-bg:       rgba(14, 7, 24, 0.86);
    --glass-inner:           rgba(255, 255, 255, 0.06);
    --glass-inner-strong:    rgba(255, 255, 255, 0.10);
    --avatar-ring:           rgba(255, 255, 255, 0.14);
    --shadow-soft:           0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-card:           0 20px 40px -28px rgba(0, 0, 0, 0.6),
                             inset 0 0 0 1px var(--glass-inner-strong);
    --shadow-glow:           0 12px 32px rgba(155, 66, 219, 0.35);
    --shadow-hover:          0 16px 40px -12px rgba(155, 66, 219, 0.42);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-primary-soft);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   导航
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 66px;
    background: var(--color-nav-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 10000;
    border-bottom: 1px solid var(--color-border);
}

.nav-brand {
    font-family: var(--font-averia);
    font-size: 1.25rem;
    font-weight: 400;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.nav-brand-en {
    font-size: 0.78em;
    margin-left: 0.35rem;
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-menu a {
    color: var(--color-muted);
    text-decoration: none;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-brand);
    background: rgba(155, 66, 219, 0.08);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

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

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 66px;
}

#techCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.backimg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-inner {
    z-index: 10;
    position: relative;
    width: 100%;
    max-width: 1200px;
    padding: 4rem 2rem 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
}

.hero-text {
    flex: 1 1 0;
    text-align: left;
    position: relative;
}

.hero-visual {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero h1 {
    font-family: var(--font-averia);
    font-size: clamp(2.6rem, 7vw, 4.5rem);
    font-weight: 400;
    margin-bottom: 1rem;
    line-height: 1.05;
    color: var(--color-primary);
}

.hero h1 .greeting {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--color-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.hero h1 .name {
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    color: var(--color-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

/* 打字机 */
.typing-wrapper {
    font-size: 1.15rem;
    color: var(--color-brand);
    margin-bottom: 2rem;
    min-height: 1.8em;
    font-family: var(--font-mono);
    font-weight: 500;
}

.typing-text { display: inline; }

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.15em;
    background: var(--color-brand);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 0.8s infinite;
}

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

/* 社交链接 — 玻璃药丸 */
.social-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-primary-soft);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                border-color 0.2s ease, color 0.2s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
}

.social-link:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--color-brand);
    color: var(--color-brand);
    box-shadow: var(--shadow-glow);
}

.social-link i {
    color: var(--color-brand);
    font-size: 0.95rem;
}

.hero-text .social-links { justify-content: flex-start; }

/* 滚动指示 */
.scroll-arrow {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-muted);
    font-size: 0.82rem;
    animation: bounce 2s infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}

.scroll-arrow::before {
    content: '';
    width: 18px;
    height: 28px;
    border: 2px solid var(--color-brand);
    border-radius: 9px;
    position: relative;
}

.scroll-arrow::after {
    content: '';
    width: 3px;
    height: 7px;
    background: var(--color-brand);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    animation: scrollDot 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes scrollDot {
    0%, 100% { top: 8px; opacity: 1; }
    50% { top: 15px; opacity: 0.5; }
}

/* ============================================================
   3D 名片（紫色版）
   ============================================================ */
.name-card-scene {
    width: 280px;
    height: 380px;
    perspective: 1000px;
    position: relative;
}

.name-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    outline: none;
}

.name-card:hover { transform: scale(1.02); }

.name-card:focus-visible,
.name-card.flipped {
    transform: rotateY(180deg) scale(1.02);
}

.name-card-rocker {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: cardRock 8s ease-in-out infinite;
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-back { transform: rotateY(180deg); }

.card-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--color-brand);
    box-shadow: 0 8px 24px rgba(155, 66, 219, 0.25);
    margin-bottom: 1.4rem;
    object-fit: cover;
    background: #fff;
}

.card-name {
    font-family: var(--font-averia);
    font-size: 2rem;
    font-weight: 400;
    color: var(--color-primary);
    margin-bottom: 0.3rem;
    text-align: center;
}

.card-tagline {
    color: var(--color-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-align: center;
}

.card-back h3 {
    font-family: var(--font-averia);
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.card-role {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-bottom: 1.4rem;
    letter-spacing: 1px;
}

.card-roles {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

.card-roles li {
    color: var(--color-primary-soft);
    font-size: 0.88rem;
    padding: 0.35rem 1rem;
    background: rgba(155, 66, 219, 0.07);
    border: 1px solid var(--color-border-soft);
    border-radius: 999px;
}

.card-glow {
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle, rgba(155, 66, 219, 0.25) 0%, transparent 70%);
    filter: blur(40px);
    z-index: -1;
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardRock {
    0%, 100% { transform: rotateY(-8deg) rotateX(2deg) translateY(0); }
    50% { transform: rotateY(8deg) rotateX(-2deg) translateY(-8px); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .name-card-rocker,
    .card-glow { animation: none; }
}

/* ============================================================
   悬浮玻璃面板 (floating panels)
   ============================================================ */
.floating-panel {
    position: absolute;
    z-index: 20;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow:
        0 24px 48px -24px rgba(42, 16, 64, 0.15),
        inset 0 0 20px var(--glass-inner);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: floatPanel 6s ease-in-out infinite;
    pointer-events: none;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary-soft);
}

.floating-panel i {
    font-size: 1.1rem;
    color: var(--color-brand);
}

.floating-panel img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.floating-panel .panel-badge {
    background: var(--color-brand);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

@keyframes floatPanel {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ============================================================
   Sections
   ============================================================ */
section {
    padding: 6rem 2rem;
    position: relative;
    z-index: 2;
    scroll-margin-top: 66px;
}

#about {
    background: linear-gradient(180deg, var(--color-bg-section) 0%, var(--color-bg) 100%);
}

#skills { background: var(--color-bg); }

#projects {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-section) 100%);
}

#blog { background: linear-gradient(180deg, var(--color-bg-section) 0%, var(--color-bg) 100%); }

#contact { background: var(--color-bg-section); }

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-family: var(--font-sans);
    font-size: clamp(1.9rem, 4vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
    width: 100%;
    color: var(--color-primary);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-brand), var(--color-brand-secondary));
    border-radius: 2px;
}

.section-title-en {
    display: block;
    font-family: var(--font-averia);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--color-muted);
    letter-spacing: 0.1em;
    margin-top: 0.4rem;
}

/* ============================================================
   关于
   ============================================================ */
.about-content {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 3rem;
    align-items: start;
}

.about-avatar { position: relative; }

.avatar-img {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-md);
    border: 2px solid var(--avatar-ring);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    object-fit: cover;
}

.avatar-img:hover {
    transform: scale(1.04);
    box-shadow: 0 16px 36px rgba(155, 66, 219, 0.18);
}

.about-avatar::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 1.5px solid var(--color-brand);
    border-radius: 28px;
    opacity: 0.30;
    pointer-events: none;
}

.about-text { padding-top: 0.5rem; }

.about-text p {
    color: var(--color-primary-soft);
    margin-bottom: 1rem;
    line-height: 1.85;
    font-size: 1rem;
}

.about-text .about-meta {
    color: var(--color-muted);
    font-size: 0.9rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border-soft);
}

.stats-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.stat-box {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    padding: 1.5rem 1.2rem;
    border-radius: var(--radius-md);
    text-align: center;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-brand), var(--color-brand-secondary));
}

.stat-box:hover {
    transform: translateY(-4px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-family: var(--font-averia);
    font-size: 2.2rem;
    font-weight: 400;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1.1;
}

.stat-label {
    color: var(--color-muted);
    font-size: 0.88rem;
    margin-top: 0.4rem;
    display: block;
}

/* ============================================================
   技能
   ============================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.skill-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    padding: 1.6rem;
    border-radius: var(--radius-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                border-color 0.25s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-hover);
}

.skill-card h3 {
    color: var(--color-primary);
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.skill-card h3 span {
    margin-left: auto;
    font-family: var(--font-averia);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.skill-card h3 i {
    font-size: 1.2rem;
    color: var(--color-brand);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(155, 66, 219, 0.07);
    border: 1px solid var(--color-border-soft);
    color: var(--color-primary-soft);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    transition: background 0.2s ease, color 0.2s ease,
                border-color 0.2s ease;
}

.skill-tag:hover {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
}

/* ============================================================
   项目
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease,
                box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-hover);
}

.project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-card h3 { font-size: 1.1rem; }

.project-card h3 a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.project-card h3 a:hover { color: var(--color-brand); }

.project-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.project-stars i { color: var(--color-brand); }

.project-card p {
    color: var(--color-primary-soft);
    margin: 0.5rem 0 0.8rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-tags span {
    background: rgba(155, 66, 219, 0.08);
    color: var(--color-brand);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 500;
}

.projects-more {
    text-align: center;
    margin-top: 2.5rem;
}

/* ============================================================
   博客
   ============================================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.blog-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                border-color 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-hover);
}

.blog-card .blog-date {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-card .blog-date i { color: var(--color-brand); font-size: 0.7rem; }

.blog-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-card p {
    font-size: 0.88rem;
    color: var(--color-primary-soft);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card .blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.8rem;
}

.blog-card .blog-tags span {
    font-size: 0.7rem;
    color: var(--color-brand);
    background: rgba(155, 66, 219, 0.08);
    padding: 2px 10px;
    border-radius: 999px;
}

.blog-card .read-more {
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--color-brand);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.2s ease;
}

.blog-card:hover .read-more { gap: 0.6rem; }

/* ============================================================
   联系
   ============================================================ */
.contact-methods {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.6rem 2rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-primary-soft);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                border-color 0.25s ease, color 0.25s ease;
    min-width: 120px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-weight: 500;
    box-shadow: var(--shadow-soft);
}

.contact-method:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-hover);
    color: var(--color-brand);
    box-shadow: var(--shadow-hover);
}

.contact-method i {
    font-size: 1.6rem;
    color: var(--color-brand);
    transition: transform 0.25s ease;
}

.contact-method:hover i { transform: scale(1.1); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
    background: var(--color-bg-section);
    padding: 3.5rem 2rem 2rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
    position: relative;
}

.footer-content { max-width: 600px; margin: 0 auto; }

.footer-logo {
    font-family: var(--font-averia);
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.footer-tagline {
    color: var(--color-muted);
    font-size: 0.92rem;
    margin-bottom: 1.3rem;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    color: var(--color-primary-soft);
    font-size: 1rem;
    transition: transform 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.footer-social a:hover {
    color: var(--color-brand);
    border-color: var(--color-brand);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.footer-copyright {
    color: var(--color-muted);
    font-size: 0.82rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--color-border);
}

/* ============================================================
   按钮 / 通用
   ============================================================ */
.brand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-brand);
    color: #fff;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(155, 66, 219, 0.12);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.brand-btn:hover {
    background: color-mix(in srgb, var(--color-brand) 85%, #000);
    box-shadow: 0 6px 18px rgba(155, 66, 219, 0.20);
    transform: translateY(-1px);
}

.btn-gradient {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 22px;
    border: none;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(155, 66, 219, 0.15);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-gradient:hover {
    box-shadow: 0 8px 24px rgba(155, 66, 219, 0.22);
    transform: translateY(-2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-card);
    color: var(--color-brand);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 22px;
    border: 1px solid var(--color-border-soft);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: var(--color-brand);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 通用玻璃卡片 (供博客阅读器等复用) */
.card {
    position: relative;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow:
        0 20px 40px -28px rgba(42, 16, 64, 0.12),
        inset 0 0 20px var(--glass-inner);
    overflow: hidden;
}

/* ============================================================
   主题切换按钮
   ============================================================ */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: var(--color-brand);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform 0.25s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    transform: rotate(24deg);
    border-color: var(--color-brand);
    box-shadow: var(--shadow-glow);
}

.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

/* ============================================================
   阅读进度条 + 回到顶部
   ============================================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--color-brand), var(--color-brand-secondary), var(--color-brand-cyan));
    z-index: 10001;
    border-radius: 0 2px 2px 0;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-card-strong);
    border: 1px solid var(--color-border);
    color: var(--color-brand);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s,
                box-shadow 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    z-index: 9998;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

/* ============================================================
   自定义滚动条 / 选中 / 焦点
   ============================================================ */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--color-brand) var(--color-bg-soft);
}

::-webkit-scrollbar { width: 10px; height: 10px; }

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-brand), var(--color-brand-secondary));
    border-radius: 999px;
    border: 2px solid var(--color-bg-soft);
}

::-webkit-scrollbar-thumb:hover { background: var(--color-brand); }

::selection {
    background: rgba(155, 66, 219, 0.24);
    color: var(--color-primary);
}

:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

/* ============================================================
   日历 / 时间玻璃小部件
   ============================================================ */
.calendar-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9990;
    width: 240px;
    background: var(--color-card-strong);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    padding: 1rem 1rem 0.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.calendar-widget:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.calendar-month {
    font-family: var(--font-averia);
    font-size: 1rem;
    color: var(--color-primary);
    font-weight: 400;
}

.calendar-year {
    font-size: 0.75rem;
    color: var(--color-muted);
    background: rgba(155, 66, 219, 0.07);
    padding: 2px 10px;
    border-radius: 999px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

.calendar-grid .day-header {
    color: var(--color-muted);
    font-weight: 600;
    padding: 3px 0;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.calendar-grid .day {
    padding: 4px 0;
    border-radius: 999px;
    color: var(--color-primary-soft);
    transition: background 0.15s ease, color 0.15s ease;
}

.calendar-grid .day:hover {
    background: rgba(155, 66, 219, 0.10);
}

.calendar-grid .day.weekend {
    color: var(--color-brand-secondary);
}

.calendar-grid .day.today {
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-secondary));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(155, 66, 219, 0.35);
}

.calendar-grid .day.other-month {
    color: var(--color-border);
}

.calendar-time {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--color-brand);
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
    letter-spacing: 1px;
}

#time {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--color-card-strong);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    color: var(--color-brand);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    z-index: 9999;
    border: 1px solid var(--color-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
}

#time i { font-size: 0.8rem; }

/* ============================================================
   工具类
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.error-msg {
    text-align: center;
    padding: 2.5rem;
    color: #c0392b;
    background: rgba(192, 57, 43, 0.06);
    border-radius: var(--radius-md);
    border: 1px solid rgba(192, 57, 43, 0.12);
    margin: 1.5rem 0;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 992px) {
    .navbar { padding: 0 1.5rem; }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-avatar { display: flex; justify-content: center; }

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

@media (max-width: 768px) {
    section { padding: 4.5rem 1.25rem; }

    .hero-inner {
        padding: 1rem 1.25rem 4rem;
        flex-direction: column-reverse;
        justify-content: center;
        gap: 2.5rem;
    }

    .hero-text { text-align: center; }
    .hero-text .social-links { justify-content: center; }
    .name-card-scene { width: 250px; height: 340px; }

    .navbar { height: 60px; padding: 0 1rem; }

    .nav-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: calc(100vh - 60px);
        background: var(--color-menu-bg);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 0.5rem;
        transition: right 0.3s ease;
        border-left: 1px solid var(--color-border-soft);
        align-items: stretch;
    }

    .nav-menu a { text-align: left; }
    .nav-menu.active { right: 0; }
    .nav-toggle { display: flex; }

    .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);
    }

    .typing-wrapper { font-size: 1rem; }

    .social-links { gap: 0.45rem; }
    .social-link { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
    .social-link span { display: none; }

    .section-title { font-size: 1.6rem; }

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

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
    .stat-box { padding: 1.1rem; }
    .stat-number { font-size: 1.6rem; }

    .contact-methods { gap: 0.8rem; }
    .contact-method { padding: 1.2rem 1.4rem; min-width: 90px; }

    .avatar-img { width: 140px; height: 140px; }
}

@media (max-width: 480px) {
    .name-card-scene { width: 220px; height: 300px; }
    .card-name { font-size: 1.6rem; }
    .card-avatar { width: 96px; height: 96px; }
    .scroll-arrow { display: none; }
    .floating-panel { display: none; }
    .calendar-widget { display: none; }
}
