/* 微我社区 · 样式（与 wewat.hk 主站、刷题端同一套「微我蓝」设计体系） */
:root {
    --brand: #2563eb;
    --brand-d: #1d4ed8;
    --brand-l: #eff6ff;
    --brand-b: #bfdbfe;
    --teal: #0d9488;
    --teal-l: #f0fdfa;
    --ink: #0f172a;
    --ink-2: #475569;
    --ink-3: #94a3b8;
    --line: #e2e8f0;
    --bg: #ffffff;
    --bg-2: #f8fafc;
    --danger: #dc2626;
    --danger-l: #fef2f2;
    --warn: #b45309;
    --warn-l: #fffbeb;
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 16px;
    --ring: 0 0 0 1px var(--line), 0 1px 2px 0 rgba(15, 23, 42, .04);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", "Noto Sans CJK TC", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg-2); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 导航 */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.links { display: flex; gap: 22px; font-size: 15px; color: var(--ink-2); }
.links a:hover { color: var(--brand); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; font-size: 13px; padding: 3px 10px; border-radius: 999px; color: var(--ink-2); cursor: pointer; }
.lang button.on { background: var(--ink); color: #fff; }
.account { position: relative; }
.acct-login { font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: var(--r-sm); background: var(--brand); color: #fff; }
.acct-login:hover { background: var(--brand-d); }
.acct-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.acct-name { font-size: 14px; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .18); }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--bg-2); }
.acct-menu button { color: var(--danger); }

