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

html, body {
    width: 100%;
    min-height: 100vh;
    position: relative;
    transition: all 0.8s ease;
    scroll-behavior: smooth; /* 平滑滚动到顶部 */
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background-color: #fdfaf6;
    background-image: radial-gradient(rgba(212, 168, 168, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    color: #6d5b5b;
    line-height: 1.8;
    overflow-x: hidden;
    opacity: 0;
    animation: pageFadeIn 1.5s ease-in-out forwards;
    padding-bottom: 120px;
}

body.dark {
    background: transparent;
    color: #e2e8f0;
}

/* 星空背景 - 最底层 */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #070714;
    z-index: -9999;
    opacity: 0;
    transition: opacity 1s ease;
}

body.dark .stars-bg {
    opacity: 1;
}

/* 星星 + 光晕发光 */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2.5s infinite alternate;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 16px rgba(180, 140, 255, 0.4);
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(212, 168, 168, 0.15), transparent 60%);
    pointer-events: none;
    z-index: -2;
    opacity: 1;
    transition: all 0.8s ease;
}

body.dark::before {
    background: radial-gradient(circle at 50% 20%, rgba(180, 120, 255, 0.2), transparent 75%);
}

.light-float {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -2;
}

.light {
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(212, 168, 168, 0.18), transparent 70%);
    animation: lightMove 25s infinite alternate ease-in-out;
    filter: blur(40px);
}

body.dark .light {
    background: radial-gradient(circle, rgba(180, 140, 255, 0.15), transparent 70%);
}

.light.l1 {
    top: 10%;
    left: -100px;
}

.light.l2 {
    top: 40%;
    right: -150px;
    animation-delay: 7s;
}

.light.l3 {
    top: 70%;
    left: 100px;
    animation-delay: 13s;
}

@keyframes lightMove {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(60px, -60px) scale(1.2);
    }
}

.float-decor {
    position: fixed;
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.float-item {
    position: absolute;
    opacity: 0.5;
    animation: floatDrift 6s linear infinite;
    filter: drop-shadow(0 0 8px currentColor);
}

body.dark .float-item {
    opacity: 0.7;
    filter: drop-shadow(0 0 12px currentColor);
}

@keyframes floatDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translate(60px, 900px) rotate(1080deg);
        opacity: 0;
    }
}

.dark-toggle {
    position: fixed;
    bottom: 150px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #d4a8a8;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 0 20px rgba(212, 168, 168, 0.4);
    transition: all 0.5s ease;
}

body.dark .dark-toggle {
    background: #7c3aed;
    box-shadow: 0 0 35px rgba(124, 58, 237, 0.7);
}

.dark-toggle:hover {
    transform: scale(1.1) rotate(30deg);
}

/* 直达顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #d4a8a8;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 0 20px rgba(212, 168, 168, 0.4);
    transition: all 0.5s ease;
    opacity: 0;
    visibility: hidden;
}

body.dark .back-to-top {
    background: #7c3aed;
    box-shadow: 0 0 35px rgba(124, 58, 237, 0.7);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: scale(1.1) rotate(180deg);
}

.loading-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #fdfaf6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

body.dark .loading-wrapper {
    background: #070714;
}

.loading-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-text {
    font-size: 18px;
    background: linear-gradient(90deg, #d4a8a8, #b88888);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(212, 168, 168, 0.3));
    margin-bottom: 20px;
}

body.dark .loading-text {
    background: linear-gradient(90deg, #c4b5fd, #a78bfa);
}

.loading-petal {
    width: 20px;
    height: 20px;
    border-radius: 50% 0;
    background: rgba(212, 168, 168, 0.4);
    transform: rotate(45deg);
    animation: petalLoad 3s linear infinite;
    filter: drop-shadow(0 0 8px rgba(212, 168, 168, 0.4));
}

body.dark .loading-petal {
    background: rgba(168, 130, 255, 0.5);
}

@keyframes petalLoad {
    0% {
        transform: rotate(45deg) translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: rotate(65deg) translateY(-15px);
        opacity: 1;
    }
    100% {
        transform: rotate(45deg) translateY(0);
        opacity: 0.5;
    }
}

/* 加载更多提示样式 */
.load-more {
    text-align: center;
    padding: 30px 0;
    color: #a89696;
    font-size: 14px;
    display: none;
}

body.dark .load-more {
    color: #d1c4e9;
}

.load-more.show {
    display: block;
}

.load-more .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(212, 168, 168, 0.3);
    border-radius: 50%;
    border-top-color: #d4a8a8;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

body.dark .load-more .spinner {
    border: 2px solid rgba(124, 58, 237, 0.3);
    border-top-color: #7c3aed;
}

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

