
:root {
    --ld-bg: #f5f7fb;
    --ld-surface: #ffffff;
    --ld-surface-soft: #f9fbff;
    --ld-border: #e9eef7;
    --ld-border-strong: #dce5f2;
    --ld-text: #1d2939;
    --ld-muted: #667085;
    --ld-faint: #98a2b3;
    --ld-primary: #2f80ed;
    --ld-primary-strong: #1d6fe8;
    --ld-primary-soft: #eff6ff;
    --ld-radius: 14px;
    --ld-shadow: 0 8px 24px rgba(16, 24, 40, .045);
    --ld-shadow-hover: 0 14px 34px rgba(16, 24, 40, .075);
}

body.lightdao-app-active {
    background: var(--ld-bg);
}

body.lightdao-app-active > header,
body.lightdao-app-active > footer,
body.lightdao-app-active > .bottom-nav,
body.lightdao-app-active > .floating-actions {
    display: none !important;
}

body.lightdao-app-active #body {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.lightdao-app-active #body > .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.lightdao-app-active #body > .container > :not(.lightdao-app) {
    display: none !important;
}

.lightdao-app {
    display: none;
}

body.lightdao-app-active .lightdao-app {
    display: block;
    min-height: 100vh;
    color: var(--ld-text);
    background: radial-gradient(circle at 50% -120px, rgba(47, 128, 237, .08), transparent 360px), var(--ld-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    letter-spacing: -.01em;
}

.ld-shell {
    min-height: 100vh;
}

.ld-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 68px;
    border-bottom: 1px solid rgba(233, 238, 247, .92);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(18px);
}

.ld-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1200px, calc(100vw - 32px));
    height: 68px;
    margin: 0 auto;
}

.ld-brand,
.ld-header nav,
.ld-channel,
.ld-card-foot,
.ld-card-meta,
.ld-post-author,
.ld-mobile-nav {
    display: flex;
    align-items: center;
}

.ld-brand {
    gap: 9px;
    color: var(--ld-text);
    font-size: 18px;
    font-weight: 780;
    letter-spacing: -.02em;
    text-decoration: none;
}

.ld-brand-text {
    display: grid;
    gap: 1px;
}

.ld-brand-text small {
    color: var(--ld-faint);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .1em;
}

.ld-brand img {
    width: 34px;
    height: 34px;
}

.ld-header nav {
    gap: 4px;
}

.ld-header nav a,
.ld-mobile-nav a {
    color: var(--ld-muted);
    text-decoration: none;
}

.ld-header nav a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
}

.ld-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ld-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 248px;
    height: 40px;
    padding: 0 10px 0 14px;
    border: 1px solid var(--ld-border);
    border-radius: 20px;
    color: var(--ld-faint);
    background: #f7f9fd;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.ld-search span {
    flex: 1;
}

.ld-search kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #e5eaf3;
    border-radius: 7px;
    color: #98a2b3;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
}

.ld-publish {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 17px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--ld-primary), var(--ld-primary-strong));
    font-size: 14px;
    font-weight: 720;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(47, 128, 237, .2);
}

.ld-header nav a:hover {
    color: var(--ld-primary);
    background: var(--ld-primary-soft);
}

.ld-main {
    display: grid;
    grid-template-columns: 218px minmax(0, 1fr) 282px;
    gap: 16px;
    width: min(1200px, calc(100vw - 32px));
    margin: 20px auto 48px;
}

.ld-panel,
.ld-card,
.ld-forum-card,
.ld-post,
.ld-hero,
.ld-thread,
.ld-composer,
.ld-tabs {
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius);
    background: #fff;
    box-shadow: var(--ld-shadow);
}

.ld-panel {
    padding: 14px;
}

.ld-panel + .ld-panel {
    margin-top: 14px;
}

.ld-panel-title {
    margin-bottom: 9px;
    color: var(--ld-faint);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .06em;
}

.ld-channel {
    gap: 9px;
    min-height: 38px;
    padding: 8px 9px;
    border-radius: 11px;
    color: var(--ld-muted);
    font-size: 14px;
    font-weight: 620;
    text-decoration: none;
}

.ld-channel-count {
    margin-left: auto;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 750;
}

.ld-channel:hover {
    color: #2563eb;
    background: rgba(59, 130, 246, .08);
}

.ld-channel i,
.ld-forum-card i {
    color: #3b82f6;
}

.ld-section-head {
    margin-bottom: 14px;
}

.ld-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #2563eb;
    background: rgba(37, 99, 235, .09);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ld-section-head h1 {
    margin: 0 0 6px;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.1;
    letter-spacing: -.04em;
}

.ld-tabs {
    display: flex;
    gap: 8px;
    padding: 10px;
    margin-bottom: 14px;
}

