/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', '宋体', 'SimSun', serif;
    background-color: #1e1a1a;
    color: #e0d6c6;
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
}

.bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(60, 40, 30, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80, 60, 40, 0.2) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.memorial-hall {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    background-color: rgba(20, 15, 12, 0.7);
    backdrop-filter: blur(2px);
    border-left: 1px solid #5f4b3a;
    border-right: 1px solid #5f4b3a;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 遗像区域 */
.portrait-section {
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #7f6248;
    padding-bottom: 1rem;
}

.frame-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.portrait {
    display: block;
    max-width: 160px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.7), 0 0 0 2px #ab8e6a, 0 0 0 5px #3a2e26;
}

.portrait.framed {
    /* 使用带相框的图片 */
}

.hidden {
    display: none;
}

.deceased-name {
    font-size: 2.4rem;
    letter-spacing: 4px;
    color: #f0e4d0;
    text-shadow: 2px 2px 0 #3f2e1e, 4px 4px 0 #00000055;
    font-weight: normal;
    margin-bottom: 0.3rem;
    font-family: 'Times New Roman', '宋体', serif;
}

.subtle-title {
    font-size: 1rem;
    color: #b7a48b;
    font-style: italic;
    border-top: 1px dashed #7f6248;
    padding-top: 0.5rem;
    display: inline-block;
}

/* 生平简介区块（新增） */
.bio-section {
    background: #2a221c;
    border-left: 4px solid #8b6f50;
    padding: 1.2rem 1.2rem 0.8rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: inset 0 0 10px #0f0b08;
}

.bio-title {
    font-size: 1.4rem;
    color: #ecd5b0;
    border-bottom: 1px solid #6a4f38;
    padding-bottom: 0.3rem;
    margin-bottom: 0.8rem;
    font-weight: normal;
    letter-spacing: 2px;
}

.bio-content p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    text-align: justify;
    color: #d4c0aa;
}

.bio-content p:last-child {
    margin-bottom: 0;
    font-style: italic;
    color: #b8a48c;
}

/* 纸钱计数器 */
.paper-money-panel {
    background: #2c241e;
    border: 1px solid #6a4f38;
    padding: 1.2rem 1rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    box-shadow: inset 0 0 15px #0f0b08, 0 6px 10px #00000055;
}

.counter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.6rem;
    background: #1f1915;
    padding: 0.6rem 1.8rem;
    border-radius: 60px;
    border: 1px solid #b2926b;
    box-shadow: 0 2px 0 #3f2e1e;
}

.zhiqian-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 3px black);
}

.counter-label {
    font-size: 1.2rem;
    color: #e6d5bb;
}

.counter-value {
    font-weight: bold;
    color: #fadfad;
    font-size: 2.2rem;
    min-width: 100px;
    text-align: center;
    font-family: 'Courier New', monospace;
    background: #00000033;
    padding: 0 0.3rem;
    border-radius: 8px;
}

.counter-unit {
    font-size: 1.2rem;
    color: #c5b096;
}

/* 功德/罪孽称号（新增） */
.virtue-title {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0.5rem 0 0.2rem;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    background: #1e1612;
    border: 1px solid #b2926b;
    color: #ffecb3;
    text-align: center;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
    box-shadow: 0 0 10px #6a4f38 inset;
}

.burn-status {
    min-height: 1.8rem;
    margin-top: 0.6rem;
    font-size: 0.95rem;
    color: #dbbd9a;
    font-style: italic;
    background: #1e1612;
    padding: 0.3rem 1rem;
    border-radius: 30px;
    border-left: 4px solid #b87c4b;
}

/* 烧纸按钮区 */
.offering-actions {
    margin-bottom: 2.2rem;
    background: #231e19;
    padding: 1.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #7b5f42;
}

.denomination-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.burn-btn {
    background: #3d3127;
    border: 1px solid #8b6f50;
    color: #fbebd2;
    font-size: 1.2rem;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    box-shadow: 0 4px 0 #1b130e;
    transition: 0.1s linear;
    min-width: 70px;
    font-weight: bold;
    letter-spacing: 1px;
}

.burn-btn:hover:not(:disabled) {
    background: #5b4433;
    border-color: #c99e73;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1b130e;
}

.burn-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1b130e;
}

.burn-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-amount {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#customAmount {
    background: #1f1a15;
    border: 1px solid #8b6f50;
    color: #f0e0c0;
    padding: 0.6rem 1rem;
    font-size: 1.2rem;
    border-radius: 30px;
    width: 240px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

#customAmount:focus {
    outline: none;
    border-color: #d4a373;
    box-shadow: 0 0 8px #b87c4b;
}

.notice {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #9e8b78;
    border-top: 1px dashed #4f3e2e;
    padding-top: 0.8rem;
}

/* 讣告按钮 */
.obituary-trigger {
    text-align: center;
    margin: 1.8rem 0 1rem;
}

.obituary-btn {
    background: transparent;
    border: 2px solid #a48362;
    color: #ebd5b0;
    font-size: 1.3rem;
    padding: 0.6rem 2rem;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    transition: 0.2s;
    box-shadow: 0 2px 8px black;
    backdrop-filter: blur(4px);
}

.obituary-btn:hover {
    background: #3e2e22;
    border-color: #dbbd9a;
    color: #fff5e6;
}

/* 弹窗 (modal) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 5, 3, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background-color: #2c241c;
    border: 2px solid #b38b5f;
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 0 1px #6f523b inset;
    color: #ecdcc0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #7f6248;
    background: #1e1712;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: normal;
    letter-spacing: 2px;
    color: #f5d7b3;
}

.close-btn {
    background: none;
    border: none;
    color: #b7a48b;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
}

.close-btn:hover {
    color: #f5d7b3;
}

.modal-body {
    padding: 2rem 2rem;
    line-height: 1.9;
    font-size: 1rem;
    text-align: justify;
    white-space: pre-wrap;
    font-family: 'Times New Roman', '宋体', serif;
}

/* 页脚 */
.site-footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem 0;
    color: #7f6b58;
    font-size: 0.9rem;
    border-top: 1px solid #4f3e2e;
}