:root {
    --rd-bg: #f4f6f8;
    --rd-panel: #ffffff;
    --rd-ink: #14201a;
    --rd-muted: #5f6f66;
    --rd-line: #d5ddd8;
    --rd-accent: #0f6b4c;
    --rd-accent-soft: #e6f3ed;
    --rd-hot: #b45309;
}

.rd-page {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: .35rem .5rem .5rem;
}

.rd-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .5rem;
    align-items: end;
    margin-bottom: .45rem;
    background: var(--rd-panel);
    border: 1px solid var(--rd-line);
    border-radius: 8px;
    padding: .4rem .55rem;
}

.rd-field label {
    display: block;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--rd-muted);
    margin-bottom: .1rem;
}

.rd-field select,
.rd-field input {
    border: 1px solid var(--rd-line);
    border-radius: 6px;
    padding: .28rem .45rem;
    background: #f8faf9;
    color: var(--rd-ink);
    min-width: 6.5rem;
    font-size: .85rem;
}

.rd-btn {
    border: 0;
    border-radius: 6px;
    padding: .32rem .7rem;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    background: var(--rd-accent);
    color: #fff;
}

.rd-btn:disabled {
    opacity: .55;
    cursor: wait;
}

.rd-btn-ghost {
    background: #eef2f0;
    color: var(--rd-ink);
}

.rd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
    height: calc(100vh - 7.5rem);
    min-height: 420px;
}

.rd-aside,
.rd-main {
    background: var(--rd-panel);
    border: 1px solid var(--rd-line);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: calc(100vh - 7.5rem);
}

.rd-main {
    position: sticky;
    top: .75rem;
}

.rd-aside-head,
.rd-main-head {
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--rd-line);
    font-weight: 800;
    color: var(--rd-ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.rd-aside-head span,
.rd-status {
    font-size: .78rem;
    font-weight: 600;
    color: var(--rd-muted);
}

.rd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.rd-main-body {
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.rd-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: .55rem;
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--rd-line);
    cursor: pointer;
    text-align: left;
    width: 100%;
    background: transparent;
    border-left: 3px solid transparent;
}

.rd-item:hover {
    background: #f7faf8;
}

.rd-item.is-active {
    background: var(--rd-accent-soft);
    border-left-color: var(--rd-accent);
}

.rd-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #e8eee9;
}

.rd-thumb-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rd-muted);
    font-size: .7rem;
    font-weight: 700;
}

.rd-item-title {
    font-size: .88rem;
    font-weight: 700;
    color: var(--rd-ink);
    line-height: 1.3;
    margin: 0 0 .25rem;
}

.rd-item-meta {
    font-size: .72rem;
    color: var(--rd-muted);
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .55rem;
}

.rd-empty {
    color: var(--rd-muted);
    padding: 2rem 1rem;
    text-align: center;
}

.rd-post-title {
    margin: 0 0 .5rem;
    font-size: 1.35rem;
    line-height: 1.25;
    color: var(--rd-ink);
}

.rd-post-meta {
    font-size: .8rem;
    color: var(--rd-muted);
    margin-bottom: .85rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
}

.rd-post-meta a {
    color: var(--rd-accent);
    font-weight: 700;
    text-decoration: none;
}

.rd-post-text {
    white-space: pre-wrap;
    line-height: 1.5;
    color: #1c2a23;
    margin-bottom: 1.25rem;
}

.rd-post-orig {
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--rd-muted);
}

.rd-comments-title {
    margin: 0 0 .65rem;
    font-size: .95rem;
    font-weight: 800;
}

.rd-comment {
    border-top: 1px solid var(--rd-line);
    padding: .7rem 0 .7rem 0;
}

.rd-comment[data-depth="1"] { padding-left: 1rem; }
.rd-comment[data-depth="2"] { padding-left: 1.75rem; }

.rd-comment-meta {
    font-size: .72rem;
    color: var(--rd-muted);
    margin-bottom: .25rem;
}

.rd-comment-body {
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: .9rem;
}

.rd-score {
    color: var(--rd-hot);
    font-weight: 700;
}

@media (max-width: 860px) {
    .rd-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }
    .rd-aside {
        height: 42vh;
        max-height: 42vh;
    }
    .rd-main {
        position: static;
        height: auto;
        max-height: none;
        min-height: 50vh;
    }
}
