/* 推荐卡片上的「不感兴趣」（2026-11-07，用户定的效果图）：首页首屏精品卡片、列表页没结果时「为你推荐」那一排。
   标记在 Views/Shared/_RecommendDismissButton.cshtml（按钮）、_RecommendDismissed.cshtml（点了之后那一格）、_RecommendDismissSheet.cshtml（手机底部菜单），
   行为在 rec-dismiss.js。
   桌面：平时不多任何东西，鼠标移上去（或 Tab 到）右上角才出现 ×，悬停提示「不感兴趣」；
   手机（没有悬停）：常驻「⋯」，点开底部菜单。 */

/* 卡片被藏起来的那一会儿（撤销时再露出来）：列表卡片那几条 display:flex 的特指度很高，[hidden] 压不过 */
.hd-project[hidden], .project-card[hidden], .cd-interest-cell[hidden] { display: none !important; }

/* ---- 右上角那颗按钮：点击区 44×44，看得见的是中间那个小圆 ---- */
.rec-dismiss-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    color: #34404c;
    cursor: pointer;
}
.rec-dismiss-face {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 44, 60, .18), 0 0 0 1px rgba(20, 44, 60, .08);
}
.rec-dismiss-btn svg { width: 14px; height: 14px; }
.rec-dismiss-btn .rec-ico-more { display: none; width: 18px; height: 18px; }
.rec-dismiss-btn:focus-visible { outline: 3px solid #9ed6a5; outline-offset: -4px; border-radius: 50%; }
.rec-dismiss-btn::after {
    content: attr(aria-label);
    position: absolute;
    top: 44px;
    right: -2px;
    padding: 5px 10px;
    border-radius: 6px;
    background: #172333;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(23, 35, 51, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
@media (hover: hover) {
    .rec-dismiss-btn { opacity: 0; transition: opacity .15s; }
    .hd-project:hover .rec-dismiss-btn, .hd-project:focus-within .rec-dismiss-btn,
    .project-card:hover .rec-dismiss-btn, .project-card:focus-within .rec-dismiss-btn { opacity: 1; }
    .rec-dismiss-btn:hover::after, .rec-dismiss-btn:focus-visible::after { opacity: 1; }
    .rec-dismiss-btn:hover .rec-dismiss-face { color: #172333; background: #f7faf8; }
}
@media (hover: none) {
    .rec-dismiss-btn .rec-ico-x { display: none; }
    .rec-dismiss-btn .rec-ico-more { display: block; }
    .rec-dismiss-face { background: rgba(255, 255, 255, .92); }
}

/* 首页卡片：左上角那一行（分类 + 授权）给按钮让出右上角 */
.hd-project.is-compact .hd-project-head { right: 56px; }

/* 列表卡片：小一号，精品标记往左挪一格，标题不钻到按钮底下 */
.project-card .rec-dismiss-btn { top: 2px; right: 2px; }
.project-card .rec-dismiss-face { width: 26px; height: 26px; background: #f1f4f2; box-shadow: none; }
.project-card .rec-dismiss-btn svg.rec-ico-x { width: 12px; height: 12px; }
body.rwd .catalog-list-page .project-card:has(.rec-dismiss-btn) .project-card-quality { right: 44px; }
.project-card:has(.rec-dismiss-btn) .project-card-text { padding-right: 22px; }

/* 详情页「你可能感兴趣」：每条只有一行，按钮小一号、竖着居中，盖住右边那个小箭头 */
.cd-interest-cell { position: relative; min-width: 0; }
.cd-interest-cell .rec-dismiss-btn { top: 50%; right: 0; width: 40px; height: 40px; margin-top: -20px; }
.cd-interest-cell .rec-dismiss-face { width: 24px; height: 24px; background: #fff; box-shadow: 0 0 0 1px #dbe4de; }
.cd-interest-cell .rec-dismiss-btn svg.rec-ico-x { width: 11px; height: 11px; }
.cd-interest-cell .rec-dismiss-btn svg.rec-ico-more { width: 15px; height: 15px; }
.cd-interest-cell .rec-dismiss-btn::after { top: 38px; }
@media (hover: hover) {
    .cd-interest-cell:hover .rec-dismiss-btn, .cd-interest-cell:focus-within .rec-dismiss-btn { opacity: 1; }
    .cd-interest-cell:hover .cd-interest-item::after, .cd-interest-cell:focus-within .cd-interest-item::after { opacity: 0; }
}
@media (hover: none) {
    .cd-interest-cell .cd-interest-item { padding-right: 40px; }
    .cd-interest-cell .cd-interest-item::after { display: none; }
}

/* ---- 点了之后那一格：至少跟原卡片一样高（脚本按原卡片量好写在 min-height 上），虚线边、可撤销。
   卡片窄到两颗原因按钮挤成两行时会比原卡片高一点点（首屏卡片一般 220～240，这一格两行时 225 上下），宁可高一点也不裁掉按钮 ---- */
.rec-dismissed {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 16px 16px 14px;
    background: #fff;
    border: 1px dashed #c9d6cd;
    border-radius: 12px;
    color: #172333;
    font-size: 13px;
    line-height: 1.5;
}
.rec-dismissed:focus { outline: none; }
.rec-dismissed:focus-visible { outline: 3px solid #9ed6a5; outline-offset: 2px; }
.rec-dismissed-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rec-dismissed-ok {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #edf8ef;
    color: #278426;
}
.rec-dismissed-ok svg { width: 16px; height: 16px; }
.rec-dismissed-text { min-width: 0; }
.rec-dismissed-title { display: block; font-size: 14px; font-weight: 650; }
.rec-dismissed-sub { display: block; font-size: 12px; color: #5f6b76; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-dismissed-reasons { display: flex; flex-direction: column; gap: 6px; }
.rec-dismissed-hint { font-size: 12px; color: #5f6b76; }
.rec-dismissed-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-chip {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dbe4de;
    border-radius: 17px;
    background: #fff;
    color: #34404c;
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
}
.rec-chip:hover { border-color: #b7d7bf; }
.rec-chip[aria-pressed="true"] { border-color: #278426; background: #edf8ef; color: #1f6e1f; font-weight: 600; }
.rec-chip[aria-pressed="true"]::before { content: "✓ "; }
.rec-chip:focus-visible, .rec-undo:focus-visible { outline: 3px solid #9ed6a5; outline-offset: 2px; }
.rec-dismissed-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rec-undo {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #dbe4de;
    border-radius: 8px;
    background: #fff;
    color: #172333;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.rec-undo:hover { background: #f7faf8; }
.rec-manage { font-size: 12.5px; color: #1f6e1f; }
.rec-manage:hover { color: #216f21; }
.rec-dismissed.is-busy { opacity: .6; pointer-events: none; }

/* 列表页那一格：小一号，标题一行 */
.rec-dismissed.is-compact { justify-content: center; gap: 10px; padding: 14px 16px; border-radius: 10px; background: #fbfdfb; }
.rec-dismissed.is-compact .rec-dismissed-ok { width: auto; height: auto; background: none; }
.rec-dismissed.is-compact .rec-dismissed-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-dismissed.is-compact .rec-chip { min-height: 32px; padding: 0 11px; font-size: 12px; }
.rec-dismissed.is-compact .rec-dismissed-foot { margin-top: 0; }
.rec-dismissed.is-compact .rec-undo { min-height: 32px; padding: 0; border: 0; background: none; color: #1f6e1f; }

/* 详情页那一行：标题 + 撤销，跟原来那一条一样高 */
.rec-dismissed.is-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 0 12px; border-radius: 6px; background: #fbfdfb; font-size: 13px; }
.rec-dismissed.is-inline .rec-dismissed-title { min-width: 0; font-size: 13px; font-weight: 400; color: #5f6b76; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-dismissed.is-inline .rec-undo { flex: none; min-height: 32px; padding: 0 8px; border: 0; background: none; color: #1f6e1f; }

/* ---- 手机上的底部菜单（详情页那几条在桌面上也用它：宽屏上摆成居中的小窗） ---- */
.rec-sheet { position: fixed; inset: 0; z-index: 1000; }
.rec-sheet[hidden] { display: none; }
.rec-sheet-backdrop { position: absolute; inset: 0; background: rgba(23, 35, 51, .45); }
.rec-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 640px;
    margin: 0 auto;
    padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(23, 35, 51, .2);
    color: #172333;
    font-size: 14px;
    line-height: 1.5;
}
.rec-sheet-grip { width: 36px; height: 4px; margin: 0 auto 14px; border-radius: 2px; background: #d5dcd7; }
.rec-sheet-title { margin: 0 0 10px; font-size: 12.5px; color: #5f6b76; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-sheet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid #eef2ef;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.rec-sheet-option[hidden] { display: none; }
.rec-sheet-option:last-of-type { border-bottom: 0; }
.rec-sheet-option svg { flex: none; width: 20px; height: 20px; }
.rec-sheet-option strong { display: block; font-size: 15px; }
.rec-sheet-option small { display: block; font-size: 12px; color: #5f6b76; }
.rec-sheet-cancel {
    width: 100%;
    min-height: 48px;
    margin-top: 12px;
    border: 0;
    border-radius: 10px;
    background: #f1f4f2;
    color: #172333;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.rec-sheet-option:focus-visible, .rec-sheet-cancel:focus-visible { outline: 3px solid #9ed6a5; outline-offset: -3px; }
@media (min-width: 768px) {
    .rec-sheet-panel { top: 50%; bottom: auto; left: 50%; right: auto; width: min(420px, calc(100% - 32px)); margin: 0; padding: 18px 20px 20px;
        border-radius: 14px; transform: translate(-50%, -50%); box-shadow: 0 18px 50px rgba(23, 35, 51, .25); }
    .rec-sheet-grip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .rec-dismiss-btn, .rec-dismiss-btn::after { transition: none; }
}
