:root {
    --bg: #fafafa;
    --card: #ffffff;
    --text: #2b2b2b;
    --meta: #9a9a9a;
    --border: #ececec;
    --primary: #1B3A5B;
    --danger: #c0392b;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.wb-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 12px;
}
/* 头部 */
.wb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5;
}
.wb-head-title { font-size: 18px; font-weight: 600; }
.wb-head-actions { display: flex; gap: 8px; }
.wb-btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
}
.wb-btn:active { opacity: .85; }
.wb-btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}
/* 列表 / 卡片 */
.wb-list { display: flex; flex-direction: column; gap: 10px; }
.wb-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}
.wb-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.wb-card-time {
    color: var(--meta);
    font-size: 13px;
    text-decoration: none;
}
.wb-del {
    border: none;
    background: transparent;
    color: var(--meta);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.wb-del:hover { color: var(--danger); }
.wb-card-content {
    white-space: pre-wrap;
    word-break: break-word;
}
.wb-card-content a { color: var(--primary); }
/* 底部操作条（点赞） */
.wb-card-foot { margin-top: 8px; }
.wb-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--meta);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 0;
}
.wb-like svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.wb-like.liked { color: var(--danger); }
.wb-like.liked svg { fill: var(--danger); stroke: var(--danger); }
.wb-like-count { font-variant-numeric: tabular-nums; }
/* 图片灯箱 */
#wb-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}
#wb-lightbox.show { display: flex; }
#wb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
/* 图片网格 */
.wb-imgs {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    grid-template-columns: repeat(3, 1fr);
}
.wb-imgs.cols-1 { grid-template-columns: 1fr; max-width: 320px; }
.wb-imgs.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wb-imgs a { display: block; position: relative; overflow: hidden; border-radius: 10px; }
.wb-imgs img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    background: #f0f0f0;
}
/* 多图超过 9 张时，第 9 格叠加「+N」遮罩（真·九宫格） */
.wb-imgs-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}
.wb-imgs.cols-1 img { aspect-ratio: auto; max-height: 480px; object-fit: contain; }
/* 空态 / 翻页 */
.wb-empty { color: var(--meta); padding: 40px 0; text-align: center; }
.wb-pager {
    display: flex;
    justify-content: space-between;
    padding: 18px 0 30px;
}
.wb-pager a { color: var(--primary); text-decoration: none; font-size: 14px; }
/* 发文 */
.wb-compose textarea {
    width: 100%;
    min-height: 140px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font: inherit;
    resize: vertical;
    background: var(--card);
    color: var(--text);
}
.wb-compose-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}
.wb-upload {
    font-size: 20px;
    cursor: pointer;
    user-select: none;
}
.wb-count { color: var(--meta); font-size: 13px; margin-left: auto; }
.wb-msg { margin-top: 10px; font-size: 14px; min-height: 18px; }
.wb-msg.ok { color: #2e7d32; }
.wb-msg.err { color: var(--danger); }
/* 登录 / 初始化 */
.wb-login, .wb-setup {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-top: 10px;
}
.wb-login input, .wb-setup pre {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    margin: 8px 0;
}
.wb-setup pre { background: #f5f5f5; word-break: break-all; }
