/* ============================================================
   有求必应 - 全局样式
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
}

body {
    background: #0b0e1a;
    font-family: -apple-system, 'PingFang SC', sans-serif;
    padding: 12px;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app {
    max-width: 400px;
    width: 100%;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: 900px;
    background: #12192e;
    border-radius: 32px;
    padding: 20px 16px 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 大屏(电脑/平板)适度加宽主界面 */
@media (min-width: 768px) {
    .app {
        max-width: 720px;
    }
}

/* ===== 顶部导航 ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header h1 {
    color: #f7e3c0;
    font-size: 20px;
    font-weight: 600;
}

.header h1 span {
    color: #d9a066;
    font-size: 12px;
    background: #2a2a1a;
    padding: 2px 12px;
    border-radius: 20px;
    border: 1px solid #c9a04a44;
}

.header .logout {
    color: #ff6a5a;
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
}

/* ===== 页面面板（全屏展示）===== */
#mainPage {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#mainPage.hidden {
    display: none !important;
}

.page-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page-panel.hidden {
    display: none !important;
}

#poolMainView {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ===== 许愿池 ===== */
.pool {
    background: #0d1322;
    border-radius: 20px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,200,80,0.3);
    box-shadow: inset 0 -8px 30px rgba(90,15,15,0.35), 0 0 24px rgba(255,90,60,0.1);
    position: relative;
    cursor: pointer;
    margin-bottom: 12px;
    overflow: hidden;
    min-height: 180px;
}

.pool canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 0;
}

/* ===== 动物 DOM 层 ===== */
.animal-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.pool-animal {
    position: absolute;
    font-size: 22px;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.05s linear;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.3));
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
}

.pool-animal.grown {
    filter: drop-shadow(0 0 8px rgba(255,215,0,0.6));
}

.pool-animal .animal-name {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #f7e3c0;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    pointer-events: none;
    background: rgba(0,0,0,0.5);
    padding: 1px 6px;
    border-radius: 8px;
}

/* 愿望文字标签 */
.pool-animal .animal-wish {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #ffd98c;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    pointer-events: none;
    background: rgba(13,18,34,0.8);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,200,80,0.3);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 原生 CSS 动画动物（兜底方案，不依赖 JS） */
.pool-animal.native {
    font-size: 26px;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.4));
    will-change: left;
}
@keyframes swim1 { from { left: -30px; } to { left: calc(100% + 30px); } }
@keyframes swim2 { from { left: calc(100% + 30px); } to { left: -30px; } }
@keyframes swim3 { from { left: -30px; } to { left: calc(100% + 30px); } }
@keyframes swim4 { from { left: calc(100% + 30px); } to { left: -30px; } }
@keyframes swim5 { from { left: -30px; } to { left: calc(100% + 30px); } }
@keyframes swim6 { from { left: calc(100% + 30px); } to { left: -30px; } }

.pool .hint {
    position: absolute;
    bottom: 12px;
    color: #8895b955;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 16px;
    border-radius: 20px;
    transition: color 0.5s;
    z-index: 2;
}

/* ===== 愿望输入卡片 ===== */
.wish-input-card {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0d1222; /* 纯色背景：华为浏览器 fixed+blur 弹键盘会黑屏，去掉毛玻璃 */
    border: 1px solid rgba(217,160,102,0.3);
    padding: 16px 12px 12px;
    z-index: 1003;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.25s ease;
    transition: opacity 0.2s, transform 0.2s;
}

.wish-input-card textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 6px 16px 26px;
    color: #f0e3d0;
    font-size: 18px;
    font-family: inherit;
    outline: none;
    resize: none;
    line-height: 1.8;
    overflow-y: auto;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s;
    text-align: center;
}

.wish-input-card textarea:focus {
    border-color: rgba(217,160,102,0.5);
}

.wish-input-card textarea::placeholder {
    color: #5a6a8a;
    text-align: center;
}

.wish-input-card.hidden {
    display: none;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== 任务值档位 ===== */
.task-tier-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    margin: 8px 0;
}

.task-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 2px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    color: #5a6a8a;
}

.task-tier:hover {
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
}

.task-tier.active {
    border-color: rgba(217,160,102,0.4);
    background: rgba(217,160,102,0.1);
    color: #d9a066;
    box-shadow: 0 0 12px rgba(217,160,102,0.1);
}

.task-tier .tier-animal {
    font-size: 22px;
    transition: transform 0.2s;
}

.task-tier.active .tier-animal {
    transform: scale(1.15);
}

.task-tier .tier-label {
    font-size: 10px;
    white-space: nowrap;
}

.task-tier .tier-cost {
    font-size: 11px;
    font-weight: 600;
}

.task-tier.active .tier-cost {
    color: #ffd98c;
}

.wish-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    flex-shrink: 0;
    /* 贴在许愿框底部：键盘弹出/内容超高时按钮永远可见 */
    position: sticky;
    bottom: 0;
    background: rgba(13,18,34,0.97);
    padding: 8px 0 10px;
}

.wish-input-count {
    color: #5a6a8a;
    font-size: 11px;
}

.btn-wish-submit {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: #d9a066;
    color: #141c2e;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-wish-submit:hover {
    background: #e5b076;
    box-shadow: 0 0 16px rgba(217,160,102,0.3);
}

.btn-wish-submit:active {
    transform: scale(0.95);
}

/* ===== 免费档位特殊样式 ===== */
.task-tier[data-tier="0"] {
    border-color: rgba(255,90,60,0.35);
    background: linear-gradient(135deg, rgba(255,80,60,0.18), rgba(255,200,80,0.1));
    color: #ffb39a;
}
.task-tier[data-tier="0"].active {
    border-color: rgba(255,200,80,0.55);
    background: linear-gradient(135deg, rgba(255,90,60,0.3), rgba(255,200,80,0.18));
    color: #ffd98c;
    box-shadow: 0 0 16px rgba(255,120,60,0.25);
    animation: freePulse 2.5s ease-in-out infinite;
}
@keyframes freePulse {
    0%, 100% { box-shadow: 0 0 6px rgba(255,120,60,0.15); }
    50% { box-shadow: 0 0 18px rgba(255,180,60,0.35); }
}

/* ===== 夜间模式 ===== */
.night-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 70% 30%, rgba(80,120,220,0.15), rgba(10,20,60,0.4));
    pointer-events: none;
    border-radius: 20px;
    transition: opacity 2s ease;
    opacity: 0;
}

