:root {
    --paper-color: #FFFEFC;      /* 仿古宣纸色 —— 与正文 style.css 一致 */
    --ink-color: #2E3A33;        /* 深青墨 */
    --accent-color: #3A6351;     /* 嫩荷青绿 —— 与正文按钮一致 */
    --gold-color: #b08d57;       /* 暖金点缀 */
    --shadow-dark: rgba(40, 50, 45, 0.18);
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: "楷体", "STKaiti", "SimSun", serif;
    /* 仿古宣纸白渐变 + 极淡青瓷角晕 —— 与小说正文页面协调 */
    background:
        radial-gradient(ellipse at 18% 22%, rgba(58,99,81,0.07) 0%, transparent 42%),
        radial-gradient(ellipse at 82% 78%, rgba(58,99,81,0.06) 0%, transparent 40%),
        linear-gradient(160deg, #FFFEFC 0%, #F7F3E9 45%, #EFE8D8 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center;
    color: var(--ink-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ================================================================
   书封容器 + 翻书动画
   ================================================================ */
.book-cover {
    width: 92%;
    max-width: 720px;
    min-height: auto;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.8s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-back {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(200,190,170,0.18) 0%,
        rgba(225,215,195,0.32) 15%,
        rgba(210,200,180,0.2) 50%,
        rgba(225,215,195,0.32) 85%,
        rgba(200,190,170,0.18) 100%
    );
    border: 1px solid rgba(180,165,140,0.35);
    box-shadow: 0 12px 30px var(--shadow-dark);
    z-index: 1;
    transition: opacity 0.05s;
}

/* 书封正面 —— 宣纸白卡片，与正文观感统一 */
.front-cover {
    background: rgba(255, 254, 252, 0.96);
    border: 1px solid rgba(58,99,81,0.25);
    box-shadow:
        0 12px 35px var(--shadow-dark),
        inset 0 1px 0 rgba(255,255,255,0.6);
    padding: 1.8rem 1.5rem;
    text-align: center;
    transform-origin: left center;
    backface-visibility: hidden;
    width: 100%;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* ================================================================
   封面主视觉图
   ================================================================ */
.cover-art {
    width: 100%;
    max-width: 380px;
    margin: 0 auto 1.5rem;
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        0 8px 24px rgba(40,50,45,0.22),
        0 0 0 1px rgba(58,99,81,0.18);
    line-height: 0;
}

.cover-art img {
    width: 100%;
    height: auto;
    max-height: 58vh;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.cover-art:hover img {
    transform: scale(1.02);
}

/* ================================================================
   展卷阅读按钮 —— 青绿（与正文按钮一致）
   ================================================================ */
.open-book {
    display: inline-block;
    padding: 0.75rem 2.8rem;
    background: linear-gradient(135deg, #3A6351, #2f5243);
    color: #fffefc;
    border-radius: 4px;
    font-size: 1.05rem;
    letter-spacing: 3px;
    transition: all 0.3s;
    margin: 0.8rem 0 1.5rem;
    border: 1px solid rgba(176,141,87,0.35);
    cursor: pointer;
    font-family: "楷体", "STKaiti", serif;
    box-shadow: 0 4px 12px rgba(58,99,81,0.3);
}

.open-book:hover {
    background: linear-gradient(135deg, #4a7a64, #3A6351);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(58,99,81,0.4);
    border-color: var(--gold-color);
}

.open-book:active {
    transform: translateY(0);
}

/* ================================================================
   兄弟站点链接区 —— 宣纸卡片 + 青绿链接
   ================================================================ */
.links-section {
    width: 100%;
    max-width: 420px;
    padding: 1.2rem 1rem;
    background: rgba(247, 243, 233, 0.92);
    border: 1px solid rgba(58,99,81,0.18);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(40,50,45,0.08);
    margin-top: 0.5rem;
    order: 3;
}

.links-title {
    text-align: center;
    margin-bottom: 0.9rem;
    color: var(--accent-color);
    font-size: 0.95rem;
    letter-spacing: 2px;
    font-weight: bold;
}

.friend-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 0.6rem;
    text-align: center;
    margin: 0;
    padding: 0;
}

.friend-links-grid a {
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.45rem 0.3rem;
    border-bottom: 1px dashed rgba(58,99,81,0.35);
    transition: all 0.25s;
    font-size: 0.88rem;
    border-radius: 3px;
}

.friend-links-grid a:hover {
    color: var(--ink-color);
    border-bottom-color: var(--ink-color);
    background: rgba(58,99,81,0.07);
}

.friend-links-grid a.self-link {
    color: var(--accent-color);
    font-weight: bold;
    border-bottom-style: solid;
}

/* ================================================================
   翻书动画
   ================================================================ */
.book-cover.opened {
    transform: rotateY(-150deg);
    pointer-events: none;
}

.book-cover.opened ~ .book-back,
.book-cover.opened + .book-back,
.book-cover.opened :scope > .book-back {
    opacity: 1;
    z-index: 3;
}

/* ================================================================
   桌面端适配
   ================================================================ */
@media (min-width: 768px) {
    .front-cover {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
        padding: 2.5rem 3rem;
        max-width: 800px;
    }

    .cover-art {
        max-width: 340px;
        margin: 0;
    }

    .cover-art img {
        max-height: 52vh;
    }

    .open-book {
        padding: 0.9rem 3.2rem;
        font-size: 1.1rem;
    }

    .links-section {
        max-width: 260px;
        margin-top: 0;
        order: 0;
    }

    .friend-links-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .book-cover { max-width: 820px; }
    .cover-art { max-width: 380px; }
    .cover-art img { max-height: 56vh; }
    .links-section { max-width: 300px; }
}
