@font-face {
    font-family: "LoveMiPastTitle";
    src: url("assets/AaGuDianKeBenSongYouMoBan-2.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "LoveMiPastKai";
    src: url("assets/FangZhengKaiTiJianTi-1.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "LoveMiPastHand";
    src: url("assets/QingSongShouXieTi1-2.ttf") format("truetype");
    font-display: swap;
}

.if-line-screen.past-avg-screen {
    background:
        radial-gradient(circle at 50% 18%, rgba(142, 24, 18, 0.24), transparent 34%),
        linear-gradient(180deg, #211613 0%, #100b0b 48%, #251715 100%);
    color: #2c211d;
}

.past-avg-screen::before {
    content: "";
    position: absolute;
    inset: 64px 0 0;
    pointer-events: none;
    opacity: 0.28;
    background:
        linear-gradient(90deg, rgba(255, 244, 214, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(255, 244, 214, 0.07) 1px, transparent 1px);
    background-size: 18px 18px;
    mix-blend-mode: screen;
}

.past-avg-screen .past-avg-topbar {
    background: rgba(32, 21, 18, 0.9);
    border-bottom-color: rgba(218, 188, 139, 0.22);
}

.past-avg-screen .past-avg-topbar .if-line-title {
    color: #ead9b8;
}

.past-avg-screen .past-avg-topbar .if-line-subtitle {
    color: rgba(236, 213, 178, 0.72);
}

.past-avg-screen .past-avg-topbar .if-line-icon-btn {
    background: rgba(236, 213, 178, 0.11);
    color: #ead9b8;
    border: 1px solid rgba(236, 213, 178, 0.22);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.past-avg-stage {
    --past-avg-text-size: 18px;
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 14px 12px 18px 54px;
    display: grid;
    place-items: center;
    font-family: "LoveMiPastKai", "Songti SC", "Noto Serif SC", serif;
}

.past-avg-stage::before,
.past-avg-stage::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.past-avg-stage::before {
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 244, 214, 0.09), transparent 30%, rgba(99, 12, 12, 0.12)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 5px);
}

.past-avg-stage::after {
    inset: auto 18px 16px auto;
    width: 92px;
    height: 92px;
    border: 2px solid rgba(145, 31, 24, 0.42);
    transform: rotate(-7deg);
    opacity: 0.42;
}

.past-avg-rail {
    position: absolute;
    z-index: 6;
    left: 11px;
    top: 24px;
    display: grid;
    gap: 7px;
}

.past-avg-rail-btn {
    width: 34px;
    min-height: 62px;
    border: 1px solid rgba(232, 207, 170, 0.42);
    border-radius: 8px;
    background: rgba(35, 20, 17, 0.78);
    color: #ead9b8;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 8px 5px;
}

.past-avg-rail-btn span {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: "LoveMiPastTitle", "LoveMiPastKai", serif;
    font-size: 16px;
    line-height: 1;
}

.past-avg-rail-btn:active {
    transform: translateY(1px) scale(0.98);
}

.past-avg-paper {
    position: relative;
    z-index: 2;
    width: min(100%, 430px);
    max-height: 100%;
    overflow: auto;
    scrollbar-width: none;
    padding: 14px 18px 16px;
    border: 2px solid rgba(73, 42, 34, 0.72);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 250, 232, 0.92), rgba(223, 211, 181, 0.92)),
        repeating-linear-gradient(90deg, rgba(88, 60, 47, 0.05), rgba(88, 60, 47, 0.05) 1px, transparent 1px, transparent 11px);
    box-shadow:
        inset 0 0 0 6px rgba(91, 52, 43, 0.12),
        0 24px 56px rgba(0, 0, 0, 0.42);
}

.past-avg-paper::-webkit-scrollbar,
.past-avg-modal-body::-webkit-scrollbar {
    display: none;
}

.past-avg-paper::before,
.past-avg-paper::after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(71, 42, 34, 0.42);
    border-radius: 6px;
    pointer-events: none;
}

.past-avg-paper::after {
    inset: 17px;
    border-style: dashed;
    opacity: 0.34;
}

