/**
 * Weibo Pro 前台样式（宽度修复版）
 */

/* 重置盒子模型 */
.weibo-pro-wrapper,
.weibo-pro-wrapper * {
    box-sizing: border-box;
}

/* 主容器 */
.weibo-pro-wrapper {
    display: flex;
    max-width: 100%;               /* 允许占满全宽 */
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 侧边栏 - 无内容时自动隐藏 */
.weibo-pro-sidebar-left,
.weibo-pro-sidebar-right {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* 当侧边栏内没有小工具时，不占用宽度 */
.weibo-pro-sidebar-left:not(:has(.weibo-widget)),
.weibo-pro-sidebar-right:not(:has(.weibo-widget)) {
    display: none !important;
}

/* 兼容不支持 :has 的浏览器 */
.weibo-pro-sidebar-left .widget:first-child:last-child:empty,
.weibo-pro-sidebar-right .widget:first-child:last-child:empty {
    display: none;
}

/* 主内容区 */
.weibo-pro-main {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    padding: 16px 12px;            /* 减小左右内边距，释放更多空间 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 解除主题对内容区的宽度限制 */
.entry-content .weibo-pro-wrapper,
.post-content .weibo-pro-wrapper,
.content-area .weibo-pro-wrapper,
.site-content .weibo-pro-wrapper,
main .weibo-pro-wrapper {
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* 小工具通用 */
.weibo-widget {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.weibo-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

/* 页面标题 */
.weibo-page-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #1a1a1a;
}

/* 发布框 */
.weibo-publish-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.weibo-publish-avatar {
    flex-shrink: 0;
}

.weibo-publish-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.weibo-publish-content {
    flex: 1;
    min-width: 0;
    width: 100%;
}

#weibo-publish-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    background: #fff;
    box-sizing: border-box;
}

#weibo-publish-textarea:focus {
    outline: none;
    border-color: #2196F3;
}

.weibo-publish-toolbar {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.weibo-toolbar-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    margin-right: 8px;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
    transition: background 0.2s;
}

.weibo-toolbar-btn:hover {
    background: #f0f0f0;
    color: #2196F3;
}

.weibo-char-count {
    margin-left: auto;
    font-size: 12px;
    color: #999;
}

.weibo-publish-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
}

.weibo-privacy-select {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.weibo-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.weibo-btn-primary {
    background: #2196F3;
    color: #fff;
}

.weibo-btn-primary:hover {
    background: #1976D2;
}

.weibo-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 图片预览 */
.weibo-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.weibo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.weibo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.weibo-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
}

/* 微博列表 */
.weibo-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.weibo-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.weibo-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.weibo-item.pinned {
    border-left: 3px solid #2196F3;
    background: #fafafa;
}

.weibo-item.private {
    background: #fef9e7;
}

.weibo-item-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.weibo-user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.weibo-user-info {
    flex: 1;
}

.weibo-user-name {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    margin-right: 6px;
}

.weibo-user-name:hover {
    color: #2196F3;
    text-decoration: underline;
}

.weibo-user-meta {
    font-size: 13px;
    color: #999;
}

.weibo-pin-badge,
.weibo-private-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    font-size: 12px;
    color: #666;
}

.weibo-pin-badge .dashicons,
.weibo-private-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 2px;
}

.weibo-item-actions {
    display: flex;
    gap: 4px;
}

.weibo-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    border-radius: 4px;
    transition: all 0.2s;
}

.weibo-action-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.weibo-delete-btn:hover {
    color: #f44336;
}

/* 内容区 */
.weibo-item-content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
    margin-bottom: 12px;
}

.weibo-item-content a {
    color: #2196F3;
    text-decoration: none;
}

.weibo-item-content a:hover {
    text-decoration: underline;
}

.weibo-topic {
    color: #2196F3;
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 13px;
}

.weibo-mention {
    color: #2196F3;
    font-weight: 500;
}

.weibo-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 8px;
}

