/* ============================================
   庙绘忠义 — 公共样式
   关帝巡礼数字典藏库
   ============================================ */

/* 重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "STSong", "SimSun", "Songti SC", "Noto Serif SC", serif;
    color: #3a2e1f;
    background-color: #f5efe2;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(200, 180, 140, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(180, 150, 100, 0.06) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4c4a8' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-height: 100vh;
    position: relative;
    line-height: 1.8;
}

/* 四角回纹装饰 — 用纯CSS模拟 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        /* 左上角回纹 */
        linear-gradient(90deg, #c9a96e 2px, transparent 2px),
        linear-gradient(180deg, #c9a96e 2px, transparent 2px),
        linear-gradient(90deg, #c9a96e 2px, transparent 2px),
        linear-gradient(180deg, #c9a96e 2px, transparent 2px);
    background-size:
        24px 24px,
        24px 24px,
        24px 24px,
        24px 24px;
    background-position:
        12px 12px,
        12px 12px,
        12px 36px,
        36px 12px;
    background-repeat: no-repeat;
    opacity: 0.4;
}

.corner-decoration {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

.corner-tl {
    top: 8px;
    left: 8px;
    border-top: 2px solid #b8956a;
    border-left: 2px solid #b8956a;
}
.corner-tl::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    border-top: 1px solid #b8956a;
    border-left: 1px solid #b8956a;
}

.corner-tr {
    top: 8px;
    right: 8px;
    border-top: 2px solid #b8956a;
    border-right: 2px solid #b8956a;
}
.corner-tr::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-top: 1px solid #b8956a;
    border-right: 1px solid #b8956a;
}

.corner-bl {
    bottom: 8px;
    left: 8px;
    border-bottom: 2px solid #b8956a;
    border-left: 2px solid #b8956a;
}
.corner-bl::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    border-bottom: 1px solid #b8956a;
    border-left: 1px solid #b8956a;
}

.corner-br {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid #b8956a;
    border-right: 2px solid #b8956a;
}
.corner-br::after {
    content: "";
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-bottom: 1px solid #b8956a;
    border-right: 1px solid #b8956a;
}

/* 页面内容容器 */
.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ================== 顶部导航栏 ================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px 20px;
    border-bottom: 1px solid rgba(180, 150, 100, 0.3);
    margin-bottom: 24px;
}

.back-btn {
    font-size: 20px;
    color: #5a4632;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.back-btn:hover {
    color: #8b2323;
}

.page-title {
    font-size: 28px;
    font-weight: normal;
    color: #2d5a3d;
    letter-spacing: 6px;
    flex: 1;
    text-align: center;
    margin-right: 40px; /* 抵消右侧印章宽度，视觉居中 */
}

/* ================== 红色印章 ================== */
.red-seal {
    background: #9c2020;
    color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    letter-spacing: 2px;
    box-shadow: 0 2px 6px rgba(156, 32, 32, 0.3);
    position: relative;
}
.red-seal::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    pointer-events: none;
}

.red-seal-horizontal {
    width: 52px;
    height: 36px;
    writing-mode: horizontal-tb;
}

.red-seal-vertical {
    width: 40px;
    height: 110px;
    writing-mode: vertical-rl;
    font-size: 16px;
    letter-spacing: 4px;
}

.red-seal-small {
    width: 32px;
    height: 46px;
    writing-mode: vertical-rl;
    font-size: 12px;
    letter-spacing: 1px;
}

/* ================== 金色边框卡片 ================== */
.gold-card {
    background: linear-gradient(135deg, rgba(255, 252, 242, 0.95), rgba(250, 244, 230, 0.9));
    border: 2px solid #d4b88a;
    border-radius: 12px;
    padding: 24px 20px;
    position: relative;
    box-shadow:
        0 4px 16px rgba(120, 90, 50, 0.1),
        inset 0 0 0 4px rgba(212, 184, 138, 0.15);
}

/* 卡片四角装饰 */
.gold-card::before,
.gold-card::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #b8956a;
}
.gold-card::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}
.gold-card::after {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
}

/* ================== 模块标题 ================== */
.section-title {
    text-align: center;
    font-size: 22px;
    color: #5a3a22;
    margin-bottom: 20px;
    position: relative;
    letter-spacing: 4px;
    font-weight: normal;
}

.section-title::before,
.section-title::after {
    content: "◇";
    color: #b8956a;
    font-size: 14px;
    margin: 0 10px;
    vertical-align: middle;
}

.section-title-line {
    text-align: center;
    font-size: 22px;
    color: #5a3a22;
    margin-bottom: 20px;
    position: relative;
    letter-spacing: 4px;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.section-title-line::before,
.section-title-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c9a96e, transparent);
    max-width: 60px;
}

/* ================== 按钮 ================== */
.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(180deg, #a0522d, #8b4513);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    letter-spacing: 4px;
    border: 1px solid #6b3410;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
    transition: all 0.2s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
}

.btn-outline {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(255, 252, 242, 0.8);
    color: #8b4513;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    letter-spacing: 2px;
    border: 1.5px solid #c9a96e;
    transition: all 0.2s;
}
.btn-outline:hover {
    background: #f5efe2;
    border-color: #a0522d;
}

/* ================== 海棠形/花瓣形 图片框 ================== */
.begonia-frame {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    /* 用 border-radius 模拟海棠形（花瓣形） */
    border-radius: 30% 30% 30% 30% / 40% 40% 40% 40%;
    border: 3px solid #c9a96e;
    background: #e9e2d0;
    box-shadow: 0 4px 12px rgba(120, 90, 50, 0.15);
}

.begonia-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.begonia-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    font-size: 14px;
    text-align: center;
    background: linear-gradient(135deg, #ede5d5, #e5dcc8);
}

/* ================== 画框样式（工笔画） ================== */
.painting-frame {
    position: relative;
    border: 10px solid #6b4423;
    border-radius: 4px;
    background: #f5efe2;
    box-shadow:
        0 0 0 2px #8b6914,
        0 8px 24px rgba(60, 40, 20, 0.3);
    padding: 4px;
}

.painting-frame::before {
    content: "";
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 1px solid #5a3a1a;
    border-radius: 2px;
    pointer-events: none;
}

.painting-inner {
    width: 100%;
    aspect-ratio: 1;
    background: #f8f4e8;
    border: 1px solid #d4c4a8;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================== 分割线 ================== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #c9a96e, transparent);
    margin: 24px 0;
}

.divider-double {
    height: 3px;
    border-top: 1px solid #c9a96e;
    border-bottom: 1px solid #c9a96e;
    margin: 24px 0;
    opacity: 0.5;
}

/* ================== 文字排版 ================== */
.text-content p {
    font-size: 17px;
    line-height: 2;
    text-indent: 2em;
    margin-bottom: 16px;
    color: #4a3828;
}

/* ================== 底部操作区 ================== */
.bottom-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(201, 169, 110, 0.3);
}

.bottom-actions a {
    color: #5a4632;
    text-decoration: none;
    font-size: 18px;
    letter-spacing: 2px;
    transition: color 0.2s;
}
.bottom-actions a:hover {
    color: #8b2323;
}

/* ================== 祥云装饰 ================== */
.cloud-decoration {
    position: absolute;
    opacity: 0.15;
    pointer-events: none;
    font-size: 80px;
    color: #b8956a;
}

/* ================== 响应式 ================== */
@media (max-width: 480px) {
    .page-title {
        font-size: 22px;
        letter-spacing: 4px;
    }
    .section-title {
        font-size: 18px;
    }
    .gold-card {
        padding: 18px 14px;
    }
    .text-content p {
        font-size: 15px;
    }
}