.past-avg-date {
    position: relative;
    z-index: 1;
    text-align: center;
    color: rgba(60, 35, 30, 0.78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.past-avg-title-wrap {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 2px;
    margin-top: 7px;
}

.past-avg-seal {
    font-family: "LoveMiPastTitle", serif;
    font-size: clamp(58px, 15vw, 94px);
    line-height: 0.88;
    color: rgba(143, 31, 24, 0.92);
    text-shadow: 0 2px 0 rgba(84, 28, 24, 0.18);
    transform: rotate(-1deg);
    white-space: nowrap;
}

.past-avg-title {
    margin: 0;
    font-family: "LoveMiPastTitle", "LoveMiPastKai", serif;
    font-size: clamp(31px, 8.4vw, 52px);
    line-height: 1.02;
    color: #93251f;
    text-align: center;
    letter-spacing: 0;
    font-weight: 400;
}

.past-avg-title span {
    display: inline-block;
    color: #3b241f;
    transform: translateY(-0.04em);
}

.past-avg-poster-btn {
    position: relative;
    z-index: 1;
    display: block;
    width: min(78%, 280px);
    aspect-ratio: 0.72;
    margin: 12px auto 13px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #281a15;
    cursor: pointer;
    box-shadow:
        0 18px 42px rgba(39, 19, 15, 0.32),
        0 0 0 8px rgba(255, 248, 224, 0.74),
        0 0 0 10px rgba(75, 45, 37, 0.22);
    overflow: hidden;
}

.past-avg-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: sepia(0.28) contrast(1.06) saturate(0.74) brightness(0.9);
    transition: transform 0.45s ease, filter 0.45s ease;
}

.past-avg-poster-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(30, 12, 10, 0.12), transparent 36%, rgba(64, 10, 10, 0.26)),
        radial-gradient(circle at 50% 46%, transparent 0 38%, rgba(0, 0, 0, 0.22) 78%);
    pointer-events: none;
}

.past-avg-enter-stamp {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 54px;
    min-height: 54px;
    border: 2px solid rgba(164, 28, 22, 0.82);
    color: #9c201a;
    background: rgba(244, 229, 194, 0.74);
    display: grid;
    place-items: center;
    transform: rotate(-9deg);
    font-family: "LoveMiPastTitle", serif;
    font-size: 20px;
    line-height: 1;
}

.past-avg-poster-btn:hover .past-avg-poster-img {
    transform: scale(1.025);
    filter: sepia(0.35) contrast(1.14) saturate(0.82) brightness(0.82);
}

.past-avg-poster-btn:active {
    transform: scale(0.985);
}

.past-avg-synopsis {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: var(--past-avg-text-size);
    line-height: 1.58;
    color: #382720;
    text-align: justify;
}

.past-avg-footer-line {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px solid rgba(64, 38, 32, 0.28);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: rgba(54, 35, 29, 0.72);
    font-size: 11px;
    line-height: 1.4;
}

.past-avg-side-script {
    position: absolute;
    z-index: 1;
    top: 28px;
    bottom: 24px;
    width: 22px;
    color: rgba(234, 217, 184, 0.24);
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: "LoveMiPastHand", serif;
    font-size: 18px;
    overflow: hidden;
}

.past-avg-side-script--left {
    left: 53px;
}

.past-avg-side-script--right {
    right: 8px;
}

.past-avg-stage--game {
    place-items: stretch;
    background:
        linear-gradient(90deg, rgba(14, 8, 8, 0.92), rgba(36, 16, 14, 0.62) 46%, rgba(12, 8, 8, 0.9)),
        radial-gradient(circle at 68% 28%, rgba(155, 38, 30, 0.24), transparent 35%),
        url("assets/民国背景.jpg") center / cover no-repeat;
}

.past-avg-stage--game::before {
    background:
        linear-gradient(180deg, rgba(7, 4, 4, 0.18), rgba(7, 4, 4, 0.74)),
        repeating-linear-gradient(0deg, rgba(255, 248, 220, 0.035), rgba(255, 248, 220, 0.035) 1px, transparent 1px, transparent 6px);
}

.past-avg-chapter-shell {
    position: relative;
    z-index: 2;
    width: min(100%, 760px);
    max-height: 100%;
    min-height: 0;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    color: #f1dfbd;
}

