/* QQUI 黑白简约主题 - Typecho 1.3.0 */
:root {
    --bg: #FAFAFA;
    --panel: #FFFFFF;
    --border: #EBEBEB;
    --text: #1A1A1A;
    --text-secondary: #8A8A8A;
    --hover: #F5F5F5;
    --active: #F0F0F0;
    --sidebar-width: 52px;
    --sidebar-expand: 160px;
}

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

body {
    font-family: 'zql';
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    height: 100vh;
    overflow: hidden;
    max-width: 780px;
    margin: auto;
}
@font-face {
    font-family: 'zql';
    src: url('/usr/themes/qqnote/font/zql-v2-subset.woff2') format('woff2');
      
    font-display: swap;
    unicode-range: U+0000-007F, U+4E00-9FFF, U+2000-206F, U+3000-303F;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== 顶部栏 ===== */
.topbar {
    height: 50px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.topbar .logo {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.topbar .search {
    flex: 1;
    max-width: 320px;
    margin: 0 auto;
    position: relative;
}

.topbar .search input {
    width: 100%;
    height: 28px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    padding: 0 12px;
    font-size: 12px;
    background: var(--bg);
    color: var(--text);
    outline: none;
}

.topbar .search input::placeholder { color: var(--text-secondary); }

.topbar .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--border);
    overflow: hidden;
}

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

/* ===== 主体 ===== */
.main {
    display: flex;
    height: calc(100vh - 44px - 24px);
}

/* ===== 左侧分类（丝滑核心） ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--panel);
    border-right: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 8px 0;
    overflow: hidden;
    will-change: width;
    transition: width 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.sidebar.expanded {
    width: var(--sidebar-expand);
    min-width: var(--sidebar-expand);
}

/* hover 已禁用，避免干扰收起状态 */

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    transition: color 0.2s;
}

.sidebar-toggle:hover { color: var(--text); }

.sidebar-inner {
    width: var(--sidebar-expand);
    transition: transform 0.35s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.25s ease;
}

.sidebar:not(.expanded) .sidebar-inner {
    /*transform: translateX(-8px);*/
    /*opacity: 0.5;*/
}

