/* ======================================================
   1. 全局通用操作按钮组件 (Action Button Component)
   ====================================================== */

/* ----- 容器：弹性换行，防止溢出 ----- */
.action-group {
    float: right;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: var(--action-gap, 6px);  /* 默认6px，页面可覆盖 */
    box-sizing: border-box;
}
.action-text {
    display: inline-block;
    min-width: 3em;
    text-align: center;
    vertical-align: middle;   /* 与图标对齐 */
    line-height: 1;           /* 防止额外行高 */
}
/* ----- 按钮基础：使用变量控制尺寸和颜色 ----- */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    /* 核心尺寸变量，页面微调时只需重定义这几个变量 */
    padding: var(--action-padding, 3px 10px);
    font-size: var(--action-font-size, 12px);
    border-radius: var(--action-radius, 16px);
    min-height: var(--action-min-height, 26px);

    font-family: inherit;
    color: #999;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: all 0.25s ease;
    outline: none;
    line-height: 1.4;
}
.action-btn .iconfont {
    font-size: calc(var(--action-font-size, 12px) + 1px);
    line-height: 1;
    color: inherit;
}
.action-btn:hover {
    transform: translateY(-1px) scale(1.04);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.action-btn:active {
    transform: scale(0.93);
    transition-duration: 0.08s;
}

/* ----- 变体：分享按钮 ----- */
.action-btn-share {
    color: #999;
}
.action-btn-share:hover {
    color: #1196DD;
    background: rgba(17, 150, 221, 0.10);
    border-color: rgba(17, 150, 221, 0.25);
}
/* 复制成功状态（JS控制） */
.action-btn-share.copied {
    color: #52c41a;
    background: rgba(82, 196, 26, 0.10);
    border-color: rgba(82, 196, 26, 0.25);
}

/* ----- 变体：收藏按钮 ----- */
.action-btn-collect {
    color: #999;
}
.action-btn-collect.active {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.10);
    border-color: rgba(255, 107, 107, 0.25);
}
.action-btn-collect.active:hover {
    background: rgba(255, 107, 107, 0.18);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

/* ======================================================
   2. 全局响应式适配 (默认微调)
   ====================================================== */
@media (max-width: 768px) {
    .action-group { --action-gap: 4px; }
    .action-btn {
        --action-padding: 2px 8px;
        --action-font-size: 11px;
        --action-min-height: 24px;
    }
}
@media (max-width: 480px) {
    .action-group { --action-gap: 3px; }
    .action-btn {
        --action-padding: 2px 6px;
        --action-font-size: 10px;
        --action-radius: 12px;
        --action-min-height: 22px;
    }
}
/* 极端小屏：仅显示图标（文字隐藏） */
@media (max-width: 360px) {
    .action-btn {
        --action-padding: 0;
        --action-font-size: 0;      /* 文字隐藏 */
        --action-radius: 50%;
        min-width: 28px;
        --action-min-height: 28px;
        gap: 0;
    }
    .action-btn .iconfont {
        font-size: 14px;
    }
}