.past-avg-chapter-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px 12px;
    border: 1px solid rgba(233, 205, 160, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(32, 18, 15, 0.94), rgba(18, 11, 10, 0.94)),
        repeating-linear-gradient(90deg, rgba(236, 213, 178, 0.035), rgba(236, 213, 178, 0.035) 1px, transparent 1px, transparent 10px);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}

.past-avg-node-badge {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(182, 54, 44, 0.48);
    border-radius: 8px;
    background: rgba(94, 23, 19, 0.54);
    color: #ffd9a2;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.past-avg-chapter-head .past-avg-game-kicker {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.past-avg-chapter-head .past-avg-game-title {
    margin: 3px 0 0;
    font-size: clamp(31px, 7.6vw, 50px);
}

.past-avg-chapter-board {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.past-avg-story-panel,
.past-avg-clue-panel,
.past-avg-choice-panel {
    border: 1px solid rgba(235, 211, 172, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(30, 17, 14, 0.95), rgba(16, 10, 10, 0.97)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 7px);
    box-shadow:
        inset 0 0 0 1px rgba(255, 244, 214, 0.04),
        0 18px 48px rgba(0, 0, 0, 0.38);
}

.past-avg-story-panel {
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    padding: 14px 16px;
}

.past-avg-story-panel::-webkit-scrollbar,
.past-avg-choice-list::-webkit-scrollbar,
.past-avg-clue-panel::-webkit-scrollbar {
    display: none;
}

.past-avg-node-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.past-avg-node-meta span {
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid rgba(236, 213, 178, 0.18);
    border-radius: 8px;
    background: rgba(245, 226, 188, 0.08);
    color: rgba(246, 225, 188, 0.76);
    font-size: 12px;
    font-weight: 800;
}

.past-avg-dialogue {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.past-avg-dialogue-line {
    display: grid;
    grid-template-columns: minmax(58px, auto) 1fr;
    gap: 9px;
    align-items: start;
    padding: 9px 10px;
    border-left: 3px solid rgba(182, 54, 44, 0.72);
    border-radius: 8px;
    background: rgba(245, 226, 188, 0.08);
}

.past-avg-dialogue-line b {
    color: #e5b56f;
    font-size: 13px;
    white-space: nowrap;
}

.past-avg-dialogue-line span {
    min-width: 0;
    color: rgba(246, 225, 188, 0.94);
    font-size: calc(var(--past-avg-text-size) - 2px);
    line-height: 1.58;
}

.past-avg-dialogue-line--char {
    border-left-color: rgba(211, 157, 78, 0.82);
}

.past-avg-discuss-card {
    width: 100%;
    margin-top: 14px;
    min-height: 62px;
    padding: 11px 13px;
    border: 2px solid rgba(203, 67, 55, 0.74);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(48, 34, 27, 0.94), rgba(31, 24, 20, 0.98)),
        repeating-linear-gradient(90deg, rgba(255, 235, 185, 0.035), rgba(255, 235, 185, 0.035) 1px, transparent 1px, transparent 9px);
    color: #ffe2a8;
    display: grid;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.past-avg-discuss-card span {
    color: #ffd28f;
    font-size: 15px;
    font-weight: 900;
}

.past-avg-discuss-card small {
    color: rgba(255, 234, 193, 0.78);
    font-size: 12px;
    line-height: 1.45;
}

.past-avg-discuss-card.is-disabled {
    cursor: default;
    border-color: rgba(235, 211, 172, 0.18);
    opacity: 0.66;
}

.past-avg-stage--companion {
    place-items: stretch;
    background:
        linear-gradient(90deg, rgba(14, 8, 8, 0.93), rgba(45, 18, 16, 0.66), rgba(12, 8, 8, 0.92)),
        url("assets/民国背景.jpg") center / cover no-repeat;
}

.past-avg-companion-shell {
    position: relative;
    z-index: 2;
    width: min(100%, 760px);
    max-height: 100%;
    min-height: 0;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid rgba(235, 211, 172, 0.24);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(29, 17, 15, 0.94), rgba(12, 8, 8, 0.97)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 7px);
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.48);
}

.past-avg-companion-head {
    min-height: 64px;
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(235, 211, 172, 0.16);
    background: rgba(24, 13, 12, 0.92);
}

