/* tp-riven home */

:root {
    --bg-page: #F7F3EC;
    --bg-page-alt: #F3EEE6;
    --bg-card: #FBF8F2;
    --bg-soft: #F8F4ED;
    --bg-float: #FCFAF6;
    --text-primary: #2F2A26;
    --text-body: #4B433D;
    --text-secondary: #7C7168;
    --text-muted: #9C9188;
    --line-primary: #DDD4C8;
    --line-secondary: #E9E2D8;
    --line-soft: #EFE9E0;
    --accent-brown: #8A6D4A;
    --accent-gold: #B79A6A;
    --accent-red: #A64637;
    --page-width: 800px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-soft: 0 8px 24px rgba(80, 64, 48, 0.04);
    --shadow-btn: 0 6px 16px rgba(72, 57, 43, 0.08);
    --font-logo: "汉仪尚巍手书", "HYShangWeiShouShuW", "STKaiti", "Kaiti SC", "Songti SC", serif;
    --font-main: "LXGW WenKai Screen", "霞鹜文楷 屏幕阅读版", "Noto Serif SC", "Songti SC", "Microsoft YaHei", sans-serif;
    --tp-bg: url("../static/images/home-bg.jpg");
    --main: var(--text-primary);
    --bg-color: var(--accent-red);
}

html {
    background: var(--bg-page);
}

body {
    box-sizing: border-box;
    min-height: 100vh;
    color: var(--text-primary);
    font-family: var(--font-main);
    letter-spacing: 0;
    background-color: var(--bg-page);
    background-image: none;
}

body::before {
    content: "";
    position: fixed;
    inset: -4px;
    z-index: 0;
    pointer-events: none;
    background-color: var(--bg-page);
    background-image: var(--tp-bg);
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100%;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgba(247, 243, 236, 0.08), linear-gradient(90deg, rgba(243, 238, 230, 0.07), rgba(247, 243, 236, 0.015) 22%, rgba(247, 243, 236, 0.015) 78%, rgba(243, 238, 230, 0.07)), radial-gradient(circle at 18% 24%, rgba(138, 109, 74, 0.045) 0 1px, transparent 1.3px), radial-gradient(circle at 76% 64%, rgba(138, 109, 74, 0.035) 0 1px, transparent 1.4px);
    background-size: auto, 28px 28px, 34px 34px;
}

.main_screen {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(var(--page-width), calc(100% - 64px));
    max-width: none;
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 40px 0;
}

main {
    width: 100%;
    margin: 0 auto;
    flex: 1 0 auto;
}

a {
    color: var(--text-primary);
    transition: color .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

a:hover {
    color: var(--accent-gold);
    text-shadow: none;
    text-decoration: none;
}

.cat_menu.tp-header {
    position: static;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 68px;
    margin: 0 auto;
    padding: 0 0 17px;
    border: 0;
    border-bottom: 1px solid rgba(221, 212, 200, 0.78);
    border-radius: 0;
    box-shadow: none !important;
    background: transparent;
    overflow: visible;
}

.tp-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: fit-content;
    min-width: max-content;
    color: #1F1A17;
    white-space: nowrap;
}

.tp-brand:hover {
    color: #1F1A17;
}

.tp-brand-text {
    color: #1F1A17;
    font-family: var(--font-logo);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
}

.tp-seal {
    display: block;
    width: 16px;
    height: 24px;
    margin-left: 9px;
    object-fit: contain;
    transform: translateY(2px);
}

.tp-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    color: var(--text-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 26px;
    white-space: nowrap;
}

.tp-nav-item {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}

.tp-nav-link {
    position: relative;
    color: var(--text-body);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 9px;
    transition: background-color .2s ease, color .2s ease;
}

.tp-nav-caret {
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    transition: transform .22s ease;
}

.tp-subnav {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 30;
    min-width: 132px;
    padding: 8px;
    border: 1px solid rgba(218, 209, 195, 0.92);
    border-radius: 8px;
    background: rgba(252, 250, 246, 0.96);
    box-shadow: 0 14px 30px rgba(80, 64, 48, 0.11);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity .18s ease, transform .18s ease;
}

.tp-subnav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.tp-subnav-link {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-body);
    font-size: 13px;
    line-height: 20px;
    text-align: left;
}

.tp-nav-item.has-children:hover .tp-subnav,
.tp-nav-item.has-children:focus-within .tp-subnav {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.tp-nav-item.has-children:hover .tp-nav-caret,
.tp-nav-item.has-children:focus-within .tp-nav-caret,
.tp-nav-item.has-children.is-open .tp-nav-caret {
    transform: rotate(225deg) translate(-2px, -2px);
}

.site-search {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 32px;
    line-height: 1;
    margin-left: 0;
}

.search-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #5F5750;
    border-radius: 50%;
    line-height: 1;
}

