* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    height: 100vh;
    overflow: hidden;
    position: relative;
    color: #ddd;
}

/* 全屏背景 */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./imgs/birth.jpg'); /* 可以设置一个默认背景 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(30%);  /* 可以保留一点灰度，或者删除这一行 */
    z-index: -1;
    transition: opacity 0.5s ease;  /* 过渡效果 */
}

/* ==================== 移动端适配 ==================== */
/* 默认桌面端样式 */
:root {
    --sidebar-width: 280px;
    --event-width: 80%;
    --event-max-width: 800px;
    --modal-min-width: 400px;
    --doctor-modal-width: 600px;
    --doctor-image-size: 400px;
    --doctor-font-size: 48px;
}

/* 移动端样式 - 宽度小于768px */
@media screen and (max-width: 768px) {
    :root {
        --sidebar-width: 85%;
        --event-width: 90%;
        --event-max-width: none;
        --modal-min-width: 90%;
        --doctor-modal-width: 95%;
        --doctor-image-size: 80vw;
        --doctor-font-size: 36px;
    }
    
    /* 左侧边栏 - 移动端占满宽度 */
    .sidebar {
        width: var(--sidebar-width);
        max-height: 85vh;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px;
    }
    
    /* 帮助按钮 - 移动端调整位置 */
    .help-btn {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 16px;
    }
    
    /* 底部事件面板 - 移动端调整 */
    .event-panel {
        width: var(--event-width);
        bottom: 10px;
        padding: 12px;
    }
    
    .event-title {
        font-size: 20px;
    }
    
    .event-desc {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .option-btn {
        padding: 10px;
        font-size: 14px;
    }
    
    /* 弹窗 - 移动端适配 */
    .modal-content {
        min-width: var(--modal-min-width);
        max-width: 95%;
        padding: 15px;
    }
    
    /* 出生选择表单 - 移动端 */
    .form-group {
        margin: 10px 0;
    }
    
    .form-group label {
        width: 60px;
        font-size: 14px;
    }
    
    .form-group input, .form-group select {
        padding: 6px;
        font-size: 14px;
        width: calc(100% - 70px);
    }
    
    #inputMonth, #inputDay {
        width: 60px !important;
    }
    
    .confirm-btn {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    /* 玩家信息区域 - 移动端 */
    .player-info div, .player-stats div {
        font-size: 14px;
        margin: 5px 0;
    }
    
    /* 人生轨迹区域 - 移动端 */
    .timeline-section {
        max-height: 200px;
    }
    
    .timeline-list {
        max-height: 200px;
        min-height: 120px;
    }
    
    .timeline-item {
        font-size: 12px;
    }
    
    /* 物品栏区域 - 移动端 */
    .items-section {
        max-height: 150px;
    }
    
    .items-list {
        max-height: 150px;
    }
    
    .item-entry {
        font-size: 13px;
    }
    
    .item-entry button {
        padding: 2px 6px;
        font-size: 12px;
    }
}

/* 小屏手机 - 宽度小于480px */
@media screen and (max-width: 480px) {
    :root {
        --sidebar-width: 92%;
        --doctor-font-size: 28px;
    }
    
    .sidebar {
        padding: 8px;
    }
    
    .player-info div, .player-stats div {
        font-size: 13px;
    }
    
    .event-title {
        font-size: 18px;
    }
    
    .event-desc {
        font-size: 14px;
    }
    
    .option-btn {
        padding: 8px;
        font-size: 13px;
    }
    
    .modal-content {
        padding: 12px;
    }
    
    .form-group label {
        width: 55px;
        font-size: 13px;
    }
    
    .death-actions {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==================== 博士特殊弹窗 - 移动端适配 ==================== */
.doctor-modal {
    min-width: 500px !important;
    max-width: var(--doctor-modal-width);
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    padding: 0;
    animation: doctorAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 移动端博士弹窗 */
@media screen and (max-width: 768px) {
    .doctor-modal {
        min-width: 90% !important;
    }
}

.doctor-image-container {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.doctor-image {
    max-width: var(--doctor-image-size);
    max-height: var(--doctor-image-size);
    width: auto;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 0 18px 2px rgba(255, 68, 68, 0.8);
    animation: pulse 2s infinite;
    display: block;
    margin: 18px auto 0 auto;
}

/* 移动端图片适配 */
@media screen and (max-width: 768px) {
    .doctor-image {
        max-width: 80vw;
        max-height: 80vw;
        margin: 5vw auto 0 auto;
    }
}

.doctor-text {
    font-size: var(--doctor-font-size);
    font-weight: bold;
    color: #ff6666;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    margin: 30px 0 0 0;
    letter-spacing: 6px;
}

/* 移动端文字适配 */
@media screen and (max-width: 768px) {
    .doctor-text {
        font-size: 10vw;
        margin: 5vw 0 0 0;
        letter-spacing: 3px;
    }
}

/* 左侧边栏 - 固定显示 */
.sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 280px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid #666;
    color: #ccc;
    padding: 15px;
    z-index: 10;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: scroll;  /* 保留滚动功能 */
    scrollbar-width: none;  /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none;  /* IE/Edge 隐藏滚动条 */
}

/* Chrome/Safari 隐藏滚动条 */
.sidebar-content::-webkit-scrollbar {
    display: none;
}

/* 玩家信息区域 */
.player-info div, .player-stats div {
    margin: 8px 0;
    font-size: 16px;
    border-bottom: 1px dashed #555;
    padding-bottom: 4px;
}

hr {
    border: 1px solid #444;
    margin: 10px 0;
    flex-shrink: 0;
}

/* 玩家信息区域和数值区域固定不滚动 */
.player-info, .player-stats {
    flex-shrink: 0;
}

.warning {
    color: #ff6666;
    font-weight: bold;
}

/* 人生轨迹区域 */
.timeline-section {
    margin: 10px 0;
    flex-shrink: 0;
    max-height: 250px;
    display: flex;
    flex-direction: column;
}

.section-title {
    background: #3a3a3a;
    padding: 8px;
    border: 1px solid #555;
    text-align: center;
    margin-bottom: 5px;
    font-weight: bold;
    color: #eee;
}

/* 人生轨迹列表隐藏滚动条 */
.timeline-list {
    background: #252525;
    border: 1px solid #444;
    padding: 8px;
    overflow-y: scroll;  /* 保留滚动功能 */
    max-height: 250px;
    min-height: 150px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.timeline-list::-webkit-scrollbar {
    display: none;
}

.timeline-item {
    padding: 8px;
    border-bottom: 1px solid #3a3a3a;
    font-size: 13px;
    color: #bbb;
    line-height: 1.4;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    color: #888;
    font-size: 11px;
    margin-bottom: 3px;
}

.timeline-event {
    color: #ddd;
    font-weight: bold;
}

.timeline-choice {
    color: #9a9a9a;
    font-size: 12px;
    margin-top: 2px;
    padding-left: 10px;
    border-left: 2px solid #555;
}

.timeline-result {
    color: #7a7a7a;
    font-size: 11px;
    margin-top: 3px;
    font-style: italic;
}

/* 物品栏区域 */
.items-section {
    margin-top: 10px;
    flex-shrink: 0;
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

/* 物品列表隐藏滚动条 */
.items-list {
    max-height: 200px;
    overflow-y: scroll;  /* 保留滚动功能 */
    border: 1px solid #444;
    padding: 5px;
    background: #252525;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.items-list::-webkit-scrollbar {
    display: none;
}

.item-entry {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    border-bottom: 1px solid #444;
    cursor: pointer;
}

.item-entry:last-child {
    border-bottom: none;
}

.item-entry button {
    background: #555;
    color: white;
    border: 1px solid #777;
    padding: 2px 8px;
    cursor: pointer;
}

.item-entry button:hover {
    background: #777;
}

/* 帮助按钮 */
.help-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #444;
    color: white;
    border: 1px solid #777;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
}

.help-btn:hover {
    background: #666;
}

/* 模态弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a2a2a;
    border: 2px solid #777;
    padding: 25px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #ddd;
}

.modal-content.small {
    min-width: 300px;
}

.close-btn {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

/* 帮助内容 */
.help-content h3 {
    margin: 15px 0 5px;
    color: #bbb;
    border-bottom: 1px solid #555;
}

.suicide-btn {
    background: #5a2a2a;
    color: white;
    border: 1px solid #a55;
    padding: 10px;
    margin-top: 20px;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
}

.suicide-btn:hover {
    background: #7a3a3a;
}

/* 底部事件面板 */
.event-panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background: rgba(40, 40, 40, 0.95);
    border: 2px solid #777;
    padding: 20px;
    z-index: 5;
}

.event-title {
    font-size: 24px;
    color: #ccc;
    border-bottom: 1px solid #666;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.event-desc {
    font-size: 18px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.event-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: #3a3a3a;
    color: #ddd;
    border: 1px solid #666;
    padding: 12px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.option-btn:hover:not(:disabled) {
    background: #555;
    border-color: #888;
}

.option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-main {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.option-condition {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
    background: #2a2a2a;
    padding: 2px 6px;
    border-radius: 3px;
}

.option-desc {
    font-size: 14px;
    color: #999;
    margin-top: 4px;
}

/* 出生弹窗表单 */
.form-group {
    margin: 15px 0;
    text-align: left;
}

.form-group label {
    display: inline-block;
    width: 70px;
    color: #ccc;
}

.form-group input, .form-group select {
    background: #3a3a3a;
    color: #ddd;
    border: 1px solid #666;
    padding: 8px;
    font-size: 16px;
}

.form-group input:focus, .form-group select:focus {
    outline: 1px solid #888;
}

.confirm-btn {
    background: #4a4a4a;
    color: white;
    border: 1px solid #777;
    padding: 12px 30px;
    font-size: 18px;
    margin-top: 20px;
    cursor: pointer;
}

.confirm-btn:hover {
    background: #666;
}

/* 死亡弹窗按钮 */
#restartBtn {
    background: #555;
    color: white;
    border: 1px solid #777;
    padding: 10px 20px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 16px;
}

/* ==================== 弹窗动态效果 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    
    /* 动画效果 */
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a2a2a;
    border: 2px solid #777;
    padding: 25px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #ddd;
    
    /* 动画效果 */
    animation: slideIn 0.3s ease;
}

/* 弹窗关闭动画 */
.modal.fade-out {
    animation: fadeOut 0.2s ease forwards;
}

.modal-content.slide-out {
    animation: slideOut 0.2s ease forwards;
}

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
}

/* ==================== 物品详情弹窗 ==================== */
.item-detail-name {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    border-bottom: 2px solid #666;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.item-detail-image-container {
    text-align: center;
    margin: 20px 0;
    min-height: 100px;  /* 无图片时占位 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-detail-image {
    max-width: 200px;
    max-height: 200px;
    border: 1px solid #666;
    background: #333;
    padding: 10px;
    border-radius: 5px;
}

.item-detail-description {
    font-size: 16px;
    line-height: 1.6;
    color: #ccc;
    margin: 20px 0;
    padding: 15px;
    background: #222;
    border-left: 3px solid #666;
    min-height: 80px;  /* 固定最小高度 */
}

.item-detail-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
}

.item-detail-footer button {
    background: #555;
    color: white;
    border: 1px solid #777;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.item-detail-footer button:hover {
    background: #777;
    transform: scale(1.05);
}

/* ==================== 死亡记录弹窗 ==================== */
.death-record {
    max-width: 500px;
}

.death-title {
    font-size: 28px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 100, 100, 0.3);
}

.death-reason-box {
    background: #1a1a1a;
    border-left: 4px solid #a55;
    padding: 15px;
    margin: 20px 0;
    font-size: 18px;
    color: #faa;
    text-align: center;
}

.timeline-summary {
    max-height: 300px;
    overflow-y: scroll;
    background: #222;
    border: 1px solid #444;
    padding: 10px;
    margin: 15px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.timeline-summary::-webkit-scrollbar {
    display: none;
}

.timeline-summary .timeline-item {
    padding: 8px;
    border-bottom: 1px solid #333;
    font-size: 13px;
}

.timeline-summary .timeline-item:last-child {
    border-bottom: none;
}

.death-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.death-actions button {
    flex: 1;
    background: #4a4a4a;
    color: white;
    border: 1px solid #666;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.death-actions button:hover {
    background: #666;
    transform: translateY(-2px);
}

.death-actions .copy-btn {
    background: #2a4a4a;
    border-color: #2a6a6a;
}

.death-actions .copy-btn:hover {
    background: #2a6a6a;
}

.death-actions .restart-btn {
    background: #5a2a2a;
    border-color: #a55;
}

.death-actions .restart-btn:hover {
    background: #7a3a3a;
}

/* 复制成功提示 - 改为左下角显示 */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 20px;  /* 与侧边栏相同的左边距 */
    width: 350px;  /* 与侧边栏相同的宽度 */
    background: #4a4a4a;
    border: 1px solid #888;
    border-top: 4px solid #888;  /* 顶部边框加粗 */
    padding: 12px 20px;
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    z-index: 200;
    text-align: center;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    pointer-events: none;  /* 让提示不阻挡点击 */
}

/* 修改动画，改为从左侧滑入 */
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* 调整原有物品弹窗样式，适配新结构 */
#itemModal .modal-content {
    min-width: 350px;
}

