/* style.css */
:root {
    --primary-bg-color: #ffffff; 
    --phone-case-color: #282c34; 
    --phone-screen-bg-default: #E6FFE6; 
    --header-footer-bg: rgba(240, 255, 240, 0.85); 
    --modal-bg-color: #fdfdfd;
    
    --accent-color-green-light: #fff8da;
    --accent-color-green-medium: #e3b604;
    --accent-color-green-dark: #4CAF50;   
	
    --accent-color-pink-soft: #FFECF5;
    --accent-color-pink-medium: #FFB6C1;
    --accent-color-cyan-medium: #ddddff; 
    
    --text-color-dark: #333D33;     
    --text-color-light: #FFFFFF;     
    --text-color-header-button: #e3b604; 

    --border-color: #B4EEB4;
    --disabled-color: #c0c0c0;
    --shadow-color-light: rgba(0, 0, 0, 0.08);
    --shadow-color-strong: rgba(0, 0, 0, 0.15);

    --subtitle-bg-color: rgba(50, 50, 50, 0.75);
    --character-bg-color: #999999; 

    /* 按鈕特定顏色 */
    --record-button-bg: var(--accent-color-green-dark);
    --record-button-recording-bg: #81c784; 
    --record-button-hover-bg: #388E3C;
    --call-button-bg: #F44336;   
    --call-button-hover-bg: #D32F2F;

    /* 字型 */
    --font-family-sans-serif: 'Open Sans', 'Noto Sans TC', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
}

/* --- Global Reset & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%; 
    overflow: hidden;
}

body {
    font-family: var(--font-family-sans-serif);
    background-color: var(--character-bg-color);
    color: var(--text-color-dark);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; 
}

/* --- Phone Container & Screen --- */
.phone-container {
    width: 100%;
    max-width: 400px;
    height: 100%;
    max-height: 800px; 
    background-color: var(--phone-case-color);
    border-radius: 36px; 
    box-shadow: 0 12px 40px rgba(0,0,0,0.25), 0 0 0 10px #1c1f25; /* 更精緻的陰影 */
    padding: 12px; 
    display: flex; 
}

.phone-screen {
    flex-grow: 1;
    background-color: var(--phone-screen-bg-default);
    border-radius: 24px;
    display: flex;
    flex-direction: column; 
    overflow: hidden;
    position: relative; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.background-media { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    z-index: 1;
}

#background-placeholder-img {
    /* 初始可見，影片載入後 JS 會隱藏它 */
}

#background-video {
    display: none;
}

.app-content-overlay { 
    position: relative;
    z-index: 2; 
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: transparent; 
}

.phone-screen.dark-mode-bg { 
    background-image: none !important; 
    background-color: #121212; 
}
.phone-screen.dark-mode-bg .app-header,
.phone-screen.dark-mode-bg .app-footer {
    background-color: rgba(30, 30, 30, 0.20);
    border-color: #444;
}
.phone-screen.dark-mode-bg .header-button,
.phone-screen.dark-mode-bg .language-switcher select {
    color: #ccc;
    border-color: #555;
}
.phone-screen.dark-mode-bg .header-button:hover {
    background-color: #555;
    color: #fff;
}
.phone-screen.dark-mode-bg #subtitle-text {
    background-color: rgba(20, 20, 20, 0.8);
    color: #f0f0f0;
}


/* --- App Header --- */
.app-header {
    background-color: rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0px solid var(--border-color);
    flex-shrink: 0;
}

.logo-container img#app-logo {
    width: 48px; 
    height: 48px;
    vertical-align: middle;
    transition: transform 0.2s ease-in-out; /* Added transition for smooth scaling */
}

.logo-container img#app-logo:hover {
    transform: scale(1.15); /* Scale up on hover */
}

.logo-container {
    position: relative; /* Added for positioning the bubble tip */
}

.app-logo-bubble {
    position: absolute;
    top: -5px; 
    right: -15px;
    background-color: rgba(255,255,255,0.0);
    color: var(--accent-color-pink-medium);
    border: 0px solid var(--accent-color-pink-medium);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 0px 0px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, background-color 0.2s ease;
}

.app-logo-bubble:hover {
    transform: scale(1.1);
    background-color: var(--accent-color-pink-medium);
    color: var(--text-color-light);
}

