/* 
 * 火种协议聊天助手 - 极简主义设计
 */

:root {
    --primary-color: #fe3c72;
    --primary-gradient: linear-gradient(262deg, #ff7854 0%, #fd267d 100%);
    --bg-main: #f8fafc;
    --sidebar-width: 300px;
    --detail-width: 280px;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, sans-serif; }
body { height: 100vh; background: var(--bg-main); overflow: hidden; }
.app-container { display: flex; height: 100%; }

/* 侧边栏 */
.sidebar { width: var(--sidebar-width); background: white; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
.sidebar-tabs-main { display: flex; background: #f1f5f9; padding: 5px; margin: 15px; border-radius: 10px; }
.tab-main { flex: 1; text-align: center; padding: 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: 8px; transition: all 0.2s; }
.tab-main.active { background: white; color: var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

.sidebar-view { flex: 1; overflow-y: auto; padding: 0 10px; }
.sidebar-action-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.add-mini-btn { border: none; background: var(--primary-gradient); color: white; width: 24px;    height: 24px;
    border-radius: 6px;
    cursor: pointer;
}

/* 发现卡片容器 */
.discovery-card-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.swipe-card {
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.swipe-photo-area {
    flex: 1;
    position: relative;
    background: #eee;
}

.swipe-photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swipe-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.swipe-info-overlay h2 { font-size: 24px; margin-bottom: 5px; }
.swipe-info-overlay p { font-size: 14px; opacity: 0.9; }

.swipe-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.swipe-badge {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.swipe-actions {
    padding: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.swipe-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.swipe-btn:hover { transform: scale(1.1); }
.swipe-btn.nope { border-color: #f1f5f9; color: #ff4458; }
.swipe-btn.super { border-color: #f1f5f9; color: #3ca4ff; width: 44px; height: 44px; font-size: 16px; }
.swipe-btn.like { border-color: #f1f5f9; color: #1be4a1; }

/* 列表项 */
.account-item-simple { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; transition: 0.2s; margin-bottom: 5px; }
.account-item-simple:hover { background: #f1f5f9; }
.account-item-simple.active { background: #fff1f4; }

/* 匹配按钮样式 */
.acc-swipe-btn:hover { background: var(--primary-gradient); color: white; transform: scale(1.1); }

/* 按钮组容器修复 */
.acc-action-btns {
    display: flex;
    gap: 8px;
    margin-left: auto; /* 推到最右侧 */
}
.acc-action-btns button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.acc-action-btns button:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
.acc-swipe-btn:hover {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
}

/* 未读提醒样式 */
.unread-badge {
    position: absolute;
    left: 45px;
    top: 5px;
    background: #ff4458;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 10;
}
.unread-dot {
    width: 10px;
    height: 10px;
    background: #ff4458;
    border-radius: 50%;
    margin-left: 10px;
    box-shadow: 0 0 0 2px white;
}
.account-item-simple.has-unread {
    background: #fff5f7;
}

/* 滑动卡片样式 - 弹窗适配版 */
.swipe-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease-out;
    z-index: 2;
}
.swipe-card.animate-like {
    transform: translateX(120%) rotate(15deg) !important;
    opacity: 0 !important;
}
.swipe-card.animate-pass {
    transform: translateX(-120%) rotate(-15deg) !important;
    opacity: 0 !important;
}
/* 第二张卡片的样式（背景卡片） */
.swipe-card:nth-child(2) {
    transform: translateY(10px) scale(0.92);
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
}
/* 第三张及以后的卡片彻底隐藏 */
.swipe-card:nth-child(n+3) {
    display: none;
}
#swipe-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.swipe-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 15px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: white;
    pointer-events: none;
}
.swipe-name-age { font-size: 22px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.swipe-distance { font-size: 13px; opacity: 0.9; margin: 3px 0; }
.swipe-interests { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.interest-tag { background: rgba(255,255,255,0.2); padding: 3px 8px; border-radius: 10px; font-size: 11px; }

.swipe-actions {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    z-index: 100;
}
.action-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.action-circle:hover { transform: scale(1.1); }
.action-circle.nope { color: #ff4458; }
.action-circle.like { color: #1be4a1; }
.action-circle.like { background: white; color: #4caf50; }
.action-circle:active { transform: scale(0.9); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-color); }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; font-size: 14px; }
.last-msg { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer-simple { padding: 15px; border-top: 1px solid var(--border-color); }
.mini-profile { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.mini-profile img { width: 32px; height: 32px; border-radius: 50%; background: #eee; }

/* 聊天主区 */
.chat-main { flex: 1; display: flex; flex-direction: column; background: white; }
.chat-header { padding: 15px 25px; border-bottom: 1px solid var(--border-color); }
.chat-header-info h2 { font-size: 18px; }
.chat-header-info span { font-size: 12px; color: var(--text-muted); }

.chat-header-info span { font-size: 12px; color: var(--text-muted); }

.messages { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    background: #f8fafc; 
    scroll-behavior: smooth;
}
.message { display: flex; }
.message.incoming { justify-content: flex-start; }
.message.outgoing { justify-content: flex-end; }
.message-bubble { padding: 12px 18px; border-radius: 18px; max-width: 70%; font-size: 14px; line-height: 1.4; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.message.incoming .message-bubble { background: white; color: var(--text-main); border-bottom-left-radius: 4px; }
.message.outgoing .message-bubble { background: var(--primary-gradient); color: white; border-bottom-right-radius: 4px; }

/* 发送中状态 */
.message.sending .message-bubble {
    opacity: 0.7;
    position: relative;
    padding-right: 35px; /* 为转圈留出空间 */
}
.sending-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.8;
}
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}
.message.sending {
    animation: pulse 1.5s infinite ease-in-out;
}

.input-area { padding: 15px 20px; background: white; border-top: 1px solid var(--border-color); }
.input-wrapper { display: flex; gap: 12px; align-items: center; }
.chat-input { flex: 1; padding: 12px 20px; border: 1px solid var(--border-color); border-radius: 25px; outline: none; font-size: 14px; background: #f8fafc; transition: 0.2s; }
.chat-input:focus { background: white; border-color: #fe3c72; }
#send-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--primary-gradient); color: white; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 16px; transition: 0.2s; box-shadow: 0 4px 10px rgba(254, 60, 114, 0.3); }
#send-btn:hover { transform: scale(1.05); box-shadow: 0 6px 15px rgba(254, 60, 114, 0.4); }

/* 账号仪表盘 */
.account-dashboard { max-width: 900px; margin: 0 auto; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.dash-card { background: #f8f9fa; padding: 20px; border-radius: 15px; border: 1px solid #eee; }
.dash-card h3 { font-size: 14px; color: #fd3a73; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.info-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.info-row label { color: #64748b; }
.info-row span { font-weight: 600; color: #1e293b; }
.token-box { background: #1e293b; color: #cbd5e1; padding: 15px; border-radius: 10px; font-family: monospace; font-size: 11px; word-break: break-all; margin-top: 5px; }
.status-tag { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }

/* 资料面板 & 照片浏览器 */
.detail-pane { width: var(--detail-width); background: white; border-left: 1px solid var(--border-color); overflow-y: auto; }
.profile-photo-wrapper { position: relative; width: 100%; height: 320px; background: #000; overflow: hidden; }
.profile-photo { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s; }

.photo-nav-prev, .photo-nav-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; background: rgba(0,0,0,0.3); color: white;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%; cursor: pointer; opacity: 0; transition: 0.3s;
}
.profile-photo-wrapper:hover .photo-nav-prev, .profile-photo-wrapper:hover .photo-nav-next { opacity: 1; }
.photo-nav-prev { left: 10px; } .photo-nav-next { right: 10px; }
.photo-counter { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.5); color: white; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

.profile-content { padding: 20px; }
.profile-content h1 { font-size: 20px; margin-bottom: 5px; }
.profile-section h3 { font-size: 14px; margin: 15px 0 8px; color: var(--text-main); }
.profile-bio { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* 弹窗 */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); display: none; justify-content: center; align-items: center; z-index: 100; }
.modal.show { display: flex; }
.modal-content { background: white; width: 400px; border-radius: 12px; padding: 20px; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; outline: none; }
.btn { width: 100%; padding: 10px; border-radius: 8px; cursor: pointer; border: none; font-weight: 600; margin-top: 10px; }
.btn-primary { background: var(--primary-gradient); color: white; }
.btn-secondary { background: #f1f5f9; color: #475569; }

/* Custom Sliders */
.slider-container { position: relative; width: 100%; }
.tinder-slider { -webkit-appearance: none; width: 100%; height: 4px; background: #cbd5e1; border-radius: 2px; outline: none; }
.tinder-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fe3c72; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.dual-slider-container { position: relative; width: 100%; height: 30px; }
.slider-track { position: absolute; width: 100%; height: 4px; background: #cbd5e1; top: 50%; transform: translateY(-50%); border-radius: 2px; z-index: 1; }
.slider-fill { position: absolute; height: 4px; background: #fe3c72; top: 50%; transform: translateY(-50%); z-index: 2; border-radius: 2px; }
.dual-slider { position: absolute; width: 100%; top: 50%; transform: translateY(-50%); -webkit-appearance: none; background: transparent; pointer-events: none; z-index: 3; }
.dual-slider::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 24px; height: 24px; border-radius: 50%; background: #fe3c72; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* 全局通知弹窗 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.notif-toast {
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    max-width: 350px;
    border-left: 4px solid #fe3c72;
    animation: slideIn 0.3s ease-out;
    transition: all 0.5s;
    pointer-events: auto;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}