/* 树洞功能样式 v19.0 - 用户认证版本 */
:root {
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --primary: #667EEA;
    --primary-light: #764BA2;
    --text-dark: #2D3748;
    --text-gray: #718096;
    --border-color: #E2E8F0;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.18);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: linear-gradient(180deg, #FDF8F3 0%, #F5F7FA 100%);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

.card-display {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.card-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* 卡片样式 */
.hole-card {
    position: absolute;
    width: 350px;
    height: 130px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.hole-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-color, var(--primary)), transparent);
    border-radius: 16px 16px 0 0;
}

.hole-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
    border-radius: 16px;
    pointer-events: none;
}

.hole-card:hover {
    transform: translateY(-3px) scale(1.02) rotate(0deg) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    z-index: 100 !important;
}

/* 动画 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideFromLeft { from { transform: translateX(-100%) rotate(-5deg); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideFromRight { from { transform: translateX(100%) rotate(5deg); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideFromTop { from { transform: translateY(-80%) rotate(-3deg); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideFromBottom { from { transform: translateY(80%) rotate(3deg); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0) rotate(-10deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes flipIn { from { transform: perspective(800px) rotateY(-90deg); opacity: 0; } to { transform: perspective(800px) rotateY(0); opacity: 1; } }
@keyframes bounceIn { 0% { transform: translateY(-120px) scale(0.5); opacity: 0; } 60% { transform: translateY(10px) scale(1.05); } 100% { transform: translateY(0); opacity: 1; } }
@keyframes rotateIn { from { transform: rotate(-150deg) scale(0); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }
@keyframes floatIn { 0% { transform: translate(-30px, -30px) scale(0.85); opacity: 0; } 100% { transform: translate(0); opacity: 1; } }

@keyframes heartBeat { 0% { transform: scale(1); } 25% { transform: scale(1.5); } 50% { transform: scale(0.85); } 75% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rainbow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* 卡片内容 */
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; position: relative; z-index: 1; }
.card-meta { display: flex; align-items: center; gap: 6px; }
.emotion-tag { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; color: white; background: var(--card-color, var(--primary)); }
.nickname { font-size: 10px; color: var(--text-dark); font-weight: 500; opacity: 0.85; }
.card-time { font-size: 9px; color: var(--text-gray); opacity: 0.7; }

.card-body { margin-bottom: 10px; position: relative; z-index: 1; }
.card-content { font-size: 12px; line-height: 1.5; color: var(--text-dark); word-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.06); position: relative; z-index: 1; }
.card-stats { display: flex; gap: 6px; }
.stat-item { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text-gray); cursor: pointer; padding: 3px 6px; border-radius: 8px; transition: all 0.2s; background: rgba(0,0,0,0.02); }
.stat-item:hover { background: rgba(102,126,234,0.1); color: var(--primary); }
.stat-item.liked { color: #E91E63; background: rgba(233,30,99,0.08); }
.stat-item.liked i { animation: heartBeat 0.6s ease; }
.report-btn-sm { padding: 3px 8px; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; background: rgba(255,255,255,0.8); font-size: 9px; color: var(--text-gray); cursor: pointer; transition: all 0.2s; }
.report-btn-sm:hover { border-color: #FF5252; color: #FF5252; }

/* 加载动画 */
.card-loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.card-loading.hidden { display: none; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }

/* 底栏 */
.bottom-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

.icon-row, .input-row { pointer-events: auto; display: flex; justify-content: center; align-items: center; }
.icon-row { gap: 10px; padding: 8px 12px 4px; }

.icon-btn {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 41px;
    transition: all 0.25s;
    color: var(--text-dark);
}
.icon-btn:focus { outline: none; }

.icon-btn:hover { transform: translateY(-2px) scale(1.12); }
.icon-btn.active { transform: scale(1.12); }
.icon-btn .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 4px 8px;
    background: rgba(0,0,0,0.75);
    color: white;
    font-size: 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
}
.icon-btn:hover .tooltip { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* 用户菜单 */
.user-menu-wrapper { position: relative; }
.user-menu {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1001;
}
.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-dark);
}
.user-menu-items a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}
.user-menu-items a:hover {
    background: rgba(102,126,234,0.1);
    color: var(--primary);
}
.user-menu-items a i { width: 16px; }

.input-row { padding: 3px 12px 12px; }

.quick-publish {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 750px;
}