/* ===== 白天鹅许愿按钮 ===== */
.swan-btn {
    position: absolute;
    bottom: 40px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(200,210,230,0.5);
    background: rgba(18,25,46,0.85);
    backdrop-filter: blur(8px);
    font-size: 26px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 0 20px rgba(180,200,230,0.25), 0 4px 12px rgba(0,0,0,0.4);
    animation: swanFloat 3s ease-in-out infinite, swanGlow 2s ease-in-out infinite;
    transition: transform 0.2s, box-shadow 0.2s;
}

.swan-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(200,220,255,0.4), 0 4px 16px rgba(0,0,0,0.5);
}

.swan-btn:active {
    transform: scale(0.9);
    box-shadow: 0 0 50px rgba(220,230,255,0.7);
    transition: all 0.15s;
}

.swan-btn.flying {
    animation: swanFly 2.2s ease-out forwards;
    pointer-events: none;
}

@keyframes swanFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    15% {
        transform: translate(-30px, -20px) scale(1.2);
        opacity: 1;
    }
    40% {
        transform: translate(-120px, -180px) scale(1.6);
        opacity: 0.9;
    }
    70% {
        transform: translate(-80px, -260px) scale(2);
        opacity: 0.5;
    }
    100% {
        transform: translate(-60px, -320px) scale(2.5);
        opacity: 0;
    }
}

@keyframes swanFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes swanGlow {
    0%, 100% { box-shadow: 0 0 18px rgba(180,200,230,0.2), 0 4px 12px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 0 36px rgba(200,220,255,0.4), 0 4px 16px rgba(0,0,0,0.5); }
}

/* ===== 飞鹤动画 ===== */
.crane-fly {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    animation: craneFlight 2.5s ease-in-out forwards;
}
@keyframes craneFlight {
    0%   { left: 65%; top: 70%; transform: scale(0.2) rotate(-5deg); opacity: 0; }
    8%   { left: 55%; top: 58%; transform: scale(0.5) rotate(-3deg); opacity: 0.9; }
    20%  { left: 42%; top: 42%; transform: scale(0.8) rotate(0deg); opacity: 1; }
    45%  { left: 28%; top: 22%; transform: scale(1) rotate(0deg); opacity: 1; }
    50%  { left: 26%; top: 20%; transform: scale(1) rotateY(180deg); opacity: 1; }
    70%  { left: 12%; top: 8%;  transform: scale(0.7) rotateY(180deg); opacity: 0.7; }
    100% { left: -10%; top: -8%; transform: scale(0.2) rotateY(180deg); opacity: 0; }
}
@keyframes craneWing {
    0%,100% { transform: rotate(-25deg); }
    30%     { transform: rotate(5deg); }
    70%     { transform: rotate(25deg); }
}
.crane-fly .wing {
    transform-origin: 50% 50%;
    animation: craneWing 0.25s ease-in-out infinite;
}
.wish-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}

.wish-tags::-webkit-scrollbar { display: none; }

.wish-tag {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #2a3a5a55;
    background: #0d1422;
    color: #8895b9;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.wish-tag:hover {
    border-color: #445071;
    color: #c0c8dd;
}

.wish-tag.active {
    background: #d9a06622;
    border-color: #d9a06666;
    color: #d9a066;
    box-shadow: 0 0 12px rgba(217, 160, 102, 0.15);
}

/* ===== 余额行 ===== */
.balance-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.balance-row .item {
    flex: 1;
    background: #1a2440;
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    border: 1px solid #2a3a5a33;
}

.balance-row .item .num {
    color: #f7e3c0;
    font-size: 18px;
    font-weight: 600;
}

.balance-row .item .label {
    color: #8895b9;
    font-size: 11px;
}

.balance-row .item.gold .num {
    color: #ffd98c;
}

/* ===== 许愿池 - 幸运统计 ===== */
.luck-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #5a6a8a;
}

.luck-stats b {
    color: #d9a066;
    font-weight: 600;
}

/* ===== 许愿池 - 奖励弹窗 ===== */
.reward-pop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-pop.show {
    transform: translate(-50%, -50%) scale(1);
}

.reward-content {
    background: rgba(18, 25, 46, 0.95);
    border: 2px solid #d9a06666;
    border-radius: 20px;
    padding: 16px 24px;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.reward-content.lucky {
    border-color: #ffd98c;
    box-shadow: 0 0 40px rgba(255, 200, 80, 0.3);
    animation: rewardGlow 0.8s ease-in-out infinite;
}

@keyframes rewardGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 200, 80, 0.3); }
    50% { box-shadow: 0 0 50px rgba(255, 200, 80, 0.6); }
}

.reward-emoji {
    font-size: 40px;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.reward-name {
    color: #f7e3c0;
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

.reward-desc {
    color: #ffd98c;
    font-size: 14px;
    margin-top: 4px;
}

/* ===== 许愿池 - 浮动愿望 ===== */
.floating-wishes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-wish {
    position: absolute;
    bottom: -30px;
    color: #f7e3c0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 200, 100, 0.5);
    animation: floatUp linear forwards;
    opacity: 0;
}

@keyframes floatUp {
    0% { bottom: -30px; opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { bottom: 100%; opacity: 0; }
}

/* ===== 许愿池 - 愿望墙 ===== */
.wish-wall {
    background: #0d1322;
    border-radius: 16px;
    border: 1px solid #2a3a5a44;
    padding: 10px 12px;
    flex-shrink: 0;
}

.wish-wall-title {
    color: #d9a066;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a3a5a33;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.golden-hint {
    color: #ffd98c;
    font-size: 11px;
    font-weight: 400;
    animation: goldenPulse 2s ease-in-out infinite;
}

@keyframes goldenPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.wish-list {
    min-height: 180px;
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wish-list::-webkit-scrollbar {
    width: 3px;
}

.wish-list::-webkit-scrollbar-thumb {
    background: #2a3a5a;
    border-radius: 3px;
}

.wish-empty {
    color: #5a6a8a;
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
    line-height: 1.8;
}

.wish-empty-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.wish-empty span {
    font-size: 11px;
    color: #445071;
    display: block;
}

.wish-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin: 3px 0;
    border-bottom: 1px solid #1a244020;
    font-size: 12px;
    animation: fadeIn 0.3s ease;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

/* 粉丝的漂流瓶：金色描边高亮 */
.wish-item.fan-wish {
    border: 1px solid rgba(255, 200, 120, 0.45);
    background: rgba(217, 160, 102, 0.08);
}
.wish-item .fan-star {
    font-size: 10px;
    position: absolute;
    top: -6px;
    right: 8px;
    background: #1a2440;
    border: 1px solid rgba(255, 200, 120, 0.5);
    border-radius: 8px;
    padding: 0 4px;
    line-height: 14px;
}

.wish-item:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
}

/* 愿望状态标识 */
.wish-status {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    font-weight: 500;
}

.wish-status.pending {
    background: rgba(255,200,80,0.1);
    color: #ffd98c;
    border: 1px solid rgba(255,200,80,0.2);
    animation: statusPendingPulse 3s ease-in-out infinite;
}

.wish-status.active {
    background: rgba(100,180,255,0.1);
    color: #5a9ac9;
    border: 1px solid rgba(100,180,255,0.2);
    animation: statusActiveBreathe 4s ease-in-out infinite;
}

.wish-status.done {
    background: rgba(90,200,90,0.1);
    color: #5ac95a;
    border: 1px solid rgba(90,200,90,0.2);
    box-shadow: 0 0 6px rgba(90,200,90,0.1);
}

@keyframes statusPendingPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255,200,80,0); }
    50% { box-shadow: 0 0 6px rgba(255,200,80,0.2); }
}

