/* 3-screens.css @🍮 */

/* --- Home Screen --- */
#home-screen {
    justify-content: space-between;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
    padding: 50px 0;
}
.time-widget {
    text-align: center;
    padding: 0 20px;
    color: var(--text-color);
}
.time-widget .time {
    font-size: 72px;
    font-weight: 600;
}
.time-widget .date {
    font-size: 18px;
    color: #666;
}
.app-grid {
    width: 100%;
    padding: 20px 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-content: center;
    align-content: center;
    margin-top: 40px;
}
.dock {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    margin: 0 20px;
    min-height: 80px;
    gap: 15px;
}
.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
}
.icon-img {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    object-fit: cover;
}
.app-icon:hover .icon-img {
    transform: translateY(-5px);
}
.app-icon .app-name {
    font-size: 12px;
    color: var(--text-color);
    font-weight: 500;
}
#home-screen.day-mode .time-widget,
#home-screen.day-mode .time-widget .date,
#home-screen.day-mode .app-icon .app-name {
    color: var(--white-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* --- Chat List & World Book Screens --- */
#chat-list-screen .content, #world-book-screen .content {
    padding: 10px 0 0 0;
}
.chat-item.pinned {
    background-color: var(--top-pinned-bg);
}

/* --- Chat Room Screen --- */
#chat-room-screen {
    background-size: cover;
    background-position: center;
}
#chat-room-screen .content {
    display: flex;
    flex-direction: column;
    padding: 10px;
    padding-bottom: 10px;
    transition: padding-bottom 0.3s ease;
}
#chat-room-screen.multi-select-active .content {
    padding-bottom: 70px;
}
.message-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 10px;
    scroll-behavior: smooth;
}
.load-more-btn {
    background-color: #e0e0e0;
    color: #757575;
    border: none;
    padding: 8px 16px;
    margin: 10px auto;
    border-radius: 15px;
    cursor: pointer;
    display: block;
    font-size: 13px;
    font-weight: 500;
}
.load-more-btn:hover {
    background-color: #d1d1d1;
}
.typing-indicator {
    text-align: center;
    color: #aaa;
    font-style: italic;
    font-size: 14px;
    padding: 10px 0;
    display: none;
}
.chat-input-wrapper {
    flex-shrink: 0;
}
.message-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    gap: 10px;
    border-bottom-left-radius: var(--phone-corner-radius);
    border-bottom-right-radius: var(--phone-corner-radius);
    overflow: hidden;
}
.message-input-area input {
    flex-grow: 1;
    border: none;
    padding: 12px;
    border-radius: 18px;
    background-color: #f0f0f0;
}
.message-input-area input:focus {
    outline: none;
}
.message-input-area .icon-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.message-input-area .icon-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
.message-input-area .icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.message-input-area .icon-btn.send-btn {
    font-size: 18px;
}
#multi-select-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    z-index: 20;
    border-bottom-left-radius: var(--phone-corner-radius);
    border-bottom-right-radius: var(--phone-corner-radius);
    animation: slideUp 0.3s ease-out;
}
#multi-select-bar.visible {
    display: flex;
}

/* --- Message Bubbles --- */
.message-wrapper {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
    transition: background-color 0.2s;
    flex-direction: column;
}
.message-wrapper.group-message { margin-bottom: 18px; }
.message-wrapper.sent { align-items: flex-end; }
.message-wrapper.received { align-items: flex-start; }
.message-wrapper.system-notification { align-items: center; }
.message-wrapper.multi-select-selected {
    background-color: rgba(144, 202, 249, 0.2);
    border-radius: var(--border-radius);
}
.message-bubble-row {
    display: flex;
    width: 100%;
    align-items: flex-start;
}
.message-wrapper.sent .message-bubble-row { flex-direction: row-reverse; }
.message-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.group-nickname {
    position: absolute;
    top: -15px;
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    width: 70px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.message-time {
    font-size: 9px;
    color: #aaa;
    margin-top: 3px;
}
.message-bubble {
    max-width: 260px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    word-wrap: break-word;
    line-height: 1.4;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin: 0 8px;
    cursor: pointer;
    font-size: 15px;
}
.message-bubble.sent { border-bottom-right-radius: 5px; }
.message-bubble.received { border-bottom-left-radius: 5px; }
.system-notification-bubble {
    background-color: rgba(200, 200, 200, 0.5);
    color: #666;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 10px;
    text-align: center;
}

/* --- Sticker / Image Bubble --- */
.image-bubble {
    max-width: 120px;
    border-radius: var(--border-radius);
    margin: 0 8px;
    padding: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}
.image-bubble img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: calc(var(--border-radius) - 4px);
}
.message-wrapper.sent .image-bubble { border-bottom-right-radius: 5px; }
.message-wrapper.received .image-bubble { border-bottom-left-radius: 5px; }

