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

:root {
    --primary-neon: #00f3ff;
    --secondary-neon: #bc13fe;
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(10, 15, 30, 0.6);
    --glass-border: rgba(0, 243, 255, 0.3);
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --historical-font: 'Noto Serif SC', serif;
    --tech-font: 'IBM Plex Mono', monospace;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('历史的天空.jpg') no-repeat center center/cover;
    z-index: -2;
}

.background-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Darken background */
    backdrop-filter: blur(3px);
    z-index: -1;
}

/* Layout */
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    min-height: 100vh;
}

/* Glass Panel Style */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 0 15px var(--glass-border);
}

/* Left Panel */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Sticky sidebar on desktop */
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    /* Hide scrollbar */
    scrollbar-width: none;
}
.left-panel::-webkit-scrollbar {
    display: none;
}

/* Right Panel */
.right-panel {
    flex: 2;
}

/* Profile Section */
.profile-section {
    text-align: center;
}

.avatar-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, var(--primary-neon), var(--secondary-neon));
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #000;
}

.name {
    font-family: var(--historical-font);
    font-size: 1.8rem;
    margin-bottom: 5px;
    text-shadow: 0 0 10px var(--primary-neon);
}

.bio-short {
    font-family: var(--tech-font);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Music Player Section */
.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.player-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 15px;
    padding: 0 10px;
}

.disk-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.visualizer-container {
    position: relative;
    width: 140px; /* Reduced from 200px to fit better */
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0; /* Remove margin */
}

#visualizer-canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Limit height to bottom area */
    z-index: 0; /* Behind other elements */
    pointer-events: none; /* Click-through */
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    opacity: 0.6; /* Semi-transparent */
}

.rotating-disk {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
    border: 2px solid var(--primary-neon);
    box-shadow: 0 0 15px var(--primary-neon);
    animation: rotate 20s linear infinite;
    animation-play-state: paused; /* Start paused */
}

.disk-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.song-info {
    text-align: center; /* Center align within its own space */
    margin-bottom: 0; /* Remove margin */
    flex: 1; /* Take up available space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Center items horizontally */
}

#song-title {
    font-family: var(--historical-font);
    font-size: 1.2rem;
    color: var(--primary-neon);
    margin-bottom: 5px;
}

#volume-slider {
    width: 90px;
    appearance: none;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-neon);
    box-shadow: 0 0 8px var(--primary-neon);
    cursor: pointer;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#artist-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    z-index: 3;
    justify-content: flex-start; /* Align left */
    align-items: center; /* Align button centers on the same horizontal line */
    padding-left: 2%; /* Add some padding to not be completely on the edge */
    width: 100%;
}

.volume-inline {
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#volume-percent {
    font-family: var(--tech-font);
    font-size: 0.85rem;
    color: var(--primary-neon);
    width: 42px;
    text-align: right;
}

#volume-btn.control-btn {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

.control-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem; /* Standardize icon size */
}

.control-btn:hover {
    background: var(--primary-neon);
    color: #000;
    box-shadow: 0 0 10px var(--primary-neon);
}

.play-main {
    /* Removed custom size override */
    border-color: var(--primary-neon);
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-family: var(--tech-font);
    margin-bottom: 15px;
}

#current-time, #duration {
    font-family: var(--tech-font);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum","lnum";
    display: inline-block;
    width: 56px;
    text-align: center;
    font-weight: 700;
    line-height: 1;
}

.progress-bar-wrapper {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(0, 243, 255, 0.25);
    border-radius: 2px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-neon);
    border-radius: 2px;
    box-shadow: 0 0 5px var(--primary-neon);
    transition: width 0.1s linear;
}

.progress-knob {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary-neon);
    box-shadow: 0 0 8px var(--primary-neon);
    background: #000;
}

/* Lyrics */
.lyrics-container {
    width: 100%;
    height: 60px; /* Fixed height for single line */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5; /* Ensure above canvas */
    text-align: center;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.1);
}

