/* ========================================
   AstroPort - 个人星球博客 样式表
   Design Tokens & Base
   ======================================== */

:root {
    /* 主色调 */
    --bg-deep: #0a0a1a;
    --bg-surface: #12122a;
    --bg-card: rgba(20, 20, 50, 0.85);
    --accent-cyan: #00d4ff;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-green: #22d3ee;
    --accent-orange: #f97316;
    --accent-blue: #3b82f6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(100, 116, 139, 0.2);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.15);

    /* 尺寸 */
    --avatar-size: 120px;
    --orbit-radius: 180px;
    --planet-size: 50px;

    /* 动画 */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

/* ========================================
   Starfield Canvas
   ======================================== */

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========================================
   Main Container
   ======================================== */

.main-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

/* ========================================
   Orbit & Avatar Section
   ======================================== */

.avatar-orbit {
    position: relative;
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 轨道环 */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(100, 200, 255, 0.08);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.orbit-ring-1 {
    width: 200px;
    height: 200px;
    animation: orbitSpin 20s linear infinite;
}

.orbit-ring-2 {
    width: 300px;
    height: 300px;
    animation: orbitSpin 30s linear infinite reverse;
    border-style: dashed;
    border-color: rgba(168, 85, 247, 0.1);
}

.orbit-ring-3 {
    width: 380px;
    height: 380px;
    animation: orbitSpin 40s linear infinite;
    border-color: rgba(236, 72, 153, 0.06);
}

@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* SVG头像 */
.avatar-wrapper {
    position: relative;
    z-index: 10;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out-expo), filter 0.4s var(--ease-out-expo);
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
}

.avatar-wrapper:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 35px rgba(0, 212, 255, 0.7));
}

.avatar-svg {
    width: 100%;
    height: 100%;
}

/* 脉冲光环 */
.avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    opacity: 0;
    animation: avatarPulse 3s ease-out infinite;
    pointer-events: none;
}

@keyframes avatarPulse {
    0%   { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* ========================================
   Planets
   ======================================== */

.planet {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--planet-size);
    height: var(--planet-size);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out-expo);
    z-index: 5;
}

.planet:hover {
    transform: scale(1.2);
    z-index: 15;
}

.planet:hover .planet-label {
    opacity: 1;
    transform: translateY(0);
}

.planet-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.planet:hover .planet-body {
    box-shadow: 0 0 25px currentColor;
}

/* 星球颜色主题 */
.p-about {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #3b82f6;
}

.p-skills {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #a855f7;
}

.p-projects {
    background: linear-gradient(135deg, #22d3ee, #0891b2);
    color: #22d3ee;
}

.p-timeline {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #f97316;
}

.p-contact {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #ec4899;
}

.p-blog {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #10b981;
}

/* 星球纹理 - 环形山 */
.planet-crater {
    position: absolute;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    top: 25%;
    left: 20%;
}

.crater-sm {
    width: 18%;
    height: 18%;
    top: 55%;
    left: 50%;
}

.crater-xs {
    width: 10%;
    height: 10%;
    top: 40%;
    left: 60%;
}

/* 星球光环（土星环） */
.planet-ring {
    position: absolute;
    width: 140%;
    height: 20%;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    top: 40%;
    left: -20%;
    transform: rotateX(75deg);
}

/* 星球标签 */
.planet-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s var(--ease-out-expo);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 星球位置 - 六星环绕布局 */
.planet-1 { transform: translate(-50%, -50%) rotate(0deg)   translateY(calc(var(--orbit-radius) * -0.8)); }
.planet-2 { transform: translate(-50%, -50%) rotate(60deg)  translateY(calc(var(--orbit-radius) * -0.8)); }
.planet-3 { transform: translate(-50%, -50%) rotate(120deg) translateY(calc(var(--orbit-radius) * -0.8)); }
.planet-4 { transform: translate(-50%, -50%) rotate(180deg) translateY(calc(var(--orbit-radius) * -0.8)); }
.planet-5 { transform: translate(-50%, -50%) rotate(240deg) translateY(calc(var(--orbit-radius) * -0.8)); }
.planet-6 { transform: translate(-50%, -50%) rotate(300deg) translateY(calc(var(--orbit-radius) * -0.8)); }

.planet-1:hover { transform: translate(-50%, -50%) rotate(0deg)   translateY(calc(var(--orbit-radius) * -0.8)) scale(1.2); }
.planet-2:hover { transform: translate(-50%, -50%) rotate(60deg)  translateY(calc(var(--orbit-radius) * -0.8)) scale(1.2); }
.planet-3:hover { transform: translate(-50%, -50%) rotate(120deg) translateY(calc(var(--orbit-radius) * -0.8)) scale(1.2); }
.planet-4:hover { transform: translate(-50%, -50%) rotate(180deg) translateY(calc(var(--orbit-radius) * -0.8)) scale(1.2); }
.planet-5:hover { transform: translate(-50%, -50%) rotate(240deg) translateY(calc(var(--orbit-radius) * -0.8)) scale(1.2); }
.planet-6:hover { transform: translate(-50%, -50%) rotate(300deg) translateY(calc(var(--orbit-radius) * -0.8)) scale(1.2); }

/* ========================================
   Site Title
   ======================================== */

.site-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.title-greeting {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.title-name {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.3); }
}

