/* ----------------------------------------------------------
   GLOBAL VARIABLES & DARK MODE
---------------------------------------------------------- */
:root {
    --bg-gradient-start: #f4f7ff;
    --bg-gradient-end: #e9eefc;
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-blur: blur(16px);
    --text-primary: #1e293b;
    --text-secondary: #4a5a8a;
    --navbar-bg: rgba(255, 255, 255, 0.75);
    --navbar-border: rgba(255, 255, 255, 0.6);
    --link-color: #2d3a6e;
    --link-hover: #4f46e5;
    --footer-bg: rgba(255, 255, 255, 0.5);
    --circle-base: rgba(141, 163, 253, 0.6);
    --transition: background 0.3s ease, color 0.2s ease, border-color 0.2s;
}

body.dark {
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --card-bg: rgba(15, 23, 42, 0.92);
    --card-blur: blur(16px);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --navbar-bg: rgba(15, 23, 42, 0.8);
    --navbar-border: rgba(51, 65, 85, 0.6);
    --link-color: #cbd5e1;
    --link-hover: #818cf8;
    --footer-bg: rgba(15, 23, 42, 0.6);
    --circle-base: rgba(99, 102, 241, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    transition: var(--transition);
}

/* ========= 动态圆形背景 ========= */
.circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    z-index: 0;
    pointer-events: none;
}

.circles li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: var(--circle-base);
    bottom: -150px;
    animation: animate 25s linear infinite;
    will-change: transform, opacity;
    border-radius: 6px;
    transition: background 0.2s;
}

/* 圆形独立参数 */
.circles li:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; background: rgba(141, 163, 253, 0.35); }
.circles li:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; background: rgba(110, 135, 230, 0.55); }
.circles li:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; background: rgba(200, 215, 255, 0.7); }
.circles li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; background: rgba(100, 120, 220, 0.4); }
.circles li:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; background: rgba(255, 255, 245, 0.5); }
.circles li:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; background: rgba(141, 163, 253, 0.25); }
.circles li:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; background: rgba(180, 200, 255, 0.2); }
.circles li:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; background: rgba(80, 100, 210, 0.5); }
.circles li:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; background: rgba(210, 225, 255, 0.6); }
.circles li:nth-child(10) { left: 85%; width: 140px; height: 140px; animation-delay: 0s; animation-duration: 11s; background: rgba(120, 140, 245, 0.3); }
.circles li:nth-child(11) { left: 55%; width: 45px; height: 45px; animation-delay: 8s; animation-duration: 22s; background: rgba(150, 170, 255, 0.45); }
.circles li:nth-child(12) { left: 92%; width: 35px; height: 35px; animation-delay: 5s; animation-duration: 17s; background: rgba(90, 115, 235, 0.5); }
.circles li:nth-child(13) { left: 5%; width: 55px; height: 55px; animation-delay: 1s; animation-duration: 28s; background: rgba(200, 215, 250, 0.4); }
.circles li:nth-child(14) { left: 48%; width: 18px; height: 18px; animation-delay: 12s; animation-duration: 40s; background: rgba(130, 155, 250, 0.6); }

body.dark .circles li {
    background: rgba(129, 140, 248, 0.4);
}
body.dark .circles li:nth-child(1) { background: rgba(99, 102, 241, 0.35); }
body.dark .circles li:nth-child(2) { background: rgba(129, 140, 248, 0.5); }
body.dark .circles li:nth-child(3) { background: rgba(167, 139, 250, 0.6); }
body.dark .circles li:nth-child(4) { background: rgba(139, 92, 246, 0.4); }
body.dark .circles li:nth-child(5) { background: rgba(192, 132, 252, 0.45); }
body.dark .circles li:nth-child(6) { background: rgba(99, 102, 241, 0.3); }
body.dark .circles li:nth-child(7) { background: rgba(129, 140, 248, 0.25); }
body.dark .circles li:nth-child(8) { background: rgba(167, 139, 250, 0.4); }
body.dark .circles li:nth-child(9) { background: rgba(139, 92, 246, 0.5); }
body.dark .circles li:nth-child(10) { background: rgba(99, 102, 241, 0.3); }
body.dark .circles li:nth-child(11) { background: rgba(167, 139, 250, 0.5); }
body.dark .circles li:nth-child(12) { background: rgba(129, 140, 248, 0.45); }
body.dark .circles li:nth-child(13) { background: rgba(139, 92, 246, 0.4); }
body.dark .circles li:nth-child(14) { background: rgba(99, 102, 241, 0.55); }

