
/* ========== 精灵养成系统样式 白色/浅棕/黄色 明亮可爱版 ========== */

/* === 列表页整体包裹 === */
.spirit-list-page-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    background: #FFF9F0;
    overflow: hidden;
}

/* === 列表页顶部导航 === */
.spirit-list-nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 44px;
    padding-top: 0px;
    background: #FFFFFF;
    border-bottom: 1.5px solid #F0E0C8;
    box-shadow: 0 2px 8px rgba(180,150,100,0.08);
}

.sln-back {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #FFF5E6;
    color: #C8A060;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(200,160,96,0.12);
    border: 1.5px solid #F0DFC0;
    transition: all 0.2s;
}
.sln-back:active { transform: scale(0.92); }

.sln-title {
    font-size: 17px;
    font-weight: 800;
    color: #A07840;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
}
.sln-title-icon {
    font-size: 16px;
    animation: starSpin 3s ease-in-out infinite;
}
@keyframes starSpin {
    0%,100% { transform: rotate(-15deg) scale(1); }
    50% { transform: rotate(15deg) scale(1.2); }
}

.sln-add {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #FFD060;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,208,96,0.35);
    transition: all 0.2s;
}
.sln-add:active { transform: scale(0.92); box-shadow: 0 2px 6px rgba(255,208,96,0.25); }

/* === 列表滚动区 === */
.spirit-list-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px 30px;
}

/* === 列表页顶部英雄区 === */
.spirit-list-hero {
    padding: 24px 0 16px;
    text-align: center;
}
.slh-bubbles {
    font-size: 22px;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}
.slh-bubbles span {
    display: inline-block;
    animation: bubbleFloat 2.5s ease-in-out infinite;
}
.slh-bubbles span:nth-child(2) { animation-delay: 0.4s; }
.slh-bubbles span:nth-child(3) { animation-delay: 0.8s; }
.slh-bubbles span:nth-child(4) { animation-delay: 1.2s; }
.slh-bubbles span:nth-child(5) { animation-delay: 1.6s; }
@keyframes bubbleFloat {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.slh-title {
    font-size: 20px;
    font-weight: 800;
    color: #A07840;
    margin-bottom: 4px;
}
.slh-sub {
    font-size: 13px;
    color: #C8A878;
}

/* === 精灵卡片（列表） === */
.spirit-card {
    background: #FFFFFF;
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(180,150,100,0.1);
    border: 2px solid #F5E8D0;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    overflow: hidden;
}

.spirit-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #FFD060;
    border-radius: 22px 22px 0 0;
}

.spirit-card:active {
    transform: scale(0.975);
    box-shadow: 0 2px 8px rgba(180,150,100,0.12);
}

.spirit-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.spirit-card-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #FFF5E6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    box-shadow: 0 3px 10px rgba(200,160,96,0.15);
    border: 3px solid #FFFFFF;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.spirit-card-avatar img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.spirit-card-info { flex: 1; min-width: 0; }

.spirit-card-name {
    font-size: 17px;
    font-weight: 800;
    color: #8B6530;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spirit-card-meta {
    font-size: 12px;
    color: #C8A878;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spirit-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.spirit-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #A08050;
    background: #FFF8EE;
    border-radius: 10px;
    padding: 5px 8px;
}

.spirit-stat-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* === 空状态 === */
.spirit-empty-box {
    text-align: center;
    padding: 60px 20px 40px;
}
.spirit-empty-emoji {
    font-size: 72px;
    margin-bottom: 16px;
    animation: eggWiggle 2s ease-in-out infinite;
}
@keyframes eggWiggle {
    0%,100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}
.spirit-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #A07840;
    margin-bottom: 8px;
}
.spirit-empty-tip {
    font-size: 13px;
    color: #C8A878;
    margin-bottom: 20px;
    line-height: 1.6;
}
.spirit-empty-btn {
    padding: 12px 28px;
    background: #FFD060;
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255,208,96,0.4);
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.spirit-empty-btn:active { transform: scale(0.95); }

/* === 详情页整体包裹 === */
.spirit-detail-page-wrap {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #FFF9F0;
    z-index: 5;
}

