/* style.css - 答案之书 典雅风格，整体宽1200px，高800px */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    /* 避免拖动文字，提升翻书感，但不影响复制 */
}

html,
body {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2e241f 0%, #1f1915 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', '华文楷书', 'Microsoft YaHei', 'PingFang SC', 'Georgia', serif;
    padding: 0;
    /* 如果屏幕小于目标尺寸，允许滚动 */
    overflow: auto;
}

/* 站点统一顶部导航条 */
.site-topbar {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #e2e8f0;
}
.site-topbar-back {
    color: #0d9488;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
.site-topbar-back:hover { color: #0f766e; }
.site-topbar-brand {
    color: #0f172a;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 主容器 — 固定宽高 1200x800 */
.book-container {
    width: 1200px;
    height: 800px;
    max-width: 1200px;
    max-height: 800px;
    background: rgba(46, 36, 31, 0.3);
    border-radius: 48px;
    backdrop-filter: blur(2px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    padding: 20px 18px 30px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

/* 书页核心卡片 — 填充容器，自适应高度 */
.answer-book {
    flex: 1;
    background: #fff9ef;
    background-image: radial-gradient(circle at 25% 40%, rgba(210, 180, 140, 0.08) 2%, transparent 2.5%);
    background-size: 28px 28px;
    border-radius: 32px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 245, 215, 0.8), inset 0 0 0 8px #f7eedb;
    padding: 30px 20px 40px;
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1), box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.answer-book:active {
    transform: scale(0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* 书脊装饰线 */
.answer-book::before {
    content: "";
    position: absolute;
    left: 28px;
    top: 20px;
    bottom: 20px;
    width: 4px;
    background: linear-gradient(to bottom, #e0c8a0, #b5926a, #e0c8a0);
    border-radius: 4px;
    opacity: 0.6;
    box-shadow: 0 0 2px #ffefc0;
}

/* 标题区域 */
.book-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.book-header h1 {
    font-size: 2.8rem;
    letter-spacing: 6px;
    color: #4b2e1e;
    font-weight: 600;
    text-shadow: 3px 3px 6px rgba(150, 90, 40, 0.2);
    background: linear-gradient(135deg, #6b3f1c, #9b6a3c);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
    font-family: 'Georgia', '华文楷书', cursive;
}

.sub {
    font-size: 1rem;
    color: #b28b5e;
    margin-top: 8px;
    font-style: italic;
    letter-spacing: 1px;
    border-top: 1px dashed #e2caa4;
    display: inline-block;
    padding-top: 6px;
}

/* 答案展示区 — 神圣启示，弹性占据主要空间 */
.answer-area {
    background: #fef6e8;
    border-radius: 48px;
    padding: 30px 18px;
    margin: 15px 0 25px;
    box-shadow: inset 0 0 0 2px #fff6e6, inset 0 0 0 6px #f6ebd8, 0 12px 20px rgba(0, 0, 0, 0.1);
    min-height: 280px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.answer-text {
    font-size: 2rem;
    line-height: 1.45;
    font-weight: 500;
    color: #2b2a27;
    font-family: 'Segoe UI', '华文楷书', 'KaiTi', 'Georgia', serif;
    word-break: break-word;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease, transform 0.2s;
    max-width: 90%;
    margin: 0 auto;
}

/* 占位符轻柔样式 - 用于初始提示 */
.placeholder-answer {
    color: #c7ad88;
    font-style: italic;
    font-weight: normal;
    font-size: 1.8rem;
}

/* 随机按钮 / 翻书触发区 */
.book-action {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 10px;
}

.flip-btn {
    background: #dbb87c;
    border: none;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 14px 42px;
    border-radius: 60px;
    color: #2c1c10;
    cursor: pointer;
    box-shadow: 0 8px 0 #7a4c28;
    transition: 0.08s linear;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(2px);
    letter-spacing: 2px;
}

.flip-btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #7a4c28;
}

/* 辅助信息区 */
.info-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 20px;
    color: #c9ad85;
    font-size: 0.85rem;
    font-family: monospace;
    padding: 0 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    background: #2d241d80;
    backdrop-filter: blur(4px);
    padding: 6px 16px;
    border-radius: 60px;
    font-size: 0.8rem;
    color: #ecdcaa;
}

.counter {
    background: #34281f70;
    border-radius: 30px;
    padding: 6px 16px;
}

/* 动画: 答案弹出柔光效果 */
@keyframes gentlePop {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }

    80% {
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.answer-pop {
    animation: gentlePop 0.3s ease-out forwards;
}

/* 优雅触摸反馈 */
.answer-book,
.flip-btn {
    -webkit-tap-highlight-color: transparent;
}

footer {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 12px;
    color: #aa8b64;
}

/* 针对较小屏幕的适配：允许滚动并适当缩放内容（保持宽高比例不破坏布局） */
@media (max-width: 1240px) or (max-height: 840px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .book-container {
        transform: scale(0.98);
        transform-origin: center top;
    }
}

@media (max-width: 1220px) {
    .book-container {
        width: 100%;
        height: auto;
        min-height: 800px;
        max-width: 1200px;
    }

    .answer-text {
        font-size: 1.7rem;
    }
}

@media (max-height: 820px) {
    .book-container {
        height: auto;
        min-height: 800px;
    }
}