.ld-tab {
    padding: 8px 14px;
    border-radius: 999px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.ld-tab.is-active,
.ld-tab:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, .09);
}

.ld-composer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.ld-composer-avatar,
.ld-card-avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.ld-composer-input {
    flex: 1;
    height: 42px;
    padding: 0 15px;
    border-radius: 999px;
    color: #94a3b8;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 650;
    line-height: 42px;
}

.ld-section-head p,
.ld-card p,
.ld-panel p,
.ld-forum-card span,
.ld-empty {
    color: #64748b;
}

.ld-feed {
    display: grid;
    gap: 12px;
}

.ld-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ld-card:hover {
    border-color: rgba(37, 99, 235, .24);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.ld-card h2 {
    margin: 6px 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.ld-card-main {
    min-width: 0;
}

.ld-card p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.7;
}

.ld-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #2563eb;
    background: rgba(37, 99, 235, .08);
    font-size: 12px;
    font-weight: 800;
}

.ld-card h2 a {
    color: #0f172a;
    text-decoration: none;
}

.ld-card h2 a:hover {
    color: #2563eb;
}

.ld-card-meta,
.ld-card-foot {
    flex-wrap: wrap;
    gap: 12px;
    color: #94a3b8;
    font-size: 13px;
}

.ld-card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ld-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ld-forum-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ld-forum-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 112px;
    padding: 16px;
    color: #0f172a;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ld-forum-card:hover {
    border-color: rgba(37, 99, 235, .26);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .075);
    transform: translateY(-1px);
}

.ld-hot-list {
    display: grid;
    gap: 8px;
}

.ld-hot-item {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border-radius: 11px;
    color: var(--ld-text);
    background: #f8fafc;
    text-decoration: none;
}

.ld-hot-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 680;
}

.ld-hot-item span {
    color: var(--ld-faint);
    font-size: 12px;
}

.ld-forum-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(47, 128, 237, .13), rgba(14, 165, 233, .08));
}

.ld-forum-icon i {
    font-size: 23px;
}

.ld-forum-main {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.ld-forum-main strong {
    font-size: 17px;
    font-weight: 730;
}

.ld-forum-main em {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ld-muted);
    font-size: 13px;
    font-style: normal;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ld-forum-count {
    display: grid;
    justify-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    padding-left: 10px;
    color: var(--ld-faint);
}

.ld-forum-count b {
    color: var(--ld-primary);
    font-size: 20px;
    line-height: 1;
}

.ld-forum-count small {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 750;
}

.ld-stats span {
    display: block;
    color: var(--ld-primary);
    font-size: 28px;
    font-weight: 780;
}

.ld-hero {
    padding: 32px;
}

.ld-button {
    display: inline-flex;
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 999px;
    color: #fff;
    background: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

.ld-thread {
    padding: 0;
    overflow: hidden;
}

.ld-thread-head {
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--ld-border);
    background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.ld-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--ld-primary);
    background: var(--ld-primary-soft);
    font-size: 13px;
    font-weight: 680;
    text-decoration: none;
}

.ld-thread-head h1 {
    margin: 0 0 16px;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 780;
    line-height: 1.22;
    letter-spacing: -.035em;
}

.ld-thread-author,
.ld-thread-stats,
.ld-post-actions {
    display: flex;
    align-items: center;
}

.ld-thread-author {
    gap: 11px;
}

.ld-thread-author img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.ld-thread-author span {
    display: block;
    margin-top: 2px;
    color: var(--ld-faint);
    font-size: 12px;
}

.ld-thread-stats {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.ld-thread-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--ld-muted);
    background: #fff;
    border: 1px solid var(--ld-border);
    font-size: 12px;
    font-weight: 650;
}

.ld-posts {
    display: grid;
    gap: 0;
}

.ld-post {
    padding: 20px 24px 22px;
    border: 0;
    border-bottom: 1px solid var(--ld-border);
    border-radius: 0;
    box-shadow: none;
}

.ld-post-author {
    gap: 12px;
    margin-bottom: 14px;
}

.ld-post-author img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.ld-post-author span {
    display: block;
    color: var(--ld-faint);
    font-size: 12px;
}

