.blog-manage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-manage-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.page--blog_main {
    --shelf-bg-1: #f7f2e4;
    --shelf-bg-2: #e7efe9;
    --shelf-bg-3: #f3e1cf;
    --shelf-ink: #243734;
    --shelf-muted: #60726e;
    --shelf-accent: #c86c3a;
    --shelf-primary: #2f7b64;
    --shelf-border: #d7c8b1;
    --shelf-card: #fffdf7;
    position: relative;
    background:
        radial-gradient(1200px 360px at -8% -10%, var(--shelf-bg-3), transparent 60%),
        radial-gradient(900px 280px at 100% -8%, #d8e9e0, transparent 62%),
        linear-gradient(180deg, var(--shelf-bg-1), var(--shelf-bg-2));
}

.page--blog_main::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.16;
    background-image: repeating-linear-gradient(
        -10deg,
        rgba(67, 92, 85, 0.07) 0 1px,
        transparent 1px 28px
    );
}

.blog-shelf-layout {
    position: relative;
    z-index: 1;
}

.blog-shelf-frame {
    border: 1px solid var(--shelf-border);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 254, 251, 0.95)),
        var(--shelf-card);
    box-shadow:
        0 18px 40px rgba(60, 72, 67, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.blog-shelf-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 24px 26px 20px;
    border-bottom: 1px solid rgba(120, 103, 78, 0.18);
    background:
        linear-gradient(95deg, rgba(255, 247, 234, 0.95), rgba(238, 247, 240, 0.96));
}

.blog-shelf-hero__intro {
    max-width: 780px;
}