.nav {
    width: 95%;
    max-width: 1200px;
    padding: 0 3%;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    border-radius: 60px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #d4a8a8, #f3e0e0, #d4a8a8);
    border-radius: 62px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.dark .nav::after {
    background: linear-gradient(135deg, #7c3aed, #c4b5fd, #7c3aed);
}

.nav:hover::after {
    opacity: 1;
}

.nav.scroll {
    width: 85%;
    max-width: 800px;
    top: 15px;
    box-shadow: 0 10px 40px rgba(212, 168, 168, 0.18), 0 0 35px rgba(212, 168, 168, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.dark .nav.scroll {
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.4), 0 0 45px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 15px rgba(212, 168, 168, 0.3);
}

body.dark .nav-avatar {
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.6);
}

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

.logo {
    font-size: 22px;
    background: linear-gradient(90deg, #d4a8a8, #b88888);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-style: italic;
    filter: drop-shadow(0 0 8px rgba(212, 168, 168, 0.3));
}

.nav-menu a {
    margin-left: 30px;
    text-decoration: none;
    color: #8a7a7a;
    transition: all 0.4s;
    font-size: 14px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

body.dark .nav-menu a {
    color: #cbd5e1;
}

.nav-menu a:hover {
    color: #d4a8a8;
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(212, 168, 168, 0.4));
}

body.dark .nav-menu a:hover {
    color: #c4b5fd;
    filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.6));
}

.header {
    height: 25vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 5%;
    text-align: center;
}

.header h1, .header p {
    display: none;
}

.header-desc {
    margin-top: 0;
    font-size: 13px;
    color: #b8a8a8;
    font-style: italic;
}

body.dark .header-desc {
    color: #d1c4e9;
    text-shadow: 0 0 10px rgba(180, 140, 255, 0.4);
}

/* ========== 核心修改：Grid 布局实现自动换行的左右卡片 ========== */
.notes-container {
    width: 70%;
    max-width: 1400px;
    margin: 0 auto;
    /* 核心：Grid 布局 - 2列，自动换行 */
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 固定2列 */
    gap: 40px 2%; /* 行间距40px，列间距2% */
    padding-bottom: 60px;
    position: relative;
    z-index: 1;
}

/* 单个卡片样式（保留原有独立结构） */
.note-card {
    position: relative;
    width: 100%;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07), 0 0 30px rgba(212, 168, 168, 0.15);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    overflow: hidden;
    z-index: 10;
    opacity: 0;
    transform: translateY(60px) scale(0.9);
}

/* 给奇数卡片加轻微左旋转，偶数卡片加轻微右旋转（保留原有视觉效果） */
.note-card:nth-child(odd) {
    transform: translateY(60px) scale(0.9) rotate(-1deg);
}
.note-card:nth-child(even) {
    transform: translateY(60px) scale(0.9) rotate(1deg);
}

/* 显示动画 */
.note-card.show {
    opacity: 1;
    transform: translateY(0) scale(1) !important;
}
.note-card:nth-child(odd).show {
    transform: translateY(0) scale(1) rotate(-1deg) !important;
}
.note-card:nth-child(even).show {
    transform: translateY(0) scale(1) rotate(1deg) !important;
}

/* 黑夜模式卡片样式 */
body.dark .note-card {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(124, 58, 237, 0.25),
    0 0 60px rgba(180, 140, 255, 0.15);
}

/* 日期头部区域 */
.card-date-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.date-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.date-day {
    font-size: 36px;
    font-weight: 700;
    color: #6d5b5b;
    line-height: 1;
}

body.dark .date-day {
    color: #e2e8f0;
}

.date-month {
    font-size: 14px;
    color: #a89696;
}

body.dark .date-month {
    color: #d1c4e9;
}

.day-count {
    font-size: 12px;
    color: #b8a8a8;
}

body.dark .day-count {
    color: #a5b4fc;
}

/* 状态标签区域 */
.card-status {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap; /* 防止标签溢出 */
}

.status-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #a89696;
}

body.dark .status-tag {
    color: #c4b5fd;
}

.status-tag i {
    font-size: 9px;
}