/* --- Voice Bubble --- */
.voice-bubble {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin: 0 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
    max-width: 200px;
}
.message-wrapper.sent .voice-bubble {
    border-bottom-right-radius: 5px;
    flex-direction: row-reverse;
}
.message-wrapper.received .voice-bubble { border-bottom-left-radius: 5px; }
.voice-bubble .play-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.voice-bubble .duration {
    font-size: 13px;
    margin: 0 8px;
    white-space: nowrap;
}
.message-wrapper.sent .play-icon { transform: scaleX(-1); }
.voice-transcript {
    font-size: 14px;
    color: #555;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    margin-top: 5px;
    margin-left: 54px;
    margin-right: 54px;
    border-radius: 10px;
    line-height: 1.6;
    max-width: calc(100% - 108px);
    display: none;
    animation: fadeIn 0.3s ease;
}
.voice-transcript.active { display: block; }
.message-wrapper.sent .voice-transcript { align-self: flex-end; margin-right: 54px; margin-left: auto; }
.message-wrapper.received .voice-transcript { align-self: flex-start; margin-left: 54px; margin-right: auto; }

/* --- PV Card --- */
.pv-card {
    width: 230px;
    aspect-ratio: 1 / 1;
    background-color: #f0f0f0;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    margin: 0 8px;
}
.message-wrapper.sent .pv-card { border-bottom-right-radius: 5px; }
.message-wrapper.received .pv-card { border-bottom-left-radius: 5px; }
.pv-card-image-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 0.5s ease-in-out;
    z-index: 2;
}
.pv-card-image-overlay.hidden { opacity: 0; pointer-events: none; }
.pv-card-content {
    padding: 15px; height: 100%; overflow-y: auto; color: var(--text-color);
    line-height: 1.6; font-size: 15px; background-color: white; position: relative; z-index: 1;
}
.pv-card-footer {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: white; padding: 20px 10px 8px; font-size: 12px;
    display: flex; align-items: center; gap: 5px;
    position: absolute; bottom: 0; left: 0; width: 100%;
    z-index: 3; pointer-events: none; transition: opacity 0.5s ease-in-out;
}
.pv-card-footer.hidden { opacity: 0; }
.pv-card-footer svg { width: 14px; height: 14px; fill: white; flex-shrink: 0; }

