* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------------------------------- */
/* 🎨 主题与配色系统                 */
/* ---------------------------------- */

/* 亮色主题 (默认) */
:root {
    --bg-gradient-start: #fff9f0;
    --bg-gradient-end: #ffe6d5;
    --text-primary: #2D2A24;
    --text-secondary: #5B5348;
    --text-light: #7A7062;
    --accent-orange: #FF8A5C;
    --accent-coral: #FF6B6B;
    --accent-mango: #F9C74F;
    --shadow-sm: 0 12px 28px rgba(0,0,0,0.05);
    --shadow-hover: 0 24px 40px rgba(0,0,0,0.12);
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(255, 188, 128, 0.3);
    --input-bg: rgba(0, 0, 0, 0.03); /* ✅ 亮色模式保持原样 */
    --input-text: #2D2A24; /* 🟢 新增：输入框文字颜色 */
    --placeholder-color: #9E9589;
    /* 🟢 新增：亮色模式下链接使用原本的橙色 */
    --modal-link-color: var(--accent-orange); 
}

/* 深色主题 */
[data-theme="dark"] {
    --bg-gradient-start: #1F1B17;
    --bg-gradient-end: #2A241E;
    --text-primary: #F2E8DD;
    --text-secondary: #CFC4B6;
    --text-light: #B0A294;
    --accent-orange: #FF9F7A;
    --accent-coral: #FF8686;
    --accent-mango: #FCD36A;
    --shadow-sm: 0 12px 28px rgba(0,0,0,0.4);
    --shadow-hover: 0 24px 40px rgba(0,0,0,0.6);
    --card-bg: rgba(35, 30, 26, 0.85);
    --border-glass: rgba(255, 188, 128, 0.15);
    --input-bg: #EBE1CA; /* 🟢 修改：明亮的羊皮纸米黄色 */
    --input-text: #2D2A24; /* 🟢 新增：米黄背景必须配深色文字才清晰 */
    --placeholder-color: #8C7A61; /* 🟢 修改：深棕灰色提示文字 */
    /* 🟢 新增：夜晚模式下，将链接切换为高亮、高对比度的浅金黄色或象牙白 */
    --modal-link-color: #FFB088; /* 如果觉得还不够亮，可以直接改成 #FFE6D5 */
}

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* 全局背景微粒画布 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---------------------------------- */
/* 🛠️ 工具栏 (同排两端对齐，互不紧挨)      */
/* ---------------------------------- */
.toolbar {
    position: fixed;
    top: 24px;
    left: 24px;   /* 🟢 铺满左侧限制 */
    right: 24px;  /* 🟢 铺满右侧限制 */
    z-index: 100;
    display: flex;
    justify-content: space-between; /* 🟢 核心修改：让两组元素分别贴紧左右两侧，中间留空 */
    align-items: center;
    pointer-events: none; /* 防止通栏隐形层挡住下方点击，子元素需开启 pointer-events */
}

/* 左侧控制组内部并排 */
.toolbar .left-controls {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

#auth-toolbar-box {
    pointer-events: auto;
}

/* 按钮与状态标签的基础样式 */
.toolbar button, .user-welcome-tag {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

/* 欢迎状态标签微调 */
.user-welcome-tag {
    cursor: default;
    font-weight: 600;
    border-color: var(--accent-orange);
}
.user-welcome-tag .uid-text {
    color: var(--accent-orange);
}

.toolbar button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.toolbar button span {
    font-size: 0.85rem;
    display: inline-block;
}

/* ---------------------------------- */
/* 📱 移动端自适应响应式（更新后）      */
/* ---------------------------------- */
@media (max-width: 768px) {
    .toolbar {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .toolbar .left-controls {
        gap: 6px;
    }

    /* 缩小移动端按钮间距和字体，确保极小屏幕也能在一排装下两端 */
    .toolbar button, .user-welcome-tag {
        padding: 6px 10px !important;
        font-size: 0.9rem !important; 
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--bg-gradient-start) !important;
    }
    
    .toolbar button span, .user-welcome-tag span {
        font-size: 0.75rem !important;
    }
}

/* ---------------------------------- */
/* 📦 主容器与布局                    */
/* ---------------------------------- */
.container {
    width: 100%;
    max-width: 1100px;
    padding: 20px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* 🎨 Logo动画承载区域布局 */
#logo-wrapper {
    width: 100%;
    max-width: 900px;
    margin-top: 50px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

#animationCanvas {
    background-color: transparent;
    max-width: 100%;
    height: auto;
}

/* 📜 优雅标语区 */
.slogan-wrapper {
    margin-top: 15px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 8px 12px;
    color: var(--text-secondary);
}

.slogan-text { font-size: 1.2rem; font-weight: 400; line-height: 1.4; }
.slogan-icon { font-size: 1.2rem; color: var(--accent-orange); }

/* ---------------------------------- */
/* 🍱 核心按钮区                      */
/* ---------------------------------- */
.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
    width: 100%;
}