.past-avg-companion-back {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(235, 211, 172, 0.26);
    background: rgba(246, 231, 199, 0.08);
    color: #f0d9b0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.past-avg-companion-head h1 {
    margin: 0;
    color: #f0d9b0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 900;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.past-avg-companion-head p {
    margin: 4px 0 0;
    color: rgba(240, 217, 176, 0.58);
    font-size: 12px;
    line-height: 1.35;
}

.past-avg-companion-scroll {
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.past-avg-companion-scroll::-webkit-scrollbar {
    display: none;
}

.past-avg-companion-empty {
    margin: auto;
    width: min(100%, 330px);
    padding: 18px 14px;
    border: 1px dashed rgba(235, 211, 172, 0.22);
    border-radius: 8px;
    background: rgba(246, 231, 199, 0.06);
    color: rgba(240, 217, 176, 0.7);
    display: grid;
    gap: 6px;
    text-align: center;
}

.past-avg-companion-empty strong {
    color: #f0d9b0;
    font-size: 15px;
}

.past-avg-companion-empty span {
    font-size: 12px;
    line-height: 1.5;
}

.past-avg-chat-row {
    display: grid;
    gap: 4px;
    max-width: min(82%, 470px);
}

.past-avg-chat-row.is-user {
    align-self: flex-end;
    justify-items: end;
}

.past-avg-chat-row.is-char {
    align-self: flex-start;
    justify-items: start;
}

.past-avg-chat-name {
    color: rgba(240, 217, 176, 0.58);
    font-size: 11px;
    font-weight: 800;
}

.past-avg-chat-bubble {
    padding: 10px 12px;
    border-radius: 8px;
    color: #fff0c8;
    font-size: calc(var(--past-avg-text-size) - 2px);
    line-height: 1.56;
    word-break: break-word;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.past-avg-chat-row.is-user .past-avg-chat-bubble {
    background: linear-gradient(180deg, rgba(147, 37, 31, 0.94), rgba(102, 27, 23, 0.98));
    border: 1px solid rgba(211, 107, 80, 0.42);
}

.past-avg-chat-row.is-char .past-avg-chat-bubble {
    background: rgba(246, 231, 199, 0.1);
    border: 1px solid rgba(235, 211, 172, 0.18);
}

.past-avg-chat-bubble ruby {
    ruby-position: over;
}
.past-avg-chat-bubble rt {
    font-size: 0.72em;
    line-height: 1.2;
    color: rgba(255, 240, 200, 0.82);
}
.past-avg-chat-bubble rp {
    font-size: 0.65em;
    color: rgba(240, 217, 176, 0.55);
}

.past-avg-chat-bubble.is-loading {
    color: rgba(255, 240, 200, 0.64);
}

.past-avg-companion-composer {
    min-height: 64px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 10px 12px;
    border-top: 1px solid rgba(235, 211, 172, 0.16);
    background: rgba(17, 10, 10, 0.96);
}

.past-avg-companion-composer textarea {
    width: 100%;
    min-height: 42px;
    max-height: 120px;
    resize: none;
    border: 1px solid rgba(235, 211, 172, 0.2);
    border-radius: 8px;
    background: rgba(255, 250, 236, 0.09);
    color: #ffe8bc;
    padding: 10px 11px;
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    outline: none;
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

.past-avg-companion-composer textarea::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.past-avg-companion-composer textarea::placeholder {
    color: rgba(240, 217, 176, 0.42);
}

.past-avg-receive-btn,
.past-avg-send-btn {
    min-height: 42px;
    min-width: 56px;
    border-radius: 8px;
    border: 1px solid rgba(235, 211, 172, 0.22);
    color: #ffe8bc;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.past-avg-receive-btn {
    background: rgba(246, 231, 199, 0.12);
}

.past-avg-send-btn {
    background: #93251f;
}

.past-avg-receive-btn:disabled,
.past-avg-send-btn:disabled,
.past-avg-companion-composer textarea:disabled {
    cursor: default;
    opacity: 0.52;
}

.past-avg-clue-panel {
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    padding: 12px;
}

.past-avg-modal-card--clues {
    width: min(100%, 390px);
}

.past-avg-clue-modal-body {
    display: grid;
    gap: 10px;
}

.past-avg-clue-status {
    min-height: 30px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(246, 231, 199, 0.07);
    color: rgba(240, 217, 176, 0.74);
    font-size: 12px;
    font-weight: 800;
}

.past-avg-clue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    color: #f0d9b0;
    font-size: 13px;
    font-weight: 900;
}

.past-avg-clue-head b {
    color: #d99a62;
}

.past-avg-clue-panel ul {
    list-style: none;
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.past-avg-clue-panel li {
    padding: 9px;
    border: 1px dashed rgba(235, 211, 172, 0.16);
    border-radius: 8px;
    background: rgba(10, 7, 7, 0.22);
    opacity: 0.66;
}

.past-avg-clue-panel li.is-found {
    border-style: solid;
    border-color: rgba(202, 83, 62, 0.42);
    background: rgba(139, 35, 28, 0.24);
    opacity: 1;
}

.past-avg-clue-panel strong,
.past-avg-clue-panel small {
    display: block;
}

.past-avg-clue-panel strong {
    color: #f0d9b0;
    font-size: 13px;
}

.past-avg-clue-panel small {
    margin-top: 4px;
    color: rgba(240, 217, 176, 0.64);
    font-size: 11px;
    line-height: 1.45;
}

.past-avg-clue-flash {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(235, 211, 172, 0.16);
}

.past-avg-clue-flash span {
    color: rgba(240, 217, 176, 0.66);
    font-size: 11px;
    font-weight: 900;
}

.past-avg-clue-flash b {
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 8px;
    background: rgba(213, 154, 92, 0.18);
    color: #ffd29b;
    font-size: 12px;
}

.past-avg-choice-panel {
    display: grid;
    gap: 9px;
    padding: 12px;
}

.past-avg-choice-panel .past-avg-companion-line {
    font-size: 12px;
    line-height: 1.45;
}

.past-avg-choice-list {
    display: grid;
    gap: 8px;
    max-height: 176px;
    overflow: auto;
    scrollbar-width: none;
}

.past-avg-choice {
    width: 100%;
    min-height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(235, 211, 172, 0.22);
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    box-shadow: inset 0 0 0 1px rgba(255, 244, 214, 0.04);
}

.past-avg-choice span {
    color: #fff0c8;
    font-size: 14px;
    font-weight: 900;
}

.past-avg-choice small {
    color: rgba(255, 240, 200, 0.66);
    font-size: 12px;
    line-height: 1.4;
}

.past-avg-choice--primary {
    background: linear-gradient(180deg, rgba(147, 37, 31, 0.92), rgba(92, 24, 21, 0.96));
    border-color: rgba(211, 107, 80, 0.48);
}

.past-avg-choice--secondary {
    background: rgba(246, 231, 199, 0.09);
}

.past-avg-choice--danger {
    background: linear-gradient(180deg, rgba(46, 38, 31, 0.94), rgba(30, 25, 21, 0.96));
    border-color: rgba(219, 180, 122, 0.34);
}

.past-avg-choice:active {
    transform: translateY(1px) scale(0.995);
}

.past-avg-choice:disabled {
    cursor: default;
    opacity: 0.5;
    transform: none;
}

.past-avg-game-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 440px);
    max-height: 100%;
    overflow: auto;
    scrollbar-width: none;
    padding: 24px 22px;
    border-radius: 8px;
    border: 1px solid rgba(229, 202, 158, 0.28);
    background:
        linear-gradient(180deg, rgba(36, 22, 19, 0.94), rgba(18, 12, 12, 0.96)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 6px);
    color: #ead9b8;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}

.past-avg-game-kicker {
    color: #b64235;
    font-family: "LoveMiPastTitle", serif;
    font-size: 22px;
}

.past-avg-game-title {
    margin: 2px 0 16px;
    font-family: "LoveMiPastTitle", serif;
    font-size: clamp(34px, 10vw, 58px);
    line-height: 1;
    font-weight: 400;
    color: #ead9b8;
}

.past-avg-game-text {
    font-size: var(--past-avg-text-size);
    line-height: 1.72;
    color: rgba(243, 224, 190, 0.92);
}

.past-avg-game-text p {
    margin: 0 0 8px;
}

.past-avg-companion-line {
    color: #dcb070;
}

.past-avg-game-actions,
.past-avg-modal-foot,
.past-avg-preset-editor-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.past-avg-primary-btn,
.past-avg-secondary-btn,
.past-avg-mini-btn {
    border: 1px solid rgba(147, 37, 31, 0.28);
    border-radius: 8px;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.past-avg-primary-btn {
    background: #93251f;
    color: #f5e3bf;
}

.past-avg-secondary-btn,
.past-avg-mini-btn {
    background: rgba(246, 231, 199, 0.84);
    color: #4b2c25;
}

.past-avg-mini-btn {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 12px;
}

.past-avg-modal-host {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.past-avg-modal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(9, 6, 6, 0.62);
    pointer-events: auto;
}

.past-avg-modal-card {
    width: min(100%, 430px);
    max-height: min(86vh, 650px);
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    border: 1px solid rgba(235, 211, 172, 0.34);
    background: #211511;
    color: #ecd8b8;
    box-shadow: 0 24px 68px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.past-avg-modal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(235, 211, 172, 0.16);
}

.past-avg-modal-head h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-family: "LoveMiPastTitle", serif;
    font-size: 24px;
    font-weight: 400;
    color: #f0d9b0;
}

.past-avg-modal-head button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(235, 211, 172, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #f0d9b0;
    cursor: pointer;
}

.past-avg-modal-body {
    padding: 14px;
    overflow: auto;
    scrollbar-width: none;
}

.past-avg-modal-foot {
    padding: 12px 14px;
    border-top: 1px solid rgba(235, 211, 172, 0.14);
}

.past-avg-friend-list {
    display: grid;
    gap: 8px;
}

.past-avg-archive-list {
    display: grid;
    gap: 8px;
}

.past-avg-archive-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 62px;
    padding: 8px;
    border: 1px solid rgba(235, 211, 172, 0.14);
    border-radius: 8px;
    background: rgba(246, 231, 199, 0.05);
}

.past-avg-archive-row.is-filled {
    background: rgba(147, 37, 31, 0.16);
    border-color: rgba(198, 78, 58, 0.28);
}

.past-avg-archive-main {
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.past-avg-archive-main:disabled {
    cursor: default;
    opacity: 0.56;
}

.past-avg-archive-main strong,
.past-avg-archive-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.past-avg-archive-main strong {
    color: #f0d9b0;
    font-size: 14px;
}

.past-avg-archive-main small {
    margin-top: 4px;
    color: rgba(240, 217, 176, 0.58);
    font-size: 11px;
}

.past-avg-archive-delete,
.past-avg-archive-delete-placeholder {
    width: 32px;
    height: 32px;
}

.past-avg-archive-delete {
    border-radius: 8px;
    border: 1px solid rgba(235, 211, 172, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #e6c79a;
    cursor: pointer;
}

.past-avg-friend-row {
    display: grid;
    grid-template-columns: auto 42px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px;
    border: 1px solid rgba(235, 211, 172, 0.14);
    border-radius: 8px;
    background: rgba(246, 231, 199, 0.06);
}

.past-avg-friend-row input {
    accent-color: #a72d24;
}

.past-avg-friend-avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(236, 211, 172, 0.18);
    color: #f0d9b0;
    font-weight: 900;
}

.past-avg-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.past-avg-friend-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.past-avg-empty {
    padding: 18px 10px;
    color: rgba(240, 217, 176, 0.62);
    text-align: center;
    font-size: 13px;
}

.past-avg-settings-body {
    display: grid;
    gap: 14px;
}

.past-avg-setting-field {
    display: grid;
    gap: 8px;
}

.past-avg-setting-field label,
.past-avg-setting-title-row label {
    color: #f0d9b0;
    font-size: 13px;
    font-weight: 800;
}

.past-avg-range-row {
    display: grid;
    grid-template-columns: 1fr 52px;
    align-items: center;
    gap: 10px;
}

.past-avg-range-row input {
    width: 100%;
    accent-color: #a72d24;
}

.past-avg-range-row output {
    color: #dcb070;
    text-align: right;
    font-size: 12px;
}

.past-avg-setting-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.past-avg-danger-field {
    padding: 10px;
    border: 1px solid rgba(194, 60, 47, 0.32);
    border-radius: 8px;
    background: rgba(130, 30, 25, 0.15);
}

.past-avg-danger-field p {
    margin: 0;
    color: rgba(240, 217, 176, 0.66);
    font-size: 12px;
    line-height: 1.5;
}

.past-avg-danger-btn {
    justify-self: start;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(235, 211, 172, 0.18);
    border-radius: 8px;
    background: #7d211c;
    color: #ffe5bd;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.past-avg-preset-list {
    display: grid;
    gap: 8px;
}

.past-avg-preset-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    min-height: 50px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(235, 211, 172, 0.14);
    background: rgba(246, 231, 199, 0.05);
}

.past-avg-preset-toggle input {
    display: none;
}

.past-avg-preset-toggle span {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: rgba(235, 211, 172, 0.18);
    display: block;
    position: relative;
}

.past-avg-preset-toggle span::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #cbb58e;
    transition: transform 0.18s ease, background 0.18s ease;
}

