/**
 * 前台 · 宣纸卷轴
 * 米白纸地、褐木轴、双线回纹框。
 */

:root {
    color-scheme: light;
    --bg: #F4EDD8;
    --paper: #FFFCF4;
    --card: #FFFCF4;
    --ink: #3C261C;
    --ink-2: #5C4032;
    --ink-3: #8C7364;
    --gold: #8B4630;
    --gold-2: #A86848;
    --on-gold: #FFFCF4;
    --line: rgba(122, 62, 40, 0.18);
    --line-2: rgba(122, 62, 40, 0.09);
    --edge: rgba(139, 70, 48, 0.48);
    --fill: rgba(139, 70, 48, 0.08);
    --fill-soft: rgba(139, 70, 48, 0.05);
    --field: rgba(122, 62, 40, 0.04);
    --glass: rgba(255, 252, 244, 0.92);
    --glass-2: #FFFCF4;
    --wood: #7A3A26;
    --wood-deep: #5C2A18;
    --gold-line: #C9A35A;
    --pad: 20px;
    --gap: 18px;
    --max-width: 1120px;
    --serif: "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
    --display: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "PMingLiU", "SimSun", serif;
    --gold-title: #5C2A1C;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    background-color: var(--bg);
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body:not(.gate-body)::before {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
    inset: 0;
    background: radial-gradient(90% 32% at 50% -10%, rgba(255, 255, 255, 0.45), transparent 62%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

.header,
.main-content,
.footer,
.gate {
    position: relative;
    z-index: 1;
}

/* 页头 */

.header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px var(--pad) 8px;
    background: rgba(244, 237, 216, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-container,
.footer-content,
.announcement-bar,
.browse-bar,
.search-and-filter,
.search-bar {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.scroll {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 12px 18px rgba(92, 42, 24, 0.08));
}

.scroll-rod {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    height: 22px;
    pointer-events: none;
}

.scroll-head .scroll-rod {
    height: 16px;
}

.rod {
    flex: 1;
    height: 13px;
    margin: 0 -4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f0d2b2 0%, #c4845c 16%, #8d4a30 46%, #642c18 74%, #a86a46 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 236, 214, 0.8),
        inset 0 -2px 2px rgba(48, 16, 8, 0.35);
}

.scroll-head .rod {
    height: 10px;
}

.cap {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 26px;
    height: 22px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f3d7ba 0%, #c17a52 30%, #7a3c24 64%, #5c2a18 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 244, 226, 0.75),
        0 1px 2px rgba(70, 28, 12, 0.22);
}

.scroll-head .cap {
    width: 20px;
    height: 16px;
    border-radius: 6px;
}

.cap::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    width: 2px;
    border-radius: 1px;
    background: linear-gradient(180deg, #f8e7c0, #b8893a);
}

.cap-l::before { right: 4px; }
.cap-r::before { left: 4px; }

.scroll-paper {
    position: relative;
    z-index: 1;
    margin: -4px 16px;
    padding: 40px 24px 34px;
    background: #FFFCF4;
    box-shadow:
        inset 0 0 0 1.5px var(--wood),
        inset 0 0 0 5px #FFFCF4,
        inset 0 0 0 6.5px var(--gold-line),
        inset 0 0 0 10px #FFFCF4,
        inset 0 0 0 11.5px var(--wood);
}

.scroll-head .scroll-paper {
    padding: 16px 40px 12px;
}

.scroll-inner,
.gate-inner {
    position: relative;
    z-index: 1;
}

.meander {
    position: absolute;
    z-index: 3;
    width: 44px;
    height: 44px;
    pointer-events: none;
    background: #FFFCF4 url("/assets/images/meander.svg") center / 100% 100% no-repeat;
}

.scroll-head .meander {
    width: 30px;
    height: 30px;
}

.meander-tl { top: 1px; left: 1px; }
.meander-tr { top: 1px; right: 1px; transform: scaleX(-1); }
.meander-bl { bottom: 1px; left: 1px; transform: scaleY(-1); }
.meander-br { bottom: 1px; right: 1px; transform: scale(-1); }

.brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 8px 6px;
    color: inherit;
    text-align: center;
}

.brand-name {
    display: block;
    max-width: 100%;
}

.site-title {
    display: block;
    font-family: var(--display);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.32em;
    line-height: 1.35;
    text-align: center;
    color: var(--gold-title);
}

.site-slogan {
    display: block;
    max-width: 100%;
    font-family: var(--display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.46em;
    line-height: 1.6;
    color: rgba(92, 42, 28, 0.62);
}

.scroll-head .brand {
    padding: 2px 8px 0;
}

.announcement-bar {
    margin: 8px auto 2px;
}

.announcement-content-full {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: none;
    margin: 0 20px;
    padding: 4px 6px 0;
    border-top: 0;
}

.notice-tag {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    line-height: 1.7;
}

.announcement-body {
    flex: 1;
    min-width: 0;
}

.announcement-text {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-2);
    letter-spacing: 0.04em;
}

.announcement-text + .announcement-text {
    margin-top: 4px;
}

/* 搜索、分类、标签 */

.main-content {
    max-width: none;
    padding: 8px var(--pad) 36px;
    min-height: calc(100vh - 180px);
}

.browse-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 22px;
}

.search-bar,
.search-and-filter {
    position: relative;
    z-index: 35;
    padding: 0;
    background: transparent;
    border: 0;
}

.search-and-filter .search-bar {
    max-width: none;
    overflow: visible;
}

.search-form,
.search-and-filter .search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.search-and-filter .search-form {
    flex: 1;
    min-width: 0;
}

.search-input,
.search-and-filter .search-input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    letter-spacing: 0.06em;
}

.search-input::placeholder {
    color: var(--ink-3);
    letter-spacing: 0.14em;
}

.search-btn,
.search-and-filter .search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--gold);
    background: transparent;
    border: 0;
    border-radius: 0;
    flex: 0 0 auto;
}

