/**
 * PC 回帖际遇 —— 浅色扁平版。
 * 圆角跟随程序：var(--ls-border-radius, 12px)，与文章页、jinsom 页面模块同一口径；
 * 内层小件用 8px/6px 字面值。颜色全部写字面值，主色取宿主 --ls-primary 的 #3b82f6。
 */

.YXYH-pc-page-reply-fortune {
    width: min(1200px, calc(100% - 24px));
    margin: 20px auto 40px;
    color: #1f2937;
}

.YXYH-pc-page-reply-fortune .yxyh-rf-card,
.YXYH-pc-page-reply-fortune .yxyh-rf-hero {
    border: 1px solid #eef0f2;
    border-radius: var(--ls-border-radius, 12px);
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}

/* ===== 顶部：头部行 + 发丝线 + 数据条，同一张卡 ===== */

.yxyh-rf-hero {
    margin-bottom: 14px;
}

.yxyh-rf-hero-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 26px;
}

.yxyh-rf-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 0 26px;
    padding: 14px 0 18px;
    border-top: 1px solid #f1f2f4;
}

.yxyh-rf-stat-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
}

.yxyh-rf-stat-card i {
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f5f6f8;
    color: #9ca3af;
    font-size: 16px;
}

.yxyh-rf-stat-card span {
    color: #6b7280;
    font-size: 12px;
}

.yxyh-rf-stat-card strong {
    overflow: hidden;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 按类型配浅色：触发蓝 / 奖励绿 / 惩罚红 / 今日紫 / 上限琥珀 */
.yxyh-rf-stat-card.is-trigger i {
    background: #eff6ff;
    color: #3b82f6;
}

.yxyh-rf-stat-card.is-reward i {
    background: #ecfdf5;
    color: #10b981;
}

.yxyh-rf-stat-card.is-punish i {
    background: #fef2f2;
    color: #ef4444;
}

.yxyh-rf-stat-card.is-today i {
    background: #f5f3ff;
    color: #8b5cf6;
}

.yxyh-rf-stat-card.is-limit i {
    background: #fffbeb;
    color: #d97706;
}

.yxyh-rf-hero-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f5f6f8;
    color: #6b7280;
    font-size: 20px;
}

.yxyh-rf-hero-text {
    flex: 1 1 auto;
    min-width: 0;
}

.yxyh-rf-hero-text h1 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.yxyh-rf-hero-text p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.yxyh-rf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.yxyh-rf-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.yxyh-rf-btn.is-ghost {
    border-color: #e5e7eb;
    background: #ffffff;
    color: #4b5563;
}

.yxyh-rf-btn.is-ghost:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* ===== 主体三栏 ===== */

.yxyh-rf-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 300px;
    gap: 12px;
    margin-bottom: 14px;
}

.yxyh-rf-card {
    padding: 20px 22px;
}

.yxyh-rf-rules-card {
    height: 380px;
    display: flex;
    flex-direction: column;
}

.yxyh-rf-rules-card .yxyh-rf-card-head {
    flex: 0 0 auto;
}

.yxyh-rf-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 28px;
    margin-bottom: 14px;
}

.yxyh-rf-card-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.yxyh-rf-card-head h2 i {
    color: #9ca3af;
    font-size: 16px;
}

.yxyh-rf-card-head span {
    color: #9ca3af;
    font-size: 12px;
}

/* 记录卡头部：标题与条数靠左，操作按钮靠右 */
.yxyh-rf-card-head.is-record {
    justify-content: flex-start;
}

.yxyh-rf-card-head.is-record > span {
    margin-inline-start: 10px;
}

.yxyh-rf-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.yxyh-rf-card-actions .yxyh-rf-btn {
    min-height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.yxyh-rf-rule-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
}

.yxyh-rf-rule {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
    height: 56px;
    padding: 0 14px;
    border-radius: 8px;
    background: #f9fafb;
}

.yxyh-rf-rule > div {
    flex: 1 1 auto;
    min-width: 0;
}

.yxyh-rf-rule strong {
    display: block;
    margin-bottom: 3px;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
}