/* --- Transfer Card --- */
.transfer-card {
    width: 240px; height: auto; border-radius: var(--border-radius);
    margin: 0 8px; overflow: hidden; position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); color: white;
}
.message-wrapper.sent .transfer-card { border-bottom-right-radius: 5px; }
.message-wrapper.received .transfer-card { border-bottom-left-radius: 5px; cursor: pointer; }
.transfer-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover; background-position: center;
    filter: blur(4px); transform: scale(1.1); z-index: 1;
}
.transfer-card.sent-transfer::before { background-image: url('https://i.postimg.cc/sxN893WF/IMG-20250712.png'); }
.transfer-card.received-transfer::before { background-image: url('https://i.postimg.cc/FzR8LY7g/IMG-20250712-170703.png'); }
.transfer-card .overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.3); z-index: 2; transition: background-color 0.5s ease;
}
.transfer-card.received .overlay { background-color: rgba(255, 182, 193, 0.4); }
.transfer-card.returned .overlay { background-color: rgba(100, 100, 100, 0.5); }
.transfer-content {
    position: relative; z-index: 3; padding: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.transfer-title { font-size: 14px; margin: 0 0 5px 0; opacity: 0.9; }
.transfer-amount { font-size: 28px; font-weight: bold; margin: 0; }
.transfer-remark {
    font-size: 14px; margin-top: 10px; opacity: 0.9; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.transfer-status {
    font-size: 12px; margin-top: 15px; padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3); opacity: 0.8;
}

/* --- Gift Card --- */
.gift-card {
    width: 230px; background-color: #fff; border: 2px solid #333;
    border-radius: var(--border-radius); box-shadow: 4px 4px 0px #ddd;
    padding: 10px; display: flex; align-items: center; cursor: pointer;
    margin: 0 8px; position: relative; overflow: hidden;
}
.message-wrapper.sent .gift-card { border-bottom-right-radius: 5px; }
.message-wrapper.received .gift-card { border-bottom-left-radius: 5px; }
.gift-card-icon { width: 50px; height: 50px; margin-right: 15px; flex-shrink: 0; }
.gift-card-text {
    font-size: 16px; font-weight: bold; color: #333;
    font-family: 'Comic Sans MS', 'Chalkduster', 'Handwriting', cursive;
}
.gift-card-description {
    font-size: 14px; color: #555; background-color: rgba(240, 240, 240, 0.9);
    padding: 8px 12px; margin-top: 5px; margin-left: 54px; margin-right: 54px;
    border-radius: 10px; line-height: 1.6; max-width: calc(100% - 108px);
    display: none; animation: fadeIn 0.3s ease;
}
.gift-card-description.active { display: block; }
.message-wrapper.sent .gift-card-description { align-self: flex-end; margin-right: 54px; margin-left: auto; }
.message-wrapper.received .gift-card-description { align-self: flex-start; margin-left: 54px; margin-right: auto; }
.gift-card-received-stamp {
    position: absolute; top: 5px; right: 5px; font-size: 14px;
    font-weight: bold; color: var(--primary-color); border: 2px solid var(--primary-color);
    border-radius: 8px; padding: 2px 6px; transform: rotate(15deg);
    opacity: 0; transition: opacity 0.3s ease;
    font-family: 'Comic Sans MS', 'Chalkduster', 'Handwriting', cursive;
}
.gift-card.received .gift-card-received-stamp { opacity: 1; }

/* --- Sticker Bar & Modal --- */
#sticker-bar {
    flex-shrink: 0; padding: 0 10px 5px; display: flex; align-items: center;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px);
}
.sticker-bar-btn { background: none; border: none; padding: 5px; cursor: pointer; }
.sticker-bar-btn svg { width: 28px; height: 28px; fill: #888; }
#sticker-modal {
    position: absolute; bottom: 0; left: 0; right: 0; height: 35%;
    max-height: 250px; background: #f7f7f7; border-top-left-radius: 20px;
    border-top-right-radius: 20px; box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    z-index: 25; display: none; flex-direction: column;
}
#sticker-modal.visible { display: flex; animation: slideUp 0.3s ease-out; }
#sticker-modal .header {
    padding: 10px 15px; font-weight: bold; color: var(--text-color);
    border-bottom: 1px solid #eee; display: flex;
    justify-content: space-between; align-items: center;
}
.sticker-grid {
    flex-grow: 1; overflow-y: auto; padding: 15px; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 15px;
}
.sticker-item {
    position: relative; display: flex; flex-direction: column;
    align-items: center; cursor: pointer;
}
.sticker-item img { width: 60px; height: 60px; object-fit: contain; }
.sticker-item span { font-size: 12px; color: #666; margin-top: 5px; text-align: center; }
#add-sticker-modal .modal-window { max-width: 360px; }
#sticker-preview {
    width: 100px; height: 100px; border: 2px dashed #ddd;
    border-radius: 10px; margin: 0 auto 15px; display: flex;
    align-items: center; justify-content: center; color: #aaa;
    background-color: #f9f9f9;
}
#sticker-preview img { max-width: 100%; max-height: 100%; }

