/* ============================================
   Personal Site - Glassmorphism 灰白质感风格
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    background: linear-gradient(135deg, #fafbfc, #f0f2f5);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- CSS Variables ---- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-bg-hover: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-border-hover: rgba(255, 255, 255, 0.9);
    --accent: #4f6cf7;
    --text-on-glass: #1f2937;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;
    --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-glass-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
    --radius-glass: 20px;
    --radius-glass-sm: 14px;
    --max-width: 640px;
    --section-gap: 40px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ---- Sections ---- */
section {
    padding: var(--section-gap) 0;
}

/* ---- Hero / Module 1 ---- */
#hero {
    padding: 48px 0 24px;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 20px;
    animation: fadeInUp 0.7s ease-out;
}

.hero-left {
    flex-shrink: 0;
}

.hero-right {
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: block;
    object-fit: cover;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
}

.hero-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.hero-bio {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ---- Section Header ---- */
.section-header {
    text-align: left;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

/* ---- Card Grid ---- */
.card-grid {
    display: grid;
    gap: 12px;
}

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

/* ---- Card (Square Style) ---- */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-glass);
    text-decoration: none;
    color: var(--text-on-glass);
    transition: transform var(--transition), box-shadow var(--transition),
        background var(--transition), border-color var(--transition);
    cursor: pointer;
    min-height: 100px;
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }

.card:hover {
    transform: translateY(-4px);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glass-hover);
}

.card-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
    flex-shrink: 0;
}

.card-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.card-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-on-glass);
    text-align: center;
}

/* ---- Menu List (Rectangular Style) ---- */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    display: block;
    padding: 16px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-glass);
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition),
        background var(--transition), border-color var(--transition);
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

.menu-item:nth-child(1) { animation-delay: 0.1s; }
.menu-item:nth-child(2) { animation-delay: 0.2s; }
.menu-item:nth-child(3) { animation-delay: 0.3s; }

.menu-item:hover {
    transform: translateY(-3px);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glass-hover);
}

.menu-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-on-glass);
    margin-bottom: 3px;
}

.menu-item-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-dim);
    font-size: 0.8125rem;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Sub-page Styles ---- */
.sub-page {
    padding-top: 32px;
    min-height: 100vh;
}

.sub-page-header {
    margin-bottom: 32px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.sub-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.sub-page-content {
    color: var(--text-muted);
    line-height: 1.8;
    min-height: 300px;
}

/* ---- Placeholder Content (for sub-pages) ---- */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    border: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-glass);
    padding: 48px 24px;
    text-align: center;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.placeholder-content .placeholder-icon-lg {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.placeholder-content p {
    font-size: 0.875rem;
    max-width: 360px;
}

/* ---- Responsive ---- */

/* Tablet & Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .card {
        padding: 22px 14px;
        min-height: 88px;
    }

    .menu-item {
        padding: 14px 18px;
    }
}

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

    #hero {
        padding: 36px 0 20px;
    }

    .avatar {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }

    .hero-name {
        font-size: 1.1rem;
    }

    .hero-bio {
        font-size: 0.825rem;
    }

    .card {
        padding: 20px 12px;
        min-height: 80px;
        gap: 8px;
    }

    .card-icon {
        width: 28px;
        height: 28px;
    }

    .card-label {
        font-size: 0.8125rem;
    }

    .menu-item {
        padding: 12px 16px;
    }

    .menu-item-title {
        font-size: 0.875rem;
    }

    .menu-item-desc {
        font-size: 0.775rem;
    }

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

    .sub-page-title {
        font-size: 1.25rem;
    }
}