.header-controls-right {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.header-controls-right .action-button.deity-settings-button {
    width: auto; 
    height: auto; 
    padding: 5px 5px; 
    font-size: 1.2em; 
    background-color: transparent; 
    color: var(--text-color-header-button); 
    border: 1px solid transparent; 
    box-shadow: none; 
}

.header-controls-right .action-button.deity-settings-button:hover:not(:disabled) {
    background-color: var(--accent-color-green-light);
    border-color: var(--accent-color-green-medium);
    color: #e3b604;
    transform: none; /* 移除 action-button 的 hover 縮放 */
}

.header-button {
    background-color: transparent;
    color: var(--text-color-header-button);
    border: 1px solid transparent; 
    padding: 6px 10px;
    border-radius: 16px; 
    cursor: pointer;
    font-family: var(--font-family-sans-serif);
    font-size: 0.8em; 
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.header-button:hover {
    background-color: var(--accent-color-green-light);
    border-color: var(--accent-color-green-medium);
    color: #e3b604;
}

.language-switcher select {
    padding: 6px 8px;
    border-radius: 16px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.65);
    color: var(--text-color-header-button);
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    font-size: 0.8em;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.language-switcher select:hover,
.local-speech-switcher select:hover {
    border-color: var(--accent-color-green-medium);
    background-color: var(--accent-color-green-light);
}

.local-speech-switcher select {
    padding: 6px 8px;
    border-radius: 16px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.65);
    color: var(--text-color-header-button);
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    font-size: 0.8em;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* --- Chat Area (Main Content) --- */
.chat-area {
    flex-grow: 1;
    padding: 10px; 
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    position: relative;
}

#subtitle-display-area {
    position: absolute;     
    bottom: 45px;
    left: 10px;             
    right: 10px;            
    width: calc(100% - 20px); 
    max-height: 25%;
    display: flex;          
    justify-content: center;
    align-items: center;
    padding: 0;             
    overflow: hidden;       
    pointer-events: none;   
    box-sizing: border-box;
    z-index: 998;
}

#subtitle-text {
    background-color: var(--subtitle-bg-color);
    color: var(--text-color-light);
    padding: 8px 15px;
    border-radius: 16px; 
    font-size: 1em; 
    line-height: 1.3;
    text-align: center;
    max-width: 100%;
    max-height: 100%; 
    overflow-wrap: break-word;
    word-break: break-word;  
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    overflow: hidden; 
    display: inline-block; 
}

#subtitle-text.visible {
    opacity: 1;
    display: inline-block !important;
}

.subtitle-text-style {
    margin: 0;
    padding: 0;
    display: inline-block;
}

