/* ==========================================================================
   现代都市日常 · 极简拟态美学 UI组件库 (Built for Text RPG)
   ========================================================================== */

/* --------------------------------------------------------------------------
   [1] 核心滚动条美化 (纤细胶囊状，隐匿于背景)
   -------------------------------------------------------------------------- */
.game-ui-scope ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: transparent;
}

.game-ui-scope ::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 12px;
}

.game-ui-scope ::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.game-ui-scope ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------------------
   [2] 字体与排版基底设置 (护眼、柔和、现代)
   -------------------------------------------------------------------------- */
.game-ui-scope {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    color: #333333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   [3] 交互面板：手账本/现代消息折叠面板 (<details> & <summary>)
   -------------------------------------------------------------------------- */
.game-ui-scope details {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

/* 细节质感补充：顶部微光反射 */
.game-ui-scope details::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.9), rgba(255,255,255,0.2));
    z-index: 1;
    pointer-events: none;
}

.game-ui-scope details[open] {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
}

.game-ui-scope summary {
    list-style: none;
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: #333333;
    position: relative;
    user-select: none;
    transition: color 0.3s ease;
}

.game-ui-scope summary::-webkit-details-marker {
    display: none;
}

/* 自定义展开图标：纯CSS绘制平滑十字加号 */
.game-ui-scope summary::before,
.game-ui-scope summary::after {
    content: '';
    position: absolute;
    top: 50%;
    background-color: #8baaa3; /* 薄荷灰 */
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* 带有轻微回弹的阻尼动画 */
}

/* 横线 */
.game-ui-scope summary::before {
    right: 24px;
    width: 14px;
    height: 2px;
    margin-top: -1px;
}

/* 竖线 */
.game-ui-scope summary::after {
    right: 30px;
    width: 2px;
    height: 14px;
    margin-top: -7px;
}

/* 展开状态：加号变平滑减号 */
.game-ui-scope details[open] summary {
    color: #ffb6c1; /* 初恋粉点缀标题 */
}

.game-ui-scope details[open] summary::after {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

.game-ui-scope details[open] summary::before {
    background-color: #ffb6c1; /* 初恋粉 */
    transform: rotate(180deg);
}

/* 展开内容区的滑顺淡入动画 */
.game-ui-scope .details-content {
    padding: 0 24px 20px 24px;
    color: #555555;
    line-height: 1.7;
    animation: detailsFadeIn 0.4s ease-out forwards;
}

@keyframes detailsFadeIn {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   [4] 核心互动载体：现代气泡消息 (.msg-bubble)
   -------------------------------------------------------------------------- */
.game-ui-scope .msg-bubble {
    display: inline-block;
    position: relative;
    padding: 14px 22px;
    border-radius: 16px;
    max-width: 78%;
    font-size: 15px;
    color: #333333;
    line-height: 1.65;
    word-wrap: break-word;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    clear: both;
}

/* 接收方消息 (珍珠灰基底 + 浅卡其微边框) */
.game-ui-scope .msg-bubble.is-received {
    background-color: #f5f7fa; /* 珍珠灰 */
    border: 1px solid rgba(234, 221, 207, 0.4); /* 浅卡其 */
    border-bottom-left-radius: 4px;
    float: left;
}

/* 发送方消息 (清爽气泡蓝基底 + 云白文字) */
.game-ui-scope .msg-bubble.is-sent {
    background-color: #007aff; /* 气泡蓝 */
    color: #ffffff;
    border-bottom-right-radius: 4px;
    float: right;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.15); /* 蓝色发光弥散阴影 */
}

/* 互动微动画：点击反馈 */
.game-ui-scope .msg-bubble:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* 清理浮动 */
.game-ui-scope .msg-clearfix::after {
    content: "";
    display: table;
    clear: both;
}