.cta-btn {
    position: relative;
    padding: 16px 0;
    width: 100%;
    max-width: 340px;
    border-radius: 60px;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(4px);
    gap: 10px;
}

.cta-btn:hover { transform: scale(1.05) rotate(-1deg); box-shadow: var(--shadow-hover); }

.cta-btn.primary {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-mango));
    color: #2D2A24;
    border: none;
    box-shadow: 0 8px 20px rgba(255, 138, 92, 0.25);
}

.cta-btn.coming-soon { border: 2px dashed var(--accent-coral); }
.cta-btn.coming-soon::after {
    content: "coming soon ✨";
    position: absolute; top: -12px; right: -10px;
    background: var(--accent-coral); color: #fff;
    font-size: 0.7rem; padding: 3px 12px; border-radius: 20px;
    font-weight: 600; box-shadow: 0 4px 10px rgba(255,107,107,0.3);
}

/* ---------------------------------- */
/* 🌐 底部入口网格                    */
/* ---------------------------------- */
.footer-grid {
    margin-top: 60px; margin-bottom: 20px;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 30px;
}

.footer-entry {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; transition: all 0.3s ease; gap: 10px;
    background: transparent; border: none; color: var(--text-primary); font-family: inherit;
}

.footer-entry:hover { transform: translateY(-8px); }

.circle-icon {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--card-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    display: flex; justify-content: center; align-items: center; font-size: 1.6rem;
    box-shadow: var(--shadow-sm); transition: all 0.3s ease; color: var(--text-primary);
}

