.side-nav .nav-item {
    width: 100%;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #7f8ea3;
    border-radius: 18px;
    transition: color 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.side-nav .nav-item:hover {
    color: #007aff;
}

.side-nav .nav-item.active {
    color: #007aff;
    font-weight: 600;
}

.side-nav .nav-icon {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-nav .nav-icon svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.18s ease;
}

.side-nav .nav-icon .icon-solid {
    fill: currentColor;
    stroke: none;
    opacity: 0;
}

.side-nav .nav-item.active .nav-icon .icon-outline {
    opacity: 0;
}

.side-nav .nav-item.active .nav-icon .icon-solid {
    opacity: 1;
}

.side-nav .nav-label {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.2px;
}

/* 全局：隐藏所有页面的“返回”按钮（无侵入性，优先级高） */
.back-btn,
.back-button,
a[aria-label^="返回"],
button[aria-label^="返回"] {
    display: none !important;
}

/* Numeric badge for nav items (e.g. 通讯录 未处理的好友请求) */
.side-nav .nav-item .nav-badge {
    position: absolute;
    top: 120px;
    right: 20px;
    min-width: 11px;
    height: 18px;
    padding: 0 6px;
    background: #ff3b30; /* red */
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Smaller badge for bottom-nav (mobile) */
.bottom-nav .nav-item .nav-badge {
    position: absolute;
    top: 6px;
    right: 14px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    font-size: 11px;
    border-radius: 7px;
}
/* iframe美化：圆角、阴影、边框 */
.chat-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    background: #fff;
    margin: 8px 0;
}

/* 当 iframe 加载聊天页面时，去掉圆角并铺满 */
.chat-iframe.no-radius {
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

/* common.css - 全局共享样式 */

:root {
    --primary-color: #007AFF;
    --primary-color-light: #e5f2ff;
    --body-bg-color: #f0f2f5;
    --card-bg-color: #ffffff;
    --text-color: #1c1e21;
    --text-color-secondary: #65676b;
    --border-color: #e0e0e0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Scrollbar variables (Telegram-like defaults for light theme) */
    --scrollbar-thumb: rgba(0,0,0,0.22);
    --scrollbar-thumb-hover: rgba(0,0,0,0.34);
    --scrollbar-track: transparent;
    --scrollbar-size: 10px;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--body-bg-color);
    color: var(--text-color);
    font-size: 16px;
}

/* Global Telegram-like scrollbar styling (WebKit + Firefox) */
/* Thin, rounded, semi-transparent thumb that becomes darker on hover */
* {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); /* Firefox */
}