.search-form:focus-within,
.search-and-filter .search-bar:focus-within {
    border-bottom-color: var(--gold);
}

.search-and-filter .search-bar,
.search-form {
    position: relative;
}

.search-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 60;
    max-height: min(360px, 60vh);
    overflow: auto;
    background: var(--glass-2);
    border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(92, 42, 24, 0.12);
}

.search-suggest[hidden] {
    display: none;
}

.search-suggest-item {
    display: block;
    padding: 12px 16px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--line-2);
}

.search-suggest-item.is-active,
.search-suggest-item:hover {
    background: var(--fill-soft);
    color: var(--gold-2);
}

.search-suggest mark {
    background: transparent;
    color: var(--gold);
    font-weight: 600;
}

.search-suggest-more,
.search-suggest-empty {
    display: block;
    padding: 11px 16px;
    color: var(--ink-3);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-align: center;
}

.search-suggest-more:hover {
    color: var(--gold);
}

.category-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 0;
    border-bottom: 1px solid var(--line);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    margin-bottom: -1px;
    padding: 10px 16px;
    color: var(--ink-3);
    font-size: 13px;
    letter-spacing: 0.14em;
    border-bottom: 1px solid transparent;
    white-space: nowrap;
}

.category-tab:hover {
    color: var(--ink);
}

.category-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
}

.tag-row::-webkit-scrollbar {
    display: none;
}