.blog-shelf-hero__kicker {
    margin: 0 0 8px;
    color: var(--shelf-accent);
    font: 700 12px/1.2 "Avenir Next", "Trebuchet MS", "PingFang SC", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.blog-shelf-hero__title {
    margin: 0;
    color: var(--shelf-ink);
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.blog-shelf-hero__desc {
    margin: 12px 0 0;
    color: var(--shelf-muted);
    max-width: 56ch;
    font: 500 15px/1.65 "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.blog-shelf-hero__actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.blog-shelf-hero__actions .button {
    margin: 0;
    border-radius: 999px;
}

.blog-shelf-hero__actions .button.primary {
    border: 0;
    background: linear-gradient(135deg, #2f7b64, #459678);
    box-shadow: 0 8px 20px rgba(47, 123, 100, 0.32);
}

.blog-shelf-hero__actions .button:not(.primary) {
    border: 1px solid rgba(53, 86, 78, 0.26);
    background: rgba(255, 255, 255, 0.7);
    color: var(--shelf-ink);
}

.blog-shelf-body {
    padding: 24px;
}

.blog-shelf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.blog-shelf-card {
    border: 1px solid rgba(121, 102, 75, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffefb, #fff9ee);
    box-shadow:
        0 10px 24px rgba(59, 67, 64, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    min-height: 260px;
    overflow: visible;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    opacity: 0;
    animation: shelf-card-in 0.54s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.blog-shelf-card:hover {
    transform: translateY(-2px);
    border-color: rgba(90, 72, 43, 0.42);
    box-shadow:
        0 16px 30px rgba(42, 55, 49, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.blog-shelf-card__cover {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background:
        linear-gradient(130deg, rgba(45, 121, 98, 0.16), rgba(202, 138, 92, 0.22));
    border-bottom: 1px solid rgba(118, 96, 66, 0.22);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.blog-shelf-card__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #fbf3e6;
    background: linear-gradient(160deg, #5f3e24, #8d5f37);
    font: 700 14px/1 "Avenir Next", "Trebuchet MS", sans-serif;
}

.blog-shelf-card__content {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-shelf-card__title {
    margin: 0;
    color: #1e2f2d;
    font: 700 27px/1.3 "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
}

.blog-shelf-card__subtitle {
    margin: 0;
    color: #586c67;
    font: 500 14px/1.55 "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    min-height: 1.5em;
}

.blog-shelf-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    color: #66766f;
    font: 600 12px/1.4 "Avenir Next", "Trebuchet MS", "PingFang SC", sans-serif;
}

.blog-shelf-card__actions {
    margin-top: auto;
    padding: 0 16px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-shelf-card__actions .button {
    margin: 0;
    border-radius: 999px;
}

.blog-shelf-card__actions .button.primary {
    border: 0;
    background: linear-gradient(135deg, #2f7b64, #46967a);
}

.blog-shelf-admin-toggle {
    margin: 0;
    color: #355c53;
}

.blog-shelf-card__actions .button.rounded.blog-shelf-admin-toggle {
    background: #dff2ea;
    border-color: #b8dbcd;
    color: #2f6f5f;
}

.blog-shelf-card__actions .button.rounded.blog-shelf-admin-toggle:hover {
    background: #d2ebdf;
    border-color: #9fceb9;
}

.blog-shelf-admin__panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid rgba(105, 92, 74, 0.32);
    border-radius: 12px;
    background: #fffdf9;
    box-shadow: 0 6px 14px rgba(43, 54, 50, 0.12);
}

.blog-shelf-admin__panel[hidden] {
    display: none;
}

.blog-shelf-admin__panel .button {
    margin: 0;
    width: 100%;
    text-align: center;
    border-radius: 9px;
    border: 1px solid rgba(99, 86, 66, 0.24);
    background: #fff;
    color: #354b46;
    font-weight: 600;
}

.blog-shelf-admin__panel .button:hover {
    background: #f4f8f6;
    border-color: rgba(63, 98, 88, 0.36);
}

.blog-shelf-admin__panel .inline-form {
    display: block;
}

.blog-manage-book-title {
    font-weight: 600;
}

.blog-manage-book-id {
    color: #6d8280;
    font-size: 12px;
    margin-top: 4px;
}

.blog-manage-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
    display: inline;
}

.blog-editor-card {
    border: 1px solid #d6e1df;
    border-radius: 12px;
    background: #fff;
    padding: 16px;
    margin-bottom: 16px;
}

.blog-editor-card__title {
    margin: 0 0 12px;
}

.blog-editor-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.blog-editor-grid {
    display: grid;
    gap: 10px;
}

.blog-editor-grid--basic,
.blog-editor-grid--intro,
.blog-editor-grid--chapter,
.blog-editor-grid--section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.blog-editor-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.blog-editor-field span {
    font-size: 13px;
    color: #425c59;
}

.blog-editor-field--full {
    grid-column: 1 / -1;
}

.blog-editor-chapter {
    border: 1px solid #dce6e4;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fbfdfc;
}

.blog-editor-chapter__title {
    margin: 0;
    font-size: 16px;
}

.blog-editor-section {
    border: 1px dashed #cfdddb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
}

.blog-editor-row-actions {
    display: flex;
    gap: 8px;
}

.blog-editor-submit-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.blog-structure-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-structure-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px dashed #cfdddb;
    border-radius: 10px;
    background: #fff;
}

.blog-structure-row .textbox {
    margin: 0;
}

.page--blog_book .reader-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0 10px;
}

@media (max-width: 900px) {
    .blog-shelf-hero {
        grid-template-columns: 1fr;
        padding: 20px 18px 16px;
    }

    .blog-shelf-hero__title {
        font-size: 32px;
    }

    .blog-shelf-body {
        padding: 16px;
    }

    .blog-shelf-grid {
        grid-template-columns: 1fr;
    }

    .blog-shelf-card__title {
        font-size: 23px;
    }

    .blog-shelf-card__meta,
    .blog-shelf-card__actions {
        flex-wrap: wrap;
        align-items: center;
    }

    .blog-editor-grid--basic,
    .blog-editor-grid--intro,
    .blog-editor-grid--chapter,
    .blog-editor-grid--section {
        grid-template-columns: 1fr;
    }

    .blog-structure-row {
        grid-template-columns: 1fr;
    }
}

@keyframes blog-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shelf-card-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.995);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.page--blog_main .section,
.page--blog_manage .section {
    animation: blog-fade-up 0.38s ease both;
}

.page--blog_main .blog-shelf-card:nth-child(1) { animation-delay: 0.04s; }
.page--blog_main .blog-shelf-card:nth-child(2) { animation-delay: 0.08s; }
.page--blog_main .blog-shelf-card:nth-child(3) { animation-delay: 0.12s; }
.page--blog_main .blog-shelf-card:nth-child(4) { animation-delay: 0.16s; }
.page--blog_main .blog-shelf-card:nth-child(5) { animation-delay: 0.20s; }
.page--blog_main .blog-shelf-card:nth-child(6) { animation-delay: 0.24s; }

.page--blog_manage .section__table-container tbody tr {
    opacity: 0;
    animation: blog-fade-up 0.4s ease forwards;
}

.page--blog_manage .section__table-container tbody tr:nth-child(1) { animation-delay: 0.03s; }
.page--blog_manage .section__table-container tbody tr:nth-child(2) { animation-delay: 0.06s; }
.page--blog_manage .section__table-container tbody tr:nth-child(3) { animation-delay: 0.09s; }
.page--blog_manage .section__table-container tbody tr:nth-child(4) { animation-delay: 0.12s; }
.page--blog_manage .section__table-container tbody tr:nth-child(5) { animation-delay: 0.15s; }
.page--blog_manage .section__table-container tbody tr:nth-child(6) { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
    .page--blog_main .section,
    .page--blog_manage .section,
    .page--blog_main .blog-shelf-card,
    .page--blog_manage .section__table-container tbody tr {
        animation: none !important;
    }

    .blog-shelf-card {
        transition: none !important;
    }
}