.sidebar .section-title {
    font-size: 10px;
    color: var(--text-secondary);
    padding: 8px 16px 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.sidebar.expanded .section-title {
    opacity: 1;
    transform: translateX(0);
}

/* 菜单项 */
.sidebar .item {
    display: flex;
    align-items: center;
    padding: 7px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.sidebar .item:hover { background: var(--hover); text-decoration: none; }
.sidebar .item.active { background: var(--active); font-weight: 500; }

.sidebar .item .icon {
    font-size: 16px;
    width: 20px;
    min-width: 20px;
    text-align: center;
    opacity: 0.7;
}

.sidebar .item .label,
.sidebar .item .count {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.sidebar.expanded .item .label,
.sidebar.expanded .item .count {
    font-size:16px;
    opacity: 1;
    transform: translateX(0);
}

.sidebar .item .count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== 笔记列表 ===== */
.note-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    min-width: 0;
    overflow: hidden;
}

.note-list-header {
    padding: 10px 16px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.note-list-header .title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-list .list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 关键：强制 a.note-item 表现为块级元素，解决布局错乱 */
.note-list .list > a.note-item {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 16px !important;
    cursor: pointer !important;
    border-bottom: 0.5px solid #fafafa !important;
    background: transparent !important;
    color: inherit !important;
    text-decoration: none !important;
    outline: none !important;
}

.note-list .list > a.note-item:hover {
    background: var(--hover) !important;
    color: inherit !important;
    text-decoration: none !important;
}

.note-list .list > a.note-item.active {
    background: var(--active) !important;
}

.note-list .list > a.note-item .note-title {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 3px !important;
    color: var(--text) !important;
    line-height: 1.4 !important;
}

.note-list .list > a.note-item .note-preview {
    display: block !important;
    font-size: 11px !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
}

.note-list .list > a.note-item .note-meta {
    display: block !important;
    font-size: 10px !important;
    color: var(--text-secondary) !important;
    margin-top: 4px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.note-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 分页 */
.page-nav {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.page-nav a {
    color: var(--text);
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.page-nav a:hover { background: var(--hover); }
.page-nav .current { font-weight: 600; }

/* 滚动条 */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #D5D5D5; border-radius: 3px; }

/* ===== 底部状态栏 ===== */
.statusbar {
    /*height: 24px;*/
    background: var(--panel);
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    color: var(--text-secondary);
    gap: 16px;
}

.statusbar .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #52C41A;
    display: inline-block;
    margin-right: 4px;
}

/* ===== 文章详情页 ===== */
.post-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}

.post-content img {
    max-width: 100%;
    height: auto;
}

.post-content pre {
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.6;
}

.post-content code {
    background: var(--bg);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}

.post-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
}

.post-content h2, .post-content h3, .post-content h4 {
    margin: 16px 0 8px;
}

.post-content p {
    margin-bottom: 12px;
}

.post-content ul, .post-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.post-content li {
    margin-bottom: 4px;
}
/* ===== 你的原始CSS（完全不变） ===== */
.comments {
    color: #111;
    background: #fff;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 25px;
}

.comments h4 {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.comment-item {
    padding: 12px 0;
}

/*.comment-children {*/
/*    margin-left: 26px;*/
/*    border-left: 2px solid #ddd;*/
/*    padding-left: 8px;*/
/*    background: #fafafa;*/
/*}*/

.comment-body {
    position: relative;
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    position: relative;
    min-height: 24px;
}

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

.comment-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.comment-user {
    font-weight: 500;
    color: #727272;
    font-size: 11px;
}

.comment-badge {
    font-size: 9px;
    color: #fff;
    background: #000;
    padding: 0 3px;
    border-radius: 2px;
    margin-left: 3px;
}

.comment-text {
    margin: 2px 0 2px 28px;
    color: #222;
    font-size: 12px;
    display: flex;
}
.comment-text a {
    margin-right: 5px;
    color: #888;
    font-weight: bold;
}
.comment-act {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.comment-act a {
    font-size: 10px;
    color: #999;
    text-decoration: none;
}

.comment-act a:hover {
    color: #000;
}

.comment-date {
    font-size: 10px;
    color: #bbb;
}

.comment-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.comment-fields input {
    font-size: 11px;
    padding: 8px 6px;
    border: 0px solid #ddd;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
}

.comment-form textarea {
    width: 100%;
    min-height: 42px;
    border: 0px solid #ddd;
    padding: 4px;
    resize: vertical;
    font-size: 11px;
    border-radius: 8px;
}

.comment-form button {
    background: #000;
    color: #fff;
    border: none;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 11px;
    border-radius: 8px;
}

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

.comment-pagenav {
    margin-top: 10px;
    font-size: 11px;
}

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

.cancel-reply {
    font-size: 10px;
    color: #aaa;
    margin-left: 4px;
}

form.comment-form {
    padding: 16px 8px;
    border-radius: 10px;
    border: 1px solid #eee !important;
}

p.comment-submit {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    align-content: space-between;
}

a#cancel-comment-reply-link {
    background: #b91919;
    color: #fff;
    border: none;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 11px;
    border-radius: 8px;
}

/* ===== 完整修复：QQ/微信对话逻辑 ===== */

/* 自己评论：整体右对齐 */
/*.comment-item.comment-self {*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    align-items: flex-end;*/
/*}*/

/* 自己评论：头像在右侧 */
.comment-self .comment-avatar {
    order: 2;
    margin-left: 6px;
    margin-right: 0;
}

/* 关键修复：自己评论的头部容器完全镜像翻转 */
.comment-self .comment-head {
    flex-direction: row-reverse !important;
    justify-content: flex-start;
    width: 100%;
    padding-right: 0px; /* 为头像留出空间 */
    box-sizing: border-box;
}

/* 自己评论：信息区域也要翻转 */
.comment-self .comment-info {
    flex-direction: row-reverse !important;
    justify-content: flex-start;
    order: 1;
}

/* 自己评论：操作按钮位置调整 */
.comment-self .comment-act {
    position: static !important;
    transform: none !important;
    order: 0;
    margin-right: 0;
    margin-left: 8px;
}

/* 自己评论：文字颜色调整 */
.comment-self .comment-user {
    color: #333;
}

.comment-self .comment-date {
    color: #888;
}

/* 关键修复：自己评论的黑色气泡 - 左对齐文字 */
.comment-self .comment-text {
    background: #000;
    color: #fff;
    border-radius: 4px;
    border-top-right-radius: 0; /* QQ/微信风格：右上角直角 */
    margin-left: 0;
    margin-right: 28px; /* 为头像留出空间 */
    padding: 8px 12px;
    margin-top: 2px;
    text-align: left; /* 确保文字左对齐 */
    max-width: calc(100% - 28px); /* 限制最大宽度 */
    align-self: flex-end; /* 从右侧开始 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 自己评论的子评论 */
.comment-self.comment-child {
    margin-left: 0;
    margin-right: 26px;
    border-left: none;
    border-right: 2px solid #333;
    padding-left: 0;
    padding-right: 8px;
}

/* 修复连续评论的间距问题 */
.comment-item.comment-self + .comment-item.comment-self {
    margin-top: -2px;
}

/* 确保自己的评论中，各个元素的顺序正确 */
.comment-self .comment-head > * {
    order: initial;
}

/* 自己评论的comment-body也需要调整 */
.comment-self .comment-body {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* 所有内容靠右 */
    width: 100%;
}

/* 自己评论的信息容器宽度调整 */
.comment-self .comment-info {
    max-width: 100%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .comment-fields {
        grid-template-columns: 1fr;
    }
    
    /*.comment-children {*/
    /*    margin-left: 14px;*/
    /*}*/
    
    .comment-self.comment-child {
        margin-right: 14px;
    }
    
    .comment-act {
        opacity: 1 !important;
    }
    
    /* 移动端下自己评论的气泡调整 */
    .comment-self .comment-text {
        max-width: calc(90% - 28px);
    }
}
   /* 友链容器：去除默认边距 */
.weui-friends-list {
    padding: 10px;
    box-sizing: border-box;
}

/* 单个友链项：一行一列布局 */
.weui-friend-item {
    background: #fff;
    border-radius: 12px; /* 圆角 */
    margin-bottom: 12px; /* 每一项之间的间距 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* 轻微阴影，增加层次感 */
    overflow: hidden; /* 确保圆角生效 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 鼠标悬停效果 */
.weui-friend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* 链接样式重置 */
.weui-friend-link {
    display: flex; /* 使用 Flexbox 横向排列头像和内容 */
    align-items: center; /* 垂直居中 */
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
}

/* 头像样式 */
.weui-friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%; /* 圆形头像 */
    object-fit: cover;
    margin-right: 14px; /* 头像与文字的间距 */
    flex-shrink: 0; /* 防止头像被压缩 */
    border: 1px solid #f0f0f0;
}

/* 右侧信息区域（占据剩余空间） */
.weui-friend-info {
    flex: 1;
    min-width: 0; /* 解决 flex 布局下文本溢出不生效的问题 */
}

/* 上半部分：名字 + 状态 */
.weui-friend-top {
    display: flex;
    justify-content: space-between; /* 两端对齐 */
    align-items: center;
    margin-bottom: 6px;
}

/* 昵称 */
.weui-friend-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 超出显示省略号 */
}

/* 状态标签 */
.weui-friend-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 在线状态：绿色 */
.weui-friend-status.online {
    color: #07c160; /* 微信绿 */
    background-color: rgba(7, 193, 96, 0.1);
}

/* 离线状态：灰色 */
.weui-friend-status.offline {
    color: #999;
    background-color: #f0f0f0;
}

/* 下半部分：描述 + 时间 */
.weui-friend-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* 描述文字 */
.weui-friend-last-msg {
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px; /* 与时间的间距 */
}

/* 时间文字 */
.weui-friend-time {
    color: #999;
    flex-shrink: 0;
}