*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid transparent; /* creates padding space so thumb doesn't touch edges */
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Apply max-width to page content containers instead of #app */
.group-list-page, .chat-layout, .profile-page, .contacts-page, .auth-container {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    background-color: var(--card-bg-color); /* Give content a solid background */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.page-header {
    padding: 20px 15px;
    background-color: #b6c8d8;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    margin: 0;
    font-size: 1.8rem;
}

.page-subtitle {
    margin: 5px 0 0;
    color: var(--text-color-secondary);
}

.primary-btn, .secondary-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.primary-btn:active, .secondary-btn:active, .clickable:active {
    transform: scale(0.96);
}

.btn-full {
    width: 100%;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}
.primary-btn:hover {
    background-color: #0056b3;
}

.secondary-btn {
    background-color: #e9ecef;
    color: var(--text-color);
}
.secondary-btn:hover {
    background-color: #dcdfe2;
}

.danger {
    color: #dc3545;
}

.form-field {
    margin-bottom: 1rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    margin-top: 5px;
}

input[type="text"], input[type="tel"], input[type="password"], input[type="number"], textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    background-color: #f5f6f7;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--card-bg-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}


/* Spinner */
.spinner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.spinner-text {
    margin-top: 10px;
    color: var(--text-color-secondary);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    z-index: 200;
}

/* Desktop side navigation (hidden on small screens) */
.side-nav {
    display: none; /* shown on desktop via media query */
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 96px;
    padding-top: calc(20px + env(safe-area-inset-top));
    background-color: rgba(255,255,255,0.98);
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
    z-index: 250;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.side-nav .nav-item {
    width: 100%;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #6b7280;
}

.side-nav .nav-item img {
    width: 28px;
    height: 28px;
}

/* Desktop layout: place side-nav left and content to the right */
.desktop-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 900px) {
    /* show side-nav and hide bottom-nav on wider screens */
    .side-nav { display: flex; }
    .bottom-nav { display: none; }

    /* make app horizontal: side-nav + content */
    #app.desktop-layout { flex-direction: row; }

    /* ensure main content takes remaining width */
    .group-list-page, .chat-layout, .profile-page, .contacts-page {
        max-width: none;
        width: calc(100% - 96px);
        margin: 0;
    }

    /* ensure spinner and modal layer above side-nav visually if needed */
    .spinner-container, .modal { left: 0; }
}

/* Three-column layout specifics */
.main-columns {
    display: block;
}

@media (min-width: 900px) {
    .main-columns {
        display: flex;
        flex: 1 1 auto;
        min-height: 100vh;
        background-color: transparent;
    }

    /* 把主列向右偏移，避免被固定的 side-nav 遮挡 */
    #app.desktop-layout .main-columns {
        margin-left: 96px; /* 等于 .side-nav 的宽度 */
    }

    .conversations-column {
        width: 360px; /* 固定宽度的会话列表 */
        min-width: 300px;
        max-width: 420px;
        border-right: 1px solid rgba(0,0,0,0.04);
        background-color: var(--card-bg-color);
        box-shadow: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .chat-column {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-width: 0;
        background-color: #f7f8fa;
    }

    .group-list-page {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .group-list-page .conversation-list-wrapper {
        overflow-y: auto;
        height: calc(100vh - 64px); /* 适应 header/footer 高度，可调整 */
    }

    .chat-panel {
        display: flex;
        flex-direction: column;
        height: 100vh;
        min-height: 0;
    }

    .chat-header {
        height: 64px;
        display: flex;
        align-items: center;
        padding: 0 18px;
        border-bottom: 1px solid rgba(0,0,0,0.06);
        background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
    }

    .chat-body {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 18px;
        background-color: transparent;
    }

    .chat-empty {
        color: var(--text-color-secondary);
        text-align: center;
        margin-top: 80px;
    }
}

/* iframe 浏览器样式（用于内嵌浏览器） */
.chat-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (min-width: 900px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(112, 173, 255, 0.12), transparent 26%),
            linear-gradient(180deg, #eef4fb 0%, #e5edf7 100%);
    }

    #app.desktop-layout {
        min-height: 100vh;
        background: transparent;
    }

    .side-nav {
        width: 88px;
        padding: 22px 12px;
        background:
            linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 246, 255, 0.96));
        box-shadow: inset -1px 0 0 rgba(128, 157, 194, 0.14);
        gap: 12px;
    }

    .side-nav .nav-item {
        min-height: 74px;
        padding: 14px 8px;
        border-radius: 20px;
        gap: 8px;
        color: #68809e;
        background: transparent;
        transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }

    .side-nav .nav-item:hover {
        background: rgba(127, 171, 226, 0.12);
        color: #2e6fb8;
        transform: translateY(-1px);
    }

    .side-nav .nav-item.active {
        background: rgba(255, 255, 255, 0.74);
        color: #1870d5;
        box-shadow:
            0 10px 22px rgba(67, 101, 145, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    .side-nav .nav-item.active::before {
        left: 8px;
        top: 16px;
        bottom: 16px;
        width: 4px;
        border-radius: 999px;
        background: linear-gradient(180deg, #4c9dff, #1d6ed8);
    }

    .side-nav .nav-item img {
        width: 26px;
        height: 26px;
    }

    .side-nav .nav-item span {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.2px;
    }

    .side-nav .nav-item .nav-badge {
        top: 14px;
        right: 12px;
    }

    #app.desktop-layout .main-columns {
  
        width: calc(100%);
        min-height: 100vh;

        box-sizing: border-box;

    }

    .conversations-column {
        width: 388px;
        min-width: 388px;
        max-width: 388px;
        border-right: none;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 255, 0.86));

        overflow: hidden;
        backdrop-filter: blur(12px) saturate(135%);
        -webkit-backdrop-filter: blur(12px) saturate(135%);
    }

    .chat-column {
        min-width: 0;
        background: transparent;
    }

    .chat-panel {

        overflow: hidden;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 249, 255, 0.78));

        min-height: calc(100vh - 36px);
        position: relative;
    }

    .chat-iframe {
        border-radius: 30px;
        background: transparent;
        box-shadow: none;
        margin: 0;
    }

    .chat-iframe.no-radius {
        border-radius: 30px !important;
    }

    .chat-welcome {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 48px;
        text-align: center;
        background:
            radial-gradient(circle at top right, rgba(102, 166, 255, 0.12), transparent 26%),
            linear-gradient(180deg, rgba(245, 249, 255, 0.86), rgba(236, 243, 252, 0.9));
    }

    .chat-welcome-badge {
        width: 74px;
        height: 74px;
        border-radius: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #4c9dff 0%, #2f7def 100%);
        color: #fff;
        font-size: 22px;
        font-weight: 800;
        letter-spacing: 1px;
        box-shadow: 0 18px 34px rgba(60, 122, 211, 0.25);
    }

    .chat-welcome-title {
        margin: 0;
        font-size: 28px;
        line-height: 1.15;
        color: #132238;
        letter-spacing: -0.4px;
    }

    .chat-welcome-text {
        max-width: 420px;
        margin: 0;
        font-size: 15px;
        line-height: 1.7;
        color: #66809c;
    }

    .chat-welcome-tips {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        max-width: 460px;
    }

    .chat-welcome-tips span {
        padding: 10px 14px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.76);
        border: 1px solid rgba(156, 186, 224, 0.26);
        color: #3f6489;
        font-size: 13px;
        font-weight: 600;
        box-shadow: 0 8px 18px rgba(66, 98, 140, 0.06);
    }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: #8e8e93;
    font-size: 12px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-item:active {
    transform: scale(0.96);
}