.title-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ========================================
   Social Links
   ======================================== */

.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s var(--ease-out-expo);
    text-decoration: none;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.social-icon:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

/* ========================================
   Content Panel (Overlay)
   ======================================== */

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-out-expo);
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.content-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: min(520px, 90vw);
    max-height: 75vh;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-spring);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), var(--shadow-glow);
}

.content-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: rgba(0,0,0,0.3);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

.panel-close:hover {
    color: var(--text-primary);
    border-color: var(--accent-pink);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

.panel-content {
    padding: 2.5rem 2rem 2rem;
    overflow-y: auto;
    max-height: 70vh;
}

/* 滚动条 */
.panel-content::-webkit-scrollbar {
    width: 4px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

/* ========================================
   Panel Content Styles
   ======================================== */

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-body {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.panel-body p {
    margin-bottom: 1rem;
}

/* 时间线样式 */
.timeline-list {
    list-style: none;
    padding: 0;
}

.timeline-item {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid var(--border-subtle);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 技能标签 */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    transform: translateY(-1px);
}

.skill-tag.cyan   { color: var(--accent-cyan);   border-color: rgba(0, 212, 255, 0.3);   background: rgba(0, 212, 255, 0.08); }
.skill-tag.purple { color: var(--accent-purple); border-color: rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.08); }
.skill-tag.pink   { color: var(--accent-pink);   border-color: rgba(236, 72, 153, 0.3);  background: rgba(236, 72, 153, 0.08); }
.skill-tag.green  { color: var(--accent-green);  border-color: rgba(34, 211, 238, 0.3);  background: rgba(34, 211, 238, 0.08); }
.skill-tag.orange { color: var(--accent-orange); border-color: rgba(249, 115, 22, 0.3);  background: rgba(249, 115, 22, 0.08); }

/* 项目卡片 */
.project-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.project-card h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.project-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.project-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    :root {
        --orbit-radius: 140px;
        --planet-size: 40px;
        --avatar-size: 100px;
    }

    .avatar-orbit {
        width: 340px;
        height: 340px;
    }

    .orbit-ring-1 { width: 160px; height: 160px; }
    .orbit-ring-2 { width: 250px; height: 250px; }
    .orbit-ring-3 { width: 320px; height: 320px; }

    .title-name {
        font-size: 2rem;
    }

    .content-panel {
        width: 90vw;
        max-height: 80vh;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --orbit-radius: 110px;
        --planet-size: 32px;
        --avatar-size: 80px;
    }

    .avatar-orbit {
        width: 260px;
        height: 260px;
    }

    .orbit-ring-1 { width: 120px; height: 120px; }
    .orbit-ring-2 { width: 190px; height: 190px; }
    .orbit-ring-3 { width: 250px; height: 250px; }

    .title-name {
        font-size: 1.6rem;
    }

    .title-sub {
        font-size: 0.75rem;
    }

    .planet-label {
        display: none;
    }

    .panel-content {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .social-icon {
        width: 36px;
        height: 36px;
    }

    .social-icon svg {
        width: 18px;
        height: 18px;
    }
}