/* 炫彩输入框 */
.publish-input-wrapper {
    flex: 4;
    position: relative;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(90deg, #FF6B6B, #FFD93D, #6BCB77, #4D96FF, #9B59B6, #FF6B6B);
    background-size: 300% 100%;
    animation: rainbow 3s ease infinite;
}

.publish-input-wrapper textarea {
    width: 100%;
    border: none;
    border-radius: 23px;
    padding: 12px 18px;
    font-size: 13px;
    resize: none;
    background: rgba(255, 255, 255, 0.95);
    min-height: 42px;
    max-height: 100px;
    line-height: 1.4;
    color: var(--text-dark);
    outline: none;
}

.publish-input-wrapper textarea::placeholder {
    background: linear-gradient(90deg, #FF6B6B, #FFD93D, #6BCB77, #4D96FF, #9B59B6);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 3s ease infinite;
    font-weight: 500;
}

.publish-actions { display: flex; gap: 8px; flex-shrink: 0; }

.random-btn, .publish-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.random-btn { background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%); }
.random-btn:hover { transform: rotate(180deg) scale(1.1); box-shadow: 0 6px 16px rgba(255,107,107,0.4); }
.publish-btn { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.publish-btn:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(102,126,234,0.4); }
.publish-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 随机悬浮卡 */
.random-float-card {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 400px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    z-index: 3000;
    animation: floatCardIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
.random-float-card.hidden { display: none; }
@keyframes floatCardIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.float-card-close {
    position: absolute;
    top: 10px; right: 10px;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.08);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    color: white;
}
.float-card-close:hover { background: rgba(0,0,0,0.18); transform: rotate(90deg); }

.float-card-content { padding: 20px; }
.float-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.float-card-meta { font-size: 11px; color: var(--text-gray); }
.float-card-body { margin-bottom: 14px; }
.float-card-content-text { font-size: 14px; line-height: 1.6; color: var(--text-dark); }
.float-card-footer { display: flex; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px solid var(--border-color); }
.float-card-comments { border-top: 1px solid var(--border-color); padding: 10px 20px; max-height: 140px; overflow-y: auto; background: #F8F9FA; }
.comments-header { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.float-card-input { padding: 10px 20px; border-top: 1px solid var(--border-color); display: flex; gap: 8px; }
.float-card-input input { flex: 1; padding: 8px 14px; border: 1px solid var(--border-color); border-radius: 20px; font-size: 12px; }
.float-card-input input:focus { outline: none; border-color: var(--primary); }
.float-comment-submit { padding: 8px 16px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; border: none; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; }

/* 详情弹窗 */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    padding: 12px;
}
.modal.hidden { display: none; }
.modal-content {
    background: white;
    border-radius: 18px;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    position: relative;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.08);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s;
    z-index: 10;
    color: white;
}
.modal-close:hover { background: rgba(0,0,0,0.18); transform: rotate(90deg); }

.modal-body { padding: 20px; overflow-y: auto; }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.detail-meta { display: flex; flex-direction: column; gap: 4px; }
.detail-emotion { display: inline-block; padding: 3px 12px; border-radius: 14px; font-size: 11px; font-weight: 600; color: white; }
.detail-nickname { font-size: 14px; font-weight: 500; }
.detail-time { font-size: 10px; color: var(--text-gray); }
.detail-content { font-size: 14px; line-height: 1.7; margin-bottom: 14px; padding: 14px; background: linear-gradient(135deg, #F7FAFC 0%, #EDF2F7 100%); border-radius: 12px; }
.detail-stats { display: flex; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.detail-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-gray); cursor: pointer; padding: 5px 12px; border-radius: 14px; transition: all 0.2s; background: #F7FAFC; }
.detail-stat:hover { background: rgba(102,126,234,0.1); color: var(--primary); }
.detail-stat.liked { color: #E91E63; background: #FFF0F5; }

.comments-section h3 { font-size: 13px; margin-bottom: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.comment-item { display: flex; gap: 8px; padding: 10px; background: #F7FAFC; border-radius: 10px; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-light)); display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-meta { display: flex; justify-content: space-between; margin-bottom: 3px; }
.comment-nickname { font-size: 11px; font-weight: 600; }
.comment-time { font-size: 9px; color: var(--text-gray); }
.comment-content { font-size: 12px; line-height: 1.4; }
.comment-input-area { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.comment-input-area input { flex: 1; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 20px; font-size: 12px; }
.comment-input-area input:focus { outline: none; border-color: var(--primary); }
.comment-submit { padding: 10px 18px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; border: none; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* 举报弹窗 */
.report-content { max-width: 340px; padding: 20px; }
.report-content h3 { margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.report-form p { margin-bottom: 8px; font-size: 12px; }
.report-reasons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.report-reasons label { display: flex; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 12px; }
.report-reasons label:hover { border-color: var(--primary); }
.report-reasons input[type="radio"] { accent-color: var(--primary); }
.report-reasons textarea { width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 11px; resize: vertical; min-height: 45px; margin-bottom: 12px; }
.report-reasons textarea:focus { outline: none; border-color: var(--primary); }
.report-btn { width: 100%; padding: 10px; background: linear-gradient(135deg, #FF5252, #FF8A80); color: white; border: none; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.report-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,82,82,0.3); }

/* 登录弹窗 */
.login-modal {
    max-width: 400px !important;
    padding: 30px !important;
}
.login-modal h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-dark);
    font-size: 20px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.3s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}
.primary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
    margin-bottom: 16px;
}
.primary-btn:hover { transform: scale(1.02); }
.switch-form {
    text-align: center;
    font-size: 13px;
    color: var(--text-gray);
}
.switch-form a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.error-msg {
    color: #ff4757;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

.hidden { display: none !important; }

@media (max-width: 768px) {
    .icon-row { gap: 6px; }
    .icon-btn { width: 36px; height: 36px; font-size: 15px; }
    .publish-input-wrapper textarea { padding: 10px 14px; font-size: 12px; }
    .random-btn, .publish-btn { width: 36px; height: 36px; font-size: 14px; }
    .hole-card { width: 280px !important; height: 110px !important; }
}
