@import url('../fonts/fonts.css');

:root {
    --nav-height: 60px;
    --layout-gap: 20px;
    --page-width: 1280px;

    --font-xxs: 10px;
    --font-xs: 12px;
    --font-sm: 13px;
    --font-base: 14px;
    --font-md: 15px;
    --font-lg: 18px;
    --font-xl: 20px;
    --font-2xl: 21px;
    --font-3xl: 24px;
    --font-4xl: 32px;

    --leading-tight: 1.2;
    --leading-snug: 1.4;
    --leading-normal: 1.6;
    --leading-relaxed: 1.8;
    --leading-loose: 1.85;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-bold: 700;

    --color-text-main: #cbd5e0;
    --color-text-muted: #a0aec0;
    --color-text-secondary: rgba(255, 255, 255, .55);
    --color-link: #a0aec0;
    --color-link-hover: #f58220;
    --color-link-hover-shadow: rgba(255, 99, 71, .6);
    --color-glass-border: rgba(255, 255, 255, .08);
    --color-glass-bg: rgba(255, 255, 255, 0.01);
    --color-glass-bg-hover: rgba(255, 255, 255, 0.02);
    --color-accent-blue: #00bcd4;
    --color-accent-orange: #f58220;
    --color-accent-purple: #c4b5fd;
    --color-highlight: #d27f03;
    --color-white: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    font-family: "落霞孤鹜", "LXGW WenKai", "霞鹜文楷", "LXGW WenKai GB", sans-serif !important;
    font-size: var(--font-base);
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

.star-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.01;
    }

    50% {
        opacity: 1;
    }
}

#stars,
#stars2,
#stars3 {
    position: absolute;
    top: 0;
    left: 0;
}

#stars {
    width: 1px;
    height: 1px;
    box-shadow:
        5vw 5vh #fff, 12vw 18vh #fff, 2vw 25vh rgba(255, 255, 255, .7),
        8vw 35vh #fff, 15vw 45vh rgba(255, 255, 255, .6), 18vw 55vh #fff,
        10vw 65vh #fff, 20vw 75vh #fff, 5vw 85vh rgba(255, 255, 255, .5),
        12vw 95vh #fff, 22vw 8vh #fff, 30vw 15vh rgba(255, 255, 255, .6),
        25vw 28vh #fff, 35vw 38vh #fff, 28vw 48vh rgba(255, 255, 255, .7),
        40vw 58vh #fff, 32vw 68vh #fff, 42vw 78vh #fff,
        35vw 88vh #fff, 45vw 98vh #fff;
    animation: blink 6s infinite ease-in-out;
}

#stars2 {
    width: 2px;
    height: 2px;
    box-shadow:
        8vw 12vh #fff, 28vw 38vh #667eea,
        48vw 62vh rgba(255, 255, 255, .7), 68vw 88vh rgba(102, 126, 234, .6),
        88vw 15vh #fff, 18vw 45vh rgba(102, 126, 234, .7), 38vw 75vh #fff;
    animation: blink 10s infinite ease-in-out;
}