@keyframes statusActiveBreathe {
    0%, 100% { box-shadow: 0 0 0 rgba(100,180,255,0); }
    50% { box-shadow: 0 0 8px rgba(100,180,255,0.25); }
}

.wish-item:last-child {
    border-bottom: none;
}

.wish-emoji {
    font-size: 14px;
    flex-shrink: 0;
}

.wish-name {
    font-weight: 600;
    flex-shrink: 0;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wish-name.real {
    color: #d9a066;
}

.wish-name.ghost {
    color: #8895b9;
}

.wish-msg {
    color: #c0c8dd;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wish-time {
    color: #5a6a8a;
    font-size: 10px;
    flex-shrink: 0;
}

/* 金色愿望 */
.wish-item.golden {
    background: linear-gradient(135deg, rgba(255,200,80,0.1), rgba(255,180,40,0.05));
    border: 1px solid rgba(255,200,80,0.3);
    border-radius: 10px;
    padding: 5px 8px;
    margin: 2px -4px;
    animation: goldenGlow 3s ease-in-out infinite;
}

@keyframes goldenGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(255,200,80,0.1); }
    50% { box-shadow: 0 0 20px rgba(255,200,80,0.25); }
}

.wish-hunt-badge {
    display: inline-block;
    background: rgba(217, 160, 102, 0.15);
    border: 1px solid rgba(217, 160, 102, 0.5);
    color: #d9a066;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    cursor: pointer;
}
.golden-badge {
    font-size: 14px;
    animation: bounceIn 0.5s ease;
    flex-shrink: 0;
}

/* 匿名盲盒 */
.wish-item.anon .wish-name {
    color: #c9a04a;
    font-style: italic;
}

.wish-item.anon {
    border-left: 2px solid #c9a04a44;
}

/* 许愿签迷你标签 */
.wish-tag-mini {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    white-space: nowrap;
}

/* 捞愿望按钮 */
.btn-scoop {
    background: none;
    border: 1px solid #2a3a5a33;
    border-radius: 12px;
    color: #5a6a8a;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-scoop:hover {
    border-color: #d9a06666;
    color: #d9a066;
    background: #d9a06611;
}

.btn-scoop:active {
    transform: scale(1.1);
    color: #ffd98c;
}