.keyword-item,
.keyword-tag,
.detail-keywords-box .keyword-tag,
.tag-clear {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 5px 12px;
    color: var(--ink-2);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.keyword-item:hover,
.keyword-tag:hover,
.detail-keywords-box .keyword-tag:hover,
.tag-clear:hover {
    color: var(--gold-2);
    border-color: var(--edge);
    background: transparent;
}

.keyword-item.active {
    color: var(--on-gold);
    background: var(--gold);
    border-color: var(--gold);
}

.tag-clear {
    color: var(--ink-3);
}

/* 卡片 */

.gallery-container {
    margin-bottom: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
}

.gallery-item {
    position: relative;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
    transition: transform 0.35s ease, border-color 0.35s ease;
}

.gallery-item:hover {
    border-color: var(--edge);
    transform: translateY(-3px);
}

.gallery-link {
    display: block;
    color: inherit;
}

.gallery-image {
    position: relative;
    width: 100%;
    padding-top: 128%;
    background: #EFE4D0;
    overflow: hidden;
}

.gallery-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.03);
}

.badge-hot {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 7px;
    color: #FFFCF4;
    background: rgba(92, 42, 28, 0.78);
    border: 1px solid rgba(255, 236, 210, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.2;
}

.badge-hot::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #E7C9A0;
    flex: 0 0 auto;
}

.gallery-info {
    margin: 0;
    padding: 12px 12px 14px;
    background: transparent;
}

.gallery-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.title-badges {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
    max-width: 100%;
}

.gallery-title .title-text,
.detail-title .title-text {
    font-family: var(--display);
    font-weight: 600;
    color: var(--gold-title);
}

.gallery-title .title-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-limited,
.badge-ace,
.badge-premium,
.badge-student,
.badge-fancy {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink-2);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.6;
}