#stars3 {
    width: 3px;
    height: 2px;
    box-shadow:
        10vw 2vh rgba(255, 255, 255, 0.8), 25vw 5vh #667eea, 42vw 3vh rgba(255, 255, 255, 0.9), 55vw 7vh #fff, 70vw 2vh rgba(102, 126, 234, 0.8), 88vw 4vh #fff, 95vw 6vh rgba(255, 255, 255, 0.7), 18vw 1vh #fff, 63vw 4vh #667eea, 78vw 8vh #fff,
        4vw 15vh #fff, 16vw 28vh rgba(255, 255, 255, 0.7), 8vw 42vh #667eea, 22vw 50vh #fff, 13vw 68vh rgba(102, 126, 234, 0.6), 5vw 82vh #fff, 19vw 92vh rgba(255, 255, 255, 0.8),
        28vw 18vh #fff, 36vw 32vh rgba(102, 126, 234, 0.7), 48vw 40vh #fff, 32vw 58vh #fff, 44vw 72vh rgba(255, 255, 255, 0.5), 38vw 85vh #667eea, 49vw 94vh #fff,
        54vw 14vh rgba(255, 255, 255, 0.7), 67vw 22vh #fff, 59vw 36vh #667eea, 72vw 48vh rgba(102, 126, 234, 0.8), 61vw 60vh #fff, 75vw 78vh #fff, 68vw 90vh rgba(255, 255, 255, 0.6),
        82vw 16vh #fff, 94vw 26vh rgba(102, 126, 234, 0.7), 86vw 38vh #fff, 98vw 52vh #fff, 80vw 64vh rgba(255, 255, 255, 0.5), 92vw 80vh #667eea, 85vw 95vh #fff,
        3vw 30vh rgba(255, 255, 255, 0.6), 24vw 24vh #fff, 40vw 18vh rgba(102, 126, 234, 0.5), 57vw 29vh #fff, 79vw 35vh #fff, 96vw 12vh rgba(255, 255, 255, 0.7),
        11vw 55vh #667eea, 30vw 65vh rgba(255, 255, 255, 0.8), 52vw 52vh #fff, 74vw 56vh #fff, 89vw 48vh rgba(102, 126, 234, 0.6),
        15vw 76vh #fff, 34vw 80vh rgba(255, 255, 255, 0.6), 58vw 84vh #667eea, 71vw 88vh #fff, 91vw 84vh rgba(255, 255, 255, 0.7),
        50vw 66vh #fff, 66vw 15vh rgba(255, 255, 255, 0.5), 83vw 70vh #fff, 2vw 96vh #667eea, 97vw 97vh #fff;
    animation: blink 7s infinite ease-in-out;
    animation-delay: 3s;
    will-change: opacity;
}

.top-indicator-bar {
    position: relative;
    z-index: 1000;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255, 255, 255, .02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav-logo {
    color: var(--color-white);
        font-size: var(--font-lg);
        font-weight: var(--fw-bold);
        letter-spacing: 1px;
        white-space: nowrap;
        line-height: 1;
        transition: opacity 0.3s ease;
}

.nav-logo-link {
    display: inline-flex;
    align-items: center;
    height: var(--nav-height);
    /* 锁定高度与导航栏一致 */
    text-decoration: none;
    cursor: pointer;
}

.nav-logo-link:hover .nav-logo {
    opacity: 0.85;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a,
.resume-link {
    color: rgba(255, 255, 255, .7);
    font-size: var(--font-sm);
    text-decoration: none;
    transition: all .3s ease;
}

.nav-links a:hover,
.resume-link:hover {
    color: var(--color-link-hover);
    text-shadow: 0 0 8px var(--color-link-hover-shadow);
}

.main-view-wrapper {
    width: 100%;
    min-height: calc(100vh - var(--nav-height));
    position: relative;
    z-index: 10;
    padding: 40px 20px 100px 20px;
}

.article-container {
    max-width: 1000px;
    margin: 0 auto 40px auto;
    background: rgba(242, 236, 222, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 60px 80px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 940px;
    margin: 0 auto 40px auto;
}

.article-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 20px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.article-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 60%);
}

.card-title {
    font-size: var(--font-lg);
    color: #f7fafc;
    margin: 0 0 6px 0;
    line-height: var(--leading-snug);
    font-weight: bold;
}

.card-date {
    font-size: var(--font-xxs);
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-content {
    font-size: var(--font-xs);
    color: #e2e8f0;
    line-height: var(--leading-relaxed);
    display: -webkit-box;
    display: box;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    -webkit-line-clamp: 7;
    line-clamp: 7;
}

.card-content p {
    margin: 0 0 6px 0;
    white-space: pre-line;
}

.card-footer {
    margin-top: auto;
    padding-top: 10px;
    font-size: var(--font-xxs);
    color: rgba(255, 255, 255, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    font-size: var(--font-base);
    transition: color 0.3s;
}

.back-link:hover {
    color: #ff6347;
}

.music-player-shell {
    position: fixed;
    top: 78px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: auto;
    touch-action: none;
    transition: top 0.2s ease, right 0.2s ease;
}

.music-player-widget {
    position: fixed !important;
    top: 70px !important;
    right: 30px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 30px;
    border: none !important;
    box-shadow: none !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 70%, transparent 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 65%, rgba(0, 0, 0, 0.8) 85%, transparent 100%);
    user-select: none;
    cursor: grab;
    will-change: transform, top;
    transition: background 0.3s ease, opacity 0.3 ease !important;
    transform: none !important;
}

.music-player-widget.is-collapsed {
    width: 50px;
    padding: 4px;
    border-radius: 999px;
    overflow: hidden;
}

.music-player-widget.is-expanded {
    width: auto;
}

.music-player-widget.is-collapsed .music-info,
.music-player-widget.is-collapsed .music-title,
.music-player-widget.is-collapsed .music-controls {
    display: none;
}

.music-player-widget.is-collapsed .cd-cover {
    width: 42px;
    height: 42px;
    margin: 0;
}

.music-player-widget.is-dragging {
    cursor: grabbing;
}

.cd-cover {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    animation: cdRotate 10s linear infinite;
    animation-play-state: paused;
}

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

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

.music-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .65);
    font-size: var(--font-xxs);
    white-space: nowrap;
}