.past-avg-preset-toggle input:checked + span {
    background: rgba(171, 45, 36, 0.58);
}

.past-avg-preset-toggle input:checked + span::after {
    transform: translateX(14px);
    background: #ffe5b5;
}

.past-avg-preset-main {
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.past-avg-preset-main strong,
.past-avg-preset-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.past-avg-preset-main strong {
    color: #f0d9b0;
    font-size: 13px;
}

.past-avg-preset-main small {
    margin-top: 2px;
    color: rgba(240, 217, 176, 0.56);
    font-size: 11px;
}

.past-avg-preset-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(235, 211, 172, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #e6c79a;
    cursor: pointer;
}

.past-avg-preset-editor {
    display: grid;
    gap: 8px;
    padding-top: 2px;
}

.past-avg-preset-editor input,
.past-avg-preset-editor textarea {
    width: 100%;
    border: 1px solid rgba(235, 211, 172, 0.18);
    border-radius: 8px;
    background: rgba(255, 250, 236, 0.08);
    color: #f3dec0;
    padding: 9px 10px;
    font: 13px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.past-avg-preset-editor textarea {
    resize: vertical;
    min-height: 92px;
}

@media (max-width: 430px) {
    .past-avg-stage {
        padding: 10px 8px 12px 48px;
    }

    .past-avg-chapter-shell {
        gap: 8px;
    }

    .past-avg-chapter-head {
        min-height: 62px;
        padding: 10px 11px;
        align-items: center;
    }

    .past-avg-node-badge {
        white-space: normal;
        text-align: center;
        font-size: 11px;
    }

    .past-avg-chapter-board {
        grid-template-columns: 1fr;
    }

    .past-avg-story-panel {
        padding: 12px;
    }

    .past-avg-node-meta span {
        font-size: 11px;
    }

    .past-avg-dialogue-line {
        grid-template-columns: 1fr;
    }

    .past-avg-companion-shell {
        width: 100%;
    }

    .past-avg-companion-head {
        min-height: 58px;
        grid-template-columns: 36px 1fr;
        padding: 8px 9px;
    }

    .past-avg-companion-back {
        width: 34px;
        height: 34px;
        font-size: 24px;
    }

    .past-avg-chat-row {
        max-width: 92%;
    }

    .past-avg-companion-composer {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px;
        padding: 8px;
    }

    .past-avg-receive-btn,
    .past-avg-send-btn {
        min-width: 48px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .past-avg-choice-panel {
        padding: 10px;
    }

    .past-avg-choice-list {
        max-height: 146px;
    }

    .past-avg-paper {
        padding: 12px 14px 14px;
    }

    .past-avg-poster-btn {
        width: min(78%, 236px);
    }

    .past-avg-synopsis {
        line-height: 1.52;
    }

    .past-avg-side-script--left {
        left: 48px;
    }

    .past-avg-side-script--right {
        display: none;
    }

    .past-avg-footer-line {
        display: grid;
    }
}

@media (max-height: 760px) {
    .past-avg-paper {
        padding-top: 10px;
    }

    .past-avg-chapter-head {
        min-height: 58px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .past-avg-story-panel {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .past-avg-choice {
        min-height: 50px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .past-avg-seal {
        font-size: clamp(48px, 13vw, 74px);
    }

    .past-avg-title {
        font-size: clamp(28px, 7vw, 42px);
    }

    .past-avg-poster-btn {
        width: min(68%, 228px);
        margin-top: 8px;
        margin-bottom: 9px;
    }
}