/* 布局 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding-top: 24px; padding-bottom: 48px; align-items: start; }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--ring); }
.pad { padding: 20px; }
.side h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: var(--r-sm); white-space: nowrap; }
.btn:hover { background: var(--brand-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { background: var(--danger); }
.link-btn { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--ink-3); padding: 4px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--brand); background: var(--brand-l); }
.link-btn.on { color: var(--brand); font-weight: 600; }
.link-btn.danger:hover { color: var(--danger); background: var(--danger-l); }

/* 版块 */
.boards { display: flex; flex-direction: column; gap: 4px; }
.board { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2); }
.board:hover { background: var(--bg-2); color: var(--ink); }
.board.on { background: var(--brand-l); color: var(--brand); font-weight: 600; }
.board .n { font-size: 12px; color: var(--ink-3); }
.chips { display: none; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; font-size: 13px; padding: 6px 14px; border-radius: 999px; background: #fff; box-shadow: var(--ring); color: var(--ink-2); }
.chip.on { background: var(--brand); color: #fff; box-shadow: none; }
.rules { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

/* 列表工具栏 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; box-shadow: var(--ring); border-radius: var(--r-md); padding: 0 14px; height: 42px; }
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 14px; min-width: 0; }
.search svg { flex-shrink: 0; color: var(--ink-3); }
.tabs { display: flex; background: #fff; box-shadow: var(--ring); border-radius: var(--r-md); padding: 3px; }
.tabs a { font-size: 14px; padding: 7px 14px; border-radius: 9px; color: var(--ink-2); white-space: nowrap; }
.tabs a.on { background: var(--brand-l); color: var(--brand); font-weight: 600; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--r-lg); background: var(--teal-l); box-shadow: 0 0 0 1px #ccfbf1; font-size: 14px; }
.banner b { color: var(--teal); }

/* 帖子卡片 */
.posts { display: flex; flex-direction: column; gap: 12px; }
.post { display: block; padding: 18px 20px; transition: box-shadow .15s; }
.post:hover { box-shadow: 0 0 0 1px var(--brand-b), 0 6px 16px -8px rgba(37, 99, 235, .25); }
.post-title { font-size: 16px; font-weight: 700; line-height: 1.45; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-excerpt { margin-top: 6px; font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.meta { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.meta .who { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.meta .stat { display: inline-flex; align-items: center; gap: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--brand-l); color: var(--brand); }
.tag.teal { background: var(--teal-l); color: var(--teal); }
.tag.warn { background: var(--warn-l); color: var(--warn); }
.tag.danger { background: var(--danger-l); color: var(--danger); }
.avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--bg-2); flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; }
.avatar.md { width: 40px; height: 40px; }
.more { display: flex; justify-content: center; padding: 8px 0; }
.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); }
.empty .big { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; }
.empty .big svg { width: 26px; height: 26px; }
.skeleton { height: 108px; border-radius: var(--r-lg); background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 详情 */
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.back:hover { color: var(--brand); }
.article { padding: 26px 28px; }
.article h1 { font-size: 22px; font-weight: 800; line-height: 1.4; letter-spacing: -.01em; margin-top: 10px; word-break: break-word; }
.author-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.author-row b { color: var(--ink); font-size: 14px; display: block; }
.content { margin-top: 20px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.bank-card { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 14px; border-radius: var(--r-md); background: var(--teal-l); box-shadow: 0 0 0 1px #ccfbf1; font-size: 14px; }
.bank-card .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.bank-card .grow { flex: 1; min-width: 0; }
.actions { display: flex; align-items: center; gap: 6px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions .spacer { flex: 1; }
.like-btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.like-btn.on { background: var(--brand-l); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-b); }
.notice { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-l); color: var(--warn); box-shadow: 0 0 0 1px #fde68a; }

/* 评论 */
.comments { margin-top: 16px; padding: 22px 28px; }
.comments h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.cmt { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: 0; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.cmt-head b { color: var(--ink); font-size: 14px; }
.cmt-head .op { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--brand-l); color: var(--brand); font-weight: 600; }
.cmt-text { margin-top: 4px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.cmt-text .at { color: var(--brand); font-weight: 600; margin-right: 4px; }
.cmt-actions { margin-top: 4px; display: flex; gap: 2px; margin-left: -6px; }
.composer { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.replying { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--brand); background: var(--brand-l); padding: 6px 12px; border-radius: 8px; }
textarea, .input { width: 100%; border: 0; border-radius: var(--r-md); background: #fff; box-shadow: inset 0 0 0 1px var(--line); padding: 12px 14px; font-size: 15px; line-height: 1.7; resize: vertical; outline: 0; }
textarea:focus, .input:focus { box-shadow: inset 0 0 0 2px var(--brand); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.count { font-size: 12px; color: var(--ink-3); }
.login-hint { text-align: center; padding: 22px; border-radius: var(--r-md); background: var(--bg-2); font-size: 14px; color: var(--ink-2); }
.login-hint .btn { margin-top: 10px; }

/* 发帖 */
.form { padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.form h1 { font-size: 20px; font-weight: 800; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { border: 0; cursor: pointer; font-size: 14px; padding: 7px 14px; border-radius: 999px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.pick button.on { background: var(--brand-l); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-b); font-weight: 600; }
.tip { font-size: 13px; color: var(--ink-3); }

/* 浮动发帖、提示、弹窗 */
.fab { display: none; position: fixed; right: 20px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 30px; line-height: 56px; text-align: center; box-shadow: 0 10px 24px -6px rgba(37, 99, 235, .55); z-index: 25; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(15, 23, 42, .92); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 999px; z-index: 60; max-width: 86vw; text-align: center; }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 420px; background: #fff; border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35); }
.modal h3 { font-size: 17px; font-weight: 700; }
.modal p { font-size: 14px; color: var(--ink-2); }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; cursor: pointer; }
.radio-list label:has(input:checked) { box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-l); }

.footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 13px; color: var(--ink-2); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* 响应式 */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .side { position: static; }
    .side .boards-card { display: none; }
    .chips { display: flex; }
    .fab { display: block; }
    .side .post-cta { display: none; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 14px; }
    .nav-inner { gap: 12px; }
    .links, .acct-name { display: none; }
    .brand-text { font-size: 16px; }
    .acct-chip { padding: 3px; }
    .layout { padding-top: 14px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .tabs { align-self: flex-start; }
    .article, .comments, .form { padding: 20px 18px; }
    .article h1 { font-size: 19px; }
    .post { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