.footer-entry:hover .circle-icon {
    border-color: var(--accent-orange); color: var(--accent-orange);
    background: #fff; box-shadow: var(--shadow-hover);
}
[data-theme="dark"] .footer-entry:hover .circle-icon { background: #2A241E; }

.footer-entry span { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }

/* ---------------------------------- */
/* 🖼️ 弹窗系统 (Modals)               */
/* ---------------------------------- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    z-index: 999; display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}

.modal-overlay.active { display: flex; opacity: 1; }

.modal-box {
    background: var(--card-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary); max-width: 480px; width: 90%; padding: 30px;
    border-radius: 30px; box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    position: relative; border: 1px solid var(--border-glass);
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box { transform: scale(1); }

.close-modal {
    position: absolute; top: 15px; right: 20px; font-size: 1.8rem;
    cursor: pointer; background: none; border: none; color: var(--text-secondary);
}

.modal-box h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.modal-box p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; }

/* 🟢 弹窗表单控件 (米黄背景 & 自动切换深色文字) */
.modal-input, .modal-textarea {
    width: 100%; 
    padding: 14px 16px; 
    border: 1px solid var(--border-glass); 
    border-radius: 12px;
    background: var(--input-bg); 
    color: var(--input-text); /* 🟢 关键：使用专属文字颜色，防止米黄背景配白字看不清 */
    font-family: inherit;
    font-size: 1rem; 
    margin-bottom: 12px; 
    outline: none;
    transition: all 0.3s ease; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}

/* 鼠标聚焦时的光晕效果 */
.modal-input:focus, .modal-textarea:focus { 
    border-color: var(--accent-orange); 
    box-shadow: 0 0 0 3px rgba(255, 138, 92, 0.25); 
}

/* 优化输入框里的“提示文字”颜色 */
.modal-input::placeholder, .modal-textarea::placeholder {
    color: var(--placeholder-color);
    opacity: 1; 
}

.modal-btn {
    padding: 12px 20px; border: none; border-radius: 12px;
    font-weight: bold; cursor: pointer; font-family: inherit; transition: transform 0.2s;
}
.modal-btn:hover { transform: translateY(-2px); }
.modal-btn-primary { background: var(--accent-orange); color: #2D2A24; }
.modal-btn-coral { background: var(--accent-coral); color: #fff; }

.random-pill {
    background: var(--accent-mango); color: #2D2A24; padding: 0.7rem 1.6rem;
    border-radius: 50px; border: none; font-weight: 700; cursor: pointer;
    margin-top: 15px; display: inline-flex; align-items: center; gap: 8px;
    transition: 0.2s; font-size: 1rem; font-family: inherit;
}
.random-pill:hover { transform: scale(1.02); background: var(--accent-coral); color: #fff; }

.inspire-output {
    margin-top: 20px; padding: 20px; border-radius: 15px; background: var(--input-bg);
    min-height: 80px; display: flex; align-items: center; justify-content: center;
    gap: 10px; border: 1px solid var(--border-glass); font-weight: 600; text-align: center;
    color: var(--input-text); /* 🟢 同步文字颜色 */
}

.footer-note {
    margin-top: 40px; color: var(--text-secondary);
    font-size: 0.85rem; opacity: 0.7; text-align: center;
}

/* ---------------------------------- */
/* 📱 响应式与无障碍适配              */
/* ---------------------------------- */
@media (max-width: 600px) {
    .toolbar { top: 16px; left: 16px; gap: 8px; }
    .toolbar button { padding: 8px 14px; font-size: 1rem; }
    .slogan-text { font-size: 1rem; }
    .cta-btn { max-width: 100%; font-size: 1.2rem; }
    .footer-grid { gap: 20px; }
}

/* ---------------------------------- */
/* 📱 移动端适配与毛玻璃降级（更新后） */
/* ---------------------------------- */
@media (max-width: 768px) {
    .toolbar {
        top: 16px;  /* 靠近边缘，留出更多空间 */
        left: 16px;
        gap: 8px;
    }

    /* 缩小手机端的按钮尺寸，确保图标和文字都能排下 */
    .toolbar button {
        padding: 6px 12px !important;
        font-size: 1rem !important; 
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #fff9f0 !important; 
        color: #2D2A24 !important;
        border: 1px solid rgba(255, 188, 128, 0.5) !important;
    }
    
    /* 手机端文字微调 */
    .toolbar button span {
        font-size: 0.75rem !important;
    }
    
    /* 暗黑模式下的手机端工具栏 */
    [data-theme="dark"] .toolbar button {
        background: #2A241E !important;
        color: #F2E8DD !important;
        border: 1px solid rgba(255, 188, 128, 0.25) !important;
    }
    
    .circle-icon { background: #fff9f0 !important; color: #2D2A24 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    [data-theme="dark"] .circle-icon { background: #2A241E !important; color: #F2E8DD !important; }
    
    .modal-box { background: #fffbf5 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    [data-theme="dark"] .modal-box { background: #231E1A !important; }
}

/* 尊重用户的“减弱动态效果”系统偏好 (防晕动症) */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 🟢 SEO 与无障碍辅助类：视觉上隐藏，但对搜索引擎和屏幕阅读器可见 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------- */
/* 🔗 登录/注册切换提示文字样式       */
/* ---------------------------------- */
.auth-switch-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary); 
}

.register-link {
    color: var(--accent-orange); 
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.register-link:hover {
    opacity: 0.8;
    text-decoration: underline; 
}

/* ---------------------------------- */
/* 🎨 弹窗内嵌图标输入框样式 (Font Awesome)*/
/* ---------------------------------- */
.modal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    width: 100%;
}

/* 输入框内嵌图标 */
.modal-input-wrapper .modal-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    font-size: 0.95rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 2;
}

/* 调整带有图标的输入框缩进，防止文字盖在图标上 */
.modal-input-wrapper .modal-input {
    padding-left: 40px !important;
    margin-bottom: 0 !important; /* 接管间距 */
    width: 100%;
}

/* ---------------------------------- */
/* 📱 注册表单单列垂直流与小眼睛控制 */
/* ---------------------------------- */

/* 摒弃Grid，回归单列布局 */
.register-vertical-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-height: 320px; /* 防止内容过多在小屏上溢出，允许优雅滚动 */
    overflow-y: auto;
    padding-right: 4px;
}

/* 小眼睛在输入框右侧的绝对定位 */
.modal-input-wrapper .password-toggle-eye {
    position: absolute;
    right: 14px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.1s ease;
}

.modal-input-wrapper .password-toggle-eye:hover {
    color: var(--accent-orange);
    transform: scale(1.1);
}

/* 带有小眼睛的输入框，右侧增加内边距防止文字挡住眼睛 */
.modal-input-wrapper .pwd-field {
    padding-right: 42px !important;
}

/* 优化协议勾选栏的间距 */
.modal-agreement-wrapper {
    margin: 16px 0 8px 0;
}

.modal-agreement-wrapper label a {
    /* ⚡ 核心修改：使用随主题动态改变的颜色，彻底解决夜晚看不清的问题 */
    color: var(--modal-link-color) !important; 
    
    text-decoration: underline; /* 强制加上下划线，一眼就能看出是可点击的链接 */
    font-weight: 600;
    transition: color 0.2s ease;
}

/* 鼠标悬停时的微互动 */
.modal-agreement-wrapper label a:hover {
    color: var(--accent-coral) !important;
    text-decoration: underline;
}

/* ❓ FAQ 弹窗精美样式排版 */
.faq-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.faq-list-container {
    max-height: 400px; /* 超过 10 个问题时自动允许在弹窗内滚动，不撑爆网页 */
    overflow-y: auto;
    padding-right: 8px;
}

.faq-item {
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--accent-orange);
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 0 8px 8px 0;
    transition: all 0.2s ease;
}

[data-theme="dark"] .faq-item {
    background: rgba(255, 255, 255, 0.03);
}

.faq-item:hover {
    background: rgba(255, 138, 92, 0.05);
    transform: translateX(2px);
}

.faq-question {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 1rem;
}

.faq-answer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 优化滚动条小细节 */
.faq-list-container::-webkit-scrollbar {
    width: 6px;
}
.faq-list-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}