.search-toggle svg {
    display: block;
    width: 16px;
    height: 16px;
}

.tp-nav-link:hover,
.search-toggle:hover {
    color: #4F3828;
}

.tp-subnav-link:hover {
    background: #F1E8DC;
    color: #5A4634;
}

.tp-nav-more {
    display: inline-flex;
}

.tp-nav-more[hidden] {
    display: none !important;
}

.tp-nav-more-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.tp-nav-more.is-open .tp-subnav {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.home-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    height: 44px;
    margin: 22px 0 20px;
    padding: 0 18px 0 16px;
    border: 1px solid #E5DDD1;
    border-radius: 8px;
    background: rgba(248, 244, 237, 0.66);
    color: #5B5148;
}

.home-notice-icon {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 12px solid #7A6755;
}

.home-notice-arrow {
    position: relative;
    width: 10px;
    height: 10px;
    border-top: 1px solid #9E9388;
    border-right: 1px solid #9E9388;
    transform: rotate(45deg);
}

.home-notice-viewport {
    height: 22px;
    overflow: hidden;
}

.home-notice-track p {
    display: none;
    height: 22px;
    margin: 0;
    overflow: hidden;
    color: #5B5148;
    font-size: 15px;
    line-height: 22px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-notice-track p.active {
    display: block;
}

.home-posts {
    border: 1px solid rgba(218, 209, 195, 0.72);
    border-radius: 8px;
    background: rgba(251, 248, 242, 0.54);
    box-shadow: 0 8px 22px rgba(80, 64, 48, 0.025);
    overflow: hidden;
    backdrop-filter: blur(1px);
}

.home-post {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 50px;
    align-items: center;
    padding: 0 26px;
    border-bottom: 1px solid rgba(226, 216, 202, 0.66);
    transition: background-color .22s ease;
}

.home-post:last-child {
    border-bottom: 0;
}

.home-post:hover {
    background: rgba(255, 255, 255, 0.16);
}

.home-post-link {
    min-width: 0;
    display: grid;
    grid-template-columns: 58px 38px minmax(0, 1fr);
    align-items: center;
    color: var(--text-primary);
}

.home-post-date {
    display: grid;
    justify-items: center;
    color: #7E6F63;
    line-height: 1.08;
}

.home-post-date span {
    color: #7E6F63;
    font-size: 15px;
}

.home-post-date small {
    margin-top: 3px;
    color: #A09388;
    font-size: 11px;
}

.home-post-sep {
    width: 1px;
    height: 24px;
    margin: 0;
    justify-self: center;
    background: rgba(226, 216, 202, 0.86);
}

.home-post-title {
    min-width: 0;
    padding-left: 0;
    overflow: hidden;
    color: var(--text-primary);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
    line-height: 26px;
}

.home-post-link:hover .home-post-title {
    color: #5D4630;
}

.home-post-comments {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: #8D8176;
    font-size: 12px;
    line-height: 20px;
    transition: color .22s ease;
}

.home-post:hover .home-post-comments {
    color: var(--accent-brown);
}

.home-comment-icon {
    position: relative;
    width: 12px;
    height: 9px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.home-comment-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    bottom: -4px;
    width: 3px;
    height: 3px;
    border-left: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    background: rgba(251, 248, 242, 0.92);
    transform: rotate(-25deg);
}

.home-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 26px;
    padding-top: 18px;
}

.home-pagination li a {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #E2D8CA;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: #6B6158;
    font-size: 14px;
    line-height: 1;
}

.home-pagination li a[href]:hover {
    border-color: #D8C9B5;
    background: #F1E8DC;
    color: #5A4634;
}

.home-pagination li.active a {
    border-color: #6D5641;
    background: #6D5641;
    color: #FAF6EF;
    box-shadow: 0 4px 12px rgba(109, 86, 65, 0.16);
}

.home-pagination li:not(.active) a:not([href]) {
    border-color: #ECE4D9;
    background: #F7F2EA;
    color: #B7ADA2;
    cursor: not-allowed;
}

.float-right {
    z-index: 20;
    right: 28px;
    bottom: 72px;
    display: grid;
    gap: 10px;
}

.operator-button {
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid #E4DACC;
    border-radius: 12px;
    background: #FBF7F0;
    box-shadow: var(--shadow-btn);
    color: #6F6358;
    transition: all .22s ease;
}

