/* 左上角红包图标 */
.envelope-corner {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
    min-width: 0;
}
.envelope-corner .envelope-icon {
    display: inline-flex;
    align-items: center;
    background: rgba(233, 69, 96, 0.18);
    border-radius: 8px;
    padding: 4px 10px 4px 6px;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(233,69,96,0.05);
    border: 1px dashed rgba(233, 69, 96, 0.25);
    max-width: 220px;
}
.envelope-corner .icon-img {
    font-size: 18px;
    margin-right: 6px;
}
.envelope-corner .icon-name {
    margin-right: 8px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    display: inline-block;
}
.envelope-corner .grab-btn.mini {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 6px;
    margin-left: 2px;
    background: #e94560;
    color: #fff;
    border: none;
    cursor: pointer;
}
.envelope-corner .grab-btn.mini:hover { background: #ff6b6b; }
.envelope-corner .grab-btn.mini:disabled { opacity: 0.6; cursor: not-allowed; }
/* 悄悄话 - 风格参考 only.chageidc.cn 迎春节 */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #eee;
}

.admin-entry {
    position: fixed;
    top: 8px;
    right: 12px;
    width: 24px;
    height: 24px;
    font-size: 18px;
    color: rgba(255,255,255,0.25);
    text-decoration: none;
    z-index: 9999;
    transition: color 0.2s;
}
.admin-entry:hover { color: rgba(255,255,255,0.5); }

/* 昵称层 */
.layer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.layer-box {
    background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border: 1px solid rgba(233, 69, 96, 0.2);
}
.layer-box h1, .layer-box h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    text-align: center;
    color: #fff;
}
.intro, .slogan {
    margin: 0 0 1.5rem;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    text-align: center;
}
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.form-row input[type="text"],
.form-row input[type="number"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #0f3460;
    border-radius: 10px;
    background: #0f3460;
    color: #eee;
    font-size: 15px;
}
.form-row input::placeholder { color: rgba(255,255,255,0.4); }
.form-row button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: #e94560;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
}
.form-row button:hover { background: #ff6b6b; }
.tip { margin: 0; font-size: 13px; color: #e94560; min-height: 18px; }
.tip.ok { color: #4ecca3; }

.hidden { display: none !important; }

/* 主界面 */
#main-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
    padding-top: 48px;
}
.header {
    text-align: center;
    margin-bottom: 1rem;
}
.header h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.slogan { margin: 0 0 1rem; font-size: 14px; }
.user-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.my-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    vertical-align: middle;
}
.balance { color: rgba(255,255,255,0.9); }
.balance strong { color: #4ecca3; }
.btn-red {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: #e94560;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.btn-red:hover { background: #ff6b6b; }
.btn-red:disabled { opacity: 0.6; cursor: not-allowed; }

.chat-wrap {
    background: rgba(22, 33, 62, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(233, 69, 96, 0.15);
    overflow: hidden;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 320px;
    max-height: 55vh;
}
.msg-item {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: flex-start;
}
.msg-item .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
}
.msg-item .body { flex: 1; min-width: 0; }
.msg-item .name { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 2px; }
.msg-item .content { word-break: break-word; line-height: 1.5; }
.msg-item .content img { max-width: 100%; max-height: 200px; border-radius: 8px; }
.msg-item .time { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px; }


/* 聊天红包图标样式 */
.envelope-icon {
    display: inline-flex;
    align-items: center;
    background: rgba(233, 69, 96, 0.18);
    border-radius: 8px;
    padding: 4px 10px 4px 6px;
    margin: 4px 0;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(233,69,96,0.05);
    border: 1px dashed rgba(233, 69, 96, 0.25);
    max-width: 220px;
}
.envelope-icon .icon-img {
    font-size: 18px;
    margin-right: 6px;
}
.envelope-icon .icon-name {
    margin-right: 8px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    display: inline-block;
}
.envelope-icon .grab-btn.mini {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 6px;
    margin-left: 2px;
    background: #e94560;
    color: #fff;
    border: none;
    cursor: pointer;
}
.envelope-icon .grab-btn.mini:hover { background: #ff6b6b; }
.envelope-icon .grab-btn.mini:disabled { opacity: 0.6; cursor: not-allowed; }

.envelope-result {
    padding: 10px 14px;
    background: rgba(78, 204, 163, 0.15);
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 13px;
    color: #4ecca3;
}
.envelope-result .best { color: #ffd700; }
.envelope-result .worst { color: rgba(255,255,255,0.6); }
.envelope-result-small {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
}

.chat-input-wrap {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
#msg-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #0f3460;
    border-radius: 10px;
    background: #0f3460;
    color: #eee;
    font-size: 14px;
}
.upload-btn {
    padding: 10px 14px;
    background: #0f3460;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
}
#send-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: #e94560;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
#send-btn:hover { background: #ff6b6b; }
#send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.rate-tip { margin: 6px 0 0; font-size: 12px; color: rgba(255,255,255,0.5); }
.preview-wrap { margin-top: 8px; }
.preview-wrap img { max-width: 120px; max-height: 120px; border-radius: 8px; }

.envelope-box .form-row input { flex: 1; }
.envelope-box .form-row button { flex: 1; }
#envelope-cancel { background: #0f3460; }
#envelope-cancel:hover { background: #1a1a2e; }
