/* 企业匿名吐槽群 - WAP 样式系统 */
:root {
    --primary: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-dark: #4338CA;
    --bg-main: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #E2E8F0;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    height: 100dvh;
    overflow: hidden;
}

/* WAP 手机容器 */
.wap-container {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* 顶部导航 */
.wap-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    flex-shrink: 0;
}

.header-title-box {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.online-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #ECFDF5;
    color: #059669;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 600;
}

.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10B981;
    animation: pulse 2s infinite;
}

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

.persona-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

/* 消息滚动区 */
.chat-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.history-banner {
    text-align: center;
    margin: 4px 0 8px;
}

.history-btn {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 消息气泡 */
.msg-item {
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.msg-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: calc(100% - 48px);
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.msg-author {
    font-weight: 600;
    color: #374151;
}

.msg-time {
    color: #9CA3AF;
    font-size: 10px;
}

.msg-official-badge {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

/* 引用预览框 */
.quote-box {
    background-color: #F3F4F6;
    border-left: 3px solid #9CA3AF;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #4B5563;
    margin-bottom: 6px;
    max-width: 100%;
    word-break: break-all;
}

.quote-author {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    margin-bottom: 2px;
}

.msg-bubble {
    background-color: #FFFFFF;
    color: #1F2937;
    padding: 9px 13px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 14.5px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(229, 231, 235, 0.8);
    position: relative;
}

/* 自己发的消息稍微强调 */
.msg-item.is-me {
    flex-direction: row-reverse;
}

.msg-item.is-me .msg-body {
    align-items: flex-end;
}

.msg-item.is-me .msg-bubble {
    background-color: #4F46E5;
    color: #FFFFFF;
    border-top-left-radius: 12px;
    border-top-right-radius: 2px;
    border: none;
}

.msg-item.is-me .quote-box {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #FFFFFF;
    color: #E0E7FF;
}

.msg-item.is-me .quote-author {
    color: #FEF08A;
}

/* 图片气泡 */
.msg-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* 表情包气泡 */
.msg-sticker {
    max-width: 130px;
    max-height: 130px;
    display: block;
}

/* 消息互动条 (点赞、引用) */
.msg-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    padding: 0 4px;
}

.action-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: color 0.15s;
}

.action-btn:active {
    transform: scale(0.92);
}

.action-btn.has-liked {
    color: #EF4444;
    font-weight: 600;
}

/* 底部输入区 */
.chat-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    padding: 8px 10px calc(var(--safe-bottom) + 8px);
    display: flex;
    flex-direction: column;
    z-index: 30;
    flex-shrink: 0;
}

/* 正在引用的条幅 */
.active-quote-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #F3F4F6;
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #4B5563;
}

.quote-cancel-btn {
    border: none;
    background: none;
    color: #9CA3AF;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

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

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #F3F4F6;
    color: #4B5563;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.tool-btn:active {
    background-color: #E5E7EB;
}

.chat-input {
    flex: 1;
    min-height: 36px;
    max-height: 90px;
    padding: 8px 12px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background-color: #F9FAFB;
    font-size: 14.5px;
    line-height: 1.4;
    outline: none;
    resize: none;
    font-family: inherit;
}

.chat-input:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
}

.send-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: none;
    background-color: var(--primary);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 表情与 Sticker 面板 */
.sticker-panel {
    border-top: 1px solid var(--border-color);
    background-color: #F9FAFB;
    padding: 10px;
    max-height: 210px;
    overflow-y: auto;
    display: none;
}

.sticker-panel.show {
    display: block;
}

.sticker-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 6px;
}

.sticker-tab-btn {
    border: none;
    background: none;
    font-size: 13px;
    color: #6B7280;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
}

.sticker-tab-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    text-align: center;
}

.emoji-btn {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.emoji-btn:active {
    background-color: #E5E7EB;
}

.meme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.meme-card {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.meme-card:active {
    transform: scale(0.95);
    background-color: #F3F4F6;
}

.meme-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 2px;
}

.meme-label {
    font-size: 11px;
    color: #374151;
    font-weight: 600;
}

/* 验证入口弹层/视图 */
.entry-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.entry-card {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.entry-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: #FFFFFF;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.entry-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.entry-desc {
    font-size: 13px;
    color: #6B7280;
    margin-top: 4px;
    margin-bottom: 18px;
}

.code-input-box {
    width: 100%;
    position: relative;
    margin-bottom: 14px;
}

.code-input {
    width: 100%;
    height: 48px;
    background-color: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
    font-family: monospace, sans-serif;
}

.code-input:focus {
    border-color: var(--primary);
    background-color: #FFFFFF;
}

.entry-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #4F46E5, #4338CA);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transition: opacity 0.15s;
}

.entry-btn:active {
    opacity: 0.9;
}

.privacy-notice {
    margin-top: 18px;
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    font-size: 11.5px;
    color: #64748B;
    line-height: 1.5;
}

.privacy-item {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 4px;
}

.privacy-item:last-child {
    margin-bottom: 0;
}

/* 图片大图预览 Modal */
.image-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.image-modal.show {
    display: flex;
}

.modal-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 6px;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #FFFFFF;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
}

/* Toast 提示 */
.toast-msg {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(17, 24, 39, 0.85);
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 150;
    pointer-events: none;
    animation: fadeInOut 2.5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -10px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}
