
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background: #f7f8fc;
    padding: 30px 20px;
    min-height: 100vh;
}

/* 全局：弹窗打开时禁止页面滚动（不跳回顶部 + 关闭后可滚动） */
body.no-scroll {
    overflow: hidden;
    /* 保留页面滚动位置，防止关闭后跳顶 */
    position: relative;
}

/* 兼容移动端/老浏览器的增强方案 */
html.no-scroll {
    overflow: hidden;
    height: 100%;
}

/* 修复关闭后滚动异常：给html/body加滚动恢复兜底 */
html, body {
    scroll-behavior: smooth;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.title {
    font-size: 32px;
    color: #2d3436;
    margin-bottom: 20px;
    text-align: center;
}

/* 右上角API配置样式 */
.api-config {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.api-config input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
}

.api-config select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.api-config button {
    padding: 8px 16px;
    background: #74b9ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.input-box {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: none;
}

/* 新增：输入框下方的字符计数提示 */
.char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: -8px;
}

.char-count.warning {
    color: #ff7675;
    font-weight: bold;
}

/* 图片上传区域样式 */
.upload-area {
    margin: 8px 0;
}

.upload-area button {
    padding: 8px 12px;
    background: #a29bfe;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
}

.upload-area #imageTip {
    color: #666;
    font-size: 14px;
}

.upload-area #previewImage {
    max-width: 100%;
    max-height: 150px;
    margin-top: 8px;
    border-radius: 8px;
    display: none;
}

.color-row {
    display: flex;
    gap: 8px;
}

.color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color.active {
    border-color: #333;
}

button {
    padding: 12px;
    background: #74b9ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* 顶部信息栏 */
.info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* 发布按钮加载态 */
#publishBtn.loading {
    background: #a0cfff;
    cursor: not-allowed;
    position: relative;
    padding-left: 36px; /* 给加载图标留出空间 */
}

#publishBtn.loading::before {
    content: "";
    position: absolute;
    left: 12px;
    /*top: 40%; loading加载样式去除*/
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* IP弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 16px;
    color: #2d3436;
}

#ipList {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #666;
}

.modal-content button {
    width: 60%;
}

.wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.note {
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: float 6s ease-in-out infinite;
    max-height: 200px;
    overflow: hidden; /* 改为隐藏，让内部的内容区滚动 */
    display: flex;
    flex-direction: column;
}

/* 新增：内容滚动区，包含文字和图片 */
.note-content {
    padding: 18px 18px 0; /* 底部无内边距，由底部栏提供 */
    overflow-y: auto;
    flex: 1; /* 占据除底部栏外的所有空间 */
}

.note-content p {
    font-size: 15px;
    line-height: 1.5;
    color: #2d3436;
    word-break: break-word;
}

/* 便签图片样式 */
.note-content img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
    margin: 6px 0;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: cover;
}

.note-content img:hover {
    transform: scale(1.08);
}

/* 新增：固定在底部的信息栏 */
.note-footer {
    padding: 8px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: inherit; /* 继承便签背景色 */
}

.note-footer .time {
    font-size: 12px;
    color: #666;
}

/* 删除按钮样式 */
.note .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    color: white;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.note:hover .delete-btn {
    opacity: 1;
}

/* 点赞按钮 */
.note-footer .like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    opacity: 0.8;
}

.note-footer .like-btn:hover {
    opacity: 1;
}

.note-footer .like-btn .heart {
    color: #ff6b6b;
}

/* 表情按钮样式 */
#emojiBtn {
    background: #fd79a8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    margin-right: 8px;
}

/* Emoji 面板样式 - 适配8列6行 */
#emojiPanel {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    height: 300px;
    overflow-y: auto;
}

/* 单个表情项 */
.emoji-item {
    font-size: 20px;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.emoji-item:hover {
    background: #f0f0f0;
}

/* 图片预览弹窗样式 */
#imageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; /* 关键：隐藏弹窗滚动条 */
}

