/* ================================================================
   style.css v3.15 - 移动优先 · 二次元简约风
   设计原则：简洁留白、柔和渐变、圆润无锐角、全端适配
   断点：375px(手机) / 768px(平板) / 1024px+(PC)
   ================================================================ */

/* ---- CSS 变量 ---- */
:root {
    /* 主题色：樱花粉 + 薰衣草紫 */
    --pink:         #ff8fab;
    --pink-deep:    #e8739a;
    --pink-light:   #ffd6e0;
    --purple:       #a78bfa;
    --purple-deep:  #7c3aed;
    --purple-light: #ede9fe;

    /* 中性色 */
    --white:        #ffffff;
    --gray-50:      #fafafa;
    --gray-100:     #f5f5f5;
    --gray-200:     #ebebeb;
    --gray-300:     #d9d9d9;
    --gray-400:     #b4b4b4;
    --gray-500:     #888888;
    --gray-600:     #666666;
    --gray-700:     #444444;
    --gray-800:     #222222;

    /* 玻璃态 */
    --glass-bg:     rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.85);

    /* 间距 & 圆角 */
    --radius-xs:   8px;
    --radius-sm:   12px;
    --radius-md:   16px;
    --radius-lg:   24px;
    --radius-xl:   32px;
    --radius-full: 9999px;

    /* 阴影 */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-pink: 0 6px 20px rgba(255,143,171,0.35);

    /* 动效 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* 布局 */
    --header-h: 56px;
    --countdown-h: 60px;
    --input-h: 68px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- 重置 & 基础 ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(155deg, #ff8fab 0%, #c084fc 50%, #818cf8 100%);
    color: var(--gray-800);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- 主容器（手机优先无圆角，平板+PC有） ---- */
.container {
    width: 100%;
    height: 100dvh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

/* ---- 头部 ---- */
.chat-header {
    height: var(--header-h);
    padding: 0 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.01em;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.online-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.online-dot {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-badge.open {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
}

.status-badge.closed {
    background: var(--gray-200);
    color: var(--gray-500);
}

/* ---- 倒计时条 ---- */
.countdown-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    padding: 10px 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.countdown-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    white-space: nowrap;
    min-width: 56px;
}

.countdown-time {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 18px;
    font-weight: 800;
    color: var(--purple-deep);
    letter-spacing: 0.05em;
    background: var(--purple-light);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.countdown-track {
    flex: 1;
    height: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pink), var(--purple));
    border-radius: var(--radius-full);
    transition: width 1s linear;
    min-width: 4px;
}

/* ---- 模态弹窗（协议 & 用户名） ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    padding: 0;
}

.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: sheetUp 0.4s var(--ease-out);
}

.modal-header {
    padding: 28px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-header .modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: var(--shadow-pink);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.modal-header p {
    font-size: 13px;
    color: var(--gray-500);
}

.modal-body {
    padding: 20px 24px;
}

.notice-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    border: 1px solid var(--gray-100);
}

.notice-card .notice-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notice-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 3px;
}

.notice-card p {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.5;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.checkbox-row:has(input:checked) {
    border-color: var(--pink);
    background: var(--pink-light);
}

.checkbox-row input[type="checkbox"] {
    display: none;
}

.checkbox-pill {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 11px;
    color: white;
    font-weight: 700;
}

.checkbox-row input:checked + .checkbox-pill {
    background: var(--pink-deep);
    border-color: var(--pink-deep);
}

.checkbox-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.4;
}

.modal-footer {
    padding: 8px 24px calc(16px + var(--safe-bottom));
    display: flex;
    gap: 10px;
}

.modal-footer .btn {
    flex: 1;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    -webkit-tap-highlight-color: transparent;
}

.modal-footer .btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    box-shadow: var(--shadow-pink);
}

.btn-primary:disabled {
    opacity: 0.45;
    box-shadow: none;
}

.btn-ghost {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ---- 用户名输入 ---- */
.username-section {
    padding: 0;
}

.username-card {
    padding: 24px;
}

.username-card h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-field {
    flex: 1;
    padding: 13px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--gray-50);
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.input-field:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.15);
    background: white;
}

.input-field::placeholder {
    color: var(--gray-400);
}

.btn-join {
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-pink);
    transition: all 0.2s var(--ease-spring);
    -webkit-tap-highlight-color: transparent;
}

.btn-join:active {
    transform: scale(0.95);
}

/* ---- 聊天区域 ---- */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-snap-type: y proximity;
}

.chat-messages::-webkit-scrollbar {
    width: 3px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--pink-light);
    border-radius: var(--radius-full);
}

/* ---- 消息气泡 ---- */
.message {
    max-width: 80%;
    width: fit-content;
    animation: msgIn 0.3s var(--ease-out);
    scroll-snap-align: start;
}

.message.own-message {
    align-self: flex-end;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    padding: 0 4px;
}

.msg-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--purple-deep);
}

.msg-time {
    font-size: 10px;
    color: var(--gray-400);
}

.msg-bubble {
    padding: 10px 14px;
    background: var(--white);
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-md);
    border-top-left-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    word-break: break-word;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s;
}

.msg-bubble:active {
    transform: scale(0.99);
}

.own-message .msg-bubble {
    background: linear-gradient(135deg, var(--pink-deep) 0%, var(--purple-deep) 100%);
    color: white;
    border: none;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: 4px;
    box-shadow: var(--shadow-pink);
}

.own-message .msg-name {
    color: var(--pink-light);
}

.msg-image {
    max-width: 220px;
    max-height: 220px;
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--white);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: block;
    object-fit: cover;
    transition: transform 0.2s;
}

.msg-image:active {
    transform: scale(0.97);
}

/* ---- 系统消息 ---- */
.system-message {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    padding: 5px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-full);
    align-self: center;
    margin: 4px 0;
}