.yxyh-rf-rule span {
    display: block;
    overflow: hidden;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yxyh-rf-rule em {
    flex: 0 0 auto;
    color: #9ca3af;
    font-size: 12px;
    font-style: normal;
}

/* ===== 今日概览 ===== */

.yxyh-rf-today-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 120px;
    color: #334155;
    font-size: 14px;
}

.yxyh-rf-today-block {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f9fafb;
}

.yxyh-rf-today-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.yxyh-rf-today-block-head strong {
    color: #111827;
    font-size: 13px;
    font-weight: 600;
}

.yxyh-rf-today-block-head span {
    color: #9ca3af;
    font-size: 12px;
}

.yxyh-rf-today-block-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yxyh-rf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    max-width: 100%;
    padding: 0 10px;
    border: 1px solid #eef0f2;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    line-height: 1;
}

.yxyh-rf-pill strong {
    overflow: hidden;
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yxyh-rf-pill.is-empty {
    border-color: transparent;
    background: transparent;
    color: #9ca3af;
}

/* ===== 最近触发：发丝线分隔的平铺列表 ===== */

.yxyh-rf-record-card {
    padding: 20px 22px 6px;
}

.yxyh-rf-record-list {
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.yxyh-rf-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 2px;
    border-bottom: 1px solid #f1f2f4;
}

.yxyh-rf-record:last-child {
    border-bottom: none;
}

.yxyh-rf-record-main {
    min-width: 0;
}

.yxyh-rf-record-title {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    margin-bottom: 3px;
    color: #6b7280;
    font-size: 12px;
}

.yxyh-rf-record-title strong {
    flex: 0 0 auto;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
}

.yxyh-rf-record-title span {
    flex: 0 0 auto;
}

.yxyh-rf-record-user {
    flex: 0 0 auto;
    max-width: 100%;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.yxyh-rf-record-user:hover {
    color: #3b82f6;
}

/* 帖子名里的宿主表情：照编辑器的口径按行高内联 */
.yxyh-rf-record .ls-emoji {
    width: auto;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 1px;
}

.yxyh-rf-record-main > span {
    display: block;
    overflow: hidden;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yxyh-rf-record-reply {
    overflow: hidden;
    color: #3b82f6;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.yxyh-rf-record-reply:hover {
    text-decoration: underline;
}

.yxyh-rf-record-meta {
    flex: 0 0 auto;
    text-align: end;
}

.yxyh-rf-record-meta em {
    display: block;
    margin-bottom: 3px;
    color: #059669;
    font-size: 12px;
    font-style: normal;
}

.yxyh-rf-record[data-effect="punish"] .yxyh-rf-record-meta em.is-awarded {
    color: #dc2626;
}

.yxyh-rf-record-meta em.is-revoked {
    color: #d97706;
}

.yxyh-rf-record-meta em.is-revoke_failed {
    color: #dc2626;
}

.yxyh-rf-record-meta time {
    display: block;
    color: #9ca3af;
    font-size: 12px;
}

.yxyh-rf-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0 16px;
}

.yxyh-rf-pager span {
    min-width: 72px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

/* ===== 空态与错误 ===== */

.yxyh-rf-card > .ls-empty,
.yxyh-rf-rule-list .ls-empty {
    padding: 18px 0;
}

/* ===== 响应式 ===== */

@media (max-width: 1100px) {
    .yxyh-rf-main-grid {
        grid-template-columns: 1fr 1fr;
    }

    .yxyh-rf-today-card {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .yxyh-rf-hero-inner {
        display: block;
        padding: 20px;
    }

    .yxyh-rf-hero-badge {
        margin-bottom: 12px;
    }

    .yxyh-rf-stat-grid {
        margin: 0 20px;
        padding: 12px 0 16px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .yxyh-rf-main-grid {
        grid-template-columns: 1fr;
    }

    .yxyh-rf-today-card {
        grid-column: auto;
    }

    .yxyh-rf-rules-card {
        height: auto;
    }

    .yxyh-rf-rule-list {
        height: auto;
        max-height: 286px;
    }

    .yxyh-rf-record {
        display: block;
    }

    .yxyh-rf-record-meta {
        margin-top: 6px;
        text-align: start;
    }
}