#discardItemBtn {
    background: #5a2a2a;
    border-color: #a55;
    padding: 8px 20px;
}

#discardItemBtn:hover {
    background: #7a3a3a;
}

/* ==================== 博士特殊弹窗 ==================== */
/* ==================== 博士特殊弹窗 ==================== */
.doctor-modal {
    min-width: 500px !important;
    max-width: 600px;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    padding: 0;
    animation: doctorAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.doctor-image-container {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.doctor-image {
    max-width: 400px;
    max-height: 400px;
    border-radius: 16px;
    /* 修改：模糊半径18px，扩展半径2px，让发光更集中 */
    box-shadow: 0 0 18px 2px rgba(255, 68, 68, 0.8);
    animation: pulse 2s infinite;
    display: block;
    margin: 18px auto 0 auto;  /* 上边距18px，正好等于发光半径 */
}

.doctor-text {
    font-size: 48px;
    font-weight: bold;
    color: #ff6666;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    margin: 30px 0 0 0;
    letter-spacing: 6px;
}

/* 动画定义 */
@keyframes doctorAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 14px 1px rgba(255, 68, 68, 0.6);  /* 最小：14px模糊 + 1px扩展 = 15px范围 */
    }
    50% {
        box-shadow: 0 0 18px 2px rgba(255, 68, 68, 1);    /* 峰值：18px模糊 + 2px扩展 = 20px范围 */
    }
    100% {
        box-shadow: 0 0 14px 1px rgba(255, 68, 68, 0.6);  /* 最小：14px模糊 + 1px扩展 = 15px范围 */
    }
}