/* 内容区域 */
.card-content {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.content-title {
    font-size: 18px;
    font-weight: 600;
    color: #6d5b5b;
    margin-bottom: 6px;
}

body.dark .content-title {
    color: #f8fafc;
}

.content-desc {
    font-size: 13px;
    color: #a89696;
    line-height: 1.6;
}

body.dark .content-desc {
    color: #d1c4e9;
}

/* 底部信息区域 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 168, 168, 0.15);
    position: relative;
    z-index: 2;
}

body.dark .card-footer {
    border-top: 1px solid rgba(180, 140, 255, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(212, 168, 168, 0.3);
}

body.dark .card-avatar {
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.6);
}

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

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #6d5b5b;
}

body.dark .user-name {
    color: #e2e8f0;
}

.user-location {
    font-size: 9px;
    color: #a89696;
}

body.dark .user-location {
    color: #a5b4fc;
}

.card-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #a89696;
    transition: all 0.3s ease;
}

body.dark .stat-item {
    color: #c4b5fd;
}

.stat-item i {
    font-size: 9px;
}

/* 装饰图标 */
.note-card.cat1::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: -10px;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.12;
    z-index: 0;
    /*background-image: url('https://cdn-icons-png.flaticon.com/512/8471/8472651.png');*/
    transition: all 0.5s ease;
}
.note-card.cat2::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: -10px;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.12;
    z-index: 0;
    /*background-image: url('https://cdn-icons-png.flaticon.com/512/4140/4140048.png');*/
    transition: all 0.5s ease;
}

body.dark .note-card.cat1::after,
body.dark .note-card.cat2::after {
    opacity: 0.25;
    filter: brightness(1.7);
}

/* 卡片背景色 */
.c1 { background: rgba(212, 168, 168, 0.05); }
.c2 { background: rgba(150, 180, 210, 0.05); }
.c3 { background: rgba(180, 190, 150, 0.05); }
.c4 { background: rgba(220, 170, 140, 0.05); }

/* ========== 增强的鼠标悬浮特效（仅调整此处，其他全不变） ========== */


/* 响应式：手机端改为单列 */
@media (max-width: 768px) {
    .notes-container {
        grid-template-columns: 1fr; /* 手机端1列 */
        gap: 30px;
    }
    .note-card {
        width: 90%;
        margin: 0 auto;
    }
    .back-to-top, .dark-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

.footer {
    width: 100%;
    text-align: center;
    padding: 30px 20px;
    color: #b8a8a8;
    font-size: 14px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    margin-top: 40px;
}

body.dark .footer {
    color: #b4a8e0;
    text-shadow: 0 0 10px rgba(180, 140, 255, 0.3);
}

/* 点赞动画 */
@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

.heart-beat {
    animation: heartBeat 0.6s ease-in-out;
}


/* ========== 修复后：鼠标悬浮特效（100%生效） ========== */
/* 针对奇数卡片的悬浮（保留旋转，叠加放大上浮） */
.note-card:nth-child(odd).show:hover {
    transform: translateY(-8px) scale(1.08) rotate(-1deg) !important;
    box-shadow: 0 25px 50px rgba(212, 168, 168, 0.3), 0 0 50px rgba(212, 168, 168, 0.2);
    border-color: rgba(212, 168, 168, 0.7);
    z-index: 99 !important;
}
/* 针对偶数卡片的悬浮（保留旋转，叠加放大上浮） */
.note-card:nth-child(even).show:hover {
    transform: translateY(-8px) scale(1.08) rotate(1deg) !important;
    box-shadow: 0 25px 50px rgba(212, 168, 168, 0.3), 0 0 50px rgba(212, 168, 168, 0.2);
    border-color: rgba(212, 168, 168, 0.7);
    z-index: 99 !important;
}

/* 悬浮时装饰图标放大+变亮 */
.note-card:hover::after {
    opacity: 0.3 !important;
    transform: scale(1.3);
}

/* 悬浮时文字发光效果（增强） */
.note-card:hover .content-title {
    text-shadow: 0 0 15px rgba(212, 168, 168, 0.5);
}

/* 黑夜模式下的悬浮（对应奇偶卡片） */
body.dark .note-card:nth-child(odd).show:hover {
    box-shadow: 0 25px 55px rgba(124, 58, 237, 0.6),
    0 0 80px rgba(180, 140, 255, 0.5),
    0 0 110px rgba(200, 160, 255, 0.3) !important;
    border-color: rgba(200, 160, 255, 0.7);
}
body.dark .note-card:nth-child(even).show:hover {
    box-shadow: 0 25px 55px rgba(124, 58, 237, 0.6),
    0 0 80px rgba(180, 140, 255, 0.5),
    0 0 110px rgba(200, 160, 255, 0.3) !important;
    border-color: rgba(200, 160, 255, 0.7);
}

body.dark .note-card:hover .content-title {
    text-shadow: 0 0 20px rgba(180, 140, 255, 0.7);
}

/* 点赞按钮悬浮效果（放大比例微调） */
.stat-item:hover {
    transform: scale(1.25);
    color: #d4a8a8;
}

body.dark .stat-item:hover {
    color: #c4b5fd;
}