.nav-item.active {
    color: #007aff;
}

.nav-label {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.2px;
}

.nav-icon {
    position: relative;
    width: 28px;
    height: 28px;
    color: inherit;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.nav-item.has-notification .nav-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #ffcc00; /* Yellow dot */
    border: 1.5px solid white;
}

.nav-icon-messages {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%2224%22%20fill%3D%22currentColor%22%2F%3E%3Cpath%20d%3D%22M14%2014h20c2.2%200%204%201.8%204%204v12c0%202.2-1.8%204-4%204H20l-6%206v-6c-2.2%200-4-1.8-4-4V18c0-2.2%201.8-4%204-4z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");
}

.nav-icon-contacts {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%2224%22%20fill%3D%22currentColor%22%2F%3E%3Cpath%20d%3D%22M24%2014a6%206%200%201%201%200%2012%206%206%200%200%201%200-12zm0%2014c6.6%200%2012%203.5%2012%207.5V36H12v-.5C12%2031.5%2017.4%2028%2024%2028z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");
}

.nav-icon-discover { 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='4'%3E%3C/circle%3E%3Cline x1='4.93' y1='4.93' x2='9.17' y2='9.17'%3E%3C/line%3E%3Cline x1='14.83' y1='14.83' x2='19.07' y2='19.07'%3E%3C/line%3E%3Cline x1='14.83' y1='9.17' x2='19.07' y2='4.93'%3E%3C/line%3E%3Cline x1='14.83' y1='9.17' x2='18.36' y2='5.64'%3E%3C/line%3E%3Cline x1='4.93' y1='19.07' x2='9.17' y2='14.83'%3E%3C/line%3E%3C/svg%3E"); 
}

.nav-icon-settings {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%2224%22%20fill%3D%22currentColor%22%2F%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2216%22%20r%3D%223%22%20fill%3D%22%23ffffff%22%2F%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%223%22%20fill%3D%22%23ffffff%22%2F%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2232%22%20r%3D%223%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E");
}

.nav-item.active .nav-label {
    font-weight: 600;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: var(--shadow);
}

.toast.show {
    opacity: 1;
}