/* ---- 关闭状态 ---- */
.closed-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.closed-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.closed-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
}

.closed-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 320px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255,255,255,0.9);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.closed-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--pink-light), var(--purple-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.closed-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.closed-sub {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 24px;
    line-height: 1.5;
}

.next-open {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 16px;
}

.next-open-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.next-open-time {
    font-size: 18px;
    font-weight: 800;
    color: var(--purple-deep);
    letter-spacing: 0.02em;
}

/* ---- 输入区域 ---- */
.chat-input-area {
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-icon:active {
    background: var(--gray-200);
    transform: scale(0.92);
}

.input-area {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    background: white;
    color: var(--gray-800);
    resize: none;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.input-area:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255,143,171,0.15);
}

.input-area::placeholder {
    color: var(--gray-400);
}

.btn-send {
    height: 44px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: var(--shadow-pink);
    transition: all 0.2s var(--ease-spring);
    -webkit-tap-highlight-color: transparent;
}

.btn-send:active {
    transform: scale(0.93);
}

.btn-send:disabled {
    opacity: 0.4;
    box-shadow: none;
}

/* ---- 图片预览弹窗 ---- */
.img-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.img-modal-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90dvh;
}

.img-modal-inner img {
    max-width: 100%;
    max-height: 90dvh;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255,255,255,0.2);
    display: block;
    cursor: zoom-out;
}

.img-modal-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.img-modal-close:active {
    background: rgba(255,255,255,0.3);
}

/* ---- Toast 提示 ---- */
.toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--gray-800);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    animation: toastIn 2.5s var(--ease-out) forwards;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ---- 樱花特效容器 ---- */
#sakuraContainer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.sakura-particle {
    position: absolute;
    top: -30px;
    animation: sakuraFall linear forwards;
    user-select: none;
}

/* ---- 表情选择器 ---- */
.emoji-picker {
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 8px 12px 4px;
    flex-shrink: 0;
    animation: slideDown 0.2s var(--ease-out);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.emoji-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 6px;
}

.emoji-tab {
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.emoji-tab:hover {
    background: var(--gray-100);
}

.emoji-tab.active {
    background: var(--pink-light);
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    max-height: 140px;
    overflow-y: auto;
    padding: 2px;
}

.emoji-grid::-webkit-scrollbar {
    width: 3px;
}
.emoji-grid::-webkit-scrollbar-thumb {
    background: var(--pink-light);
    border-radius: var(--radius-full);
}

.emoji-item {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, transform 0.1s;
    flex-shrink: 0;
}

.emoji-item:hover {
    background: var(--gray-100);
    transform: scale(1.2);
}

.emoji-item:active {
    background: var(--pink-light);
    transform: scale(0.95);
}

/* ---- 图片上传按钮（专属样式） ---- */
.btn-image {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1.5px dashed var(--gray-300);
    background: var(--gray-50);
    color: var(--purple);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-image:hover {
    border-color: var(--purple);
    background: var(--purple-light);
    transform: scale(1.05);
}

.btn-image:active {
    transform: scale(0.92);
    background: var(--pink-light);
}

/* ---- 隐藏类 ---- */
.hidden { display: none !important; }

/* ================================================================
   动画
   ================================================================ */
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes toastIn {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    82%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

@keyframes sakuraFall {
    0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.9; }
    80%  { opacity: 0.6; }
    100% { transform: translateY(110vh) rotate(360deg) scale(0.6); opacity: 0; }
}

/* ================================================================
   平板适配（≥ 768px）
   ================================================================ */
@media (min-width: 768px) {
    body {
        padding: 24px;
        align-items: center;
    }

    .container {
        height: calc(100dvh - 48px);
        height: calc(100vh - 48px);
        max-width: 520px;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        border: 1.5px solid rgba(255,255,255,0.5);
    }

    .modal-sheet {
        border-radius: var(--radius-xl);
        margin: auto;
        max-height: 85dvh;
    }

    .modal-overlay {
        align-items: center;
        padding: 24px;
    }

    .msg-bubble {
        padding: 12px 16px;
        font-size: 15px;
    }

    .msg-image {
        max-width: 280px;
        max-height: 280px;
    }
}

/* ================================================================
   PC 适配（≥ 1024px）
   ================================================================ */
@media (min-width: 1024px) {
    body {
        padding: 40px;
    }

    .container {
        height: calc(100dvh - 80px);
        height: calc(100vh - 80px);
        max-width: 560px;
    }

    .chat-header {
        padding: 0 24px;
    }

    .chat-header h2 {
        max-width: 240px;
        font-size: 17px;
    }

    .chat-messages {
        padding: 20px;
        gap: 12px;
    }

    .msg-name { font-size: 12px; }
    .msg-time { font-size: 11px; }
    .system-message { font-size: 12px; }

    .chat-input-area {
        padding: 12px 20px calc(12px + var(--safe-bottom));
    }

    .btn-icon:hover {
        background: var(--gray-200);
    }

    .btn-send:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(255,143,171,0.4);
    }

    .btn-join:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-pink);
    }

    .modal-footer .btn:hover {
        transform: translateY(-1px);
    }
}

/* ================================================================
   超小屏（≤ 374px）
   ================================================================ */
@media (max-width: 374px) {
    :root { --header-h: 50px; }

    .online-count { display: none; }
    .status-badge { font-size: 10px; padding: 3px 8px; }
    .chat-header h2 { font-size: 14px; }
    .countdown-time { font-size: 16px; }
    .msg-bubble { font-size: 13px; padding: 9px 12px; }
    .btn-send { padding: 0 14px; font-size: 13px; }
    .btn-icon { width: 40px; height: 40px; font-size: 16px; }
}