/* --- App Footer --- */
.app-footer {
    display: flex; /* Ensure footer items are in a row */
    justify-content: space-around; /* Distribute space around items */
    align-items: center; /* Align items vertically */
    background-color: var(--header-footer-bg);
    backdrop-filter: blur(8px);
    padding: 10px 15px; 
	gap: 10px;
    display: flex;
	border: none;
    justify-content: space-around; 
    align-items: center;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
	transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.action-button {
    width: 56px; 
    height: 56px;
    border-radius: 50%;
    border: none;
    color: var(--text-color-light);
    font-size: 26px; 
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 3px 6px var(--shadow-color-strong);
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.action-button:hover:not(:disabled) {
    transform: scale(1.08);
}
.action-button:active:not(:disabled) {
    transform: scale(0.96);
}
.action-button:disabled {
    background-color: var(--disabled-color) !important;
    color: #888 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: scale(1);
}

.record-button {
    background-color: var(--record-button-bg);
}
.record-button.recording { 
    background-color: var(--record-button-recording-bg);
    box-shadow: 0 0 10px var(--record-button-recording-bg); 
}
.record-button:hover:not(:disabled):not(.recording) {
    background-color: var(--record-button-hover-bg);
}

.call-button {
    background-color: var(--call-button-bg);
}
.call-button:hover:not(:disabled) {
    background-color: var(--call-button-hover-bg);
}

.action-button.history-button {
    width: 40px;  
    height: 40px;
    font-size: 20px; 
    background-color: var(--accent-color-pink-medium); 
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.action-button.god-card-button {
    width: 40px;  
    height: 40px;
    font-size: 20px; 
    background-color: var(--accent-color-cyan-medium); 
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.action-button.deity-settings-button{
    width: 30px;  
    height: 30px;
    font-size: 20px; 
    background-color: var(--accent-color-pink-medium); 
	box-shadow: 0 1px 3px rgba(0,0,0,0.0);
}

.action-button.deity-settings-button {
    background-color: rgba(255,255,255,0.0);
    color: var(--text-color-dark); 
    border: 0px solid var(--border-color); 
}

.action-button.deity-settings-button:hover:not(:disabled) {
    background-color: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.0);
}

.action-button.history-button {
    background-color: var(--accent-color-pink-medium); 
}

.action-button.history-button:hover:not(:disabled) {
    background-color: #FF80AB; 
}

.action-button.change-character-button {
    width: 40px;
    height: 40px;
    font-size: 20px; 
    background-color: var(--accent-color-cyan-medium); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.15); 
}

.action-button.change-character-button:hover:not(:disabled) {
    background-color: #AEEEEE; 
}

.modal-content.chat-history-content {
    height: 75vh; 
    max-height: 600px;
    display: flex;
    flex-direction: column; 
}

.modal-content.chat-history-content #chat-history-modal-title {
    font-size: 1.2em; 
    color: var(--accent-color-green-dark);
    margin-bottom: 15px;
    flex-shrink: 0; 
}

.chat-log-area {
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 10px;
    background-color: var(--primary-bg-color); 
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column-reverse; 
}

.chat-log-area {
    flex-direction: column; 
    gap: 12px; 
}

.chat-message {
    display: flex;
    margin-bottom: 8px;
    max-width: 90%; 
}

.chat-message .message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 0.9em; 
    box-shadow: 0 1px 2px var(--shadow-color-light);
}

.chat-message .message-text {
    word-break: break-word; 
    white-space: pre-wrap; 
}

.chat-message .message-timestamp {
    display: block;
    font-size: 0.7em;
    color: #777;
    margin-top: 4px;
    text-align: inherit; 
}

.user-message {
    justify-content: flex-end; 
    margin-left: auto; 
}
.user-message .message-bubble {
    background-color: var(--accent-color-green-light); 
    color: var(--text-color-dark);
    border-bottom-right-radius: 3px; 
}
.user-message .message-timestamp {
    text-align: right;
}

.deity-message {
    justify-content: flex-start; 
    margin-right: auto;
}
.deity-message .message-bubble {
    background-color: #f0f0f0;
    color: var(--text-color-dark);
    border-bottom-left-radius: 3px; 
}
.deity-message .message-timestamp {
    text-align: left;
}

.modal-content.chat-history-content ~ .modal-content .form-group { 
    margin-bottom: 15px;
}
.modal-content .form-group { 
    margin-bottom: 12px;
}

.timer-display {
    position: absolute;
    bottom: 80px; 
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.select-character-modal-content {
    max-width: 500px;
    width: 90%;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.select-character-modal-content h2 {
    font-size: 1.3em;
    color: var(--accent-color-green-dark);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.select-character-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
}

.character-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 240px;
}

.character-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color-green-medium);
    background-color: var(--accent-color-green-light);
}

.character-option.selected {
    border-color: var(--accent-color-green-dark);
    background-color: var(--accent-color-green-light);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.character-option img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
}

.character-option:hover img {
    transform: scale(1.05);
    border-color: var(--accent-color-green-medium);
}

.character-option.selected img {
    border-color: var(--accent-color-green-dark);
}

.character-option .character-name {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-color-dark);
    text-align: center;
    margin-top: 12px;
    transition: color 0.3s ease;
    width: 100%;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.character-option:hover .character-name {
    color: var(--accent-color-green-dark);
}

/* 行動裝置適配 */
@media (max-width: 480px) {
    body {
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    .phone-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: none;
        margin: 0;
    }

    .phone-screen {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        width: 100%;
        height: 100%;
    }

    .app-content-overlay {
        width: 100%;
        height: 100%;
    }

    .select-character-modal-content {
        padding: 16px;
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .select-character-list-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
        padding: 5px;
    }

    .character-option {
        padding: 12px 8px;
        min-height: 180px;
    }

    .character-option img {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }

    .character-option .character-name {
        font-size: 0.85em;
        margin-top: 8px;
    }
}