/* === 详情页整页滚动容器 === */
.spirit-detail-full-scroll {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* === 详情页顶部导航栏 === */
.spirit-detail-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 44px;
    padding-top: 0px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1.5px solid #F0E0C8;
    box-shadow: 0 2px 8px rgba(180,150,100,0.08);
}

.sdt-back {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #FFF5E6;
    color: #C8A060;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(200,160,96,0.12);
    border: 1.5px solid #F0DFC0;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sdt-back:active { transform: scale(0.92); }

.sdt-title {
    font-size: 17px;
    font-weight: 800;
    color: #8B6530;
    flex: 1;
    text-align: center;
    letter-spacing: 0.5px;
}

.sdt-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.sdt-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    pointer-events: auto;
    position: relative;
    z-index: 11;
    -webkit-tap-highlight-color: transparent;
}
.sdt-btn:active { transform: scale(0.9); }

.sdt-btn-edit {
    background: #FFD060;
    color: #fff;
    box-shadow: 0 3px 10px rgba(255,208,96,0.3);
}

.sdt-btn-del {
    background: #F0A0A0;
    color: #fff;
    box-shadow: 0 3px 10px rgba(240,160,160,0.3);
}

.sdt-btn-expand {
    background: linear-gradient(135deg, #A78BFA, #7C3AED);
    color: #fff;
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(124,58,237,0.3);
}
.sdt-btn-expand:active {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
}

/* === 精灵展示舞台 === */
.spirit-stage {
    position: relative;
    text-align: center;
    padding: 30px 20px 24px;
    overflow: hidden;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
}

.spirit-stage-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #FFF9F0;
    pointer-events: none;
}

.spirit-stage-stars {
    position: absolute;
    top: 16px; left: 0; right: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
    font-size: 18px;
    pointer-events: none;
}
.spirit-stage-stars span {
    display: inline-block;
    animation: starFloat 2s ease-in-out infinite;
    opacity: 0.7;
}
.spirit-stage-stars span:nth-child(1) { animation-delay: 0s; }
.spirit-stage-stars span:nth-child(2) { animation-delay: 0.4s; }
.spirit-stage-stars span:nth-child(3) { animation-delay: 0.8s; }
.spirit-stage-stars span:nth-child(4) { animation-delay: 1.2s; }
.spirit-stage-stars span:nth-child(5) { animation-delay: 1.6s; }
@keyframes starFloat {
    0%,100% { transform: translateY(0) scale(1); opacity: 0.7; }
    50% { transform: translateY(-10px) scale(1.15); opacity: 1; }
}

/* 精灵形象容器 */
.spirit-display-container {
    position: relative;
    display: inline-block;
    z-index: 2;
}

/* 精灵光晕 */
.spirit-stage-halo {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 160px; height: 160px;
    background: rgba(255,220,130,0.2);
    border-radius: 50%;
    animation: haloPulse 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes haloPulse {
    0%,100% { transform: translate(-50%,-50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
}

/* 精灵GIF形象 */
.spirit-display-emoji {
    font-size: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: spiritFloat 3s ease-in-out infinite;
    cursor: pointer;
    transition: filter 0.3s;
}
.spirit-display-emoji img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}
.spirit-display-emoji:active {
    filter: brightness(1.1);
}

@keyframes spiritFloat {
    0%,100% { transform: translateY(0px) rotate(-3deg); }
    50% { transform: translateY(-18px) rotate(3deg); }
}

.spirit-stage-mood {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 700;
    color: #A07840;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 6px 18px;
    border: 1.5px solid #F0DFC0;
    box-shadow: 0 2px 8px rgba(200,160,96,0.1);
    display: inline-block;
    position: relative;
    z-index: 2;
}

/* === 精灵名片 === */
.spirit-id-card {
    margin: 0 14px 14px;
    background: #FFFFFF;
    border-radius: 22px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(180,150,100,0.1);
    border: 2px solid #F5E8D0;
    position: relative;
    overflow: hidden;
}
.spirit-id-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #FFD060;
    border-radius: 22px 22px 0 0;
}

.spirit-id-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.spirit-id-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: #FFF5E6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 3px 10px rgba(200,160,96,0.15);
    border: 3px solid #FFFFFF;
    flex-shrink: 0;
    overflow: hidden;
}