.weibo-video,
.weibo-audio {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

.weibo-bilibili,
.weibo-netease {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 8px;
    margin-top: 8px;
}

/* 元信息 */
.weibo-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

/* 底部操作 */
.weibo-item-footer {
    display: flex;
    gap: 24px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

.weibo-action {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.weibo-action .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.weibo-like-action:hover {
    color: #f44336;
}

.weibo-like-action.liked {
    color: #f44336;
}

.weibo-comment-action:hover {
    color: #2196F3;
}

/* 评论区 */
.weibo-comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.weibo-comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.weibo-comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.weibo-comment-item:last-child {
    border-bottom: none;
}

.weibo-comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.weibo-comment-content {
    flex: 1;
    min-width: 0;
}

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

.weibo-comment-author {
    font-weight: 500;
    color: #333;
    text-decoration: none;
    font-size: 13px;
}

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

.weibo-comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    word-break: break-word;
}

.weibo-delete-comment {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #ccc;
    border-radius: 4px;
}

.weibo-delete-comment:hover {
    color: #f44336;
    background: #fff0f0;
}

.weibo-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.weibo-comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    resize: none;
    min-height: 36px;
    line-height: 1.4;
}

.weibo-comment-input:focus {
    outline: none;
    border-color: #2196F3;
}

.weibo-submit-comment {
    padding: 0 16px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.weibo-submit-comment:hover {
    background: #1976D2;
}

/* 用户资料头部 */
.weibo-user-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 24px;
}

.weibo-user-profile-header .weibo-user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.weibo-user-profile-header .weibo-user-info {
    flex: 1;
}

.weibo-user-profile-header .weibo-user-name {
    font-size: 20px;
    margin-bottom: 4px;
}

.weibo-user-bio {
    margin: 8px 0 0;
    color: #666;
    font-size: 14px;
}

.weibo-user-stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.stat-label {
    font-size: 13px;
    color: #999;
}

.weibo-user-actions {
    margin-left: auto;
}

.weibo-follow-btn {
    padding: 8px 24px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.weibo-follow-btn.following {
    background: #e0e0e0;
    color: #666;
}

.weibo-follow-btn:hover {
    background: #1976D2;
}

.weibo-follow-btn.following:hover {
    background: #d0d0d0;
}

.weibo-unfollow-btn {
    padding: 8px 24px;
    background: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 加载中 */
.weibo-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.weibo-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* 分页 */
.weibo-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.weibo-pagination a,
.weibo-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.weibo-pagination a:hover {
    background: #f0f0f0;
    border-color: #2196F3;
    color: #2196F3;
}

.weibo-pagination .current {
    background: #2196F3;
    border-color: #2196F3;
    color: #fff;
}

/* 通知消息 */
.weibo-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.weibo-notice-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.weibo-notice-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

.weibo-notice-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* 登录提示 */
.weibo-login-notice {
    padding: 20px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 20px;
}

.weibo-login-notice a {
    color: #2196F3;
    font-weight: 500;
}

/* 联系方式 */
.weibo-contact-info .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: #666;
}

.weibo-contact-info .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #999;
}

/* 时钟 */
.weibo-digital-clock {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}

.clock-time {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
}

.clock-date {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

.seconds {
    font-size: 16px;
    margin-left: 4px;
    opacity: 0.8;
}

/* 公告/广告内容 */
.weibo-announcement-content,
.weibo-advertisement-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.weibo-announcement-content p,
.weibo-advertisement-content p {
    margin: 0 0 8px;
}

.weibo-announcement-content img,
.weibo-advertisement-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 夜间模式 */
body.weibo-night-mode .weibo-pro-wrapper {
    background: #1a1a1a;
}

body.weibo-night-mode .weibo-pro-main,
body.weibo-night-mode .weibo-widget,
body.weibo-night-mode .weibo-item {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.weibo-night-mode .weibo-page-title,
body.weibo-night-mode .weibo-widget-title,
body.weibo-night-mode .weibo-user-name,
body.weibo-night-mode .stat-value {
    color: #e0e0e0;
}

body.weibo-night-mode .weibo-item-content,
body.weibo-night-mode .weibo-comment-text {
    color: #ccc;
}

body.weibo-night-mode #weibo-publish-textarea,
body.weibo-night-mode .weibo-comment-input {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

body.weibo-night-mode .weibo-publish-box {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.weibo-night-mode .weibo-item-footer,
body.weibo-night-mode .weibo-comments-section,
body.weibo-night-mode .weibo-comment-item {
    border-color: #3a3a3a;
}

body.weibo-night-mode .weibo-pagination a {
    background: #2a2a2a;
    border-color: #4a4a4a;
    color: #ccc;
}

body.weibo-night-mode .weibo-user-profile-header {
    background: #2a2a2a;
}

/* 响应式 */
@media (max-width: 1024px) {
    .weibo-pro-wrapper {
        flex-direction: column;
    }
    
    .weibo-pro-sidebar-left,
    .weibo-pro-sidebar-right {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .weibo-pro-wrapper {
        padding: 10px;
    }
    
    .weibo-publish-box {
        flex-direction: column;
    }
    
    .weibo-publish-avatar {
        align-self: flex-start;
    }
    
    .weibo-user-profile-header {
        flex-wrap: wrap;
    }
    
    .weibo-user-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
    }
    
    .weibo-follow-btn {
        width: 100%;
    }
}

/* 打印时隐藏侧边栏 */
@media print {
    .weibo-pro-sidebar-left,
    .weibo-pro-sidebar-right {
        display: none;
    }
}

/* 表情面板 */
.weibo-emoji-panel {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-width: 320px;
    margin-top: 5px;
}

.weibo-emoji-item {
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    text-align: center;
    border-radius: 6px;
    transition: background 0.2s;
}

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

/* @用户面板 */
.weibo-at-panel {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 5px;
}

#weibo-at-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 12px 12px 0 0;
    font-size: 14px;
}

#weibo-at-search:focus {
    outline: none;
    background: #fafafa;
}

.weibo-at-results {
    max-height: 200px;
    overflow-y: auto;
}

.weibo-at-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.weibo-at-item:hover {
    background: #f5f5f5;
}

.weibo-at-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.weibo-at-info {
    flex: 1;
}

.weibo-at-name {
    font-weight: 500;
    color: #1a1a1a;
}

.weibo-at-login {
    font-size: 12px;
    color: #999;
}

/* 发布框工具栏按钮间距 */
.weibo-publish-toolbar .weibo-toolbar-btn {
    margin-right: 2px;
}