/* 平板裝置適配 */
@media (min-width: 481px) and (max-width: 768px) {
    .select-character-list-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 18px;
    }

    .character-option {
        min-height: 150px;
    }

    .character-option img {
        width: 70px;
        height: 70px;
    }
}

.loading-overlay {
    position: absolute; 
    bottom: 0;      
    left: 0;
    right: 0;
    height: auto;   
    min-height: 36px; 
    
    background-color: rgba(255, 255, 255, 0.5); 
    backdrop-filter: blur(4px); 
    
    display: flex;
    flex-direction: row; 
    justify-content: center;
    align-items: center;
    padding: 8px 12px; 
    z-index: 1000; 
    border-top: 1px solid rgba(0,0,0,0.05); 
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05); 
    box-sizing: border-box; 
}

.phone-screen.dark-mode-bg .loading-overlay {
    background-color: rgba(255, 255, 255, 0.5); 
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1); 
    width: 20px;
    height: 20px;
    border-left-color: var(--accent-color-green-medium);
    animation: spin 1s ease infinite;
    margin-bottom: 0; 
    margin-right: 8px; 
}

#loading-text {
    font-weight: 500;
    color: var(--text-color-dark);
    font-size: 0.85em; 
}
.phone-screen.dark-mode-bg .loading-overlay #loading-text {
    color: #333; 
}


@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.status-message { 
    margin-top: 15px; padding: 10px 15px; border-radius: 6px;
    text-align: center; font-weight: 500; font-size: 0.95em;
}
.status-message.error { 
    background-color: #FFEBEE; color: #C62828; border: 1px solid #C62828;
}
.status-message.success { 
    background-color: var(--secondary-bg-color); color: #e3b604;
    border: 1px solid #e3b604;
}

/* --- App Info Modal --- */
.app-info-modal-content {
    text-align: left; /* Changed from center to left for better readability */
    padding: 20px;
}

.app-info-modal-content h2 {
    margin-bottom: 20px; /* Increased margin */
    color: var(--accent-color-green-dark);
    text-align: center; /* Keep title centered */
}

#app-info-details {
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.6;
}

#app-info-details p {
    margin-bottom: 10px;
}

#app-info-details strong {
    color: var(--text-color-dark); /* Ensure strong tags are easily readable */
}

#app-info-details ul {
    list-style-type: disc; /* Use disc for bullet points */
    margin-left: 20px; /* Indent list */
    margin-bottom: 15px;
}

#app-info-details ul li {
    margin-bottom: 8px;
}

.app-info-modal-content .copyright-notice {
    font-size: 0.8em;
    color: #777;
    margin-top: 25px; /* Increased margin */
    margin-bottom: 20px; /* Increased margin */
    text-align: center;
}

.app-info-modal-content #donate-button-link {
    display: block; /* Make the link a block to center the button */
    text-align: center; /* Center the button */
}

.app-info-modal-content .donate-button {
    background-color: var(--accent-color-green-medium);
    color: white;
    padding: 12px 25px; /* Slightly larger padding */
    border: none;
    border-radius: 8px; /* More rounded corners */
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block; /* Ensure button behaves as expected */
}

.app-info-modal-content .donate-button:hover {
    background-color: var(--accent-color-green-dark);
    transform: translateY(-2px); /* Add a subtle lift effect on hover */
}

/* --- Modal (General) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.65);
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal.modal-open {
    display: flex;
}

.modal-content {
    background-color: var(--modal-bg-color);
    margin: 5% auto;
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    animation: fadeInModal 0.3s ease-out;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

/* 關閉按鈕樣式 */
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1;
}

.modal-close-btn:hover {
    color: #333;
}

/* 用戶資料模態框樣式 */
.user-profile-modal-content {
    max-width: 500px;
    width: 90%;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.user-profile-modal-content h2 {
    font-size: 1.3em;
    color: var(--accent-color-green-dark);
    margin-bottom: 15px;
    text-align: center;
}

/* 角色卡片模態框樣式 */
.character-card-modal-content {
    max-width: 500px;
    width: 90%;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.character-card-modal-content h2 {
    font-size: 1.3em;
    color: var(--accent-color-green-dark);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color-dark);
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background-color: var(--accent-color-green-light);
}

.range-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color-green-dark);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

#save-character-card-btn {
    background-color: var(--accent-color-green-dark);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    width: 100%;
}