.spirit-id-avatar img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.spirit-id-info { flex: 1; min-width: 0; }

.spirit-id-name {
    font-size: 18px;
    font-weight: 800;
    color: #8B6530;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spirit-id-age {
    font-size: 12px;
    color: #B08850;
    margin-bottom: 4px;
}
.spirit-id-partner {
    font-size: 12px;
    color: #D4A050;
    display: flex;
    align-items: center;
    gap: 4px;
}
.spirit-id-partner i { font-size: 10px; color: #FFB060; }

.spirit-id-badge-wrap { flex-shrink: 0; }
.spirit-id-badge {
    background: #FFD060;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 3px 8px rgba(255,208,96,0.3);
    letter-spacing: 0.5px;
}

/* === 属性面板 === */
.spirit-stats-panel {
    margin: 0 14px 14px;
    background: #FFFFFF;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(180,150,100,0.08);
    border: 2px solid #F5E8D0;
}

.spirit-panel-title {
    font-size: 15px;
    font-weight: 800;
    color: #8B6530;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.spirit-panel-title-icon { font-size: 18px; }

/* 精灵属性条 */
.spirit-stat-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.spirit-stat-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #A08050;
    font-weight: 700;
}

.spirit-stat-bar-bg {
    height: 9px;
    background: #F5EDE0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.spirit-stat-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    overflow: hidden;
}

.spirit-stat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 各属性颜色 - 统一为白色/浅棕/黄色系，无渐变 */
.spirit-stat-bar-fill.spirit-stat-hunger { background: #FFB860; }
.spirit-stat-bar-fill.spirit-stat-mood   { background: #FFD060; }
.spirit-stat-bar-fill.spirit-stat-wisdom { background: #D4B080; }
.spirit-stat-bar-fill.spirit-stat-stamina{ background: #C8A870; }
.spirit-stat-bar-fill.spirit-stat-health { background: #F0C860; }

/* === 互动按钮面板 === */
.spirit-action-panel {
    margin: 0 14px 14px;
    background: #FFFFFF;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(180,150,100,0.08);
    border: 2px solid #F5E8D0;
}

.spirit-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.spirit-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 12px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    background: #FFF8EE;
    border: 2px solid #F5E8D0;
    position: relative;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    color: #8B6530;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.spirit-action-btn:active {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(200,160,96,0.15);
}

.sab-icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: transform 0.25s;
}
.spirit-action-btn:active .sab-icon { transform: scale(0.9) rotate(-10deg); }

/* 互动按钮图标背景 - 无渐变 */
.sab-feed    { background: #FFF0D0; }
.sab-study   { background: #F5E8D0; }
.sab-play    { background: #FFEACC; }
.sab-exercise{ background: #FFF5E0; }
.sab-class   { background: #FFE8C0; }
.sab-chat    { background: #FFF2D8; }

/* === 底部返回按钮 === */
.spirit-detail-footer {
    padding: 4px 14px 36px;
}
.spirit-back-btn {
    width: 100%;
    padding: 14px;
    background: #FFFFFF;
    border: 2px solid #F0DFC0;
    border-radius: 18px;
    color: #A07840;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(200,160,96,0.08);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.spirit-back-btn:active { transform: scale(0.97); }

/* === 创建精灵弹窗 === */
.spirit-create-modal {
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(180,150,100,0.2), 0 4px 12px rgba(0,0,0,0.06);
    border: 2px solid #F5E8D0;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.scm-header {
    background: #FFD060;
    padding: 24px 20px 20px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}
.scm-header-deco {
    font-size: 18px;
    letter-spacing: 4px;
    margin-bottom: 10px;
    opacity: 0.9;
}
.scm-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.scm-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.scm-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.scm-section { margin-bottom: 18px; }

.scm-label {
    font-size: 13px;
    font-weight: 700;
    color: #8B6530;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scm-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* 精灵类型选择器 */
.spirit-type-option {
    background: #FFF8EE;
    border: 2px solid #F0DFC0;
    border-radius: 16px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
    font-size: 11px;
    font-weight: 700;
    color: #8B6530;
    -webkit-tap-highlight-color: transparent;
}
.spirit-type-option:active { transform: scale(0.93); }

.spirit-type-option img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.spirit-type-option.selected {
    background: #FFD060;
    border-color: #FFB830;
    color: #fff;
    box-shadow: 0 4px 14px rgba(255,208,96,0.4);
    transform: scale(1.04);
}

.scm-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #F0DFC0;
    border-radius: 14px;
    font-size: 15px;
    color: #8B6530;
    background: #fff;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
.scm-input:focus {
    border-color: #FFD060;
    box-shadow: 0 0 0 3px rgba(255,208,96,0.15);
}

.scm-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #F0DFC0;
    border-radius: 14px;
    font-size: 15px;
    color: #8B6530;
    background: #fff;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
    box-sizing: border-box;
}
.scm-select:focus {
    border-color: #FFD060;
    box-shadow: 0 0 0 3px rgba(255,208,96,0.15);
}

.scm-footer {
    padding: 16px 20px 20px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: #FEFAF4;
    border-top: 1.5px solid #F0DFC0;
}

.scm-btn-cancel,
.scm-btn-confirm {
    flex: 1;
    padding: 13px 20px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    letter-spacing: 0.5px;
}

.scm-btn-cancel {
    background: #FFF5E6;
    color: #A08050;
    border: 2px solid #F0DFC0;
}
.scm-btn-cancel:active {
    transform: scale(0.96);
    background: #FFEED5;
}

.scm-btn-confirm {
    background: #FFD060;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,208,96,0.35);
}
.scm-btn-confirm:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(255,208,96,0.25);
}

/* === 精灵聊天弹窗 === */
.spirit-chat-modal {
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    max-width: 420px;
    width: 92%;
    max-height: 75vh;
    box-shadow: 0 16px 48px rgba(180,150,100,0.2), 0 4px 12px rgba(0,0,0,0.06);
    border: 2px solid #F5E8D0;
    display: flex;
    flex-direction: column;
}

.spirit-chat-modal-head {
    background: #FFD060;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.scmh-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.scmh-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.scmh-close:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.45);
}

.spirit-chat-history {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    background: #FFF9F0;
}

.spirit-chat-msg {
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    animation: msgSlideIn 0.3s ease-out;
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spirit-chat-msg.user {
    flex-direction: row-reverse;
}

.scm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFF5E6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(200,160,96,0.15);
}

.spirit-chat-msg.user .scm-avatar {
    background: #FFD060;
    color: #fff;
}

.scm-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.spirit-chat-msg.spirit .scm-bubble {
    background: #FFFFFF;
    color: #6B5030;
    border: 1.5px solid #F0DFC0;
    box-shadow: 0 2px 6px rgba(200,160,96,0.06);
}

.spirit-chat-msg.user .scm-bubble {
    background: #FFD060;
    color: #fff;
    box-shadow: 0 2px 6px rgba(255,208,96,0.25);
}

/* [NEW-重Roll] 重新生成按钮 */
.scm-reroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(200,160,96,0.12);
    color: #B89060;
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}
.scm-reroll-btn:hover,
.scm-reroll-btn:active {
    opacity: 1;
    background: rgba(200,160,96,0.25);
    transform: rotate(180deg);
}

.spirit-chat-input-bar {
    padding: 14px 16px;
    background: #fff;
    border-top: 1.5px solid #F0DFC0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
}

.spirit-chat-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 2px solid #F0DFC0;
    border-radius: 20px;
    font-size: 14px;
    color: #8B6530;
    background: #FEFAF4;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
.spirit-chat-input:focus {
    border-color: #FFD060;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,208,96,0.1);
}

.spirit-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFD060;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(255,208,96,0.35);
    transition: all 0.2s;
    flex-shrink: 0;
}
.spirit-chat-send:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(255,208,96,0.25);
}

/* === 精灵类型emoji图标（兼容旧样式名） === */
.spirit-type-emoji {
    font-size: 32px;
    display: block;
    margin-bottom: 2px;
}

/* === 精灵通知样式 === */
.spirit-event-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFFFFF;
    color: #8B6530;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(180,150,100,0.2);
    border: 2px solid #F5E8D0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: notifSlideIn 0.3s ease-out;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.spirit-event-notification img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