/* --- Settings Sidebars --- */
.settings-sidebar {
    /* @🍮 彻底禁止右滑空白 */
    position: absolute; top: 0; right: 0; width: 80%; height: 100%;
    background: #fff; box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 101; display: none; flex-direction: column;
}
.settings-sidebar.open { display: flex; animation: slideInRight 0.3s ease-out; }
.settings-sidebar .header {
    padding: 15px; border-bottom: 1px solid #eee; font-weight: bold;
    text-align: center; color: var(--primary-color);
}
.settings-sidebar .content { padding: 20px; overflow-y: auto; flex-grow: 1; }
.settings-sidebar .form-group textarea { height: 100px; resize: vertical; }
.settings-sidebar .avatar-setting {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px;
}
.settings-sidebar .avatar-preview {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--primary-color); cursor: pointer;
}
#group-settings-sidebar .group-avatar-setting {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px;
}
#group-settings-sidebar .group-avatar-preview {
    width: 60px; height: 60px; border-radius: 10px; object-fit: cover;
    border: 2px solid var(--primary-color); cursor: pointer;
}
#group-settings-sidebar .group-members-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 15px; margin-top: 10px;
}
#group-settings-sidebar .group-member, #group-settings-sidebar .add-member-btn {
    display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
#group-settings-sidebar .group-member img {
    width: 50px; height: 50px; border-radius: 50%; object-fit: cover;
    margin-bottom: 5px; border: 2px solid #eee;
}
#group-settings-sidebar .add-member-btn .add-icon {
    width: 50px; height: 50px; border-radius: 50%; border: 2px dashed #ccc;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    color: #ccc; margin-bottom: 5px; transition: all 0.2s ease;
}
#group-settings-sidebar .add-member-btn:hover .add-icon {
    color: var(--primary-color); border-color: var(--primary-color);
}
#group-settings-sidebar .group-member span, #group-settings-sidebar .add-member-btn span {
    font-size: 12px; text-align: center; color: var(--text-color);
}

/* --- Wallpaper Screen --- */
.wallpaper-preview {
    width: 100%; aspect-ratio: 9 / 16; max-height: 400px;
    border-radius: var(--border-radius); margin-bottom: 25px;
    background-size: cover; background-position: center;
    border: 3px dashed var(--primary-color); display: flex; align-items: center;
    justify-content: center; color: var(--secondary-color); font-style: italic;
    background-color: #fff8fa;
}

/* --- Customize Screen --- */
#customize-screen .icon-custom-item {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px;
    padding-bottom: 15px; border-bottom: 1px solid #f0f0f0;
}
#customize-screen .icon-custom-item:last-child { border-bottom: none; }
#customize-screen .icon-preview {
    width: 50px; height: 50px; border-radius: 12px;
    object-fit: cover; flex-shrink: 0;
}
#customize-screen .icon-details { flex-grow: 1; }
#customize-screen .icon-details p { margin: 0 0 8px 0; font-weight: 600; }
#customize-screen .icon-details input { width: calc(100% - 70px); }
#customize-screen .reset-icon-btn {
    background: #e0e0e0; color: #555; border: none; border-radius: 8px;
    padding: 8px 10px; font-size: 12px; cursor: pointer; margin-left: 10px;
}

/* --- Tutorial Screen --- */
.tutorial-item {
    margin-bottom: 15px; border: 1px solid #fce4ec; border-radius: 12px;
    overflow: hidden; background-color: #fff8fa;
}
.tutorial-header {
    padding: 12px 18px; font-weight: 600; color: var(--secondary-color);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.tutorial-header::after {
    content: '▼'; font-size: 12px; transition: transform 0.3s ease;
}
.tutorial-item.open .tutorial-header::after { transform: rotate(180deg); }
.tutorial-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease;
    padding: 0 10px;
}
.tutorial-item.open .tutorial-content {
    padding: 10px 10px; max-height: 5000px;
}
.tutorial-content img {
    width: 100%; height: auto; border-radius: 8px; display: block;
}
