/* 现代化朋友圈样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* 顶部工具栏 - 悬浮在头部图片上 */
.top-toolbar {
    position: absolute;
    top: 0;
    right: 0;
    padding: 15px 20px;
    z-index: 10;
}

.toolbar-icons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

.post-icon:hover {
    background: rgba(24, 144, 255, 0.8);
    color: white;
}

.login-icon:hover {
    background: rgba(82, 196, 26, 0.8);
    color: white;
}

.logout-icon:hover {
    background: rgba(255, 77, 79, 0.8);
    color: white;
}

/* 朋友圈头部 */
.moments-header {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.cover-image {
    width: 100%;
    height: 100%;
}

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

.user-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 3px solid white;
    background: white;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-info h2 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 发布按钮 */
.post-button-container {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.post-button {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.post-button:hover {
    background: #40a9ff;
}

/* 动态列表 */
.moments-list {
    padding: 0 20px;
}

.moment-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
    border-radius: 8px;
}

/* 交替背景色 - 奇数项白色，偶数项浅灰色 */
.moment-item:nth-child(odd) {
    background-color: #ffffff;
}

.moment-item:nth-child(even) {
    background-color: #f8f9fa;
}

.moment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.moment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
}

.moment-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1890ff;
}

.moment-time {
    font-size: 12px;
    color: #999;
}

/* 内容中的图片样式 - 限制在容器内 */
.moment-content img,
.post-content img,
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.moment-content img:hover,
.post-content img:hover,
.ql-editor img:hover {
    transform: scale(1.02);
}

/* 图片放大模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.image-modal-close:hover {
    opacity: 0.7;
}
.moment-content div,
.post-content div {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    white-space: pre-wrap; /* 保持换行符 */
}

.moment-content div p,
.post-content div p {
    margin: 0 0 0.5em 0; /* 减少段落间距 */
    line-height: 1.42;
    font-size: 16px;
}

.moment-content div p:last-child,
.post-content div p:last-child {
    margin-bottom: 0;
}

/* 兼容旧的p标签样式 */
.moment-content p {
    margin-bottom: 0.5em;
    font-size: 16px;
    line-height: 1.42;
    white-space: pre-wrap; /* 保持换行符 */
}

.moment-content {
    margin-bottom: 15px;
}
.moment-content > div,
.post-content > div {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap; /* 保持换行符 */
}

.moment-content > div p,
.post-content > div p {
    margin-bottom: 0.8em;
    white-space: pre-wrap; /* 保持换行符 */
}

/* 统一标题样式 - 适用于首页和详情页内容中的标题 */
.moment-content > div h1,
.moment-content > div h2,
.moment-content > div h3,
.moment-content > div h4,
.moment-content > div h5,
.moment-content > div h6,
.post-content > div h1,
.post-content > div h2,
.post-content > div h3,
.post-content > div h4,
.post-content > div h5,
.post-content > div h6 {
    color: #1890ff;
    font-weight: 700;
    margin: 1em 0 0.5em 0;
}

.moment-content > div h1,
.post-content > div h1 { font-size: 24px; }

.moment-content > div h2,
.post-content > div h2 { font-size: 20px; }

.moment-content > div h3,
.post-content > div h3 { font-size: 18px; }

.moment-content > div h4,
.post-content > div h4 { font-size: 16px; }

.moment-content > div h5,
.post-content > div h5 { font-size: 14px; }

.moment-content > div h6,
.post-content > div h6 { font-size: 12px; }

/* 标题样式 - 与正文区分 */
.moment-title {
    font-size: 20px; /* 增大标题字体 */
    font-weight: 700; /* 加粗 */
    color: #1890ff; /* 蓝色标题 */
    margin: 0 0 12px 0;
    line-height: 1.3;
}

/* 文章详情页标题样式 */
.post-title {
    font-size: 28px;
    font-weight: 700;
    color: #1890ff;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: #1890ff;
    font-weight: 700;
    margin: 1em 0 0.5em 0;
}

.post-content h1 {
    font-size: 24px;
}

.post-content h2 {
    font-size: 20px;
}

.post-content h3 {
    font-size: 18px;
}

.moment-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.moment-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.moment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.view-detail {
    color: #1890ff;
    text-decoration: none;
}

.view-detail:hover {
    text-decoration: underline;
}

/* 文章详情页 */
.post-detail {
    padding: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px; /* 增加与评论区的间距 */
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.post-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1890ff;
}

.post-time {
    font-size: 14px;
    color: #999;
}

