/* ============================================
   Usersafe · 百科详情页样式
   ============================================ */

/* ---------- 详情头部 ---------- */
.detail-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #edf2f7;
}

.detail-header .badge {
    display: inline-block;
    background: #0b1a2f;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 30px;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
}

.detail-header .badge i {
    margin-right: 6px;
}

.detail-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #0b1a2f;
    line-height: 1.3;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #8596b0;
    margin-bottom: 12px;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-tags .tag {
    font-size: 12px;
    color: #5e6f8d;
    background: #f1f4f9;
    padding: 3px 14px;
    border-radius: 30px;
}

/* ---------- 回答内容 ---------- */
.detail-answer {
    background: #fafcff;
    border: 1px solid #edf2f7;
    border-radius: 20px;
    padding: 32px 36px;
    margin-bottom: 40px;
}

.answer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.answer-header .a-icon {
    color: #5e6f8d;
    font-weight: 700;
    font-size: 16px;
    background: #f1f4f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-header .answer-label {
    font-size: 18px;
    font-weight: 600;
    color: #0b1a2f;
}

.answer-content p {
    font-size: 16px;
    line-height: 1.9;
    color: #1f2a44;
    margin-bottom: 16px;
}

.answer-content .highlight {
    background: #f0f3f8;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 15px;
    color: #0b1a2f;
}

.answer-tip {
    background: #f0f7ff;
    border-left: 4px solid #0b1a2f;
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    color: #1f2a44;
}

.answer-tip i {
    color: #0b1a2f;
    margin-right: 10px;
}

/* ========== 回答操作按钮 ========== */
.answer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f2f5;
    flex-wrap: wrap;
}

/* 通用按钮样式 */
.answer-actions .btn-like,
.answer-actions .btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* ===== 点赞按钮 ===== */
.answer-actions .btn-like {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    color: #1a73e8;
    border: 1.5px solid rgba(26, 115, 232, 0.15);
}

.answer-actions .btn-like i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.answer-actions .btn-like .like-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    background: rgba(26, 115, 232, 0.12);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #1a73e8;
    line-height: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

/* 点赞按钮悬浮效果 */
.answer-actions .btn-like:hover {
    background: linear-gradient(135deg, #e8f0fe 0%, #dce8f8 100%);
    border-color: rgba(26, 115, 232, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.15);
}

.answer-actions .btn-like:hover i {
    transform: scale(1.15);
}

.answer-actions .btn-like:hover .like-count {
    background: rgba(26, 115, 232, 0.2);
}

/* 点赞按钮激活状态（已点赞） */
.answer-actions .btn-like.liked {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #ffffff;
    border-color: #1a73e8;
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.3);
}

.answer-actions .btn-like.liked i {
    font-weight: 900;
    color: #ffffff;
    animation: likePop 0.4s ease;
}

.answer-actions .btn-like.liked .like-count {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.answer-actions .btn-like.liked:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26, 115, 232, 0.4);
}

/* 点赞加载状态 */
.answer-actions .btn-like.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: scale(0.97);
}

.answer-actions .btn-like.loading i {
    animation: spin 0.8s linear infinite;
}

/* ===== 分享按钮 ===== */
.answer-actions .btn-share {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    color: #5a6a7a;
    border: 1.5px solid rgba(0, 0, 0, 0.06);
}

.answer-actions .btn-share i {
    font-size: 15px;
    transition: transform 0.3s ease;
}

/* 分享按钮悬浮效果 */
.answer-actions .btn-share:hover {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.answer-actions .btn-share:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* 分享按钮点击效果 */
.answer-actions .btn-share:active {
    transform: scale(0.95);
}

/* ===== 响应式适配 ===== */
@media (max-width: 768px) {
    .answer-actions {
        gap: 10px;
        padding-top: 20px;
        flex-direction: column;
        width: 100%;
    }

    .answer-actions .btn-like,
    .answer-actions .btn-share {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .answer-actions .btn-like .like-count {
        min-width: 24px;
        padding: 0 8px;
        font-size: 13px;
        line-height: 22px;
    }
}

@media (max-width: 480px) {
    .answer-actions {
        gap: 8px;
        padding-top: 16px;
    }

    .answer-actions .btn-like,
    .answer-actions .btn-share {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .answer-actions .btn-like i,
    .answer-actions .btn-share i {
        font-size: 14px;
    }
}

/* ===== 动画定义 ===== */

/* 点赞弹出动画 */
@keyframes likePop {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.4) rotate(-10deg);
    }
    50% {
        transform: scale(0.9) rotate(5deg);
    }
    75% {
        transform: scale(1.15) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* 旋转动画（加载） */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 按钮进入动画 */
.answer-actions .btn-like,
.answer-actions .btn-share {
    animation: btnFadeIn 0.5s ease both;
}

.answer-actions .btn-share {
    animation-delay: 0.1s;
}

@keyframes btnFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 亮色/暗色主题适配 ===== */

/* 暗色主题支持（如果您的网站有暗色模式） */
@media (prefers-color-scheme: dark) {
    .answer-actions .btn-like {
        background: linear-gradient(135deg, #1a2332 0%, #1e2a3a 100%);
        color: #64b5f6;
        border-color: rgba(100, 181, 246, 0.15);
    }
    
    .answer-actions .btn-like .like-count {
        background: rgba(100, 181, 246, 0.15);
        color: #64b5f6;
    }
    
    .answer-actions .btn-like:hover {
        background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
        border-color: rgba(100, 181, 246, 0.3);
        box-shadow: 0 4px 16px rgba(100, 181, 246, 0.1);
    }
    
    .answer-actions .btn-like.liked {
        background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
        color: #ffffff;
        border-color: #1565c0;
        box-shadow: 0 4px 20px rgba(21, 101, 192, 0.3);
    }
    
    .answer-actions .btn-share {
        background: linear-gradient(135deg, #1a2332 0%, #1e2a3a 100%);
        color: #8a9aa8;
        border-color: rgba(255, 255, 255, 0.06);
    }
    
    .answer-actions .btn-share:hover {
        background: linear-gradient(135deg, #1e2a3a 0%, #243447 100%);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
}

/* ---------- 相关问答 ---------- */
.related-qa {
    margin-bottom: 32px;
}

.related-qa h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0b1a2f;
    margin-bottom: 16px;
}

.related-qa h3 i {
    margin-right: 10px;
}

.related-qa ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.related-qa ul li {
    list-style: none;
}

.related-qa ul li a {
    font-size: 14px;
    color: #1f2a44;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 10px;
    display: block;
    transition: 0.15s;
    border: 1px solid transparent;
}

.related-qa ul li a:hover {
    background: #f1f4f9;
    border-color: #edf2f7;
}

/* ---------- 返回链接 ---------- */
.back-link {
    margin-top: 8px;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #5e6f8d;
    transition: 0.15s;
    padding: 8px 16px;
    border-radius: 30px;
    background: #f8fafc;
}

.back-link a:hover {
    color: #0b1a2f;
    background: #f1f4f9;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .detail-header h1 {
        font-size: 22px;
    }

    .detail-answer {
        padding: 20px 18px;
    }

    .answer-content p {
        font-size: 15px;
    }

    .detail-meta {
        flex-wrap: wrap;
        gap: 12px;
        font-size: 12px;
    }

    .related-qa ul li a {
        font-size: 13px;
    }
}