:root {
    color-scheme: light;
    --ink: #192438;
    --body: #46536a;
    --muted: #66738a;
    --blue: #345fe8;
    --blue-strong: #244ecb;
    --blue-soft: #edf2ff;
    --line: #e3e8f1;
    --surface: #f6f8fc;
    --white: #fff;
    --sidebar: 248px;
    --topbar: 64px;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--white);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[v-cloak] { display: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
time, .muted { color: var(--muted); font-size: .86rem; }
.muted { line-height: 1.6; }
.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 20; top: 12px; left: 12px; background: white; padding: 10px 14px; }

.sidebar {
    position: fixed;
    z-index: 5;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar);
    padding: 24px 16px 15px;
    border-right: 1px solid #e8ecf5;
    background: var(--surface);
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 7px; }
.brand, .account-link { display: flex; align-items: center; min-width: 0; gap: 11px; padding: 0; text-align: left; }
.brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: white;
    background: linear-gradient(145deg, #5682fc, #315be1);
    box-shadow: 0 4px 9px #355ad526;
}
.brand-mark svg { width: 32px; height: 32px; }
.brand strong { display: block; font-size: 1.1rem; letter-spacing: .035em; }
.account-label small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
.button, .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.icon-button { flex: none; width: 38px; min-height: 38px; padding: 0; color: var(--muted); }
.icon-button:hover:not(:disabled), .quiet:hover, .quiet[aria-expanded="true"], .quiet[aria-pressed="true"] {
    color: var(--blue-strong);
    background: var(--blue-soft);
}
.primary { color: white; background: var(--blue); }
.primary:hover:not(:disabled) { background: var(--blue-strong); }
.secondary { color: var(--body); border-color: var(--line); background: white; }
.secondary:hover:not(:disabled), .top-action:hover { color: var(--blue-strong); border-color: #cbd9ff; background: var(--blue-soft); }
.destructive:hover:not(:disabled) { color: #ba3144; background: #fff0f1; }
.compose-button {
    width: 100%;
    justify-content: flex-start;
    min-height: 45px;
    margin-top: 30px;
    padding-left: 15px;
    color: var(--blue-strong);
    border-color: #dbe5ff;
    background: #eaf0ff;
}
.compose-button:hover { background: #dce7ff; border-color: #c8d8ff; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; margin-top: 24px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 23px; }
.nav-caption { padding: 0 9px 8px; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .08em; }
.nav-loading { padding: 10px; color: var(--muted); font-size: .85rem; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 43px;
    margin: 2px 0;
    padding: 5px 10px;
    border-radius: 9px;
    color: var(--body);
    text-align: left;
    font-size: .9rem;
}
.nav-link:hover { background: #eef1f7; }
.nav-link[aria-current="page"] { color: var(--blue-strong); background: #e7eeff; font-weight: 650; }
.nav-icon { display: grid; place-items: center; flex: none; width: 27px; height: 27px; border-radius: 8px; color: var(--muted); }
.nav-text, .account-label { flex: 1; min-width: 0; }
.nav-text, .account-label strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-indicator { flex: none; margin-left: auto; color: #647da9; font-size: .62rem; }
.sidebar-bottom { display: flex; align-items: center; gap: 5px; margin-top: 14px; padding: 14px 5px 0; border-top: 1px solid var(--line); }
.account-link { flex: 1; padding: 5px; border-radius: 10px; }
.account-link:hover { background: #eaf0fc; }
.account-label strong { font-size: .87rem; }
.drawer-scrim, .drawer-close, .menu-toggle, .mobile-compose { display: none; }

.workspace { margin-left: var(--sidebar); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 1px solid #edf0f5;
    background: #fffffffa;
}
.topbar-inner { display: flex; align-items: center; gap: 12px; justify-content: space-between; min-height: var(--topbar); padding: 0 clamp(18px, 4.5vw, 54px); }
.breadcrumbs { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: .88rem; font-weight: 600; }
.breadcrumbs button { flex: none; padding: 7px 0; color: var(--muted); }
.breadcrumbs button:hover { color: var(--blue); }
.breadcrumbs button i { margin-right: 3px; }
.breadcrumbs > i { flex: none; color: #8694ab; font-size: .61rem; }
.breadcrumbs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-action { min-height: 36px; padding-inline: 11px; color: var(--body); border-color: var(--line); font-size: .83rem; }
kbd { min-width: 18px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #f5f7fb; font: inherit; font-size: .75rem; }
.main-content { width: min(100% - 64px, 940px); margin: 32px auto 0; padding-bottom: 64px; }
.main-content:focus { outline: none; }

.search-composer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 8px 8px 8px 17px;
    border: 1px solid #dfe6f2;
    border-radius: 15px;
    box-shadow: 0 4px 16px #2542720b;
}
.search-composer:focus-within, .compact-search:focus-within { border-color: #91abff; box-shadow: 0 0 0 3px #e9efff; }
.search-glyph { color: #6f84ab; }
.search-composer input, .compact-search input { flex: 1; min-width: 0; padding: 7px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-composer input::-webkit-search-cancel-button { display: none; }
.search-composer .primary { min-width: 94px; }
.search-composer .primary i { font-size: .76rem; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.feed-heading { margin: 34px 0 14px; }
.section-kicker { margin-bottom: 5px; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .1em; }
.section-heading h1, .section-heading h2 { font-size: 1.48rem; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.count-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; color: var(--muted); background: var(--surface); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.feed { display: grid; gap: 12px; }
.post-card { min-width: 0; padding: 16px 21px 11px; border: 1px solid var(--line); border-radius: 15px; background: white; transition: border-color .16s ease; }
.post-card:hover { border-color: #cbd8f3; }
.card-top, .byline-row, .card-meta, .reading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; }
.card-top { justify-content: space-between; }
.byline { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; text-align: left; font-size: .88rem; }
.byline strong { overflow-wrap: anywhere; }
.byline:hover, .post-card h2 a:hover, .post-card h3 a:hover, .text-button:hover { color: var(--blue-strong); }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; overflow: hidden; border-radius: 10px; color: #3156bc; background: #eaf0ff; font-size: .9rem; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.guest { color: #506383; background: #e8edf6; }
.tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 8px; border-radius: 7px; color: #2f55be; background: #edf2ff; font-size: .77rem; font-weight: 650; overflow-wrap: anywhere; }
button.tag:hover { background: #dde8ff; }
.tone-blue { color: #2f55be; background: #e9efff; }
.tone-violet { color: #6548b2; background: #efeaff; }
.tone-teal { color: #237264; background: #e4f4ef; }
.post-card h2, .post-card h3 { margin: 10px 0 4px; font-size: 1.14rem; line-height: 1.55; overflow-wrap: anywhere; }
.post-content { color: var(--body); font-size: .92rem; line-height: 1.68; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-image-link { display: block; width: fit-content; max-width: 100%; margin-top: 12px; border-radius: 10px; }
.post-image { width: auto; max-height: 250px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); object-fit: contain; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 11px; padding-top: 7px; border-top: 1px solid #edf0f6; }
.quiet { min-height: 34px; padding-inline: 8px; color: var(--muted); font-size: .82rem; }
.post-tools { display: flex; gap: 2px; margin-left: auto; }
.post-actions .icon-button { width: 33px; min-height: 33px; }
.open-post { margin-left: auto; padding: 8px; color: var(--muted); font-size: .8rem; }
.open-post:hover { color: var(--blue-strong); }
.state-panel {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 125px;
    align-content: center;
    padding: 28px 18px;
    border: 1px dashed #d9e2f1;
    border-radius: 15px;
    color: var(--muted);
    background: #fbfcff;
    text-align: center;
}
.state-panel h1, .state-panel h2, .state-panel h3 { color: var(--ink); font-size: 1.15rem; }
.state-panel p { font-size: .88rem; }
.state-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 13px; background: var(--blue-soft); color: var(--blue-strong); font-size: 1.12rem; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination .icon-button { border-color: var(--line); }
.pagination [aria-current="page"] { border-color: #cddaff; color: var(--blue-strong); background: var(--blue-soft); }
.page-ellipsis { color: var(--muted); }

.reading-view, .profile-view { width: min(100%, 820px); margin: 0 auto; }
.reading-post, .discussion { border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 4vw, 36px); }
.reading-post h1 { margin: 12px 0; font-size: clamp(1.65rem, 3.6vw, 2.65rem); line-height: 1.3; letter-spacing: -.035em; overflow-wrap: anywhere; }
.reading-copy { margin: 24px 0; color: var(--body); line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.reading-image { margin-bottom: 20px; max-height: min(70vh, 560px); }
.discussion { margin-top: 14px; }
.discussion .section-heading { margin-bottom: 14px; }
.discussion > .secondary { margin-top: 12px; }
.inline-discussion { margin-top: 7px; padding: 12px; border-radius: 11px; background: var(--surface); }
.reply-list, .admin-list { display: grid; gap: 7px; list-style: none; margin: 0; padding: 0; }
.reply-list li { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; }
.reply-list li + li { border-top: 1px solid var(--line); }
.reply-copy { flex: 1; min-width: 0; }
.reply-copy p { margin-top: 3px; color: var(--body); font-size: .89rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.text-button { padding: 3px 0; color: var(--blue-strong); font-size: .85rem; font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.reply-links { display: flex; flex-wrap: wrap; gap: 9px; }
.reply-form { display: flex; align-items: stretch; gap: 7px; margin-top: 12px; }
.reply-form .field { flex: 1; }
.empty-replies { padding: 5px 0; }

.profile-head {
    display: flex;
    align-items: flex-start;
    gap: 17px;
    padding: clamp(18px, 4vw, 30px);
    border: 1px solid #dce6ff;
    border-radius: 20px;
    background: linear-gradient(115deg, #f6f8ff, #edf3ff);
}
.profile-avatar { width: 68px; height: 68px; border-radius: 18px; font-size: 1.9rem; }
.profile-identity { flex: 1; min-width: 0; }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.profile-name h1 { font-size: 1.75rem; line-height: 1.2; overflow-wrap: anywhere; }
.profile-identity p { margin-top: 7px; color: var(--body); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-stats { display: flex; gap: 13px; margin-top: 11px; color: var(--body); font-size: .83rem; }
.profile-stats strong { color: var(--ink); }
.profile-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 13px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface); }
.tabs button { padding: 8px 9px; border-radius: 8px; color: var(--body); font-size: .83rem; font-weight: 600; }
.tabs [aria-pressed="true"] { color: var(--blue-strong); background: white; box-shadow: 0 1px 4px #25427213; }
.compact-search { display: flex; align-items: center; gap: 8px; width: min(100%, 210px); padding: 3px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: .83rem; }
.compact-card { padding-bottom: 15px; }
.compact-card .card-meta { color: var(--muted); font-size: .8rem; }
.compact-card .card-meta:last-child { margin-top: 8px; }
.profile-editor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; }
.avatar-picker { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 5px; border-radius: 10px; color: var(--blue-strong); font-size: .82rem; cursor: pointer; }
.avatar-picker:focus-within, .upload-control:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }

.dialog {
    position: fixed;
    width: min(100% - 28px, 620px);
    max-height: calc(100dvh - 28px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    background: white;
    box-shadow: 0 24px 80px #172d5935;
}
.dialog::backdrop { background: #15234069; }
body:has(.dialog[open]) { overflow: hidden; }
.dialog-content { display: grid; gap: 17px; padding: clamp(16px, 4vw, 26px); }
.dialog-head, .dialog-head > div { display: flex; align-items: center; gap: 10px; }
.dialog-head { justify-content: space-between; }
.dialog-head h2 { font-size: 1.25rem; line-height: 1.4; }
.dialog-symbol { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--blue-strong); background: var(--blue-soft); }
.field-stack { display: grid; gap: 12px; min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-label { display: grid; gap: 6px; color: var(--body); font-size: .85rem; font-weight: 650; }
.field { width: 100%; min-width: 0; min-height: 41px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-weight: 400; }
.field:focus { border-color: #91abff; outline: 2px solid #dfe8ff; outline-offset: 0; }
textarea.field { resize: vertical; line-height: 1.6; }
.editor-body { min-height: 100px; }
.editor-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .82rem; }
.upload-control { cursor: pointer; }
.upload-control:has(input:disabled) { opacity: .55; cursor: wait; }
.editor-image { position: relative; width: fit-content; max-width: 100%; }
.editor-image img { max-height: 150px; border-radius: 9px; object-fit: contain; }
.editor-image button { position: absolute; top: 4px; right: 4px; background: white; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.auth-dialog, .confirm-dialog { max-width: 410px; }
.auth-switch, .confirm-dialog p { color: var(--body); font-size: .9rem; line-height: 1.65; }
.auth-switch { text-align: center; }
.auth-submit { margin-top: 3px; }
.admin-dialog { max-width: 840px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.admin-grid > section { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.admin-grid h3 { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 10px; font-size: 1rem; }
.admin-grid .reply-form { margin: 0 0 7px; }
.admin-list { max-height: 48vh; overflow-y: auto; scrollbar-width: thin; }
.admin-list li { display: flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 0; border-top: 1px solid var(--line); }
.admin-list .icon-button { width: 30px; min-height: 34px; }
.admin-list .text-button { flex: none; }
.admin-label { flex: 1; min-width: 0; font-size: .85rem; overflow-wrap: anywhere; }
.admin-label small { display: block; color: var(--muted); }
.danger-symbol, .inline-error { color: #ac3042; background: #fff0f1; }
.danger { color: white; background: #bb3749; }
.danger:hover { background: #9e2838; }
.inline-success { color: #23694e; background: #ebf7f0; }
.inline-error, .inline-success { padding: 8px 10px; border-radius: 8px; font-size: .84rem; overflow-wrap: anywhere; }
.toast {
    position: fixed;
    z-index: 8;
    right: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: min(360px, 100% - 36px);
    padding: 11px 13px;
    border: 1px solid #cbe8db;
    border-radius: 10px;
    color: #246147;
    background: #f0faf5;
    box-shadow: 0 8px 25px #1a284a16;
    font-size: .87rem;
}
.toast.error { color: #a73245; border-color: #f3cdd5; background: #fff4f6; }
.toast-enter-active, .toast-leave-active { transition: opacity .18s ease, transform .18s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(5px); }

@media (max-width: 1050px) {
    :root { --sidebar: 216px; }
    .main-content { width: calc(100% - 42px); }
}
@media (max-width: 760px) {
    :root { --topbar: 54px; }
    .sidebar {
        z-index: 7;
        width: min(82vw, 290px);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform .2s ease, visibility .2s;
        box-shadow: 10px 0 35px #14295321;
    }
    .sidebar.is-open { visibility: visible; transform: translateX(0); }
    .drawer-close, .menu-toggle { display: inline-flex; }
    .drawer-scrim { display: block; position: fixed; z-index: 6; inset: 0; width: 100%; background: #15234060; }
    body:has(.sidebar.is-open) { overflow: hidden; }
    .workspace { margin-left: 0; }
    .topbar-inner { justify-content: flex-start; gap: 8px; padding-inline: 10px; }
    .top-action { margin-left: auto; }
    .top-action kbd { display: none; }
    .mobile-compose { display: inline-flex; gap: 5px; min-height: 36px; padding-inline: 9px; }
    .breadcrumbs { gap: 7px; }
    .main-content { width: min(100% - 28px, 560px); margin-top: 17px; padding-bottom: 38px; }
    .search-composer { min-height: 53px; gap: 7px; padding: 5px 5px 5px 11px; }
    .search-composer .primary { min-width: 0; padding-inline: 10px; }
    .search-composer input { font-size: 1rem; }
    .field, .compact-search input { font-size: 1rem; }
    .feed-heading { margin-top: 24px; }
    .post-card { padding: 13px 13px 9px; }
    .post-actions { gap: 3px; }
    .post-actions .quiet { padding-inline: 5px; }
    .admin-grid { grid-template-columns: 1fr; }
    .admin-list { max-height: 30vh; }
}
@media (max-width: 420px) {
    .profile-head { flex-wrap: wrap; gap: 12px; }
    .profile-avatar { width: 52px; height: 52px; border-radius: 13px; font-size: 1.35rem; }
    .edit-profile { margin-left: 64px; }
    .profile-editor, .field-grid { grid-template-columns: 1fr; }
    .top-action span { display: none; }
    .quick-reply { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
