/* ============================================================
 * LightDao 称号系统 CSS (lightdao-titles.css) v3
 * 复刻参考图（称号中心）视觉风格
 * 稀有度: UR(紫渐变/流光) / SSR(橙红渐变) / SR(蓝渐变) / R(黑描边) / N(灰描边)
 * ============================================================ */

/* ---- 稀有度颜色变量定义（对齐参考图配色） ---- */
/* UR：紫色渐变 + 流光特效（本站最高档） */
.gacha-title-ur {
    --gacha-color: #ffffff;
    --gacha-solid: #7c3aed;
    --gacha-bg: linear-gradient(135deg, #7c3aed, #a855f7 55%, #c084fc);
    --gacha-border: #6d28d9;
    --gacha-rarity-bg: rgba(255, 255, 255, .92);
    --gacha-rarity-color: #6d28d9;
    --gacha-serial-bg: rgba(255, 255, 255, .88);
    --gacha-serial-color: #6d28d9;
    --gacha-shimmer: rgba(255, 255, 255, .75);
    --gacha-ur-shadow: rgba(124, 58, 237, .38);
}
/* SSR：橙红渐变（参考图氪金大佬） */
.gacha-title-ssr {
    --gacha-color: #ffffff;
    --gacha-solid: #ea580c;
    --gacha-bg: linear-gradient(135deg, #ff6b35, #f7931e);
    --gacha-border: #e8721a;
    --gacha-rarity-bg: rgba(255, 255, 255, .92);
    --gacha-rarity-color: #e8721a;
}
/* SR：蓝色渐变（参考图万人迷/键盘侠） */
.gacha-title-sr {
    --gacha-color: #ffffff;
    --gacha-solid: #3a7bc8;
    --gacha-bg: linear-gradient(135deg, #4a90d9, #5ba0e9);
    --gacha-border: #3a7bc8;
    --gacha-rarity-bg: rgba(255, 255, 255, .92);
    --gacha-rarity-color: #3a7bc8;
}
/* R：白底黑边（参考图常客/夜猫子） */
.gacha-title-r {
    --gacha-color: #1f2937;
    --gacha-solid: #111827;
    --gacha-bg: #ffffff;
    --gacha-border: #111827;
    --gacha-rarity-bg: #111827;
    --gacha-rarity-color: #ffffff;
}
/* N：白底灰边（参考图路人甲/吃瓜群众） */
.gacha-title-n {
    --gacha-color: #6b7280;
    --gacha-solid: #6b7280;
    --gacha-bg: #ffffff;
    --gacha-border: #9ca3af;
    --gacha-rarity-bg: #6b7280;
    --gacha-rarity-color: #ffffff;
}

/* ---- 深色模式：描边系徽章反转底色，渐变系保持渐变 ---- */
html[data-dark-mode-theme="dark"] .gacha-title-r,
html[data-themes-color-mode="dark"] .gacha-title-r {
    --gacha-color: #e5e7eb;
    --gacha-bg: #1f2937;
    --gacha-border: #9ca3af;
    --gacha-rarity-bg: #e5e7eb;
    --gacha-rarity-color: #111827;
}
html[data-dark-mode-theme="dark"] .gacha-title-n,
html[data-themes-color-mode="dark"] .gacha-title-n {
    --gacha-color: #cbd5e1;
    --gacha-bg: #27303f;
    --gacha-border: #6b7280;
    --gacha-rarity-bg: #cbd5e1;
    --gacha-rarity-color: #27303f;
}
html[data-dark-mode-theme="dark"] .gacha-title-ur,
html[data-themes-color-mode="dark"] .gacha-title-ur {
    --gacha-serial-bg: rgba(255, 255, 255, .92);
    --gacha-serial-color: #6d28d9;
    --gacha-shimmer: rgba(255, 255, 255, .5);
    --gacha-ur-shadow: rgba(168, 85, 247, .45);
}

/* ---- 称号徽章基础样式（参考图：圆角实底标签） ---- */
.gacha-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border: 1px solid var(--gacha-border);
    border-radius: 6px;
    background: var(--gacha-bg);
    color: var(--gacha-color);
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
    white-space: nowrap;
    pointer-events: none;
}
/* 渐变底徽章文字微阴影，保证白字可读 */
.gacha-title-badge.gacha-title-ur,
.gacha-title-badge.gacha-title-ssr,
.gacha-title-badge.gacha-title-sr {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 3px rgba(0, 0, 0, .1);
}
/* UR 徽章流光特效 */
.gacha-title-badge.gacha-title-ur {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.gacha-title-badge.gacha-title-ur::after {
    position: absolute;
    z-index: 1;
    inset: -2px auto -2px -45%;
    width: 34%;
    background: linear-gradient(105deg, transparent, var(--gacha-shimmer), transparent);
    content: "";
    pointer-events: none;
    transform: skewX(-18deg) translateX(-180%);
    animation: gacha-ur-shimmer 3.2s ease-in-out infinite;
}
@keyframes gacha-ur-shimmer {
    0%, 38% { transform: skewX(-18deg) translateX(-180%); }
    68%, 100% { transform: skewX(-18deg) translateX(520%); }
}
@media (prefers-reduced-motion: reduce) {
    .gacha-title-badge.gacha-title-ur::after {
        animation: none;
        display: none;
    }
}
.gacha-title-link {
    pointer-events: auto;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, box-shadow .15s ease;
}
.gacha-title-link:hover {
    filter: brightness(.96);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.gacha-title-link:focus-visible {
    outline: 2px solid var(--brand, #334155);
    outline-offset: 2px;
}

/* ---- 称号各部分 ---- */
.gacha-title-icon {
    font-size: var(--font-size-sm, 13px);
    line-height: 1;
}
.gacha-title-name {
    font-weight: 600;
}
/* 稀有度角标：渐变徽章上白底彩字，描边徽章上实底白字 */
.gacha-title-rarity {
    margin-left: 2px;
    padding: 0 4px;
    border-radius: 4px;
    background: var(--gacha-rarity-bg, var(--gacha-solid));
    color: var(--gacha-rarity-color, var(--inverse-text, #fff));
    font-size: var(--font-size-xxs, 11px);
    font-weight: 700;
    line-height: 1.4;
}
.gacha-title-serial {
    position: relative;
    z-index: 2;
    margin-left: 2px;
    padding: 0 4px;
    border-radius: 4px;
    background: var(--gacha-serial-bg, rgba(255, 255, 255, .88));
    color: var(--gacha-serial-color, #6d28d9);
    font-size: var(--font-size-xxs, 11px);
    font-weight: 800;
    line-height: 1.4;
}

/* ---- 帖子作者旁的称号（紧凑模式） ---- */
.gacha-title-post-badge {
    gap: 3px;
    padding: 1px 8px;
    border: 1px solid var(--gacha-border);
    background: var(--gacha-bg);
    color: var(--gacha-color);
    font-size: var(--font-size-xs, 12px);
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
}
.gacha-title-post-badge .gacha-title-name {
    font-weight: 600;
}
.gacha-title-post-badge:hover {
    color: var(--gacha-color);
    filter: brightness(1.04);
}
/* ---- 用户资料页头部的大号徽章 ---- */
.gacha-title-profile-badge {
    gap: 5px;
    padding: 3px 12px;
    font-size: var(--font-size-md, 14px);
    border-radius: 8px;
    vertical-align: middle;
    margin-left: 4px;
}
/* UR 级别流光特效 */
.gacha-title-post-badge.gacha-title-ur {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    text-shadow: 0 1px 3px var(--gacha-ur-shadow);
}
.gacha-title-post-badge.gacha-title-ur::after {
    position: absolute;
    z-index: 1;
    inset: -2px auto -2px -45%;
    width: 34%;
    background: linear-gradient(105deg, transparent, var(--gacha-shimmer), transparent);
    content: "";
    pointer-events: none;
    transform: skewX(-18deg) translateX(-180%);
    animation: gacha-ur-post-shimmer 3.2s ease-in-out infinite;
}
.gacha-title-post-badge.gacha-title-ur:hover {
    filter: none;
}
@keyframes gacha-ur-post-shimmer {
    0%, 38% { transform: skewX(-18deg) translateX(-180%); }
    68%, 100% { transform: skewX(-18deg) translateX(520%); }
}
@media (prefers-reduced-motion: reduce) {
    .gacha-title-post-badge.gacha-title-ur::after {
        animation: none;
        display: none;
    }
}

/* ---- 侧边栏用户卡称号 ---- */
.gacha-sidebar-title {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0 0 4px;
}
.gacha-sidebar-title .gacha-title-badge {
    border: 1px solid var(--gacha-border);
    box-shadow: none;
}
.gacha-sidebar-title .gacha-title-icon {
    display: none;
}

/* ============================================================
 * 称号中心页面（参考图布局）
 * ============================================================ */
.gacha-profile-page,
.gacha-center-page {
    display: grid;
    gap: 18px;
    min-width: 0;
}
.gacha-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 8px);
    background: var(--panel, #fff);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}
.gacha-center-header > div {
    display: grid;
    gap: 6px;
}
.gacha-header-title {
    font-size: var(--font-size-xl, 21px);
    font-weight: 700;
}
.gacha-center-header p {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-sm, 13px);
    line-height: 1.6;
}
.gacha-center-stat {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: var(--radius, 8px);
    background: var(--bg, #f9fafb);
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs, 12px);
    white-space: nowrap;
}

/* ---- 标签页导航（参考图：我的称号/称号抽取/称号熔炼/称号回收/UR合成/称号交易） ---- */
.gacha-internal-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 8px);
    background: var(--bg, #f5f6f8);
    overflow-x: auto;
    scrollbar-width: none;
}
.gacha-internal-nav::-webkit-scrollbar { display: none; }
.gacha-internal-nav a {
    flex: 1 0 auto;
    padding: 9px 14px;
    border-radius: 6px;
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-sm, 13px);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.gacha-internal-nav a:hover {
    color: var(--text, #1f2937);
}
.gacha-internal-nav a.is-active {
    background: var(--panel, #fff);
    color: var(--text, #1f2937);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* ---- 标签面板 ---- */
.gacha-tab-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}
.gacha-tab-panel[hidden] {
    display: none;
}

/* ---- 区块标题 ---- */
.gacha-profile-collection-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 4px 0;
}
.gacha-profile-collection-head > div {
    display: grid;
    gap: 3px;
}
.gacha-profile-collection-head strong {
    color: var(--text, #1f2937);
    font-size: var(--font-size-lg, 17px);
}
.gacha-profile-collection-head span {
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs, 12px);
}
.gacha-loading {
    padding: 36px;
    text-align: center;
    color: var(--text-muted, #6b7280);
}

/* ---- 称号收藏网格（参考图：3 列等宽） ---- */
.gacha-profile-titles { display: block; }
.gacha-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    padding: 4px;
}

/* ---- 称号卡片（参考图结构：徽章/描述/获得日期×数量/操作） ---- */
.gacha-profile-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 16px 16px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 10px);
    background: var(--panel, #fff);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .05);
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    min-width: 0;
}
.gacha-profile-item:hover {
    border-color: var(--brand, #334155);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
}
/* 已装备：参考图的蓝色发光边框 */
.gacha-profile-item.is-equipped {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .2), 0 6px 20px rgba(59, 130, 246, .14);
    background: linear-gradient(180deg, rgba(59, 130, 246, .05), var(--panel, #fff) 72%);
}
.gacha-profile-item.is-expired {
    opacity: .62;
    background: var(--line-soft, #f3f4f6);
}
.gacha-profile-item.is-expired .gacha-title-badge {
    filter: grayscale(.6);
}
.gacha-profile-badge {
    display: flex;
    justify-content: center;
    min-height: 30px;
    align-items: center;
}
.gacha-profile-badge .gacha-title-badge {
    font-size: var(--font-size-sm, 13px);
    padding: 3px 12px;
    pointer-events: auto;
}
.gacha-profile-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    width: 100%;
    align-items: center;
}
.gacha-profile-desc {
    margin: 0;
    font-size: var(--font-size-xs, 12px);
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 18px;
}
/* 获得日期 × 数量（参考图: 2026-08-28 获得  ×1） */
.gacha-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 6px;
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-xs, 12px);
    color: var(--text-subtle, #9ca3af);
}
.gacha-count-tag {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-subtle, #9ca3af);
}

/* ---- 操作区（参考图: 分隔线 + 深色装备按钮 + 文字赠送链接） ---- */
.gacha-profile-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft, #f3f4f6);
}
.gacha-profile-action-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}
.gacha-profile-action-main form { margin: 0; }

/* 装备：深色实心按钮（参考图） */
.gacha-equip-btn {
    min-width: 88px;
    min-height: 34px;
    padding: 5px 18px;
    border: 1px solid #2c3e50;
    border-radius: 8px;
    background: #2c3e50;
    color: #fff;
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
    cursor: pointer;
    transition: all .12s ease;
}
.gacha-equip-btn:hover {
    background: #34495e;
    filter: brightness(1.08);
}
/* 已装备：灰色文字（参考图） */
.gacha-equipped-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 34px;
    color: var(--text-subtle, #9ca3af);
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
}
/* 赠送/卸下：文字链接（参考图） */
.gacha-link-btn {
    min-height: 34px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs, 12px);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: color .12s ease, text-decoration-color .12s ease;
}
.gacha-link-btn:hover:not(:disabled) {
    color: var(--brand, #2563eb);
    text-decoration-color: currentColor;
}
.gacha-link-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ---- 功能卡片（熔炼/回收/交易：紧凑版） ---- */
.gacha-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 14px 14px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 10px);
    background: var(--panel, #fff);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .05);
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.gacha-feature-item:hover {
    border-color: var(--brand, #334155);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.gacha-feature-item .gacha-profile-action {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    min-height: 34px;
}
.gacha-feature-btn {
    width: 100%;
    min-height: 34px;
    padding: 5px 14px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 8px;
    background: var(--bg, #f9fafb);
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
    cursor: pointer;
    transition: all .12s ease;
}
.gacha-feature-btn:hover:not(:disabled) {
    filter: brightness(1.04);
}
.gacha-feature-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}
/* 限时称号不可熔炼/回收：置灰并保留边框色区分 */
.gacha-feature-btn.gacha-feature-btn-limited {
    opacity: .6;
    cursor: not-allowed;
    background: var(--bg, #f3f4f6);
    color: var(--text-muted, #9ca3af);
    border-color: var(--line, #e5e7eb);
    filter: none;
}
.gacha-smelt-btn {
    border-color: #e8721a;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #c2410c;
}
.gacha-smelt-btn:hover:not(:disabled) {
    border-color: #c2410c;
}
.gacha-recycle-btn {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #15803d;
}
.gacha-recycle-btn:hover:not(:disabled) {
    border-color: #15803d;
}
.gacha-trade-btn {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
}
.gacha-trade-btn:hover:not(:disabled) {
    border-color: #1d4ed8;
}

/* ---- 功能说明区 ---- */
.gacha-feature-intro {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 10px);
    background: var(--panel, #fff);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .04);
}
.gacha-feature-intro p {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-sm, 13px);
    line-height: 1.6;
}
.gacha-dust-balance {
    color: var(--text, #1f2937);
    font-size: var(--font-size-md, 14px);
    font-weight: 700;
}
.gacha-dust-balance b {
    padding: 1px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #c2410c;
    font-size: var(--font-size-lg, 16px);
    font-variant-numeric: tabular-nums;
}
.gacha-rate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.gacha-rate-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-xs, 12px);
}
.gacha-rate-item b {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: var(--font-size-xxs, 11px);
}

/* ---- 稀有度角标独立使用（定价说明等处的配色芯片） ---- */
b.gacha-title-rarity,
span.gacha-title-rarity-chip-ur {
    display: inline-block;
    padding: 0 5px;
    border-radius: 4px;
    background: var(--gacha-rarity-bg, var(--gacha-solid));
    color: var(--gacha-rarity-color, #fff);
    font-size: var(--font-size-xxs, 11px);
    font-weight: 700;
    line-height: 1.5;
}
span.gacha-title-rarity-chip-ur {
    background: linear-gradient(135deg, #7c3aed, #c084fc);
    color: #fff;
}

/* ---- 状态标签 ---- */
.gacha-status-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
    font-size: var(--font-size-xxs, 11px);
    font-weight: 600;
}
.gacha-status-permanent {
    background: var(--success-soft, rgba(34, 197, 94, .14));
    color: var(--success, #22c55e);
}
.gacha-status-temp {
    background: var(--warning-soft, rgba(245, 158, 11, .14));
    color: var(--warning, #f59e0b);
}

/* ---- 限时称号禁止熔炼/回收：面板顶部规则提示条 ---- */
.gacha-limited-note {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid rgba(245, 158, 11, .35);
    border-radius: var(--radius-sm, 6px);
    background: var(--warning-soft, rgba(245, 158, 11, .12));
    color: var(--warning, #b45309);
    font-size: var(--font-size-xs, 12px);
    line-height: 1.6;
}

/* ---- 熔炼/回收卡片：限时称号被禁时的置灰 ---- */
.gacha-feature-item.is-limited-blocked {
    opacity: .75;
}
.gacha-feature-item.is-limited-blocked .gacha-title-badge {
    filter: grayscale(.35);
}

/* ============================================================
 * 抽卡（称号抽取标签页）
 * ============================================================ */
.gacha-pull-zone {
    padding: 18px 16px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 12px);
    background: var(--panel, #fff);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .04);
}
.gacha-pull-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 14px;
    font-size: var(--font-size-sm, 13px);
    color: var(--text-muted, #6b7280);
}
.gacha-credits b {
    color: var(--warning, #f59e0b);
    font-size: var(--font-size-lg, 16px);
    font-weight: 700;
}
.gacha-pool-rate {
    font-size: var(--font-size-xs, 12px);
    color: var(--text-muted, #6b7280);
}
.gacha-pull-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gacha-pull-btn {
    min-height: 44px;
    padding: 0 26px;
    border: 2px solid var(--brand, #2563eb);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand, #2563eb), var(--info, #3b82f6));
    color: var(--inverse-text, #fff);
    font-size: var(--font-size-md, 14px);
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
}
.gacha-pull-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}
.gacha-pull-btn:disabled {
    border-color: var(--line-soft, #e5e7eb);
    background: var(--line-soft, #e5e7eb);
    color: var(--text-disabled, #9ca3af);
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}
/* 十连抽：橙红渐变，视觉上区分于单抽 */
.gacha-pull-10 {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* ---- 抽卡结果 ---- */
.gacha-result-single,
.gacha-result-multi {
    margin-top: 4px;
    text-align: center;
}
.gacha-result-single {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 40px;
    border: 2px solid var(--gacha-border, #d1d5db);
    border-radius: 16px;
    background: var(--gacha-bg, #f9fafb);
    color: var(--gacha-color, var(--text, #374151));
    animation: gacha-card-pop .3s ease both;
}
.gacha-result-single.is-empty,
.gacha-result-cell.is-empty {
    border-color: var(--line, #e5e7eb);
    background: var(--bg-soft, #f3f4f6);
    color: var(--text-muted, #6b7280);
}
@keyframes gacha-card-pop {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.gacha-result-icon {
    font-size: 44px;
    line-height: 1;
}
.gacha-result-name {
    font-size: var(--font-size-lg, 16px);
    font-weight: 700;
    color: var(--gacha-color, #374151);
}
.gacha-result-sub {
    font-size: var(--font-size-xs, 12px);
    color: var(--gacha-color, var(--text-muted, #6b7280));
    opacity: .85;
}
.gacha-result-multi-head {
    margin-bottom: 10px;
    font-size: var(--font-size-md, 14px);
    font-weight: 600;
    color: var(--text, #1f2937);
}
.gacha-result-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.gacha-result-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 6px;
    border: 1px solid var(--gacha-border, #d1d5db);
    border-radius: var(--radius-sm, 8px);
    background: var(--gacha-bg, #f9fafb);
    color: var(--gacha-color, var(--text, #374151));
    animation: gacha-card-pop .3s ease both;
}
.gacha-result-cell .gacha-result-icon {
    font-size: 24px;
}
.gacha-result-cell .gacha-result-name {
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
    line-height: 1.3;
    word-break: break-all;
}
.gacha-new-tag,
.gacha-dup-tag {
    padding: 0 5px;
    border-radius: 3px;
    font-size: var(--font-size-xxs, 10px);
    font-weight: 700;
    line-height: 1.5;
}
.gacha-new-tag {
    background: var(--danger, #ef4444);
    color: #fff;
}
.gacha-dup-tag {
    background: var(--line-soft, #e5e7eb);
    color: var(--text-muted, #6b7280);
}

/* ---- 状态 / 来源标签 ---- */
.gacha-status-active {
    background: var(--success-soft, rgba(34, 197, 94, .14));
    color: var(--success, #22c55e);
}
.gacha-status-expired {
    background: var(--danger-soft, rgba(239, 68, 68, .12));
    color: var(--danger, #ef4444);
}
.gacha-source-tag,
.gacha-date-tag {
    font-size: var(--font-size-xxs, 11px);
    color: var(--text-subtle, #9ca3af);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
 * UR 合成（参考图标签页）
 * ============================================================ */
.gacha-synth-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 34px 20px;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius, 12px);
    background:
        radial-gradient(circle at 50% 0%, rgba(124, 58, 237, .08), transparent 65%),
        var(--panel, #fff);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .04);
    text-align: center;
}
.gacha-synth-orb {
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7 55%, #c084fc);
    box-shadow: 0 0 0 6px rgba(124, 58, 237, .12), 0 0 34px rgba(124, 58, 237, .35);
    color: #fff;
    font-size: 40px;
    line-height: 1;
    animation: gacha-synth-pulse 2.6s ease-in-out infinite;
}
@keyframes gacha-synth-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(124, 58, 237, .12), 0 0 26px rgba(124, 58, 237, .3); }
    50%      { box-shadow: 0 0 0 9px rgba(124, 58, 237, .08), 0 0 44px rgba(124, 58, 237, .45); }
}
@media (prefers-reduced-motion: reduce) {
    .gacha-synth-orb { animation: none; }
}
.gacha-synth-title {
    color: var(--text, #1f2937);
    font-size: var(--font-size-lg, 17px);
    font-weight: 700;
}
.gacha-synth-sub {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: var(--font-size-sm, 13px);
    line-height: 1.7;
}
.gacha-synth-sub b {
    color: #7c3aed;
}
.gacha-synth-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: min(360px, 100%);
}
.gacha-synth-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--line-soft, #f3f4f6);
    overflow: hidden;
}
.gacha-synth-bar i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #c084fc);
    transition: width .4s ease;
}
.gacha-synth-progress-text {
    color: var(--text-subtle, #9ca3af);
    font-size: var(--font-size-xs, 12px);
    font-variant-numeric: tabular-nums;
}
.gacha-synth-btn {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    min-width: 220px;
}
.gacha-synth-btn:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(124, 58, 237, .3);
}
.gacha-synth-btn:disabled {
    border-color: var(--line-soft, #e5e7eb);
    background: var(--line-soft, #e5e7eb);
    color: var(--text-disabled, #9ca3af);
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}
#ld-synth-result {
    display: flex;
    justify-content: center;
}
.gacha-synth-success {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, .16), 0 10px 30px rgba(124, 58, 237, .2);
}

/* ---- 全部称号图鉴 ---- */
.gacha-all-titles {
    padding: 2px 4px;
}
.gacha-all-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.gacha-all-item {
    display: flex;
    justify-content: center;
    padding: 10px 8px;
    border-radius: var(--radius-sm, 8px);
    transition: background .15s ease;
}
.gacha-all-item:hover {
    background: var(--bg, #f9fafb);
}
.gacha-all-item .gacha-title-badge {
    padding: 3px 10px;
    font-size: var(--font-size-xs, 12px);
}
/* 未获得：置灰 + 去饱和，与已获得形成对比 */
.gacha-all-item.is-locked .gacha-title-badge {
    opacity: .45;
    filter: grayscale(.65);
}

/* ---- 抽卡记录 ---- */
.gacha-records {
    padding: 2px 4px;
}
.gacha-records-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gacha-record-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-radius: var(--radius-md, 8px);
    background: var(--bg-secondary, #f8fafc);
    transition: background .15s ease;
}
.gacha-record-row:hover {
    background: var(--bg-tertiary, #f1f5f9);
}
.gacha-record-row.is-empty {
    opacity: .62;
}
.gacha-record-row .gacha-title-badge {
    padding: 3px 10px;
    font-size: var(--font-size-xs, 12px);
}
.gacha-record-meta {
    flex: 0 0 auto;
    font-size: var(--font-size-xs, 12px);
    color: var(--text-muted, #94a3b8);
    font-variant-numeric: tabular-nums;
}

/* ---- 收集度统计 ---- */
.gacha-collect-stat {
    flex: 0 0 auto;
    font-size: var(--font-size-xs, 12px);
    color: var(--text-muted, #94a3b8);
    font-variant-numeric: tabular-nums;
}

/* ---- 响应式 ---- */
@media (max-width: 720px) {
    .gacha-profile-grid,
    .gacha-feature-grid {
        grid-template-columns: 1fr;
    }
    .gacha-center-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }
    .gacha-center-stat {
        align-self: flex-start;
    }
    .gacha-internal-nav {
        margin: 0 -2px;
    }
    .gacha-internal-nav a {
        flex: 0 0 auto;
    }
}
@media (max-width: 600px) {
    .gacha-result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .gacha-pull-actions {
        flex-direction: column;
    }
    .gacha-pull-btn {
        width: 100%;
    }
    .gacha-result-single {
        padding: 20px 24px;
    }
    .gacha-record-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ============================================================
 * v4 增补: UR 专属编号 + 称号中心 SPA 挂载点适配
 * ============================================================ */

/* ---- 我的称号卡片 meta 行: UR 专属编号（全站唯一, 按获得顺序递增） ---- */
.gacha-serial-tag {
    padding: 0 6px;
    border: 1px solid rgba(109, 40, 217, .25);
    border-radius: 4px;
    background: rgba(109, 40, 217, .07);
    color: #6d28d9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--font-size-xxs, 11px);
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}
[data-theme="dark"] .gacha-serial-tag {
    border-color: rgba(167, 139, 250, .32);
    background: rgba(139, 92, 246, .14);
    color: #c4b5fd;
}

/* ---- 称号中心挂载点（lightdao.js gacha-profile 路由, 三栏布局主内容区） ----
 * 页面骨架(导航/侧栏/页脚/暗黑模式)全部继承 lightdao 主题;
 * 这里只保证 grid 布局子项不溢出, 加载占位与内容间距对齐主题节奏。 */
.ld-titles-mount {
    min-width: 0;
    display: grid;
    gap: 18px;
}
.ld-titles-mount .ls-empty {
    margin: 48px 0;
    color: var(--text-muted, #6b7280);
}
.ld-titles-mount .ls-empty i {
    display: block;
    margin-bottom: 10px;
    font-size: 26px;
    animation: gacha-placeholder-spin 1.6s linear infinite;
}
@keyframes gacha-placeholder-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .ld-titles-mount .ls-empty i { animation: none; }
}

/* ---- 三栏布局下的响应式微调（跟随 lightdao 主题断点习惯） ---- */
@media (max-width: 992px) {
    .ld-titles-mount { gap: 14px; }
}

/* ============================================================
 * 前台内联称号徽章 (lightdao.js renderUserTitle 输出)
 * 样式规格与靓号徽章 .ls-nice-number / .ls-user-uid 一致:
 *   药丸形 · 高 18px · 用户名后 margin-left 6px · vertical-align middle
 * 稀有度: ls-title-ur / ssr / sr / r / n (配色与称号中心一致)
 * ============================================================ */
a.ls-user-title,
span.ls-user-title {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    padding: 0 7px;
    margin-left: 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
    letter-spacing: .3px;
    vertical-align: middle;
    flex-shrink: 0;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
a.ls-user-title:hover,
a.ls-user-title:focus {
    text-decoration: none;
    filter: brightness(1.06);
}
.ls-user-title .ls-title-icon {
    font-style: normal;
    font-size: 11px;
    line-height: 1;
}
.ls-user-title .ls-title-name {
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* UR 全站唯一编号小角标 */
.ls-user-title .ls-title-serial {
    display: inline-flex;
    align-items: center;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    font-size: 9px;
    font-weight: 800;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: .2px;
}

/* ---- 稀有度配色（渐变系带文字阴影，描边系反白） ---- */
.ls-user-title.ls-title-ur {
    background: linear-gradient(135deg, #7c3aed, #a855f7 55%, #c084fc);
    color: #fff;
    border-color: #6d28d9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    box-shadow: 0 1px 4px rgba(124, 58, 237, .35);
}
.ls-user-title.ls-title-ur .ls-title-serial {
    background: rgba(255, 255, 255, .92);
    color: #6d28d9;
}
.ls-user-title.ls-title-ssr {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-color: #e8721a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .16);
    box-shadow: 0 1px 3px rgba(232, 114, 26, .28);
}
.ls-user-title.ls-title-ssr .ls-title-serial {
    background: rgba(255, 255, 255, .92);
    color: #e8721a;
}
.ls-user-title.ls-title-sr {
    background: linear-gradient(135deg, #4a90d9, #5ba0e9);
    color: #fff;
    border-color: #3a7bc8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .14);
    box-shadow: 0 1px 3px rgba(58, 123, 200, .25);
}
.ls-user-title.ls-title-sr .ls-title-serial {
    background: rgba(255, 255, 255, .92);
    color: #3a7bc8;
}
.ls-user-title.ls-title-r {
    background: #ffffff;
    color: #1f2937;
    border-color: #111827;
}
.ls-user-title.ls-title-r .ls-title-serial {
    background: #111827;
    color: #ffffff;
}
.ls-user-title.ls-title-n {
    background: #ffffff;
    color: #6b7280;
    border-color: #9ca3af;
}
.ls-user-title.ls-title-n .ls-title-serial {
    background: #6b7280;
    color: #ffffff;
}

/* ---- UR 流光特效 ---- */
.ls-user-title .ls-title-shimmer {
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-18deg);
    animation: ls-title-shimmer 2.6s ease-in-out infinite;
}
@keyframes ls-title-shimmer {
    0%   { left: -60%; }
    55%  { left: 120%; }
    100% { left: 120%; }
}

/* ---- 深色模式: 描边系反转底色, 渐变系保持渐变 ---- */
html[data-theme="dark"] .ls-user-title.ls-title-r,
html[data-dark-mode-theme="dark"] .ls-user-title.ls-title-r,
html[data-themes-color-mode="dark"] .ls-user-title.ls-title-r {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #9ca3af;
}
html[data-theme="dark"] .ls-user-title.ls-title-r .ls-title-serial,
html[data-dark-mode-theme="dark"] .ls-user-title.ls-title-r .ls-title-serial,
html[data-themes-color-mode="dark"] .ls-user-title.ls-title-r .ls-title-serial {
    background: #e5e7eb;
    color: #111827;
}
html[data-theme="dark"] .ls-user-title.ls-title-n,
html[data-dark-mode-theme="dark"] .ls-user-title.ls-title-n,
html[data-themes-color-mode="dark"] .ls-user-title.ls-title-n {
    background: #27303f;
    color: #cbd5e1;
    border-color: #6b7280;
}
html[data-theme="dark"] .ls-user-title.ls-title-n .ls-title-serial,
html[data-dark-mode-theme="dark"] .ls-user-title.ls-title-n .ls-title-serial,
html[data-themes-color-mode="dark"] .ls-user-title.ls-title-n .ls-title-serial {
    background: #cbd5e1;
    color: #27303f;
}
html[data-theme="dark"] .ls-user-title.ls-title-ur,
html[data-dark-mode-theme="dark"] .ls-user-title.ls-title-ur,
html[data-themes-color-mode="dark"] .ls-user-title.ls-title-ur {
    box-shadow: 0 1px 5px rgba(168, 85, 247, .45);
}

/* ---- 区域适配: 排行榜稍大(对齐 .ls-rank-name .ls-user-uid) ---- */
.ls-rank-name .ls-user-title {
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
}
/* 用户主页头部(h1 内)保持紧凑 */
.ls-user-profile-name .ls-user-title { height: 20px; }
/* 左栏用户卡/移动端抽屉: 徽章行已是 flex+gap 布局，这里不再需要额外 margin */
.ls-user-card-info .ls-user-title,
.ls-drawer-user-info .ls-user-title { flex-shrink: 0; }
/* 评论区/帖子列表行内对齐 */
.ls-comment-header .ls-user-title,
.ls-post-user-name .ls-user-title { transform: translateY(-1px); }
/* 小黑屋 */
.ls-jail-head .ls-user-title { height: 20px; }
