:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e8e8e8;
    --text-secondary: #94a3b8;
    --accent-cyan: #00d9ff;
    --accent-blue: #5c9aff;
    --accent-purple: #a78bfa;
    --border-color: #2d3748;
    --chemical-green: #4ade80;
    --chemical-yellow: #facc15;
}

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

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(0, 217, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(167, 139, 250, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(92, 154, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: chemicalGlow 20s ease-in-out infinite;
}

@keyframes chemicalGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

/* 分子结构背景 */
.molecular-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.molecule {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0.15;
    animation: floatMolecule 25s linear infinite;
}

@keyframes floatMolecule {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(-20px, 40px) rotate(180deg);
    }
    75% {
        transform: translate(40px, 20px) rotate(270deg);
    }
}

.molecule .atom {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    transform: translate(-50%, -50%);
}

.molecule .bond {
    position: absolute;
    height: 2px;
    background: var(--accent-blue);
    transform-origin: left center;
    /* Bond styles for connecting atoms */
}

/* 电子轨道 */
.electron-orbit {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    pointer-events: none;
    z-index: 0;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(0, 217, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: rotateOrbit 15s linear infinite;
}

.orbit:nth-child(1) { width: 100px; height: 100px; }
.orbit:nth-child(2) { width: 180px; height: 180px; border-color: rgba(92, 154, 255, 0.12); }
.orbit:nth-child(3) { width: 260px; height: 260px; border-color: rgba(167, 139, 250, 0.1); }
.orbit:nth-child(4) { width: 340px; height: 340px; }
.orbit:nth-child(5) { width: 420px; height: 420px; border-color: rgba(0, 217, 255, 0.08); }
.orbit:nth-child(6) { width: 500px; height: 500px; }

@keyframes rotateOrbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 元素周期表装饰 */
.periodic-table-decor {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.element-box {
    background: rgba(22, 33, 62, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.element-box:hover {
    border-color: var(--accent-cyan);
    background: rgba(22, 33, 62, 0.95);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.2);
}

.element-number {
    font-size: 0.65rem;
    line-height: 1.2;
    color: var(--text-secondary);
    opacity: 0.6;
}

.element-symbol {
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--accent-cyan);
    margin: 3px 0;
}

.element-name {
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--text-secondary);
}

/* 主内容区域 */
.content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

/* 标题 */
.title {
    margin-bottom: 1rem;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.qiyun-name {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

.chemical-bond {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    letter-spacing: 8px;
    text-shadow: 0 0 10px var(--accent-cyan);
}

.fan-name {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 3px;
}

.nickname-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(167, 139, 250, 0.1));
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
}

.nickname-badge:hover {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
    transform: scale(1.05);
}

/* 化学式分隔线 */
.chemical-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 1.5rem auto;
    width: fit-content;
}

.chemical-divider .atom {
    width: 10px;
    height: 10px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: atomPulse 2s ease-in-out infinite;
}

.chemical-divider .atom:nth-child(1) { animation-delay: 0s; }
.chemical-divider .atom:nth-child(3) { animation-delay: 0.5s; }
.chemical-divider .atom:nth-child(5) { animation-delay: 1s; }

@keyframes atomPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 8px var(--accent-cyan);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 15px var(--accent-cyan);
    }
}

.chemical-divider .bond {
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
}

/* 烧瓶容器 */
.avatar-wrapper {
    margin: 2rem auto 1.5rem;
}

.flask-container {
    position: relative;
    width: 240px;
    height: 260px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.flask-container:hover {
    transform: translateY(-5px);
}

.flask-neck {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 60px;
    border-left: 2px solid var(--accent-cyan);
    border-right: 2px solid var(--accent-cyan);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 25px 25px 0 0;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
    transition: all 0.3s ease;
}

.flask-container:hover .flask-neck {
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.5);
}

.flask-body {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 170px;
    background: linear-gradient(180deg, rgba(22, 33, 62, 0.6), rgba(13, 13, 26, 0.8));
    border: 2px solid var(--accent-cyan);
    border-radius: 0 0 60px 60px;
    box-shadow: 
        0 0 30px rgba(0, 217, 255, 0.2),
        inset 0 0 30px rgba(0, 217, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.flask-container:hover .flask-body {
    box-shadow: 
        0 0 40px rgba(0, 217, 255, 0.3),
        inset 0 0 40px rgba(0, 217, 255, 0.15);
}

.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(180deg, rgba(0, 217, 255, 0.4), rgba(92, 154, 255, 0.3));
    animation: liquidWave 3s ease-in-out infinite;
}

@keyframes liquidWave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.05); }
}

.bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    overflow: hidden;
}

.bubbles::before,
.bubbles::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: bubbleRise 4s ease-in-out infinite;
}

.bubbles::before {
    left: 30%;
    animation-delay: 0s;
}

.bubbles::after {
    left: 70%;
    animation-delay: 1.5s;
}

@keyframes bubbleRise {
    0% { transform: translateY(0) scale(1); opacity: 0.8; }
    100% { transform: translateY(-70px) scale(0.5); opacity: 0; }
}

.avatars {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
}

.plus-sign {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--accent-cyan);
    font-weight: 300;
    text-shadow: 0 0 10px var(--accent-cyan);
}

/* 化学信息卡片 */
.chemical-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem auto;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.1), rgba(167, 139, 250, 0.1));
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.chemical-card:hover .card-header {
    background: linear-gradient(90deg, rgba(0, 217, 255, 0.15), rgba(167, 139, 250, 0.15));
}

.beaker-icon {
    font-size: 1.2rem;
    color: var(--accent-cyan);
}

.card-title {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.card-content {
    padding: 1.2rem;
}

.quote-row {
    position: relative;
    padding: 1.1rem 1rem 1.1rem 1.3rem;
    margin-bottom: 0.9rem;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 8px;
    border-left: 3px solid var(--border-color);
    transition: all 0.3s ease;
}

.quote-row:hover {
    background: rgba(26, 26, 46, 0.8);
    border-left-color: var(--accent-cyan);
    transform: translateX(4px);
}

.quote-row.highlight {
    border-left-color: var(--accent-purple);
}

.quote-row.highlight:hover {
    border-left-color: var(--chemical-yellow);
}

.quote-tag {
    position: absolute;
    top: 0.4rem;
    left: 0.6rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.5;
    letter-spacing: 1px;
}

.quote-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 0.8rem;
}

.quote-text .emoji {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin: 0 2px;
    display: inline-block;
}

/* 元素信息 */
.element-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1.1rem;
    background: rgba(22, 33, 62, 0.3);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.element-info:hover {
    border-color: rgba(0, 217, 255, 0.2);
    background: rgba(22, 33, 62, 0.4);
}

.element-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.element-stat:hover {
    transform: scale(1.1);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    font-weight: 500;
    transition: all 0.3s ease;
}

.element-stat:hover .stat-value {
    text-shadow: 0 0 10px var(--accent-cyan);
}

/* 返回链接 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 2rem;
    padding: 0.6rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    transition: all 0.3s;
}

.back-link:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.arrow {
    font-size: 1.1rem;
}

/* 点赞按钮 */
.like-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
}

.like-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--bg-primary);
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.4);
    transition: all 0.3s;
}

.atom-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.atom-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--bg-primary);
    border-radius: 50%;
}

.atom-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    animation: atomRotate 3s linear infinite;
}

@keyframes atomRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.like-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 217, 255, 0.6);
}

.like-btn:active {
    transform: scale(0.95);
}

.like-btn.liked {
    animation: likePulse 0.3s;
}

@keyframes likePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.like-count {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 0.5rem 0.9rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .periodic-table-decor {
        top: 10px;
        right: 10px;
        gap: 5px;
    }
    
    .element-box {
        min-width: 40px;
        padding: 6px 8px;
    }
    
    .element-symbol {
        font-size: 1rem;
    }
    
    .electron-orbit {
        width: 400px;
        height: 400px;
    }
    
    .orbit:nth-child(6) {
        width: 350px;
        height: 350px;
    }
    
    .qiyun-name,
    .fan-name {
        font-size: 1.2rem;
    }
    
    .chemical-bond {
        font-size: 1.2rem;
    }
    
    .element-info {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .like-wrapper {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 0.8rem;
    }
    
    .title-row {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .chemical-bond {
        letter-spacing: 4px;
    }
    
    .flask-container {
        width: 200px;
        height: 220px;
    }
    
    .flask-neck {
        width: 45px;
        height: 50px;
    }
    
    .flask-body {
        top: 48px;
        width: 130px;
        height: 140px;
    }
    
    .avatar {
        width: 50px;
        height: 50px;
    }
    
    .element-info {
        flex-wrap: wrap;
        gap: 1rem;
    }
}