#imageModal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* 关键：禁止弹窗内部滚动 */
}

#fullImage {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#imageModal button {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

#imageModal button:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
    100% {
        transform: translateY(0px);
    }
}

.image-loading {
    position: absolute;
    margin: 0 0 20px 100px;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

#fullImage {
    transition: filter 0.3s, opacity 0.3s;
}

/* 输入框禁用态 */
#content:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.footer {
    text-align: center;
    color: #888;
    font-size: 14px;
    padding: 20px 0;
}

/* 🔥 永远固定在屏幕右下角！不跟随、不消失、不被覆盖 */
.float-buttons {
    position: fixed !important; /* 固定在屏幕，不是跟着页面走 */
    right: 20px !important; /* 距离右边 20px */
    bottom: 20px !important; /* 距离底部 20px */
    z-index: 99999 !important; /* 最高层级，绝对可见 */
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

/* 按钮样式 */
.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #74b9ff;
    color: white;
    font-size: 20px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-btn:hover {
    background: #a0cfff;
}

/* 按钮样式 */
#toTopBtn {
    display: none;
    bottom: 80px;
    opacity: 1; /* 避免透明度导致视觉上"消失" */
}

#toBottomBtn {
    bottom: 20px;
    opacity: 1;
}

/* 弹窗通用样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
/* 更新弹窗 */
/*.update-modal {*/
/*    position: fixed;*/
/*    top: 20px;*/
/*    right: 20px;*/
/*    width: 340px;*/
/*    background: #fff;*/
/*    border-radius: 12px;*/
/*    box-shadow: 0 4px 20px rgba(0,0,0,0.15);*/
/*    z-index: 99999;*/
/*    display: none;*/
/*    animation: slideIn 0.3s ease-out;*/
/*}*/

/*@keyframes slideIn {*/
/*    from { transform: translateX(100%); opacity: 0; }*/
/*    to { transform: translateX(0); opacity: 1; }*/
/*}*/

/*.update-header {*/
/*    display: flex;*/
/*    justify-content: space-between;*/
/*    align-items: center;*/
/*    padding: 14px 16px;*/
/*    border-bottom: 1px solid #eee;*/
/*}*/

/*.update-header h3 {*/
/*    margin: 0;*/
/*    font-size: 16px;*/
/*    color: #333;*/
/*}*/

/*.close-btn {*/
/*    background: none;*/
/*    border: none;*/
/*    font-size: 20px;*/
/*    color: #999;*/
/*    cursor: pointer;*/
/*}*/

/*.update-content {*/
/*    padding: 16px;*/
/*    font-size: 14px;*/
/*    line-height: 1.9;*/
/*    color: #444;*/
/*}*/

/*.update-content p {*/
/*    margin: 6px 0;*/
/*}*/

/* 🔥 进阶版：现代卡片风格 */
.update-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    display: none;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

/* 渐变标题栏 */
.update-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(90deg, #87CEFA 0%, #B0E0E6 100%); /* 浅蓝渐变，和你页面主色统一 */
    min-height: 44px;
}

.update-header h3 {
    margin: 0;
    font-size: 15px;
    color: #ffffff; /* 白色标题，更醒目 */
    font-weight: 600;
    line-height: 1.2;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 18px;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
}
/* 3. 🔥 核心优化：内容区溢出滚动 */
.update-content {
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: #555;

    /* 👇 以下三行是核心！解决内容溢出 */
    max-height: calc(100% - 44px); /* 留出标题高度 */
    overflow-y: auto; /* 垂直滚动 */
    overflow-x: hidden; /* 禁止横向滚动 */
}

/* 4. 段落样式：强制换行和缩进 */
.update-content p {
    margin: 6px 0;
    padding-left: 4px; /* 左侧留一点间距，更美观 */
    word-break: break-all; /* 强制换行，防止长英文/数字撑破 */
}

/* 5. 动画效果 */
@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