.badge-limited { color: #8A4A22; border-color: rgba(138, 74, 34, 0.45); }
.badge-ace { color: #5C5348; border-color: rgba(92, 83, 72, 0.4); }
.badge-premium { color: #7A5420; border-color: rgba(122, 84, 32, 0.45); }
.badge-student { color: #3E5568; border-color: rgba(62, 85, 104, 0.4); }
.badge-fancy { color: #8A4038; border-color: rgba(138, 64, 56, 0.45); }

.empty-state {
    padding: 88px 0;
    text-align: center;
    color: var(--ink-3);
}

.empty-state svg {
    margin: 0 auto 14px;
    opacity: 0.35;
}

.empty-state p {
    font-size: 13px;
    letter-spacing: 0.2em;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-btn,
.page-num {
    min-width: 36px;
    padding: 8px 12px;
    text-align: center;
    color: var(--ink-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    letter-spacing: 0.06em;
}

.page-btn:hover,
.page-num:hover {
    color: var(--ink);
}

.page-num.active {
    color: var(--gold);
    border-color: var(--edge);
}

.page-dots {
    color: var(--ink-3);
}

/* 详情 */

body:has(.detail-container) .header-container,
body:has(.detail-container) .announcement-bar,
body:has(.detail-container) .main-content .scroll {
    max-width: 860px;
}

.detail-container {
    background: transparent;
}

.detail-info {
    padding: 0;
    background: transparent;
    border: 0;
}

.detail-top-nav,
.nav-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.detail-top-nav {
    margin-bottom: 28px;
}

.top-nav-btn,
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    color: var(--ink-2);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.12em;
}

.top-nav-btn:hover,
.nav-btn:hover {
    color: var(--gold-2);
    border-color: var(--edge);
}

.nav-btn.nav-home,
.nav-btn.nav-home:hover {
    color: var(--on-gold);
    background: var(--gold);
    border-color: var(--gold);
}

.nav-btn.nav-disabled,
.nav-btn.nav-disabled:hover {
    opacity: 0.35;
    color: var(--ink-3);
    background: transparent;
    border-color: var(--line);
}

.detail-nav {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    background: transparent;
}

.nav-row .nav-btn {
    width: 100%;
    min-width: 0;
    gap: 4px;
    padding: 0 6px;
    font-size: 12px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.nav-row .nav-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.detail-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--display);
    font-size: 36px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.35;
    text-align: left;
}

.detail-title .title-text {
    font-size: inherit;
    letter-spacing: 0.08em;
    white-space: normal;
}

.detail-title .title-badges {
    gap: 6px;
}

.detail-title .badge-limited,
.detail-title .badge-ace,
.detail-title .badge-premium,
.detail-title .badge-student,
.detail-title .badge-fancy {
    font-size: 12px;
    padding: 2px 8px;
}

.detail-keywords-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 24px;
}

.detail-content {
    color: var(--ink-2);
    font-size: 15px;
    line-height: 2;
    letter-spacing: 0.03em;
}

.detail-content :where(p, li, h1, h2, h3, h4, strong, em, span, div, font) {
    color: var(--ink-2);
}

.detail-content .ql-size-small { font-size: 0.75em; }
.detail-content .ql-size-large { font-size: 1.5em; }
.detail-content .ql-size-huge { font-size: 2.5em; }
.detail-content .ql-align-center { text-align: center; }
.detail-content .ql-align-right { text-align: right; }
.detail-content .ql-align-justify { text-align: justify; }
.detail-content .ql-color-white { color: var(--ink); }
.detail-content .ql-color-red { color: #e60000; }
.detail-content .ql-color-orange { color: #f90; }
.detail-content .ql-color-yellow { color: #ff0; }
.detail-content .ql-color-green { color: #008a00; }
.detail-content .ql-color-blue { color: #06c; }
.detail-content .ql-color-purple { color: #93f; }
.detail-content .ql-bg-black { background-color: #000; }
.detail-content .ql-bg-red { background-color: #e60000; }
.detail-content .ql-bg-orange { background-color: #f90; }
.detail-content .ql-bg-yellow { background-color: #ff0; }
.detail-content .ql-bg-green { background-color: #008a00; }
.detail-content .ql-bg-blue { background-color: #06c; }
.detail-content .ql-bg-purple { background-color: #93f; }

.detail-content a {
    color: var(--gold-2);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.detail-content img,
.detail-content video {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 22px auto;
    border-radius: 2px;
    display: block;
}

.detail-content video {
    background: #000;
}

.detail-content h1,
.detail-content h2,
.detail-content h3 {
    margin: 28px 0 10px;
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: 0.12em;
}

/* 页脚与返回 */

.footer {
    padding: 8px var(--pad) calc(28px + var(--safe-b));
    background: transparent;
}

.footer-content {
    text-align: center;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.footer-content p {
    color: var(--ink-3);
    font-size: 11px;
    letter-spacing: 0.18em;
}

.back-to-top {
    position: fixed;
    right: 16px;
    bottom: calc(22px + var(--safe-b));
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--gold);
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50%;
}

.back-to-top:hover {
    color: var(--on-gold);
    background: var(--gold);
    border-color: var(--gold);
}

/* 入口 */

.gate-body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
}

.gate-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(80% 36% at 50% -8%, rgba(255, 255, 255, 0.5), transparent 62%);
}

.gate {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
}

.scroll-gate {
    width: min(440px, 100%);
    max-width: 440px;
}

.scroll-gate .scroll-paper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(620px, calc(100dvh - 64px));
    padding: 52px 34px 88px;
}

.scroll-gate .scroll-paper::before {
    content: "";
    position: absolute;
    left: 42px;
    bottom: 54px;
    width: 92px;
    height: 16px;
    border-bottom: 1.5px solid rgba(122, 58, 40, 0.42);
    border-radius: 0 0 46px 46px;
    pointer-events: none;
}

.scroll-gate .scroll-paper::after {
    content: "";
    position: absolute;
    right: 34px;
    bottom: 36px;
    width: 150px;
    height: 70px;
    pointer-events: none;
    background:
        radial-gradient(ellipse 50px 22px at 24% 72%, rgba(150, 172, 164, 0.55), transparent 70%),
        radial-gradient(ellipse 66px 26px at 58% 56%, rgba(168, 186, 176, 0.42), transparent 72%),
        radial-gradient(ellipse 40px 18px at 84% 76%, rgba(136, 160, 150, 0.38), transparent 70%);
}

.gate-inner {
    width: 100%;
    text-align: center;
}

.gate-title {
    margin: 0;
    font-family: var(--display);
    font-size: 34px;
    font-weight: 600;
    letter-spacing: 0.28em;
    line-height: 1.35;
    text-align: center;
    color: var(--gold-title);
}

.gate-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 16px 0 0;
    color: rgba(92, 42, 28, 0.68);
    font-family: var(--display);
    font-size: 15px;
    letter-spacing: 0.16em;
    white-space: nowrap;
}

.gate-note {
    margin: 10px 0 0;
    color: rgba(92, 42, 28, 0.55);
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-align: center;
}

.gate-kicker::before,
.gate-kicker::after {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--gold-line);
    box-shadow: 0 0 0 2px var(--wood);
    transform: rotate(45deg);
    flex: 0 0 auto;
}

.gate-err {
    min-height: 0;
    margin: 0;
    color: #A33B32;
    font-size: 13px;
    letter-spacing: 0.08em;
}

.gate-err.on {
    margin: 22px 0 0;
}

.gate-form {
    width: 100%;
    margin-top: 36px;
}

.gate-input {
    width: 100%;
    margin-bottom: 8px;
    padding: 13px 12px;
    text-align: center;
    color: var(--ink);
    background: rgba(122, 58, 40, 0.04);
    border: 1px solid rgba(122, 58, 40, 0.32);
    border-radius: 0;
    outline: none;
    font-family: var(--display);
    font-size: 18px;
    letter-spacing: 0.32em;
    caret-color: var(--wood);
    -webkit-appearance: none;
    appearance: none;
}

.gate-input::placeholder {
    color: rgba(92, 42, 28, 0.34);
    letter-spacing: 0.28em;
}

.gate-input:focus {
    border-color: var(--wood);
    background: #fff;
}

.gate-input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--wood);
    box-shadow: 0 0 0 1000px #fffaf0 inset;
}

.gate-btn {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 13px 16px;
    color: #FFFCF4;
    background: linear-gradient(180deg, #a86448, #7a3e2c);
    border: 1px solid #5c2a18;
    border-radius: 0;
    box-shadow: inset 0 1px 0 rgba(255, 220, 190, 0.28);
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.42em;
    text-indent: 0.42em;
}

.gate-btn:hover {
    background: linear-gradient(180deg, #b87456, #8a4a34);
}

@media (min-width: 720px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nav-row .nav-btn {
        gap: 6px;
        padding: 0 10px;
        font-size: 13px;
        letter-spacing: 0.08em;
    }

    .nav-row .nav-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 1040px) {
    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    :root {
        --pad: 16px;
        --gap: 12px;
    }

    .header {
        padding-top: 8px;
    }

    .scroll-paper {
        margin-left: 12px;
        margin-right: 12px;
        padding: 30px 14px 24px;
    }

    .scroll-head .scroll-paper {
        padding: 14px 26px 12px;
    }

    .meander {
        width: 30px;
        height: 30px;
    }

    .scroll-head .meander {
        width: 22px;
        height: 22px;
    }

    .scroll-rod {
        height: 18px;
    }

    .cap {
        width: 20px;
        height: 18px;
    }

    .scroll-gate .scroll-paper {
        min-height: 460px;
        padding: 36px 16px 68px;
    }

    .site-title {
        font-size: 22px;
        letter-spacing: 0.18em;
    }

    .site-slogan {
        letter-spacing: 0.28em;
    }

    .gallery-title,
    .gallery-title .title-text {
        font-size: 14px;
    }

    .detail-title,
    .detail-title .title-text {
        font-size: 28px;
        letter-spacing: 0.04em;
    }

    .gate-title {
        font-size: 28px;
        letter-spacing: 0.16em;
    }

    .gate-kicker {
        font-size: 13px;
        letter-spacing: 0.06em;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-image img {
        transition: none;
    }
}