.operator-button:hover {
    border-color: #D7C6B1;
    background: #F2EADF;
    color: #5B4634;
}

#backToTopBtn {
    border-radius: 50%;
    background: rgba(251, 247, 240, 0.88);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(.96);
    transition: opacity .22s ease, transform .22s ease, border-color .22s ease, background-color .22s ease, color .22s ease;
}

#backToTopBtn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

#backToTopBtn:hover {
    transform: translateY(-2px) scale(1);
}

.tp-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    color: currentColor;
}

.tp-icon-top::before {
    content: "↑";
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    color: currentColor;
    font-family: var(--font-main);
    font-size: 22px;
    font-weight: 500;
    line-height: 18px;
    text-align: center;
    transform: none;
}

.tp-icon-top::after {
    display: none;
}

.footer.ink-footer {
    flex: 0 0 auto;
    margin-top: 18px;
    padding: 0;
    color: #93887E;
    font-size: 13px;
    line-height: 22px;
}

.footer-content {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.footer-content span:not(:last-child)::after {
    content: "|";
    margin: 0 14px;
    color: #B8AEA2;
}

.footer-content span:last-child {
    color: #8D8176;
    font-weight: 400;
}

.footer-content a {
    color: inherit;
}

@media (max-width: 800px) {
    body {
        padding: 22px 0 0;
    }
    body::before {
        inset: -8px;
        background-position: center top;
        background-size: cover;
        filter: blur(1.35px);
        opacity: 0.78;
    }
    body::after {
        background: rgba(247, 243, 236, 0.28);
    }
    .main_screen {
        width: min(100% - 24px, var(--page-width));
    }
    .cat_menu.tp-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        min-height: auto;
        padding: 4px 0 16px;
    }
    .tp-brand {
        grid-column: 1;
        grid-row: 1;
    }
    .site-search {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
    .tp-brand-text {
        font-size: 38px;
    }
    .tp-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        gap: 10px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        padding-bottom: 10px;
        scrollbar-width: none;
    }
    .tp-nav::-webkit-scrollbar {
        display: none;
    }
    .tp-nav-more {
        display: none !important;
    }
    .tp-nav-item {
        position: relative;
    }
    .tp-subnav {
        position: fixed;
        left: var(--tp-subnav-left, 16px);
        top: var(--tp-subnav-top, 120px);
        right: auto;
        min-width: 140px;
        max-width: calc(100vw - 32px);
        z-index: 100;
        transform: translateY(6px);
    }
    .tp-nav-item.has-children:hover .tp-subnav,
    .tp-nav-item.has-children:focus-within .tp-subnav,
    .tp-subnav.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .home-notice {
        margin-top: 20px;
    }
    .home-post {
        min-height: 58px;
        grid-template-columns: minmax(0, 1fr) 38px;
        padding: 0 14px;
    }
    .home-post-link {
        grid-template-columns: 48px 30px minmax(0, 1fr);
    }
    .home-post-date span {
        font-size: 14px;
    }
    .home-post-date small {
        font-size: 11px;
    }
    .home-post-sep {
        height: 24px;
        margin: 0;
    }
    .home-post-title {
        padding-left: 0;
        font-size: 15px;
        line-height: 24px;
    }
    .home-post-comments {
        font-size: 13px;
    }
    .float-right {
        right: 16px;
        bottom: 32px;
    }
    .operator-button {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 18px;
        padding-bottom: 0;
        background-position: center top;
    }
    .tp-brand-text {
        font-size: 34px;
    }
    .tp-nav {
        gap: 10px;
        font-size: 14px;
    }
    .home-notice {
        height: 44px;
        padding: 0 14px;
    }
    .home-post {
        min-height: 56px;
        grid-template-columns: minmax(0, 1fr) 30px;
        padding: 0 12px;
    }
    .home-post-link {
        grid-template-columns: 44px 24px minmax(0, 1fr);
    }
    .home-post-date span {
        font-size: 14px;
    }
    .home-post-date small {
        margin-top: 4px;
        font-size: 11px;
    }
    .home-post-sep {
        height: 28px;
        margin: 0;
    }
    .home-post-title {
        padding-left: 0;
        font-size: 14px;
        line-height: 22px;
    }
    .home-comment-icon {
        width: 13px;
        height: 10px;
    }
    .home-pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    .home-pagination li a {
        min-width: 36px;
        height: 36px;
        padding: 0 12px;
    }
    .footer-content {
        display: grid;
        gap: 4px;
    }
    .footer.ink-footer {
        padding-bottom: 10px;
    }
    .footer-content span::after {
        content: "" !important;
        margin: 0 !important;
    }
}