/* 取消愿望按钮 */
.btn-cancel-wish {
    background: none;
    border: 1px solid rgba(255,106,90,0.3);
    border-radius: 12px;
    color: #ff6a5a88;
    font-size: 12px;
    padding: 2px 7px;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-cancel-wish:hover {
    border-color: #ff6a5a88;
    color: #ff6a5a;
    background: rgba(255,106,90,0.1);
}
.btn-cancel-wish:active {
    transform: scale(0.9);
}

/* 回响文字 */
.float-wish.echo {
    font-size: 13px;
    color: #f7e3c0;
    text-shadow: 0 0 12px rgba(255,200,120,0.6);
    font-style: italic;
}
.lang-row {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #0d142266;
    padding: 6px 14px;
    border-radius: 30px;
    margin-bottom: 10px;
    border: 1px solid #2a3a5a33;
}

.lang-row label {
    color: #8895b9;
    font-size: 12px;
}

.lang-row select {
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 30px;
    padding: 4px 12px;
    color: #f0e3d0;
    font-size: 13px;
    outline: none;
    flex: 1;
}

/* ===== 聊天区域 ===== */
.chat-box-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; margin-bottom: 6px;
}
.chat-box-header span { color: #f0e3d0; font-size: 14px; font-weight: 600; }
.btn-fullscreen {
    background: #2a3a5a44; border: 1px solid #2a3a5a66; border-radius: 8px;
    color: #8895b9; font-size: 18px; cursor: pointer; padding: 2px 8px; line-height: 1;
}
.btn-fullscreen:active { background: #d9a06622; color: #d9a066; }

.chat-box {
    background: #0b111f;
    border-radius: 16px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    border: 1px solid #2b385a55;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}
.chat-box.fullscreen {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000; border-radius: 0; margin: 0;
    padding: 12px 12px 80px;
}

.chat-box .msg {
    padding: 6px 14px;
    border-radius: 16px;
    max-width: 85%;
    font-size: 14px;
    margin-bottom: 6px;
    animation: fadeIn 0.2s ease;
}

.chat-box .msg.me {
    align-self: flex-end;
    background: #d9a066;
    color: #141c2e;
    margin-left: auto;
}

.chat-box .msg.other {
    background: #2b385a;
    color: #f0e3d0;
}

.chat-box .msg.system {
    background: transparent;
    color: #8895b9;
    font-size: 12px;
    font-style: italic;
    text-align: center;
    max-width: 100%;
}

.chat-box .msg .trans {
    font-size: 11px;
    color: #aabbdd;
    margin-top: 2px;
    border-top: 1px solid #ffffff22;
    padding-top: 2px;
}

.chat-box .msg.me .trans {
    color: #4a2a1a;
    border-top-color: #6a4a2a44;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 全屏聊天 ===== */
.full-chat {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1002; background: #0b0e1a;
    display: flex; flex-direction: column;
}
.full-chat.hidden { display: none !important; }
.full-chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid #2a3a5a33;
}
.full-chat-header button {
    background: none; border: 1px solid #2a3a5a55; border-radius: 12px;
    color: #d9a066; padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.full-chat-header span { color: #f7e3c0; font-size: 16px; font-weight: 600; }
.full-chat-body {
    flex: 1; overflow-y: auto; padding: 10px;
    display: flex; flex-direction: column; gap: 6px;
}
.full-chat-input {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 10px; border-top: 1px solid #2a3a5a33;
}

/* ===== 输入行 ===== */
.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
}

.input-row input {
    flex: 1;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 30px;
    padding: 10px 16px;
    color: #f0e3d0;
    font-size: 14px;
    outline: none;
    min-height: 44px;
}

.input-row input:focus {
    border-color: #d9a066;
}

.input-row input::placeholder {
    color: #5a6a8a;
}

.input-row .btn {
    padding: 10px 14px;
    border-radius: 30px;
    border: none;
    background: #d9a066;
    color: #141c2e;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
}

.input-row .btn:active {
    transform: scale(0.95);
}

/* ===== 语音按钮 ===== */
.voice-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #4a5a7a;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.2s;
    position: relative;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.voice-btn:active {
    transform: scale(0.9);
}

.voice-btn.recording {
    background: #ff6a5a;
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 106, 90, 0.4);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(255, 106, 90, 0);
    }
}

.status-text {
    color: #ffd98c;
    font-size: 12px;
    text-align: center;
    margin-top: 6px;
    display: none;
}

.status-text.show {
    display: block;
}

/* ===== 消息时间戳 ===== */
.msg-time {
    font-size: 10px;
    text-align: right;
    margin-top: 3px;
    opacity: 0.6;
}

.msg.me .msg-time {
    color: #4a2a1a;
}

.msg.other .msg-time {
    color: #8895b9;
}

/* ===== 输入指示器 ===== */
.msg.typing {
    padding: 8px 14px;
    opacity: 0.8;
    animation: fadeIn 0.3s ease;
}

.typing-dots span {
    display: inline-block;
    animation: dotBounce 1.4s infinite;
    font-weight: 700;
    font-size: 16px;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* ===== 表情选择器 ===== */
.emoji-picker {
    position: absolute;
    bottom: 54px;
    left: 8px;
    background: #12192e;
    border: 1px solid #445071;
    border-radius: 14px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    max-width: 300px;
}

.emoji-item {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}

.emoji-item:hover {
    background: rgba(217, 160, 102, 0.2);
}

.emoji-item:active {
    transform: scale(1.3);
    background: rgba(217, 160, 102, 0.4);
}

/* ===== 好友 & 私聊 ===== */
.friend-bar {
    background: #0d1222;
    border-radius: 12px;
    border: 1px solid #2b385a55;
    padding: 10px;
    margin-bottom: 8px;
}
.friend-bar-header {
    font-size: 13px;
    font-weight: 700;
    color: #8895b9;
    margin-bottom: 8px;
}
.friend-myid {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #5a6a8a;
}
.friend-myid input {
    flex: 1;
    background: #0a0f1a;
    border: 1px solid #2b385a;
    border-radius: 8px;
    padding: 6px 10px;
    color: #d9a066;
    font-size: 11px;
    font-family: monospace;
    min-width: 0;
    cursor: pointer;
}
.fm-copy-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: #2b385a;
    font-size: 14px;
    cursor: pointer;
}
.friend-add {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.friend-add input {
    flex: 1;
    background: #0a0f1a;
    border: 1px solid #2b385a;
    border-radius: 8px;
    padding: 7px 10px;
    color: #f0e3d0;
    font-size: 13px;
    outline: none;
    min-width: 0;
}
.friend-add input:focus { border-color: #4a9e5a; }
.friend-add button {
    padding: 7px 12px;
    border-radius: 8px;
    border: none;
    background: #4a9e5a;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}
.friend-list {
    max-height: 200px;
    overflow-y: auto;
}
.fm-friend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
    font-size: 14px;
    color: #c0c8e0;
    transition: 0.15s;
}
.fm-friend:hover, .fm-friend.active { background: #1a2440; }
.fm-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fm-status.on { background: #22c55e; }
.fm-status.off { background: #5a6a8a; }
.fm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-badge {
    background: #e53935;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}
.fm-empty {
    text-align: center;
    color: #5a6a8a;
    padding: 16px 0;
    font-size: 13px;
}
.fm-empty small { font-size: 11px; color: #3a4a6a; }
.fm-friend.pending, .fm-friend.waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}
.fm-friend.pending { background: #d9a06611; border: 1px solid #d9a06633; color: #d9a066; }
.fm-friend.waiting { color: #5a6a8a; }
.fm-actions { display: flex; gap: 4px; margin-left: auto; }
.fm-accept, .fm-decline {
    width: 28px; height: 28px; border-radius: 50%;
    border: none; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.fm-accept { background: #22c55e22; color: #22c55e; }
.fm-decline { background: #e5393522; color: #e53935; }

/* 私聊面板 */
.dm-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    background: #0d1222;
    overflow: hidden;
}
.dm-panel.hidden { display: none !important; }
.dm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #111827;
    border-bottom: 1px solid #2b385a55;
}
.dm-header span { flex: 1; font-size: 14px; font-weight: 600; color: #f0e3d0; }
.dm-back, .dm-del {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: #2b385a;
    color: #8895b9;
    font-size: 16px;
    cursor: pointer;
}
.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dm-msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.dm-msg.me { align-self: flex-end; background: #d9a066; color: #141c2e; }
.dm-msg.them { align-self: flex-start; background: #2b385a; color: #f0e3d0; }
.dm-time { font-size: 10px; color: #6a7a9a; margin-top: 3px; text-align: right; }
.dm-msg.me .dm-time { color: #5a3a2a; }
.dm-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid #2b385a55;
    background: #0a0f1a;
}
.dm-input-row input {
    flex: 1;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 20px;
    padding: 8px 14px;
    color: #f0e3d0;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.dm-input-row input:focus { border-color: #d9a066; }
.dm-input-row button {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: #d9a066;
    color: #141c2e;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.dm-input-row button:active { transform: scale(0.95); }

/* ===== 聊天室面板 ===== */
.cr-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d1222;
    border-radius: 16px;
    border: 1px solid #2b385a55;
    overflow: hidden;
    margin-bottom: 10px;
}
.cr-panel.hidden { display: none !important; }
.cr-panel.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 3000;
    margin: 0;
    border-radius: 0;
    border: none;
}
.cr-panel.fullscreen .cr-body { flex: 1; }
.cr-fs-btn {
    background: none;
    border: none;
    color: #8895b9;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
}
.cr-fs-btn:hover { color: #d9a066; }
.cr-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #111827;
    border-bottom: 1px solid #2b385a55;
    font-size: 13px;
    color: #aabbdd;
}
.cr-header b { color: #d9a066; }
.cr-leave-btn {
    margin-left: auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: #2b385a;
    color: #8895b9;
    font-size: 14px;
    cursor: pointer;
}
.cr-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}
.cr-sidebar {
    width: 100px;
    background: #0a0f1a;
    border-right: 1px solid #2b385a55;
    padding: 8px;
    overflow-y: auto;
    font-size: 12px;
    color: #8895b9;
}
.cr-user {
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cr-user.me { color: #d9a066; font-weight: 600; }
.cr-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cr-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cr-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.cr-msg.me {
    align-self: flex-end;
    background: #d9a066;
    color: #141c2e;
}
.cr-msg.other {
    align-self: flex-start;
    background: #2b385a;
    color: #f0e3d0;
}
.cr-msg.system {
    align-self: center;
    background: transparent;
    color: #5a6a8a;
    font-size: 12px;
    text-align: center;
    max-width: 100%;
}
.cr-sender { font-size: 11px; color: #8895b9; margin-bottom: 2px; }
.cr-msg.me .cr-sender { color: #4a2a1a; }
.cr-time { font-size: 10px; color: #6a7a9a; text-align: right; margin-top: 2px; }
.cr-msg.me .cr-time { color: #5a3a2a; }
.cr-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid #2b385a55;
    background: #0a0f1a;
}
.cr-input-row input {
    flex: 1;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 20px;
    padding: 8px 14px;
    color: #f0e3d0;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.cr-input-row input:focus { border-color: #d9a066; }
.cr-input-row button {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: #4a9e5a;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cr-input-row button:active { transform: scale(0.95); }

/* ===== 登录页 ===== */
#loginPage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loginPage.hidden {
    display: none !important;
}

.login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 10px;
    gap: 12px;
}

.login-box .logo {
    font-size: 48px;
}

.login-box h2 {
    color: #f7e3c0;
    font-size: 22px;
    font-weight: 600;
}

.login-box .sub {
    color: #8895b9;
    font-size: 13px;
}

.login-box input {
    width: 100%;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 30px;
    padding: 14px 18px;
    color: #f0e3d0;
    font-size: 16px;
    outline: none;
}

.login-box input:focus {
    border-color: #d9a066;
}

.login-box .btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background: #d9a066;
    color: #141c2e;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.login-box .btn-login:active {
    transform: scale(0.97);
}

.login-box .switch {
    color: #8895b9;
    font-size: 13px;
    cursor: pointer;
}

.login-box .switch:active {
    color: #f7e3c0;
}

.login-box .error {
    color: #ff6a5a;
    font-size: 13px;
    background: #3a1a1a;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #ff6a5a44;
    width: 100%;
    text-align: center;
    display: none;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 8px 0 2px;
    border-top: 1px solid #1a244055;
    margin-top: 10px;
}

.bottom-nav .tab {
    background: none;
    border: none;
    color: #5a6a8a;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 12px;
    font-family: inherit;
}

.bottom-nav .tab.active {
    color: #d9a066;
}

.bottom-nav .tab .icon {
    font-size: 20px;
    display: block;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a233bb0;
    backdrop-filter: blur(12px);
    padding: 8px 24px;
    border-radius: 30px;
    color: #f7eada;
    font-size: 16px;
    border: 1px solid #f7d6aa44;
    opacity: 0;
    transition: all 0.35s ease;
    pointer-events: none;
    z-index: 6000;
}

.toast.show {
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* ===== 集市通用 ===== */
.market-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.market-title {
    color: #f7e3c0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.btn-market-action {
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    background: #d9a066;
    color: #141c2e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-market-action:active {
    transform: scale(0.95);
}

.btn-market-action.btn-outline {
    background: transparent;
    border: 1px solid #d9a066;
    color: #d9a066;
}

/* ===== 分类标签 ===== */
.market-categories {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.market-categories::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    flex-shrink: 0;
    padding: 5px 14px;
    border-radius: 16px;
    border: 1px solid #2a3a5a55;
    background: #0d1422;
    color: #8895b9;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.cat-btn.active {
    background: #d9a06622;
    border-color: #d9a06666;
    color: #d9a066;
}

/* ===== 商品网格 ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
    -webkit-overflow-scrolling: touch;
}

.product-grid::-webkit-scrollbar {
    width: 3px;
}

.product-grid::-webkit-scrollbar-thumb {
    background: #2a3a5a;
    border-radius: 3px;
}

.product-card {
    background: #0d1322;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #2a3a5a33;
    cursor: pointer;
    transition: transform 0.15s;
}

.product-card:active {
    transform: scale(0.97);
}

.product-card .card-media {
    aspect-ratio: 1/1;
    background: #1a2440;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card .card-media img,
.product-card .card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .card-media .no-media {
    font-size: 32px;
    color: #445071;
}

.product-card .card-body {
    padding: 8px 10px;
}

.product-card .card-name {
    color: #f0e3d0;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .card-price {
    color: #ffd98c;
    font-size: 15px;
    font-weight: 700;
}

.product-card .card-seller {
    color: #5a6a8a;
    font-size: 10px;
}

.product-card .card-status {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.product-card .card-status.sold {
    background: #3a2a1a;
    color: #c9a04a;
}

.product-card .card-status.mine {
    background: #1a2a3a;
    color: #5a9ac9;
}

.empty-market {
    grid-column: span 2;
    text-align: center;
    color: #5a6a8a;
    font-size: 14px;
    padding: 40px 0;
}

.empty-market span {
    font-size: 12px;
    display: block;
    margin-top: 6px;
}

/* ===== 相机 ===== */
.viewfinder {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 10px;
    aspect-ratio: 4/3;
}

.viewfinder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewfinder-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.capture-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capture-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.5);
}

.capture-btn.btn-stop {
    background: #ff6a5a;
    border-color: #ff6a5a;
}

.media-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.btn-media-upload {
    padding: 12px;
    border-radius: 14px;
    border: 1px dashed #445071;
    background: #0d1322;
    color: #8895b9;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

.btn-media-upload:active {
    background: #1a2440;
    border-color: #d9a066;
    color: #d9a066;
}

.media-preview {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #000;
}

.media-preview img,
.media-preview video {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
}

.btn-remove-media {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 106, 90, 0.8);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.record-timer {
    text-align: center;
    color: #ff6a5a;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    animation: pulse 1s ease-in-out infinite;
}

/* ===== 发布表单 ===== */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-form input,
.product-form textarea {
    width: 100%;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 14px;
    padding: 10px 14px;
    color: #f0e3d0;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.product-form input:focus,
.product-form textarea:focus {
    border-color: #d9a066;
}

.product-form input::placeholder,
.product-form textarea::placeholder {
    color: #5a6a8a;
}

.btn-publish {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: #d9a066;
    color: #141c2e;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.btn-publish:active {
    transform: scale(0.97);
}

.btn-publish:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== 商品详情 ===== */
.detail-media {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    max-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-media img,
.detail-media video {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.detail-name {
    color: #f7e3c0;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-price {
    color: #ffd98c;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-seller {
    color: #8895b9;
    font-size: 13px;
    margin-bottom: 4px;
}

.detail-desc {
    color: #c0c8dd;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.detail-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
}

.detail-status.available {
    background: #1a3a1a;
    color: #5ac95a;
}

.detail-status.sold {
    background: #3a2a1a;
    color: #c9a04a;
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.btn-buy {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: #d9a066;
    color: #141c2e;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-buy:active {
    transform: scale(0.97);
}

.btn-buy:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-ship,
.btn-confirm {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-ship {
    background: #4a8a4a;
    color: #fff;
}

.btn-confirm {
    background: #4a8a4a;
    color: #fff;
}

.btn-ship:active,
.btn-confirm:active {
    transform: scale(0.95);
}

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: #12192e;
    border-radius: 20px;
    padding: 20px;
    width: 85%;
    max-width: 340px;
    border: 1px solid #d9a06644;
}

.modal-title {
    color: #f7e3c0;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.modal-body {
    color: #c0c8dd;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-modal-cancel,
.btn-modal-confirm {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-cancel {
    background: #2b385a;
    color: #c0c8dd;
}

.btn-modal-confirm {
    background: #d9a066;
    color: #141c2e;
}

.btn-modal-cancel:active,
.btn-modal-confirm:active {
    transform: scale(0.95);
}

/* ===== 交易列表 ===== */
.tx-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.tx-tab {
    flex: 1;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid #2a3a5a55;
    background: #0d1422;
    color: #8895b9;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

.tx-tab.active {
    background: #d9a06622;
    border-color: #d9a06666;
    color: #d9a066;
}

.tx-list {
    flex: 1;
    overflow-y: auto;
}

.tx-card {
    background: #0d1322;
    border-radius: 14px;
    padding: 12px;
    border: 1px solid #2a3a5a33;
    margin-bottom: 8px;
}

.tx-card .tx-product {
    color: #f7e3c0;
    font-size: 14px;
    font-weight: 500;
}

.tx-card .tx-amount {
    color: #ffd98c;
    font-size: 15px;
    font-weight: 600;
}

.tx-card .tx-party {
    color: #8895b9;
    font-size: 12px;
}

.tx-card .tx-status {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
}

.tx-card .tx-status.pending {
    background: #3a2a1a;
    color: #c9a04a;
}

.tx-card .tx-status.shipped {
    background: #1a2a3a;
    color: #5a9ac9;
}

.tx-card .tx-status.completed {
    background: #1a3a1a;
    color: #5ac95a;
}

/* ============================================================
   许愿池 v5 新增样式
   ============================================================ */

/* ===== 愿望墙操作按钮 ===== */
.wish-wall-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-pool-sub {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #2a3a5a44;
    background: #0d1422;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.btn-pool-sub:hover {
    border-color: #d9a06666;
    background: #d9a06611;
}

.btn-pool-sub:active {
    transform: scale(0.9);
}

/* ===== 子视图标题栏 ===== */
.pool-sub-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #f7e3c0;
    font-size: 14px;
    font-weight: 600;
}

.btn-pool-back {
    background: none;
    border: 1px solid #2a3a5a55;
    border-radius: 12px;
    color: #8895b9;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-pool-back:hover {
    border-color: #d9a06666;
    color: #d9a066;
}

/* ===== 愿望历史列表 ===== */
.wish-history-list {
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 8px;
}

.wish-history-list::-webkit-scrollbar {
    width: 3px;
}

.wish-history-list::-webkit-scrollbar-thumb {
    background: #2a3a5a;
    border-radius: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 3px 0;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255,255,255,0.04);
}

.history-item:active {
    background: rgba(255,255,255,0.06);
}

.history-emoji {
    font-size: 15px;
    flex-shrink: 0;
}

.history-msg {
    color: #c0c8dd;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-tag {
    font-size: 10px;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}

.history-tier {
    color: #ffd98c;
    font-size: 11px;
    flex-shrink: 0;
}

.history-status {
    font-size: 14px;
    flex-shrink: 0;
}

.history-scoops {
    color: #8895b9;
    font-size: 11px;
    flex-shrink: 0;
}

.history-time {
    color: #5a6a8a;
    font-size: 10px;
    flex-shrink: 0;
}

.wish-history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: #8895b9;
    font-size: 12px;
}

.wish-history-pagination button {
    background: #0d1422;
    border: 1px solid #2a3a5a55;
    border-radius: 12px;
    color: #d9a066;
    padding: 4px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.wish-history-pagination button:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ===== 愿望详情弹窗 ===== */
.wish-detail-card {
    background: #12192e;
    border-radius: 20px;
    padding: 16px;
    width: 88%;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #d9a06644;
    -webkit-overflow-scrolling: touch;
}

.wish-detail-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.wish-detail-close {
    background: none;
    border: none;
    color: #8895b9;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.wish-detail-emoji {
    font-size: 48px;
    text-align: center;
    margin-bottom: 8px;
}

.wish-detail-message {
    color: #f7e3c0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.5;
    font-style: italic;
}

.wish-detail-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.wish-detail-tag {
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
}

.wish-detail-tier {
    color: #ffd98c;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(255,200,80,0.1);
}

.wish-detail-status {
    color: #5ac95a;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(90,200,90,0.1);
}

.wish-detail-info {
    color: #8895b9;
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.8;
}

.wish-detail-info div {
    padding: 2px 0;
}

.wish-detail-label {
    color: #d9a066;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.wish-detail-scoopers {
    margin-bottom: 12px;
}

.scooper-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #c0c8dd;
    font-size: 11px;
    margin: 2px;
}

.wish-detail-comments {
    border-top: 1px solid #2a3a5a33;
    padding-top: 8px;
    margin-bottom: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.comment-item {
    padding: 4px 0;
    font-size: 12px;
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.comment-name {
    color: #d9a066;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-text {
    color: #c0c8dd;
    flex: 1;
}

.comment-time {
    color: #5a6a8a;
    font-size: 10px;
    flex-shrink: 0;
}

.comment-empty {
    color: #5a6a8a;
    font-size: 12px;
    text-align: center;
    padding: 12px 0;
}

.wish-detail-comment-input {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wish-detail-comment-input input {
    flex: 1;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 14px;
    padding: 8px 12px;
    color: #f0e3d0;
    font-size: 13px;
    outline: none;
}

.wish-detail-comment-input input:focus {
    border-color: #d9a066;
}

.wish-detail-comment-input button {
    padding: 8px 14px;
    border-radius: 14px;
    border: none;
    background: #d9a066;
    color: #141c2e;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

/* ===== 愿望档位徽章 ===== */
.wish-tier-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255,200,80,0.1);
    color: #ffd98c;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== 统计面板 ===== */
.wish-stats-container {
    background: #0d1322;
    border-radius: 16px;
    border: 1px solid #2a3a5a44;
    padding: 12px;
}

.stats-section {
    margin-bottom: 14px;
}

.stats-title {
    color: #d9a066;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-bar-label {
    color: #c0c8dd;
    font-size: 11px;
    width: 70px;
    flex-shrink: 0;
    text-align: right;
}

.stat-bar-track {
    flex: 1;
    height: 14px;
    background: #1a2440;
    border-radius: 7px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 2px;
}

.stat-bar-count {
    color: #ffd98c;
    font-size: 11px;
    font-weight: 600;
    width: 28px;
    flex-shrink: 0;
}

.stats-summary {
    display: flex;
    gap: 8px;
}

.stat-card {
    flex: 1;
    background: #1a2440;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid #2a3a5a33;
}

.stat-num {
    color: #f7e3c0;
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    color: #5a6a8a;
    font-size: 10px;
    margin-top: 2px;
}

/* ===== 签到横幅 ===== */
.streak-banner {
    background: linear-gradient(135deg, rgba(255,180,60,0.1), rgba(255,120,20,0.05));
    border: 1px solid rgba(255,180,60,0.2);
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #f7e3c0;
}

.streak-banner b {
    color: #ffd98c;
    font-size: 16px;
}

.streak-bonus {
    color: #5ac95a;
    font-weight: 600;
}

/* ===== 字幕弹出文字 ===== */
.float-wish.echo {
    font-size: 13px;
    color: #f7e3c0;
    text-shadow: 0 0 12px rgba(255,200,120,0.6);
    font-style: italic;
}

/* ===== 动物喂食动画 ===== */
@keyframes heartFloat {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-30px) scale(1.5); opacity: 0; }
}

/* ===== 流星 ===== */
@keyframes shootingStarFlash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ===== 海龙稀有提示 ===== */
@keyframes rareSpawn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   应用模块 v1 — 小程序容器
   ============================================================ */

/* ===== 应用卡片网格 ===== */
.app-grid-header {
    text-align: center;
    margin-bottom: 12px;
}

.app-grid-title {
    color: #f7e3c0;
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.app-grid-sub {
    color: #5a6a8a;
    font-size: 11px;
    margin-top: 2px;
    display: block;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
    -webkit-overflow-scrolling: touch;
}

.app-grid::-webkit-scrollbar {
    width: 3px;
}

.app-grid::-webkit-scrollbar-thumb {
    background: #2a3a5a;
    border-radius: 3px;
}

.app-card {
    background: #0d1322;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #2a3a5a44;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s;
}

.app-card:active {
    transform: scale(0.96);
}

.app-card:hover {
    border-color: #d9a06666;
}

.app-card-icon {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    overflow: hidden;
}

.app-card-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
}

.app-card-body {
    padding: 10px 12px;
}

.app-card-name {
    color: #f0e3d0;
    font-size: 14px;
    font-weight: 600;
}

.app-card-desc {
    color: #5a6a8a;
    font-size: 11px;
    margin-top: 2px;
}

/* ===== 小程序全屏视图 ===== */
#appDetailView {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #f0f2f5;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 8px 8px 0;
}

#appDetailView.hidden {
    display: none !important;
}

.app-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.btn-app-back {
    background: none;
    border: 1px solid #2a3a5a55;
    border-radius: 12px;
    color: #d9a066;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-app-back:hover {
    border-color: #d9a06666;
    background: #d9a06611;
}

.app-detail-title {
    color: #f7e3c0;
    font-size: 15px;
    font-weight: 600;
}

.app-detail-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* ===== 🎴 每日一签 ===== */
.fortune-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    padding: 10px 0;
}

.fortune-barrel {
    font-size: 64px;
    cursor: pointer;
    transition: transform 0.3s;
    animation: barrelSway 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

@keyframes barrelSway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.fortune-barrel:active {
    transform: scale(0.9) rotate(0deg);
    animation: none;
}

.fortune-barrel.shaking {
    animation: barrelShake 0.5s ease-in-out;
}

@keyframes barrelShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.fortune-barrel.disabled {
    animation: none;
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.fortune-card {
    width: 85%;
    max-width: 300px;
    background: linear-gradient(180deg, #fef5e7 0%, #f5e6c8 100%);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: 2px solid #d4a76a;
    position: relative;
    animation: cardFlipIn 0.6s ease;
    color: #3a2a1a;
}

@keyframes cardFlipIn {
    0% { transform: rotateY(90deg) scale(0.8); opacity: 0; }
    100% { transform: rotateY(0) scale(1); opacity: 1; }
}

.fortune-level {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.fortune-level.shangshang { color: #d4380d; }
.fortune-level.shang { color: #e8780a; }
.fortune-level.zhong { color: #5a7a3a; }
.fortune-level.xia { color: #4a6a8a; }

.fortune-poem {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.6;
    color: #2a1a0a;
}

.fortune-desc {
    font-size: 13px;
    color: #5a3a1a;
    line-height: 1.7;
    border-top: 1px dashed #d4a76a88;
    padding-top: 10px;
    margin-top: 6px;
}

.fortune-hint {
    color: #5a6a8a;
    font-size: 13px;
}

/* ============================================================
   电话会议 v1 — WebRTC 多人音频通话
   ============================================================ */

/* ===== 会议入口栏 ===== */
.conference-bar {
    margin-bottom: 8px;
    padding: 6px;
    background: #0d1322;
    border-radius: 14px;
    border: 1px solid #2a3a5a44;
}
/* 会议/聊天室两行对称布局 */
.conference-join-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.conference-join-row input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #2b385a44;
    border-radius: 10px;
    background: #0d1222;
    color: #aabbdd;
    font-size: 12px;
    outline: none;
}
.btn-cr-create {
    padding: 7px 12px;
    border-radius: 18px;
    border: none;
    background: #4a9e5a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    min-width: 104px;
}
.btn-cr-join {
    padding: 7px 12px;
    border-radius: 18px;
    border: 1px solid #4a9e5a66;
    background: #4a9e5a11;
    color: #7cc47c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.conf-mode-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.conf-mode-row.hidden {
    display: none !important;
}

.conf-input {
    flex: 1;
    min-width: 0;
    background: #0d1422;
    border: 1px solid #445071;
    border-radius: 20px;
    padding: 7px 10px;
    color: #f0e3d0;
    font-size: 12px;
    outline: none;
    text-align: center;
    letter-spacing: 2px;
    font-family: inherit;
}
.conf-input:focus { border-color: #d9a066; }
.conf-input::placeholder { color: #5a6a8a; letter-spacing: 1px; }

.conf-switch-btn {
    padding: 6px 10px;
    border-radius: 14px;
    border: 1px solid #2a3a5a66;
    background: transparent;
    color: #8895b9;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.conf-switch-btn:active { background: #d9a06622; color: #d9a066; }


.btn-conference-create {
    padding: 7px 12px;
    border-radius: 18px;
    border: none;
    background: #4a8a4a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    min-width: 104px;
    flex-shrink: 0;
}
.btn-conference-create:active { transform: scale(0.95); }
.btn-conference-create.in-room { background: #5a9ac9; }

.btn-conference-join {
    padding: 7px 12px;
    border-radius: 18px;
    border: 1px solid #d9a06666;
    background: #d9a06611;
    color: #d9a066;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-conference-join:active { transform: scale(0.95); }

/* ===== 全屏会议界面 ===== */
#conferenceView {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #0b0e1a;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

#conferenceView.hidden { display: none !important; }

.conf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a3a5a33;
}

.conf-title {
    color: #f7e3c0;
    font-size: 18px;
    font-weight: 700;
}

.conf-room-info {
    color: #8895b9;
    font-size: 12px;
}
.conf-room-info b {
    color: #ffd98c;
    font-size: 15px;
    letter-spacing: 2px;
}

/* ===== 参与者卡片 ===== */
.conf-participants {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    align-content: center;
}

.conf-card {
    width: 100px;
    padding: 12px 8px;
    background: #12192e;
    border-radius: 16px;
    border: 2px solid #2a3a5a44;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
}

.conf-card.self {
    border-color: rgba(217,160,102,0.6);
    box-shadow: 0 0 12px rgba(217,160,102,0.1);
}

.conf-card.speaking {
    border-color: rgba(90,200,90,0.7);
    box-shadow: 0 0 20px rgba(90,200,90,0.25);
    animation: speakingPulse 0.8s ease-in-out infinite;
}

@keyframes speakingPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(90,200,90,0.2); }
    50% { box-shadow: 0 0 28px rgba(90,200,90,0.4); }
}

.conf-card.empty {
    border-style: dashed;
    border-color: #2a3a5a33;
    opacity: 0.5;
}

.conf-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.conf-name {
    color: #c0c8dd;
    font-size: 11px;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conf-self-tag {
    color: #d9a066;
    font-size: 9px;
}

.conf-empty-text {
    color: #5a6a8a;
    font-size: 10px;
}

.conf-mute-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 12px;
    display: none;
}

.conf-card.muted .conf-mute-icon {
    display: block;
}

.conf-card.muted .conf-avatar {
    opacity: 0.5;
}

/* 音量条 */
.conf-meter {
    width: 60px;
    height: 4px;
    background: #1a2440;
    border-radius: 2px;
    overflow: hidden;
}

.conf-meter-fill {
    height: 100%;
    background: #5ac95a;
    border-radius: 2px;
    transition: width 0.1s;
    width: 0%;
}

/* ===== 底部控制栏 ===== */
.conf-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px 0 8px;
    border-top: 1px solid #2a3a5a33;
    margin-top: 10px;
}

.conf-ctrl-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #445071;
    background: #1a2440;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.conf-ctrl-btn:active { transform: scale(0.9); }

.conf-ctrl-btn.muted {
    background: #ff6a5a;
    border-color: #ff6a5a;
    color: #fff;
}

.conf-ctrl-btn.speaker-off {
    background: #3a3a4a;
    border-color: #5a5a6a;
    opacity: 0.6;
}

.conf-hangup {
    background: #ff3b30;
    border-color: #ff3b30;
    color: #fff;
    width: 64px;
    height: 64px;
    font-size: 26px;
}

/* ===== 实时翻译：按钮激活态 + 字幕框 ===== */
.conf-ctrl-btn.translate-on {
    background: #2f6fbf;
    border-color: #2f6fbf;
    color: #fff;
}

/* 字幕框上方的「听成什么语言」选择条（每人自己选） */
.conf-sub-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(20, 30, 55, 0.92);
    border: 1px solid #2a3a5a66;
    border-radius: 12px;
    margin-bottom: 6px;
}

.conf-sub-bar.hidden { display: none !important; }

.conf-sub-bar-label {
    font-size: 13px;
    color: #9fb4d8;
    white-space: nowrap;
}

.conf-sub-bar select {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    font-size: 14px;
    color: #e8eefc;
    background: #16233d;
    border: 1px solid #2f6fbf;
    border-radius: 8px;
    outline: none;
}

/* 待翻译的原文（灰），译文回来会替换掉 */
.conf-sub-pending {
    opacity: 0.55;
}

.conf-subtitles {
    max-height: 28vh;
    overflow-y: auto;
    background: rgba(8, 12, 24, 0.85);
    border: 1px solid #2a3a5a66;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.conf-subtitles.hidden { display: none !important; }

.conf-sub-line {
    font-size: 14px;
    line-height: 1.5;
    color: #e8eefc;
    word-break: break-word;
}

.conf-sub-name {
    color: #ffd98c;
    font-weight: 600;
    margin-right: 6px;
}

/* ============================================================
   PWA standalone 适配 (safe-area-inset)
   ============================================================ */
@media (display-mode: standalone) {
    body {
        padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
                 calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    }
    .app {
        height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
    .bottom-nav { padding-bottom: calc(2px + env(safe-area-inset-bottom)); }
    #conferenceView {
        padding-top: calc(16px + env(safe-area-inset-top));
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    .dm-panel { padding-bottom: env(safe-area-inset-bottom); }
    #appDetailView { padding-bottom: env(safe-area-inset-bottom); }
}

/* 隐藏浏览器滚动条（移动端手势滚动保留；右侧细灰线元凶） */
::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
