/* ========== 会员端通用 ========== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #111;
    background: #ededed;
    -webkit-font-smoothing: antialiased;
}
a { color: #1677ff; text-decoration: none; }
img { max-width: 100%; }

/* ========== 聊天窗口 ========== */
.chat-page {
    height: 100vh;
    height: 100dvh;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #ededed;
    position: relative;
    overflow: hidden;
}
.chat-header {
    flex: 0 0 auto;
    height: 50px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    padding: 0 6px;
    position: relative;
    z-index: 10;
}
.icon-btn {
    width: 40px; height: 40px;
    border: 0; background: transparent;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #111; padding: 0;
}
.back-btn { font-size: 26px; line-height: 1; }
.chat-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px 18px;
}
.time-divider {
    text-align: center;
    color: #b2b2b2;
    font-size: 12px;
    margin: 10px 0 16px;
}
.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}
.msg-row.right { flex-direction: row-reverse; }
.avatar {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #d9d9d9;
    flex: 0 0 auto;
}
.bubble {
    max-width: 70%;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .02);
}
.msg-row.right .bubble { background: #95ec69; }
.image-msg { padding: 0; background: transparent !important; box-shadow: none; }
.image-msg img {
    display: block;
    width: 200px;
    max-width: 60vw;
    border-radius: 6px;
}
.system-msg {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 6px 0 16px;
    padding: 0 20px;
}
.system-msg span {
    display: inline-block;
    background: rgba(0, 0, 0, .05);
    border-radius: 4px;
    padding: 3px 8px;
    line-height: 1.4;
}

/* 转账卡片 */
.transfer-card {
    width: 268px;
    max-width: 74vw;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    transition: transform .12s ease, box-shadow .12s ease;
}
.transfer-card:active { transform: scale(.985); }
.tc-main { padding-right: 64px; min-height: 54px; }
.tc-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: #111;
}
.tc-title .amount { font-weight: 700; }
.tc-sub {
    font-size: 12px;
    color: #9a9a9a;
    margin-top: 5px;
    line-height: 1.4;
    word-break: break-all;
}
.tc-foot {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 11px;
    font-size: 12px;
    color: #8a8a8a;
}
.tc-foot img { width: 14px; height: 14px; display: block; }
.tc-logo {
    position: absolute;
    top: 12px; right: 12px;
    width: 54px; height: 54px;
    border-radius: 10px;
    overflow: hidden;
}
.tc-logo img { width: 100%; height: 100%; display: block; }
.tc-badge {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: 1px;
    background: #e8f1ff;
    color: #1677ff;
    font-weight: 500;
}
.tc-badge.ok { background: #e8f7ee; color: #0a9f4d; }
.tc-badge.danger { background: #fff1f0; color: #d4380d; }

/* 底部输入区 */
.chat-bottom {
    flex: 0 0 auto;
    background: #f7f7f7;
    border-top: 1px solid #e5e5e5;
    padding: 9px 10px 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border-radius: 9px;
    padding: 4px 8px;
    min-height: 42px;
}
.voice-btn { width: 30px; height: 30px; border: 0; background: none; font-size: 19px; color: #555; cursor: pointer; padding: 0; }
.chat-input {
    flex: 1;
    border: 0; outline: 0;
    font-size: 15px;
    background: transparent;
    padding: 7px 0;
    min-width: 0;
}
.chat-input::placeholder { color: #b0b0b0; }
.emoji-btn, .plus-btn { width: 30px; height: 30px; border: 0; background: none; font-size: 21px; color: #555; cursor: pointer; padding: 0; }
.tool-grid {
    display: flex;
    justify-content: space-around;
    padding: 9px 6px 2px;
}
.tool-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    border: 0; background: none; padding: 0; cursor: pointer;
    color: #5f6368; font-size: 11px;
}
.tool-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.tool-icon svg { width: 22px; height: 22px; }
.emoji-panel {
    display: none;
    background: #fff;
    border-radius: 9px;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 22px;
    letter-spacing: 8px;
    line-height: 1.6;
    cursor: pointer;
    user-select: none;
}
.emoji-panel.show { display: block; }
.chat-menu {
    position: absolute;
    top: 46px; right: 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
    padding: 4px 0;
    display: none;
    z-index: 30;
    min-width: 120px;
}
.chat-menu.show { display: block; }
.chat-menu a { display: block; padding: 11px 18px; color: #333; font-size: 14px; }
.chat-menu a:last-child { color: #d4380d; border-top: 1px solid #f0f0f0; }
.toast {
    position: fixed;
    left: 50%; bottom: 150px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 13px;
    padding: 9px 15px;
    border-radius: 18px;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    max-width: 80vw;
    text-align: center;
}
.toast.show { opacity: 1; }

/* ========== 登录 / 注册 ========== */
.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: linear-gradient(180deg, #e8f1ff 0%, #f5f7fa 42%, #f5f7fa 100%);
}
.auth-card {
    width: 100%;
    max-width: 370px;
    background: #fff;
    border-radius: 18px;
    padding: 30px 24px 24px;
    box-shadow: 0 12px 40px rgba(23, 105, 220, .12);
}
.auth-logo {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: #1677ff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.auth-logo img { width: 40px; height: 40px; }
.auth-card h1 { font-size: 21px; margin: 0 0 6px; font-weight: 700; letter-spacing: .3px; }
.auth-sub { font-size: 13px; color: #8a8f99; margin: 0 0 4px; }
.alert {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #d4380d;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 14px;
    line-height: 1.5;
}
.field { margin-top: 15px; }
.field label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.field input {
    width: 100%;
    height: 45px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    padding: 0 13px;
    font-size: 15px;
    outline: none;
    background: #fbfcfe;
    transition: border-color .15s;
}
.field input:focus { border-color: #1677ff; background: #fff; }
.btn-primary {
    width: 100%;
    height: 47px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #1677ff, #0b63e5);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(22, 119, 255, .25);
}
.btn-primary:active { opacity: .92; }
.btn-primary[disabled] { opacity: .6; cursor: not-allowed; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; color: #8a8f99; }
.auth-links a { color: #1677ff; font-weight: 500; }

/* ========== 领取页 ========== */
.claim-body {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f2f4f8;
    padding: 0 0 30px;
}
.claim-header {
    height: 50px;
    background: #fff;
    display: flex; align-items: center;
    padding: 0 6px;
    border-bottom: 1px solid #eee;
}
.claim-wrap { max-width: 420px; margin: 0 auto; padding: 18px 16px; }
.claim-card {
    border-radius: 18px;
    background: linear-gradient(135deg, #1677ff 0%, #0a53d6 100%);
    color: #fff;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(22, 119, 255, .24);
    position: relative;
    overflow: hidden;
}
.claim-card::after {
    content: "";
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    right: -50px; top: -60px;
}
.claim-from { font-size: 13px; opacity: .85; }
.claim-amount { font-size: 42px; font-weight: 800; margin: 12px 0 4px; letter-spacing: .5px; }
.claim-amount span { font-size: 24px; font-weight: 600; margin-right: 2px; }
.claim-title { font-size: 13px; opacity: .86; }
.claim-status { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.18); margin-top: 12px; }
.claim-form { background: #fff; border-radius: 16px; padding: 18px; margin-top: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.04); }
.claim-form h3 { margin: 0 0 6px; font-size: 16px; }
.claim-hint { font-size: 12px; color: #8a8f99; line-height: 1.6; margin: 0 0 10px; }
.claim-form .field { margin-top: 12px; }
.claim-form .btn-primary { margin-top: 18px; }
.claim-alert {
    background: #fff7e6; border: 1px solid #ffe0a3; color: #ad6800;
    padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.6; margin-top: 14px;
}
.claim-error {
    background: #fff2f0; border: 1px solid #ffccc7; color: #d4380d;
    padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-top: 12px; line-height: 1.6;
}
.claim-success { text-align: center; padding: 26px 18px; background: #fff; border-radius: 16px; margin-top: 16px; }
.success-icon {
    width: 62px; height: 62px; border-radius: 50%;
    background: #e8f7ee; color: #0a9f4d;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; margin: 0 auto 14px;
}
.claim-success h3 { margin: 0 0 6px; font-size: 18px; }
.claim-success p { margin: 0; color: #8a8f99; font-size: 13px; }
.claim-actions { text-align: center; margin-top: 18px; }
.claim-actions a { display: inline-block; padding: 11px 28px; background: #1677ff; color: #fff; border-radius: 10px; font-size: 14px; font-weight: 500; }
.claim-note { font-size: 12px; color: #9aa0a6; line-height: 1.7; margin-top: 16px; text-align: center; }

/* ========== 个人中心 ========== */
.profile-body { min-height: 100vh; min-height: 100dvh; background: #f2f4f8; }
.profile-header { height: 50px; background: #fff; display: flex; align-items: center; padding: 0 6px; border-bottom: 1px solid #eee; }
.profile-header .chat-title { font-size: 17px; }
.profile-wrap { max-width: 440px; margin: 0 auto; padding: 16px; }
.profile-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 6px 20px rgba(0,0,0,.04); }
.profile-avatar { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.profile-avatar img { width: 62px; height: 62px; border-radius: 14px; object-fit: cover; background: #e5e7eb; }
.avatar-tip { font-size: 12px; color: #8a8f99; }
.profile-form .field { margin-top: 14px; }
.profile-form .btn-primary { margin-top: 22px; }
.profile-logout { text-align: center; margin-top: 18px; }
.profile-logout a { color: #d4380d; font-size: 14px; }
.section-title { font-size: 13px; color: #8a8f99; margin: 20px 0 8px; }

@media (min-width: 640px) {
    .chat-page { box-shadow: 0 0 40px rgba(0, 0, 0, .06); }
}