#save-character-card-btn:hover {
    background-color: var(--accent-color-green-medium);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 動畫效果 */
@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-profile {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    z-index: 1000;
}

.user-profile .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile .user-details {
    font-size: 0.9rem;
}

.user-profile .user-level {
    color: #ffd700;
    font-weight: bold;
}

.user-profile .heart-points {
    color: #ff69b4;
    font-weight: bold;
}

.user-profile .logout-btn {
    margin-top: 10px;
    padding: 0.5rem;
    text-align: center;
    background-color: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff4444;
    color: #ff4444;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.user-profile .logout-btn:hover {
    background-color: rgba(255, 0, 0, 0.3);
}

.character-sidebar {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: rgba(180, 180, 180, 0.5);
    backdrop-filter: blur(10px);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.character-sidebar.active {
    right: 0;
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.character-option {
    padding: 12px;
    margin: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.character-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.character-option.selected {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.character-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.character-option-content img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.character-option:hover .character-option-content img {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.character-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.character-religion {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .character-sidebar {
        position: absolute;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        background: rgba(180, 180, 180, 0.5);
    }

    .character-sidebar.active {
        right: 0;
        background: rgba(180, 180, 180, 0.5);
    }

    .character-list {
        padding: 10px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .character-option {
        padding: 12px;
        margin: 8px 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .character-option-content {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .character-option-content img {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        object-fit: cover;
    }

    .character-info {
        flex: 1;
    }

    .character-name {
        font-size: 1.1em;
        font-weight: 600;
        color: var(--text-color-dark);
    }

    .character-religion {
        font-size: 0.9em;
        color: rgba(0, 0, 0, 0.7);
    }
}

@media (max-width: 480px) {
    .character-sidebar {
        background: rgba(180, 180, 180, 0.5);
    }

    .character-option {
        padding: 10px;
        margin: 6px 0;
    }

    .character-option-content img {
        width: 40px;
        height: 40px;
    }

    .character-name {
        font-size: 1em;
    }

    .character-religion {
        font-size: 0.8em;
    }
}

.user-profile-button-container {
    position: absolute;
    right: 20px;
    top: 80px;
    z-index: 999;
}

.user-profile-button-container .action-button {
    width: 40px;
    height: 40px;
    font-size: 20px;
    background-color: var(--phone-screen-bg-default);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* 用戶資料模態框具體樣式 */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.logout-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #f5f5f5;
    color: #ff4444;
    transform: rotate(180deg);
}

.profile-content {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-image {
    flex: 0 0 120px;
}

.profile-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-info p {
    margin: 0;
    font-size: 1rem;
    color: #666;
    display: flex;
    align-items: center;
}

.profile-info strong {
    color: #333;
    margin-right: 12px;
    font-weight: 600;
    min-width: 100px;
}

.recharge-history {
    margin-top: 24px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
}

.recharge-history h4 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.recharge-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.recharge-table th,
.recharge-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.recharge-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.recharge-table tr:hover {
    background: #f9f9f9;
}

#no-recharge-history {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .profile-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-image {
        margin-bottom: 16px;
    }



    .recharge-table {
        font-size: 0.9rem;
    }

    .recharge-table th,
    .recharge-table td {
        padding: 8px;
    }
}

/* 登入按鈕樣式 */
.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 0 20px;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.google-login-button {
    background-color: #fff;
    color: #757575;
    border: 1px solid #ddd;
}

.google-login-button:hover {
    background-color: #f8f8f8;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.x-login-button {
    background-color: #000;
    color: #fff;
}

.x-login-button:hover {
    background-color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.login-button img {
    width: 24px;
    height: 24px;
}

/* 行動裝置適配 */
@media (max-width: 480px) {
    .phone-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: none;
        margin: 0;
    }

    .phone-screen {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }

    .login-buttons {
        padding: 0 15px;
    }

    .login-button {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .login-button img {
        width: 20px;
        height: 20px;
    }
}

/* 行動裝置適配 */
@media (max-width: 480px) {
    .character-card-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 16px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        width: 100%;
        padding: 10px;
    }

    #save-character-card-btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }
}

.user-profile-modal-content .logout-btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 20px auto 0;
    padding: 10px 20px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: center;
}

.user-profile-modal-content .logout-btn:hover {
    background-color: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}