:root {
    --novel-topbar-columns: 44px 1fr 44px;
    --novel-topbar-padding: 12px 18px;
    --novel-top-btn-size: 44px;
    --novel-shell-padding: 26px 18px 34px;
    --novel-content-padding: 18px;
    --novel-reaction-margin: 24px 0;
    --react-item-width: auto;
    --react-item-justify: flex-start;
    --novel-nav-direction: row;
}

body.novel-body {
    margin: 0;
    background: #000;
    color: #e9eaec;
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.7;
}

.novel-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: var(--novel-topbar-columns);
    align-items: center;
    gap: 12px;
    padding: var(--novel-topbar-padding);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.top-btn {
    width: var(--novel-top-btn-size);
    height: var(--novel-top-btn-size);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.08);
}

.top-btn .icon {
    width: 18px;
    height: 18px;
    filter: invert(1);
}

.top-meta {
    text-align: center;
}

.top-meta .crumb {
    font-size: 12px;
    color: #9aa0a6;
    letter-spacing: 0.4px;
}

.top-meta .title {
    font-weight: 700;
    font-size: 16px;
    color: #f4f5f6;
    line-height: 1.4;
}
.top-meta .subline {
    font-size: 13px;
    color: #c3c8d0;
}

.novel-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--novel-shell-padding);
}

.novel-header {
    text-align: center;
    margin-bottom: 12px;
}
.novel-header h1 {
    margin: 12px 0 6px;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.25;
    color: #fff;
}
.novel-header .muted {
    color: #9aa0a6;
    margin: 0;
}

.novel-content {
    margin: 0 0 18px;
    padding: var(--novel-content-padding);
    background: #050505;
    border: 1px solid #0f0f0f;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.novel-content p {
    margin: 0 0 16px;
    color: #e9eaec;
    font-size: 16px;
}

.novel-content img {
    max-width: 100%;
    border-radius: 14px;
    display: block;
    margin: 14px auto;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.novel-content em,
.novel-content i {
    font-style: italic;
}

.novel-content h1,
.novel-content h2,
.novel-content h3 {
    margin: 18px 0 10px;
    color: #fff;
}

.novel-content blockquote {
    border-left: 3px solid #f05454;
    padding: 8px 12px;
    margin: 10px 0 16px;
    color: #cfd2d6;
    background: rgba(240,84,84,0.06);
    border-radius: 8px;
}

.novel-content ul,
.novel-content ol {
    padding-left: 20px;
    margin: 0 0 16px;
}

.attachment-box {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
}

.attach-head {
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 10px;
}

.attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.attach-card {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: #0e0e0e;
}

.attach-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.novel-nav {
    margin-top: 0;
    display: none;
    flex-direction: var(--novel-nav-direction);
}


.reaction-box {
    display: flex;
    justify-content: center;
    margin: var(--novel-reaction-margin);
}

.react-flex {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.react-item {
    background: #0f0f0f;
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #1e1e1e;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: var(--react-item-width);
    justify-content: var(--react-item-justify);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.react-item:hover {
    transform: translateY(-1px);
    background: #151515;
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.react-item.active-upvote {
    background: #ffcc00;
    color: #3a2c00;
}
.react-item.active-suki {
    background: #ff4d4d;
    color: #fff;
}
.react-item.active-apsih {
    background: #3da9ff;
    color: #051d30;
}


.comment-box {
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 14px;
}

.comment-text {
    width: 100%;
    background: #161616;
    color: #f5f5f5;
    border: 1px solid #242424;
    border-radius: 10px;
    padding: 10px;
    resize: vertical;
    min-height: 72px;
}

.comment-btn {
    margin-top: 8px;
    padding: 10px 14px;
    background: #f05454;
    color: #fff;
    border: 1px solid #f05454;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

#commentList {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 12px;
}

.c-head {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #f5f5f5;
    margin-bottom: 6px;
}

.c-time {
    font-size: 12px;
    color: #9aa0a6;
}

.c-text {
    margin: 0 0 8px;
    color: #dadde2;
    line-height: 1.6;
}

.c-actions {
    display: flex;
    gap: 10px;
}

.comment-reply-btn,
.comment-delete-btn {
    background: none;
    border: none;
    color: #f05454;
    cursor: pointer;
    font-weight: 700;
    padding: 0;
}

.comment-delete-btn {
    color: #ff8a8a;
}

.reply-box {
    margin-top: 10px;
}

@media (max-width: 640px) {
    :root {
        --novel-topbar-columns: 40px 1fr 40px;
        --novel-topbar-padding: 10px 14px;
        --novel-top-btn-size: 40px;
        --novel-shell-padding: 18px 14px 30px;
        --novel-content-padding: 14px;
        --novel-reaction-margin: 16px 0;
        --react-item-width: 100%;
        --react-item-justify: center;
        --novel-nav-direction: column;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}
