/**
 * Mirai WP - 交互组件样式（点赞/收藏/评论）
 */

/* Toast 提示 */
.mirai-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.mirai-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mirai-toast-success { background: rgba(40, 167, 69, 0.9); }
.mirai-toast-error { background: rgba(220, 53, 69, 0.9); }
.mirai-toast-info { background: rgba(30, 128, 255, 0.9); }

/* 文章底部操作按钮 */
.article-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid #e8e8e8;
    border-radius: 24px;
    background: #fff;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: #1e80ff;
    color: #1e80ff;
    transform: translateY(-1px);
}

.action-btn.active {
    border-color: #1e80ff;
    background: rgba(30, 128, 255, 0.08);
    color: #1e80ff;
}

.action-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.action-btn .btn-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.action-btn .count {
    font-style: normal;
    margin-left: 2px;
}

/* 评论区域 */
.mirai-comments-area {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.mirai-comments-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.mirai-comments-title span {
    color: #999;
    font-size: 14px;
    font-weight: 400;
    margin-left: 8px;
}

/* 评论表单 */
.mirai-comment-form {
    margin-bottom: 24px;
}

.mirai-comment-form-inner {
    display: flex;
    gap: 12px;
}

.mirai-comment-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.mirai-comment-input-wrap {
    flex: 1;
}

.mirai-comment-form textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s, background 0.2s;
}

.mirai-comment-form textarea:focus {
    outline: none;
    border-color: #1e80ff;
    background: #fff;
}

.mirai-comment-form .guest-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.mirai-comment-form .guest-fields input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.mirai-comment-form .form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.mirai-comment-submit {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #1e80ff;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.mirai-comment-submit:hover {
    background: #166fd8;
}

.mirai-comment-submit:disabled {
    background: #9fc8ff;
    cursor: wait;
}

.mirai-comment-cancel-reply {
    display: none;
    margin-left: 12px;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}

.mirai-comment-login-tip {
    padding: 16px;
    text-align: center;
    background: #f7f9fc;
    border-radius: 10px;
    color: #666;
    font-size: 14px;
}

.mirai-comment-login-tip a {
    color: #1e80ff;
    text-decoration: none;
}

/* 评论列表 */
.mirai-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mirai-comment-list .comment {
    display: flex;
    gap: 12px;
    padding: 18px 0;
    border-bottom: 1px solid #f5f5f5;
}

.mirai-comment-list .comment:last-child {
    border-bottom: none;
}

.mirai-comment-list .children {
    list-style: none;
    margin: 12px 0 0 56px;
    padding: 0;
    border-left: 2px solid #f0f0f0;
    padding-left: 16px;
}

.mirai-comment-avatar {
    flex-shrink: 0;
}

.mirai-comment-body {
    flex: 1;
    min-width: 0;
}

.mirai-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.mirai-comment-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-decoration: none;
}

.mirai-comment-author:hover {
    color: #1e80ff;
}

.mirai-comment-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: #1e80ff;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
}

.mirai-comment-time {
    color: #999;
    font-size: 13px;
}

.mirai-comment-content {
    color: #444;
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
}

.mirai-comment-content p {
    margin: 0 0 8px;
}

.mirai-comment-content p:last-child {
    margin-bottom: 0;
}

.mirai-comment-actions {
    margin-top: 8px;
    font-size: 13px;
}

.mirai-comment-reply {
    color: #666;
    text-decoration: none;
    cursor: pointer;
}

.mirai-comment-reply:hover {
    color: #1e80ff;
}

.mirai-comment-new {
    animation: mirai-fade-in 0.6s ease;
}

@keyframes mirai-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .action-btn {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #bbb;
    }

    .action-btn:hover,
    .action-btn.active {
        border-color: #1e80ff;
        color: #1e80ff;
        background: rgba(30, 128, 255, 0.1);
    }

    .mirai-comments-area {
        border-color: #333;
    }

    .mirai-comments-title { color: #eee; }

    .mirai-comment-form textarea,
    .mirai-comment-form .guest-fields input {
        background: #222;
        border-color: #3a3a3a;
        color: #eee;
    }

    .mirai-comment-form textarea:focus {
        background: #1a1a1a;
    }

    .mirai-comment-login-tip {
        background: #222;
        color: #aaa;
    }

    .mirai-comment-list .comment {
        border-color: #2a2a2a;
    }

    .mirai-comment-list .children {
        border-color: #333;
    }

    .mirai-comment-author { color: #eee; }
    .mirai-comment-content { color: #ccc; }
    .mirai-comment-reply { color: #aaa; }
    .mirai-comment-reply:hover { color: #1e80ff; }
    .mirai-comment-cancel-reply {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #aaa;
    }
}

/* 第三方账号绑定 */
.oauth-bindings-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.oauth-bindings-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.oauth-binding-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.oauth-binding-item:last-child {
    border-bottom: none;
}

.oauth-binding-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #444;
}

.oauth-binding-info i {
    font-size: 20px;
    color: #1e80ff;
}

.oauth-binding-nickname {
    color: #999;
    font-size: 13px;
}

.oauth-binding-item.bound .oauth-binding-info {
    color: #333;
}

.oauth-unbind-form {
    margin: 0;
}

/* 移动端 */
@media (max-width: 576px) {
    .article-actions-bar {
        gap: 8px;
    }

    .action-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .mirai-comment-list .children {
        margin-left: 16px;
        padding-left: 12px;
    }
}
