/* ============================================
   清正廉洁人生模拟器 - 样式表
   设计稿：1000px × 600px，整体等比缩放
   风格：金色RPG游戏风
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #1a0f0a;
    color: #333;
    /* 安全区域适配（刘海屏、折叠屏铰链等） */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

/* 强制横屏模式：竖屏时将内容旋转90度显示 */
body.force-landscape {
    width: 100vh;
    height: 100vw;
    width: calc(var(--vh, 1vh) * 100);
    height: calc(var(--vw, 1vw) * 100);
    transform: rotate(90deg);
    transform-origin: center center;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-left: calc(-50vh);
    margin-top: calc(-50vw);
    margin-left: calc(var(--vh, 1vh) * -50);
    margin-top: calc(var(--vw, 1vw) * -50);
}

/* ============================================
   游戏容器 - 整体等比缩放
   ============================================ */
#gameContainer {
    width: 1000px;
    height: 600px;
    position: relative;
    transform-origin: center center;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#gameContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.15) 40%,
        rgba(0, 0, 0, 0.15) 60%,
        rgba(0, 0, 0, 0.45) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* 游戏缩放包裹层 */
.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #1a0f0a;
}

/* ============================================
   顶部状态栏
   ============================================ */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: linear-gradient(180deg, #2a1a0f 0%, #1a0f0a 100%);
    border-bottom: 2px solid #c9a55a;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.stage-name {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: #ffd700;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.attributes-bar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.attr-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 4px 8px 6px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(201, 165, 90, 0.4);
    border-radius: 6px;
}

.attr-label {
    color: #c9a55a;
    margin-bottom: 2px;
    font-size: 16px;
    letter-spacing: 1px;
    font-weight: 500;
}