.ld-post-body {
    color: #1f2937;
    font-size: 16px;
    line-height: 1.85;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ld-post-body *,
.ld-post-body *::before,
.ld-post-body *::after {
    box-sizing: border-box;
    max-width: 100%;
}

.ld-post-body > :first-child {
    margin-top: 0;
}

.ld-post-body > :last-child {
    margin-bottom: 0;
}

.ld-post-body p,
.ld-post-body ul,
.ld-post-body ol,
.ld-post-body blockquote,
.ld-post-body pre,
.ld-post-body .ld-table-wrap {
    margin: 0 0 16px;
}

.ld-post-body h1,
.ld-post-body h2,
.ld-post-body h3,
.ld-post-body h4 {
    margin: 24px 0 12px;
    color: #0f172a;
    font-weight: 850;
    line-height: 1.28;
}

.ld-post-body h1 {
    font-size: 28px;
}

.ld-post-body h2 {
    font-size: 23px;
}

.ld-post-body h3 {
    font-size: 19px;
}

.ld-post-body ul,
.ld-post-body ol {
    padding-left: 1.35em;
}

.ld-post-body li + li {
    margin-top: 6px;
}

.ld-post-body blockquote {
    padding: 14px 16px;
    border-left: 4px solid #60a5fa;
    border-radius: 0 14px 14px 0;
    color: #475569;
    background: #f8fbff;
}

.ld-post-body code {
    padding: 2px 6px;
    border-radius: 7px;
    color: #1e40af;
    background: #eff6ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .92em;
}

.ld-post-body pre,
.ld-post-body .ld-content-code {
    overflow: auto;
    max-width: 100%;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    color: #dbeafe;
    background: #0f172a;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.ld-post-body pre code,
.ld-post-body .ld-content-code code {
    padding: 0;
    color: inherit;
    background: transparent;
}

.ld-post-body img,
.ld-post-body video,
.ld-post-body .ld-content-image,
.ld-post-body .ld-content-media {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 14px 0;
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

.ld-post-body audio,
.ld-post-body .ld-content-media:is(audio) {
    width: min(100%, 520px);
    margin: 14px 0;
}

.ld-post-body .ld-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
}

.ld-post-body table {
    width: max-content;
    max-width: none;
    border-collapse: collapse;
    min-width: min(520px, 100%);
}

.ld-post-body th,
.ld-post-body td {
    max-width: 360px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.ld-post-body th {
    color: #0f172a;
    background: #f8fafc;
    font-weight: 800;
}

.ld-post-body a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.ld-post-body a:hover {
    text-decoration: underline;
}

.ld-post-body .ld-content-attachment {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 6px 8px 6px 0;
    padding: 9px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 14px;
    font-weight: 800;
}

.ld-post-body .ld-content-empty {
    color: #94a3b8;
    font-style: italic;
}

.ld-post-actions {
    gap: 8px;
    margin-top: 16px;
}

.ld-post-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid #edf0f5;
    border-radius: 999px;
    color: #64748b;
    background: #fff;
    font-size: 12px;
    font-weight: 750;
}

.ld-loading,
.ld-empty {
    padding: 40px;
    text-align: center;
}

.ld-mobile-nav {
    display: none;
}

@media (max-width: 980px) {
    .ld-header-inner {
        width: calc(100vw - 28px);
    }

    .ld-header nav {
        display: none;
    }

    .ld-search,
    .ld-publish {
        display: none;
    }

    .ld-main {
        display: block;
        width: min(100% - 24px, 720px);
        margin-top: 18px;
        padding-bottom: 82px;
    }

    .ld-sidebar,
    .ld-aside {
        display: none;
    }

    .ld-forum-grid {
        grid-template-columns: 1fr;
    }

    .ld-card h2 {
        font-size: 17px;
    }

    .ld-card {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 14px;
    }

    .ld-card-avatar,
    .ld-composer-avatar {
        width: 38px;
        height: 38px;
    }

    .ld-thread-head {
        padding: 18px 16px 15px;
    }

    .ld-thread-head h1 {
        font-size: 23px;
        line-height: 1.28;
    }

    .ld-post {
        padding: 17px 16px 18px;
    }

    .ld-post-body {
        font-size: 15px;
        line-height: 1.78;
    }

    .ld-post-body h1 {
        font-size: 23px;
    }

    .ld-post-body h2 {
        font-size: 20px;
    }

    .ld-post-body h3 {
        font-size: 17px;
    }

    .ld-post-body pre,
    .ld-post-body .ld-content-code {
        padding: 12px;
        border-radius: 13px;
        font-size: 13px;
    }

    .ld-post-body .ld-table-wrap {
        margin-right: -2px;
        margin-left: -2px;
        border-radius: 13px;
    }

    .ld-post-body table {
        min-width: 560px;
        font-size: 13px;
    }

    .ld-post-body th,
    .ld-post-body td {
        max-width: 220px;
        padding: 9px 10px;
    }

    .ld-mobile-nav {
        position: fixed;
        right: 12px;
        bottom: 12px;
        left: 12px;
        z-index: 30;
        justify-content: space-around;
        padding: 8px;
        border: 1px solid rgba(226, 232, 240, .9);
        border-radius: 22px;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
        backdrop-filter: blur(16px);
    }

    .ld-mobile-nav a {
        display: grid;
        justify-items: center;
        gap: 2px;
        min-width: 56px;
        font-size: 12px;
        font-weight: 750;
    }

    .ld-mobile-nav i {
        font-size: 19px;
    }
}
