/* --- 核心3D名片 --- */
.card {
    position: relative;
    width: 480px;
    height: 280px;
    transform-style: preserve-3d;
    border-radius: 20px;
    cursor: default;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.card-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    pointer-events: none;
    transform-style: preserve-3d;
}

/* 真实边框高光层：根据角度变色 */
.border-layer {
    z-index: 10;
}

.border-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    /* 边框厚度 */
    background: conic-gradient(from var(--border-angle, 0deg),
            rgba(255, 255, 255, 0.1) 0%,
            var(--primary-color) 20%,
            transparent 40%,
            transparent 60%,
            var(--secondary-color) 80%,
            rgba(255, 255, 255, 0.1) 100%);
    /* 使用标准的mask复合属性，抠出中间内容区留下边框 */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    transition: background var(--transition-speed) ease-out;
}

/* 厚度模拟层 */
.thickness-layer {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    box-shadow:
        inset calc(var(--thickness-x) * 1px) calc(var(--thickness-y) * 1px) 15px rgba(255, 255, 255, 0.15),
        inset calc(var(--thickness-x) * -2px) calc(var(--thickness-y) * -2px) 20px rgba(0, 0, 0, 0.8);
    transform: translateZ(-1px);
}

/* 光栅渐变层: Hues shift */
.raster-layer {
    background: linear-gradient(125deg,
            transparent 0%,
            var(--primary-color) 30%,
            var(--secondary-color) 70%,
            transparent 100%);
    background-size: 200% 200%;
    background-position: var(--bg-x) var(--bg-y);
    mix-blend-mode: color-dodge;
    opacity: 0.15;
    z-index: 2;
}

/* 动态反光板 (Glare) */
.shine {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at var(--bg-x) var(--bg-y),
            rgba(255, 255, 255, 0.15) 0%,
            transparent 60%);
    z-index: 15;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

/* 卡片真实内容布局 */
.card-content {
    position: absolute;
    inset: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 3;
    transform: translateZ(30px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    transform: translateZ(20px);
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    /* 通过内联样式从 Django 传入头像 URL */
    background: var(--avatar-url, url('https://api.dicebear.com/7.x/avataaars/svg?seed=Felix&backgroundColor=b6e3f4')) center/cover;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.hologram-effect {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 20%, rgba(0, 229, 255, 0.4) 25%, rgba(140, 82, 255, 0.3) 30%, transparent 35%);
    background-size: 200% 200%;
    background-position: var(--bg-x) var(--bg-y);
    mix-blend-mode: color-dodge;
    transition: background-position 0.2s ease-out;
}

.name {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--primary-color), 0 2px 5px rgba(0, 0, 0, 0.8);
    position: relative;
    display: inline-block;
}

.role {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-family: 'Orbitron', 'Noto Sans SC', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.card-body {
    transform: translateZ(15px);
}

.bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-sub);
    margin-bottom: 20px;
}

.skills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.skill-tag {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.skill-tag:hover {
    border-color: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4), inset 0 0 10px rgba(0, 229, 255, 0.1);
    transform: translateY(-2px);
}

.skill-tag:hover::before {
    left: 150%;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    transform: translateZ(10px);
}

/* 响应式调整 */
@media (max-width: 600px) {
    .card {
        width: 90vw;
        height: 60vw;
    }
}