.post-content p {
    font-size: 16px;
    line-height: 1.42;
    margin-bottom: 0.5em; /* 减少段落间距 */
    white-space: pre-wrap; /* 保持换行符 */
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.post-image {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
}

/* 评论关闭提示样式 */
.comments-disabled {
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.comments-disabled-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.comments-disabled-icon {
    color: #999;
    opacity: 0.7;
}

.comments-disabled p {
    margin: 0;
    color: #666;
    font-size: 16px;
}
.comments-section {
    padding: 20px;
}

.comments-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.comment-form textarea {
    height: 80px;
    resize: vertical;
}

.comment-form button {
    background: #1890ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.comment-form button:hover {
    background: #40a9ff;
}

.comments-list {
    margin-top: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-nickname {
    font-weight: 600;
    color: #1890ff;
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

.comment-content p {
    font-size: 14px;
    line-height: 1.5;
}

/* 返回按钮 */
.back-button {
    padding: 20px;
    text-align: center;
}

.back-button a {
    color: #1890ff;
    text-decoration: none;
    font-size: 16px;
}

.back-button a:hover {
    text-decoration: underline;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #40a9ff;
}

.back-home {
    text-align: center;
    margin-top: 20px;
}

.back-home a {
    color: #666;
    text-decoration: none;
}

.back-home a:hover {
    text-decoration: underline;
}

/* 错误页面 */
.error-page {
    text-align: center;
    padding: 100px 20px;
}

.error-page h1 {
    font-size: 120px;
    color: #ddd;
    margin-bottom: 20px;
}

.error-page h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #666;
}

.error-page p {
    font-size: 16px;
    color: #999;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #1890ff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.btn:hover {
    background: #40a9ff;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

/* 表单样式 - 与后台管理保持一致 */
.post-form {
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #1890ff;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
}

.btn-primary:hover {
    background: #40a9ff;
}

/* 发布动态弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    margin: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: #333;
    background-color: #f5f5f5;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

/* 表单样式 */
.post-form .form-group {
    margin-bottom: 8px;
}

.post-form .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.post-form .form-group input[type="text"],
.post-form .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.post-form .form-group input[type="text"]:focus,
.post-form .form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.post-form .form-group small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* URL预览样式 - Typecho风格 */
.slug-group {
    margin-bottom: 8px !important;
}

.slug-preview {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 3px;
    overflow: hidden;
    font-size: 13px;
    font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
    transition: border-color 0.2s ease;
}

.slug-preview:focus-within {
    border-color: #467b96;
    box-shadow: 0 0 0 2px rgba(70, 123, 150, 0.1);
}

.slug-base {
    background: #f6f8fa;
    color: #586069;
    padding: 8px 10px;
    border-right: 1px solid #e1e5e9;
    white-space: nowrap;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.slug-preview input[type="text"] {
    border: none !important;
    background: transparent !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important;
    font-size: 13px !important;
    flex: 1;
    min-width: 120px;
    color: #24292e;
    font-weight: 500;
}

.slug-preview input[type="text"]:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.slug-preview input[type="text"]::placeholder {
    color: #959da5;
    font-weight: normal;
}

.slug-suffix {
    background: #f6f8fa;
    color: #586069;
    padding: 8px 10px;
    border-left: 1px solid #e1e5e9;
    white-space: nowrap;
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* Quill编辑器样式调整 */
.ql-toolbar {
    border-top: 1px solid #d9d9d9;
    border-left: 1px solid #d9d9d9;
    border-right: 1px solid #d9d9d9;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.ql-container {
    border-left: 1px solid #d9d9d9;
    border-right: 1px solid #d9d9d9;
    border-bottom: 1px solid #d9d9d9;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.ql-editor {
    min-height: 150px;
    font-size: 14px;
    line-height: 1.6;
}

.ql-editor.ql-blank::before {
    color: #999;
    font-style: normal;
}

/* 勾选框组样式 */
.checkbox-group {
    margin: 10px 0 !important;
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    font-weight: normal !important;
    margin: 0 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0 !important;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 发布按钮样式 */
.post-form .btn-primary {
    background: #1890ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.post-form .btn-primary:hover {
    background: #40a9ff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .post-form {
        gap: 12px;
    }
    
    .ql-editor {
        min-height: 120px;
    }
}

/* 兼容旧样式 */
.modal textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    resize: vertical;
}

.modal input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
}

.modal input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
}

.modal button {
    background: #1890ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.modal button:hover {
    background: #40a9ff;
}

/* 消息提示 */
.error-message {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.success-message {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    .moments-header {
        height: 200px;
    }
    
    .user-info {
        bottom: 15px;
        right: 15px;
    }
    
    .avatar {
        width: 50px;
        height: 50px;
    }
    
    .user-info h2 {
        font-size: 16px;
    }
    
    .moment-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-images {
        grid-template-columns: 1fr;
    }
}