.attr-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.attr-value.honesty { color: #4ade80; }
.attr-value.responsibility { color: #60a5fa; }
.attr-value.rules { color: #c084fc; }
.attr-value.interest { color: #fb923c; }

.attr-bar-bg {
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.attr-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 2px;
}

.attr-bar-fill.honesty { background: #4ade80; }
.attr-bar-fill.responsibility { background: #60a5fa; }
.attr-bar-fill.rules { background: #c084fc; }
.attr-bar-fill.interest { background: #fb923c; }

/* ============================================
   主内容区
   ============================================ */
#mainArea {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    align-items: center;
    justify-content: center;
}

/* ============================================
   开始页面
   ============================================ */
.start-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px 20px;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.game-logo {
    font-size: 70px;
    margin-bottom: 4px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    line-height: 1;
}

/* 纸张标题背景 */
.title-paper {
    position: relative;
    padding: 20px 50px 16px 50px;
    margin-bottom: 8px;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.title-paper::before {
    content: '';
    position: absolute;
    top: -8px;
    right: -6px;
    width: 50px;
    height: 60px;
    background: linear-gradient(135deg, #e8e8e8 50%, transparent 50%);
    border-radius: 0 4px 0 0;
}

.title-paper::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 20px;
    right: 20px;
    height: 8px;
    background: linear-gradient(to right, #ddd 0%, #ddd 25%, transparent 25%, transparent 35%, #ddd 35%, #ddd 65%, transparent 65%, transparent 75%, #ddd 75%, #ddd 100%);
    border-radius: 2px;
}

.game-title {
    font-size: 48px;
    font-weight: 900;
    color: #ffd700;
    letter-spacing: 6px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2px;
    line-height: 1.1;
}

.game-title-sub {
    font-size: 28px;
    letter-spacing: 8px;
    margin-bottom: 6px;
}

.game-subtitle {
    font-size: 18px;
    color: #f5e6c8;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.start-btn {
    padding: 12px 60px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #f5c842 0%, #d4941a 50%, #b87a0f 100%);
    border: 2px solid #8b6914;
    border-radius: 40px;
    cursor: pointer;
    margin: 4px 0;
    transition: all 0.15s ease;
    min-width: 260px;
    letter-spacing: 2px;
    box-shadow: 0 5px 0 #6b4e0a, 0 7px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #6b4e0a, 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.start-btn-gray {
    padding: 10px 48px;
    font-size: 18px;
    background: linear-gradient(180deg, #7a8090 0%, #5a6070 50%, #4a5060 100%);
    color: #e0e4ec;
    border-color: #3a4050;
    box-shadow: 0 4px 0 #2a3040, 0 5px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-width: 220px;
    font-weight: 600;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border-radius: 32px;
    letter-spacing: 2px;
}

.start-btn-gray:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #2a3040, 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-btn-gray[disabled] {
    background: linear-gradient(180deg, #555a66 0%, #404550 50%, #353a45 100%);
    color: #888d98;
    border-color: #2a2e38;
    box-shadow: 0 2px 0 #1e222a, 0 3px 6px rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
    opacity: 0.85;
    text-shadow: none;
}

/* 底部图鉴入口按钮 */
.gallery-entry-row {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-entry-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px 10px 8px;
    background: linear-gradient(180deg, #5c3a20 0%, #3d2410 100%);
    border: 2px solid #c9a55a;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 110px;
    height: 110px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.gallery-entry-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.entry-icon {
    font-size: 36px;
    margin-bottom: 2px;
}

.entry-name {
    font-size: 15px;
    color: #ffd700;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.entry-count {
    font-size: 16px;
    color: #ffd700;
    font-weight: 700;
}

/* ============================================
   出生选择页面
   ============================================ */
.birth-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
}

.birth-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 28px;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.birth-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 800px;
}

.birth-card {
    flex: 1;
    min-width: 200px;
    max-width: 240px;
    padding: 24px 20px;
    background: linear-gradient(180deg, #f5e6c8 0%, #e8d4a8 100%);
    border: 2px solid #c9a55a;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    box-shadow: 0 4px 0 #8b6914, 0 6px 16px rgba(0, 0, 0, 0.3);
}

.birth-card:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #8b6914, 0 3px 8px rgba(0, 0, 0, 0.3);
}

.birth-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.birth-name {
    font-size: 20px;
    font-weight: 700;
    color: #5c3d00;
    margin-bottom: 8px;
}

.birth-attrs {
    font-size: 13px;
    color: #7a5a2a;
    line-height: 1.8;
    text-align: left;
    padding: 0 8px;
}

.birth-attr-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.birth-attr-row span:last-child {
    font-weight: 600;
    color: #5c3d00;
}

/* ============================================
   事件页面 - 人物 + 剧情 + 选项
   ============================================ */
.event-scene {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 0;
    width: 100%;
    position: relative;
    gap: 8px;
    margin-bottom: 8px;
}

/* 人物区域 */
.character-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    z-index: 5;
}

.character-sprite {
    width: 100px;
    height: 135px;
    background: linear-gradient(180deg, #f5e6c8 0%, #e8d4a8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    border: 3px solid #c9a55a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: characterBounce 0.5s ease;
    background-size: cover;
    background-position: center top;
    position: relative;
    overflow: hidden;
    /* 盾牌形状 */
    border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%;
}

@keyframes characterBounce {
    0% { transform: translateY(15px); opacity: 0; }
    60% { transform: translateY(-3px); }
    100% { transform: translateY(0); opacity: 1; }
}

/* 立绘图片模式 */
.character-sprite.has-image {
    background-color: #f5e6c8;
    justify-content: flex-end;
    font-size: 0;
    padding: 0;
}

.character-sprite.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.character-name-tag {
    margin-top: 4px;
    background: linear-gradient(180deg, #2a1a0f 0%, #1a0f0a 100%);
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 2;
    border: 1px solid #c9a55a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 剧情面板 */
.story-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    z-index: 3;
}

.story-content {
    background: linear-gradient(180deg, #faf0d7 0%, #f0e0b8 100%);
    border: 3px solid #c9a55a;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    min-height: 160px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 对话框装饰角 */
.story-content::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 10px;
    width: 20px;
    height: 12px;
    border-top: 2px solid #c9a55a;
    border-left: 2px solid #c9a55a;
    border-radius: 4px 0 0 0;
}

.story-content::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 10px;
    width: 20px;
    height: 12px;
    border-bottom: 2px solid #c9a55a;
    border-right: 2px solid #c9a55a;
    border-radius: 0 0 4px 0;
}

.event-index {
    display: inline-block;
    background: linear-gradient(180deg, #6b4423 0%, #4a2c17 100%);
    color: #ffd700;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid #c9a55a;
}

.event-title {
    font-size: 28px;
    font-weight: 700;
    color: #5c3d00;
    margin-bottom: 12px;
    line-height: 1.4;
    border-bottom: 1px solid rgba(201, 165, 90, 0.4);
    padding-bottom: 8px;
}

.event-content {
    font-size: 22px;
    color: #4a3010;
    line-height: 1.8;
    text-align: justify;
    font-weight: 400;
}

/* 选项区域 */
.choices-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.choice-btn {
    display: block;
    width: 100%;
    padding: 14px 28px;
    color: #5c3d00;
    background: linear-gradient(180deg, #ffe066 0%, #ffc93c 50%, #e6a817 100%);
    border: 2px solid #c9a55a;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
    line-height: 1.5;
    box-shadow: 0 3px 0 #8b6914, 0 4px 8px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

.choice-btn:last-child {
    margin-bottom: 0;
}

.choice-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #8b6914, 0 2px 4px rgba(0, 0, 0, 0.25);
    background: linear-gradient(180deg, #ffd633 0%, #ffbb00 50%, #d4940f 100%);
}

/* ============================================
   结局页面
   ============================================ */
.ending-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 20px;
    padding-left: 24px;
    padding-right: 24px;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    background: linear-gradient(180deg, #faf0d7 0%, #f0e0b8 100%);
    border: 3px solid #c9a55a;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.ending-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(255, 165, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    border: 3px solid #fff;
}

.ending-title {
    font-size: 26px;
    font-weight: 700;
    color: #5c3d00;
    margin-bottom: 6px;
    letter-spacing: 2px;
}

.ending-subtitle {
    font-size: 13px;
    color: #8b6914;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.ending-desc {
    font-size: 14px;
    color: #5c3d00;
    line-height: 1.8;
    max-width: 500px;
    margin-bottom: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid rgba(201, 165, 90, 0.4);
}

.ending-attrs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.ending-attr-item {
    text-align: center;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(201, 165, 90, 0.4);
    min-width: 70px;
}

.ending-attr-label {
    font-size: 11px;
    color: #8b6914;
    margin-bottom: 2px;
}

.ending-attr-value {
    font-size: 18px;
    font-weight: 700;
}

.ending-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

.ending-btn {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #5c3d00;
    background: linear-gradient(180deg, #ffe066 0%, #ffc93c 50%, #e6a817 100%);
    border: 2px solid #c9a55a;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 1px;
    box-shadow: 0 3px 0 #8b6914, 0 4px 8px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ending-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #8b6914, 0 2px 4px rgba(0, 0, 0, 0.25);
}

.ending-btn.ending-btn-secondary {
    background: linear-gradient(180deg, #6a5a4a 0%, #4a3a2a 100%);
    color: #e0c89a;
    border-color: #8b7355;
    box-shadow: 0 3px 0 #2a1a0f, 0 4px 8px rgba(0, 0, 0, 0.3);
    text-shadow: none;
}

.ending-btn.ending-btn-secondary:active {
    box-shadow: 0 1px 0 #2a1a0f, 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   图鉴/成就页面
   ============================================ */
.gallery-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 0;
    background: linear-gradient(180deg, #faf0d7 0%, #f0e0b8 100%);
    border: 3px solid #c9a55a;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 2px solid #c9a55a;
    flex-shrink: 0;
    background: linear-gradient(180deg, #f0e0b8 0%, #e8d4a8 100%);
    border-radius: 13px 13px 0 0;
}

.gallery-back {
    padding: 6px 14px;
    font-size: 13px;
    background: linear-gradient(180deg, #6a5a4a 0%, #4a3a2a 100%);
    color: #e0c89a;
    border: 1px solid #8b7355;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.gallery-back:active {
    transform: translateY(1px);
}

.gallery-title {
    font-size: 18px;
    font-weight: 700;
    color: #5c3d00;
    letter-spacing: 1px;
}

.gallery-count {
    font-size: 13px;
    color: #8b6914;
    font-weight: 600;
}

.gallery-grid {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    align-content: start;
}

.gallery-card {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(201, 165, 90, 0.4);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.gallery-card.unlocked {
    background: rgba(255, 255, 255, 0.6);
    border-color: #c9a55a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-card.locked {
    opacity: 0.6;
}

.gallery-card-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

.gallery-card.locked .gallery-card-icon {
    filter: grayscale(100%);
    opacity: 0.5;
}

.gallery-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #5c3d00;
    margin-bottom: 4px;
}

.gallery-card.locked .gallery-card-name {
    color: #999;
}

.gallery-card-desc {
    font-size: 11px;
    color: #8b6914;
    line-height: 1.5;
}

.gallery-card.locked .gallery-card-desc {
    color: #aaa;
}

/* 人物图鉴卡片 */
.char-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}

.char-sprite-sm {
    width: 50px;
    height: 65px;
    margin: 0 auto 6px auto;
    background: linear-gradient(180deg, #f5e6c8 0%, #e8d4a8 100%);
    border: 2px solid #c9a55a;
    border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}

.char-sprite-sm.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.char-card .gallery-card-name {
    font-size: 12px;
}

/* ============================================
   属性变化提示
   ============================================ */
.attr-change-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, #2a1a0f 0%, #1a0f0a 100%);
    border: 2px solid #c9a55a;
    padding: 16px 24px;
    border-radius: 12px;
    z-index: 2000;
    font-size: 14px;
    pointer-events: none;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.attr-change-toast.show {
    display: block;
    opacity: 1;
    animation: toastFade 1.5s ease forwards;
}

.attr-change-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: #e0c89a;
    font-size: 14px;
}

.attr-change-positive {
    color: #4ade80;
    font-weight: 600;
}

.attr-change-negative {
    color: #f87171;
    font-weight: 600;
}

@keyframes toastFade {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    15% { opacity: 1; transform: translate(-50%, -50%); }
    85% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -60%); }
}

/* ============================================
   新解锁提示
   ============================================ */
.unlock-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(180deg, #faf0d7 0%, #f0e0b8 100%);
    border: 3px solid #ffd700;
    border-radius: 16px;
    padding: 24px 36px;
    text-align: center;
    z-index: 3000;
    animation: unlockPop 0.5s ease forwards;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4), 0 0 60px rgba(255, 215, 0, 0.2);
    pointer-events: none;
}

@keyframes unlockPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    60% { transform: translate(-50%, -50%) scale(1.05); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   横屏提示遮罩（竖屏时显示）
   ============================================ */
#portraitMask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0f0a 0%, #2a1a0f 50%, #1a0f0a 100%);
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    text-align: center;
    padding: 30px;
}

#portraitMask.show {
    display: flex;
}

#portraitMask.hide {
    display: none;
}

.rotate-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.portrait-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.portrait-subtitle {
    font-size: 14px;
    color: #c9a55a;
    margin-bottom: 30px;
}

.portrait-btn {
    padding: 10px 28px;
    border: 2px solid #c9a55a;
    border-radius: 22px;
    font-size: 14px;
    color: #ffd700;
    background: rgba(201, 165, 90, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.portrait-btn:active {
    background: rgba(201, 165, 90, 0.3);
}

/* ============================================
   淡入动画
   ============================================ */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   滚动条美化
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 165, 90, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 165, 90, 0.6);
}

/* 结局页和图鉴页内滚动条 */
.ending-screen::-webkit-scrollbar,
.gallery-grid::-webkit-scrollbar,
.story-content::-webkit-scrollbar {
    width: 4px;
}

.ending-screen::-webkit-scrollbar-thumb,
.gallery-grid::-webkit-scrollbar-thumb,
.story-content::-webkit-scrollbar-thumb {
    background: rgba(139, 105, 20, 0.3);
}