#progressBar {
    width: 140px;
    height: 4px;
    margin: 0;
    appearance: none;
    background: rgba(255, 255, 255, .25);
    border-radius: 10px;
    cursor: pointer;
}

#progressBar::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a7f3d0;
    cursor: pointer;
}

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

    to {
        transform: rotate(360deg);
    }
}

.music-title {
    color: #f7fafc;
    font-size: var(--font-xs);
    font-weight: bold;
}

#playBtn {
    background: transparent;
    border: none;
    color: #a7f3d0;
    font-size: var(--font-xs);
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    transition: color 0.2s;
}

#playBtn:hover {
    color: var(--color-link-hover);
}

@media (max-width: 768px) {

    html,
    body {
        overflow-y: auto;
        height: auto;
    }

    .main-view-wrapper {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .top-indicator-bar {
        view-transition-name: main-nav;
        height: auto;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .nav-links {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
        line-height: 1;
    }

    .nav-links a {
        font-size: var(--font-xs);
        display: inline-flex;
        align-items: center;
        line-height: 1;
        padding: 0;
        margin: 0;
        transform: none;
    }

    .slogan-text {
        width: 100%;
        min-height: 52px;
        display: flex;
        align-items: center;
        margin: 8px 0;
        padding: 0 15px;
        line-height: var(--leading-normal);
        font-size: var(--font-sm);
    }

    .content-container {
        width: 100%;
        padding-bottom: 90px;
    }

    .main-body {
        display: flex;
        flex-direction: column;
        max-height: none;
    }

    .sidebar {
        order: -1;
        width: 100%;
        height: auto;
    }

    .left-sidebar,
    .article-block {
        width: 100%;
        height: auto;
    }

    .article-block {
        overflow: visible;
    }

    .article-block .sub-card {
        flex: none;
        height: auto;
        overflow: visible;
    }

    .whisper-card {
        min-height: auto;
    }

    .whisper-stream {
        max-height: 240px;
        overflow-y: auto;
    }

    .music-player-shell {
        view-transition-name: music-player;
        top: calc(var(--nav-height) + 16px) !important;
        right: -6px !important;
    }

    .music-player-shell.is-collapsed {
        right: -8px !important;
    }

    .music-player-widget {
        padding: 5px 10px;
        gap: 6px;
        background: rgba(15, 20, 30, 0.72) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .music-player-widget .music-progress {
        gap: 4px;
        font-size: var(--font-xxs);
    }

    .music-player-widget #progressBar {
        width: 90px;
    }

    .music-player-widget.is-collapsed {
        width: 46px;
        padding: 4px;
    }

    .music-player-widget .cd-cover {
        width: 26px;
        height: 26px;
    }

    .music-player-widget .music-title {
        font-size: var(--font-xs);
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .music-player-widget #playBtn {
        font-size: var(--font-xs);
    }
}

.mouse-star {
    position: fixed;
    pointer-events: none;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
    z-index: 9999;
    animation: star-fade 0.8s forwards ease-out;
    will-change: transform, opacity;
}

@keyframes star-fade {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1) rotate(90deg);
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }

    100% {
        transform: translate(-50%, -50%) scale(0.2) rotate(180deg);
        opacity: 0;
    }
}