@keyframes animate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 8px;
    }
    100% {
        transform: translateY(-1200px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* ========= 导航栏 ========= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
    padding: 0.8rem 2rem;
    transition: var(--transition);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #2c3e9e, #6b46c0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
body.dark .logo-area {
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
}
.logo-area i {
    font-size: 1.7rem;
    background: none;
    color: #4f46e5;
}
body.dark .logo-area i {
    color: #818cf8;
}

/* 桌面端/移动端显示控制 */
.desktop-only {
    display: list-item;
}
.mobile-only {
    display: none;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;          /* 移除列表默认圆点 */
    align-items: center;
}
.nav-links li {
    list-style: none;          /* 确保每个 li 也无圆点 */
}
.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: var(--link-color);
    transition: 0.2s;
    font-size: 1rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-links a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* 图标按钮固定宽度防止移位 */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    width: 2.2rem;            /* 固定宽度 */
    padding: 0.2rem 0;
    border-radius: 40px;
    color: var(--link-color);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;           /* 防止在 flex 容器中被压缩 */
}
.icon-btn:hover {
    color: var(--link-hover);
    background: rgba(128, 128, 128, 0.1);
}

/* ========= 页面布局 ========= */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 6rem auto 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.guestbook-card {
    background: var(--card-bg);
    backdrop-filter: var(--card-blur);
    border-radius: 2rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    padding: 2rem 2rem 2.5rem;
    transition: var(--transition);
}

.guestbook-header {
    text-align: center;
    margin-bottom: 2rem;
}
.guestbook-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(145deg, #1e2a6e, #5b3b9c);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}
body.dark .guestbook-header h1 {
    background: linear-gradient(145deg, #a5b4fc, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
}
.guestbook-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    border-top: 1px dashed #cddcff;
    display: inline-block;
    padding-top: 0.5rem;
}

.giscus-container {
    width: 100%;
    margin-top: 1rem;
    min-height: 400px;
}

.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--footer-bg);
    backdrop-filter: blur(5px);
    border-radius: 40px 40px 0 0;
    width: 100%;
    margin-top: 2rem;
    transition: var(--transition);
    border-top: 1px solid var(--navbar-border);
}
.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer a {
    color: var(--link-hover);
    text-decoration: none;
    font-weight: 500;
}
.footer a:hover {
    text-decoration: underline;
}
.email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ----------------------------------------------------------
   响应式布局：移动端优化
   确保文字隐藏，按钮固定，导航无移位
---------------------------------------------------------- */
@media (max-width: 720px) {
    .navbar {
        padding: 0.4rem 1rem;
    }
    /* 隐藏桌面端按钮，显示移动端按钮 */
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: list-item;
    }
    .logo-area {
        font-size: 1.2rem;
    }
    .logo-area i {
        font-size: 1.3rem;
    }
    /* 关键修复：强制隐藏导航链接中的文字（只留图标） */
    .nav-links a {
        font-size: 0 !important;      /* 确保文字隐藏，避免英文文本出现 */
        gap: 0;
    }
    .nav-links a i {
        font-size: 1.2rem;
        margin: 0;
    }
    .nav-links {
        gap: 0.5rem;                  /* 稍微减小间距 */
    }
    /* 按钮固定宽度在移动端保持 */
    .icon-btn {
        width: 2rem;
    }
    .footer {
        padding: 0.8rem 1rem;
    }
    .footer-content {
        gap: 0.6rem;
        font-size: 0.75rem;
    }
}