.single-lyric {
    font-family: var(--tech-font);
    font-size: 1rem;
    color: var(--primary-neon);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.6); /* Small neon shadow */
    transition: all 0.3s ease;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Contact Section */
.contact-section h3 {
    font-family: var(--tech-font);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1rem;
}

.clock-section {
    display: flex;
    align-items: center;
    justify-content: center;
}
.clock-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
#clock-time {
    font-family: var(--tech-font);
    font-size: 1.3rem;
    color: var(--primary-neon);
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}
.divider {
    color: var(--glass-border);
}
#clock-date-cn {
    font-family: var(--tech-font);
    font-size: 0.95rem;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.social-link.app-link {
    color: var(--secondary-neon);
}
.social-link.app-link:hover {
    color: var(--secondary-neon);
}
.social-link.email-link {
    color: var(--primary-neon);
}
.social-link.email-link:hover {
    color: var(--primary-neon);
}

.social-link:hover {
    color: var(--primary-neon);
}

/* (restored to default Font Awesome icon for WeChat) */

/* Right Panel Content */
.intro-section h2, .section-title {
    font-family: var(--historical-font);
    color: var(--primary-neon);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden; /* 防止溢出 */
    padding: 0 10px; /* 增加内边距防止文字贴边 */
}

.intro-content p {
    margin-bottom: 6px;
    line-height: 1.4;
    text-align: center;
    font-family: var(--historical-font);
    font-size: 0.95rem; /* 缩小字体 */
    color: var(--text-main);
    letter-spacing: 1px; /* 减小字间距 */
    white-space: normal;
    max-width: 100%;
    word-wrap: break-word;
}

/* 针对小屏幕的优化 */
@media (max-width: 480px) {
    .intro-content p {
        font-size: 0.8rem; /* 进一步缩小字体 */
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }
}

.intro-section {
    padding: 12px;
}

.poem-lines {
    text-align: center;
}
.poem-lines p {
    text-align: center;
    font-family: var(--historical-font);
    letter-spacing: 1px;
    margin: 2px 0;
    line-height: 1.25;
}

.articles-section {
    margin-top: 30px;
    position: relative;
}

.article-list .article-card.glass-panel {
    margin-bottom: 12px;
}
.article-list .article-card.glass-panel:last-child {
    margin-bottom: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination .page-btn,
.pagination .page-number {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--tech-font);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.pagination .page-number.active {
    background: var(--primary-neon);
    color: #000;
    box-shadow: 0 0 10px var(--primary-neon);
    border-color: var(--primary-neon);
    transform: scale(1.02);
}

.pagination .page-btn.disabled,
.pagination .page-number.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination button:hover {
    box-shadow: 0 0 8px var(--primary-neon);
    border-color: var(--primary-neon);
    transform: translateY(-1px);
}

.article-list {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.page-indicator {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    font-family: var(--tech-font);
    color: #000;
    background: var(--primary-neon);
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 0 12px var(--primary-neon);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.page-indicator.show {
    opacity: 1;
}
.article-card {
    display: flex;
    gap: 20px;
    transition: transform 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-image {
    width: 150px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--tech-font);
    margin-bottom: 5px;
}

.article-meta .tag {
    margin-left: 10px;
    color: var(--primary-neon);
    border: 1px solid var(--primary-neon);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.article-title {
    font-family: var(--historical-font);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.article-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s;
}

.article-title a:hover {
    color: var(--primary-neon);
}

.article-content .external {
    color: var(--primary-neon);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.article-content .external:hover {
    color: var(--secondary-neon);
    text-shadow: 0 0 8px var(--secondary-neon);
}

.article-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
    }

    .left-panel {
        position: relative;
        top: 0;
        max-height: none;
        overflow-y: visible;
    }
    
    .article-card {
        flex-direction: column;
    }
    
    .article-image {
        width: 100%;
        height: 180px;
    }
}
