/* ---- 基础重置与字体 ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #faf9f7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text: #2c2c2c;
    --text-secondary: #6b6b6b;
    --text-muted: #999;
    --accent: #5b7fff;
    --accent-hover: #3d5fd9;
    --border: rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.1);
    --radius: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- 背景装饰 ---- */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    filter: blur(80px);
}

.bg-circle-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #a8c0ff, #c1a8ff);
    top: -10%;
    right: -8%;
    animation: float-1 12s ease-in-out infinite;
}

.bg-circle-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
    bottom: -12%;
    left: -6%;
    animation: float-2 14s ease-in-out infinite;
}

.bg-circle-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float-3 10s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, 30px) rotate(120deg); }
    66% { transform: translate(20px, -20px) rotate(240deg); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(25px, -20px) rotate(-120deg); }
    66% { transform: translate(-15px, 25px) rotate(-240deg); }
}

@keyframes float-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* ---- 主容器 ---- */
.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 40px 20px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- 卡片 ---- */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 56px 60px 48px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

/* ---- 头像 ---- */
.avatar-wrapper {
    margin-bottom: 28px;
}

.avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 4px rgba(91, 127, 255, 0.15);
    transition: transform var(--transition), box-shadow var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.12), 0 0 0 6px rgba(91, 127, 255, 0.25);
}

/* ---- 名字 ---- */
.name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 4px;
}

/* ---- 用户名 / Handle ---- */
.handle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ---- 简介 ---- */
.bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-weight: 400;
}

/* ---- 导航链接 ---- */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 36px;
}

.nav-item {
    display: inline-block;
    padding: 8px 22px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.03);
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    color: #fff;
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(91, 127, 255, 0.35);
}

.nav-item:active {
    transform: translateY(0);
}

/* ---- 社交图标 ---- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 18px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    background: rgba(0, 0, 0, 0.03);
    transition: all var(--transition);
}

.social-icon:hover {
    color: #fff;
    background: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(91, 127, 255, 0.35);
}

.social-icon:active {
    transform: translateY(0);
}

/* ---- 页脚 ---- */
.footer {
    text-align: center;
}

.footer p {
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ---- 响应式 ---- */
@media (max-width: 520px) {
    .card {
        padding: 40px 28px 36px;
        border-radius: 16px;
    }

    .avatar {
        width: 90px;
        height: 90px;
    }

    .name {
        font-size: 1.6rem;
    }

    .handle {
        font-size: 0.9rem;
    }

    .nav-item {
        padding: 7px 16px;
        font-size: 0.85rem;
    }

    .social-icon {
        width: 38px;
        height: 38px;
    }

    .bg-circle-1,
    .bg-circle-2 {
        width: 200px;
        height: 200px;
    }

    .bg-circle-3 {
        width: 120px;
        height: 120px;
    }
}

/* ---- 暗色模式 ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a2e;
        --card-bg: rgba(30, 30, 50, 0.8);
        --text: #e8e8ed;
        --text-secondary: #b0b0c0;
        --text-muted: #7a7a90;
        --accent: #7b93ff;
        --accent-hover: #5b73e6;
        --border: rgba(255, 255, 255, 0.06);
        --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.4);
    }

    .avatar {
        border-color: rgba(30, 30, 50, 0.8);
    }

    .nav-item {
        background: rgba(255, 255, 255, 0.05);
    }

    .social-icon {
        background: rgba(255, 255, 255, 0.05);
    }

    .bg-circle-1 {
        opacity: 0.25;
    }

    .bg-circle-2 {
        opacity: 0.2;
    }

    .bg-circle-3 {
        opacity: 0.15;
    }
}

/* ============================================
   子页面通用样式（友链 / 关于）
   ============================================ */

/* ---- 页面卡片（略宽） ---- */
.card-page {
    max-width: 720px;
    text-align: left;
    padding: 44px 48px 40px;
}

/* ---- 返回链接 ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 10px;
    transition: color var(--transition);
}

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

/* ---- 小号头像 ---- */
.avatar-sm {
    width: 80px;
    height: 80px;
}

/* ---- 友链列表（自适应网格） ---- */
.links-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 18px 20px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.02);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
    overflow: hidden;
    min-width: 0;
}

.link-card:hover {
    background: rgba(91, 127, 255, 0.06);
    border-color: rgba(91, 127, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.link-avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.link-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.link-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.link-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* ---- 申请友链 ---- */
.link-apply {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.link-apply p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.apply-methods {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.apply-btn {
    display: inline-block;
    padding: 8px 22px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.04);
    transition: all var(--transition);
}

.apply-btn:hover {
    color: #fff;
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(91, 127, 255, 0.35);
}

/* ---- 关于页面内容 ---- */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-section {
    /* spacing handled by gap */
}

.about-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.about-section p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ---- 技能标签 ---- */
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(91, 127, 255, 0.08);
    border-radius: 100px;
    transition: all var(--transition);
}

.skill-tag:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

/* ---- 子页面暗色模式补充 ---- */
@media (prefers-color-scheme: dark) {
    .link-card {
        background: rgba(255, 255, 255, 0.03);
    }

    .link-card:hover {
        background: rgba(123, 147, 255, 0.1);
    }

    .apply-btn {
        background: rgba(255, 255, 255, 0.06);
    }

    .skill-tag {
        background: rgba(123, 147, 255, 0.12);
    }
}

/* ---- 子页面响应式 ---- */
@media (max-width: 520px) {
    .card-page {
        padding: 32px 24px 30px;
        text-align: center;
    }

    .links-list {
        grid-template-columns: 1fr;
    }

    .link-card {
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 14px;
    }

    .about-content {
        text-align: center;
    }

    .skills-tags {
        justify-content: center;
    }
}