/* Custom Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg-color);
    margin: auto;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    animation: slide-down 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes slide-down {
    from {
        transform: translateY(-40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.modal-header span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.modal-close {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background-color: #e0e0e0;
    color: #333;
}

.modal-body {
    padding-top: 0;
}

.modal-body .form-field {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.modal-footer {
    padding-top: 20px;
    text-align: right;
}

/* Profile Card Styles (used on multiple pages) */
.profile-card {
    background: var(--card-bg-color);
    margin: 15px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-summary {
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    margin-right: 15px;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-details {
    flex-grow: 1;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.profile-sub {
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.profile-form {
    margin-top: 15px;
}

.text-center {
    text-align: center;
}

/* Override common padding for chat page */
#app[data-page="chat"] {
    padding-bottom: 0;
}

/* Search Results */
.search-results-container {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px; /* For scrollbar */
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f5f5f7;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex-grow: 1;
}

.search-result-name {
    font-weight: 600;
    color: #333;
}

.search-result-phone {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input-group input {
    flex-grow: 1;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-input-group .primary-btn {
    padding: 12px 20px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Recall Menu Styles */
.recall-menu {
    position: fixed;
    z-index: 10000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    padding: 6px;
    border: 1px solid rgba(0,0,0,0.05);
    width: 180px;
    animation: menu-fade-in 0.1s ease-out;
}

@keyframes menu-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.recall-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 12px 10px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-radius: 6px;
    color: #333;
    transition: background-color 0.15s ease;
}

.recall-menu-item:hover {
    background-color: rgba(0,0,0,0.05);
}

.recall-menu-item:disabled {
    color: #aaa;
    cursor: not-allowed;
}

.recall-menu-item.danger span {
    color: #ff3b30;
}

.recall-menu-separator {
    height: 1px;
    background-color: rgba(0,0,0,0.1);
    margin: 6px 10px;
}

.recall-menu-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
}

.recall-menu-item:disabled .recall-menu-icon {
    opacity: 0.3;
}

/* SVG Icons as Data URIs */
.icon-copy { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E"); }
.icon-favorite { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E"); }
.icon-translate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 18H3.78a2.78 2.78 0 0 1-2.22-4.44l4.44-8.89a2.78 2.78 0 0 1 4.44 0l4.44 8.89A2.78 2.78 0 0 1 12.22 18z'/%3E%3Cpath d='M15 12a4 4 0 1 0 8 0 4 4 0 0 0-8 0z'/%3E%3Cpath d='M15 12h8'/%3E%3Cpath d='M19 8v8'/%3E%3C/svg%3E"); }
.icon-reply { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 17 4 12 9 7'%3E%3C/polyline%3E%3Cpath d='M20 18v-2a4 4 0 0 0-4-4H4'%3E%3C/path%3E%3C/svg%3E"); }
.icon-recall { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'%3E%3C/path%3E%3C/svg%3E"); }
.icon-edit { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E"); }
.icon-delete { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff3b30' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3C/svg%3E"); }

/* PC shell: always use desktop layout, without width-based switching */
#app.desktop-layout {
    flex-direction: row;
    min-height: 100vh;
    background: transparent;
}

#app.desktop-layout .main-columns {
    display: flex;
    flex: 1 1 auto;
    min-height: 100vh;
    width: calc(100% - 88px);
    margin-left: 88px;
    background-color: transparent;
    box-sizing: border-box;
}

#app.desktop-layout .group-list-page,
#app.desktop-layout .chat-layout,
#app.desktop-layout .profile-page,
#app.desktop-layout .contacts-page {
    max-width: none;
    width: 100%;
    margin: 0;
}

#app.desktop-layout .bottom-nav {
    display: none !important;
}

#app.desktop-layout .side-nav {
    display: flex;
    width: 88px;
    padding: 22px 12px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 246, 255, 0.96));
    box-shadow: inset -1px 0 0 rgba(128, 157, 194, 0.14);
    gap: 12px;
}

#app.desktop-layout .side-nav .nav-item {
    min-height: 72px;
    padding: 12px 8px;
    border-radius: 18px;
    gap: 7px;
    color: #68809e;
    background: transparent;
    transition: color 0.18s ease, transform 0.18s ease;
}

#app.desktop-layout .side-nav .nav-item:hover {
    color: #2e6fb8;
    transform: translateY(-1px);
}

#app.desktop-layout .side-nav .nav-item.active {
    color: #1870d5;
    box-shadow: none;
}

#app.desktop-layout .side-nav .nav-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

#app.desktop-layout .side-nav .nav-icon {
    width: 31px;
    height: 31px;
}

#app.desktop-layout .side-nav .nav-item .nav-badge {
    top: 14px;
    right: 12px;
}

#app.desktop-layout .conversations-column {
    width: 388px;
    min-width: 388px;
    max-width: 388px;
    border-right: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 255, 0.86));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px) saturate(135%);
    -webkit-backdrop-filter: blur(12px) saturate(135%);
}

#app.desktop-layout .chat-column {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}

#app.desktop-layout .chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 249, 255, 0.78));
}

#app.desktop-layout .chat-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    border-radius: 30px;
    background: transparent;
    box-shadow: none;
    margin: 0;
}

#app.desktop-layout .chat-iframe.no-radius {
    border-radius: 30px !important;
}

#app.desktop-layout .chat-welcome {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(102, 166, 255, 0.12), transparent 26%), linear-gradient(180deg, rgba(245, 249, 255, 0.86), rgba(236, 243, 252, 0.9));
}

#app.desktop-layout .chat-welcome-badge {
    width: 74px;
    height: 74px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4c9dff 0%, #2f7def 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 18px 34px rgba(60, 122, 211, 0.25);
}

#app.desktop-layout .chat-welcome-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    color: #132238;
    letter-spacing: -0.4px;
}

#app.desktop-layout .chat-welcome-text {
    max-width: 420px;
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #66809c;
}

#app.desktop-layout .chat-welcome-tips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 460px;
}

#app.desktop-layout .chat-welcome-tips span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(156, 186, 224, 0.26);
    color: #3f6489;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(66, 98, 140, 0.06);
}
