/* ============================================
   封神与哪吒 - 武将图鉴 & 洗练界面
   仙侠水墨国风主题
   ============================================ */

/* ---------- 页面容器 ---------- */
.heroes-page {
    position: relative;
    width: 100%;
    max-width: 375px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--color-bg);
    overflow: hidden;
    box-shadow: var(--shadow-ink-heavy);
}

/* ---------- 视图切换 ---------- */
.view-codex,
.view-refine {
    width: 100%;
    min-height: 100vh;
}

.view-codex.hidden,
.view-refine.hidden {
    display: none;
}

/* ==========================================
   武将图鉴视图
   ========================================== */

/* --- 顶部标题栏 --- */
.codex-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--color-bg);
    border-bottom: 1px solid rgba(44, 44, 44, 0.08);
    padding: 14px 16px 10px;
}

.codex-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.codex-header-top h1 {
    font-family: var(--font-title);
    font-size: 1.35rem;
    color: var(--color-ink);
    letter-spacing: 0.1em;
    position: relative;
}

.codex-header-top h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold), transparent);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.btn-back:hover {
    background-color: rgba(44, 44, 44, 0.05);
}

.btn-back::before {
    content: '\2190';
    font-size: 1.1rem;
    color: var(--color-ink-light);
}

/* 收集进度 */
.codex-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.codex-progress-text {
    font-size: 0.78rem;
    color: var(--color-ink-light);
}

.codex-progress-text em {
    font-style: normal;
    font-weight: 700;
    color: var(--color-gold-dark);
}

/* 筛选按钮组 */
.codex-filters {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 4px 12px;
    font-size: 0.72rem;
    font-family: var(--font-body);
    border: 1px solid rgba(44, 44, 44, 0.15);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-ink-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-gold-dark);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #fff;
    border-color: var(--color-gold);
}

/* --- 武将列表 --- */
.codex-list {
    padding: 8px 12px 100px;
    overflow-y: auto;
}

/* --- 武将卡片 --- */
.hero-card {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 88px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    background-color: rgba(250, 248, 240, 0.8);
    border: 1px solid rgba(44, 44, 44, 0.08);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    /* 宣纸质感 */
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 4px,
            rgba(44, 44, 44, 0.006) 4px,
            rgba(44, 44, 44, 0.006) 5px
        );
}

.hero-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-ink);
    border-color: rgba(44, 44, 44, 0.15);
}

.hero-card:active {
    transform: scale(0.985);
}

/* 已解锁卡片微光 */
.hero-card.unlocked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.hero-card.unlocked:hover::after {
    opacity: 1;
}

.hero-card.unlocked.quality-legendary:hover::after {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.06), transparent 60%);
}

.hero-card.unlocked.quality-epic:hover::after {
    background: linear-gradient(135deg, rgba(155, 142, 196, 0.06), transparent 60%);
}

.hero-card.unlocked.quality-rare:hover::after {
    background: linear-gradient(135deg, rgba(106, 159, 181, 0.06), transparent 60%);
}

/* 未解锁灰色态 */
.hero-card.locked {
    opacity: 0.55;
    filter: grayscale(0.3);
}

.hero-card.locked:hover {
    opacity: 0.7;
    filter: grayscale(0.1);
}

/* 卡片左侧 - 武将大字 */
.hero-card-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    min-width: 60px;
    flex-shrink: 0;
    position: relative;
}

.hero-card-char-inner {
    font-family: var(--font-title);
    font-size: 3rem;
    line-height: 1;
    letter-spacing: 0.05em;
}

/* 品质颜色 - 传奇金色 */
.hero-card.quality-legendary .hero-card-char-inner {
    color: var(--color-gold);
    text-shadow:
        0 0 12px rgba(212, 168, 83, 0.4),
        0 0 24px rgba(212, 168, 83, 0.2),
        0 2px 4px rgba(212, 168, 83, 0.3);
}

/* 品质颜色 - 史诗紫色 */
.hero-card.quality-epic .hero-card-char-inner {
    color: var(--color-purple);
    text-shadow:
        0 0 12px rgba(155, 142, 196, 0.4),
        0 0 24px rgba(155, 142, 196, 0.2),
        0 2px 4px rgba(155, 142, 196, 0.3);
}

/* 品质颜色 - 稀有蓝色 */
.hero-card.quality-rare .hero-card-char-inner {
    color: var(--color-info);
    text-shadow:
        0 0 12px rgba(106, 159, 181, 0.4),
        0 0 24px rgba(106, 159, 181, 0.2),
        0 2px 4px rgba(106, 159, 181, 0.3);
}

/* 卡片中间 - 武将信息 */
.hero-card-info {
    flex: 1;
    padding: 0 10px;
    min-width: 0;
}

.hero-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.hero-card-name {
    font-family: var(--font-title);
    font-size: 1.05rem;
    color: var(--color-ink);
}

/* 品质标签 */
.hero-card .quality-tag {
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.hero-card.quality-legendary .quality-tag {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #fff;
}

.hero-card.quality-epic .quality-tag {
    background: linear-gradient(135deg, var(--color-purple), var(--color-purple-dark));
    color: #fff;
}

.hero-card.quality-rare .quality-tag {
    background: linear-gradient(135deg, var(--color-info), #5a8da8);
    color: #fff;
}

.hero-card-level {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-gold-dark);
    margin-left: auto;
}

/* 兵种类型 */
.hero-card-troop {
    font-size: 0.72rem;
    color: var(--color-ink-light);
    margin-bottom: 2px;
}

/* 合成公式 */
.hero-card-formula {
    font-size: 0.65rem;
    color: var(--color-ink-light);
    margin-bottom: 4px;
    opacity: 0.7;
}

.hero-card-formula .formula-char {
    color: var(--color-gold-dark);
    font-weight: 500;
}

.hero-card-formula .formula-plus {
    color: var(--color-ink-light);
    margin: 0 1px;
}

/* 属性概要 */
.hero-card-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-card-stats span {
    font-size: 0.6rem;
    color: var(--color-ink-light);
}

.hero-card-stats span em {
    font-style: normal;
    color: var(--color-ink);
    font-weight: 600;
}

/* 卡片右侧 - 操作区 */
.hero-card-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 64px;
    min-width: 64px;
    flex-shrink: 0;
}

.btn-refine {
    padding: 5px 12px;
    font-size: 0.72rem;
    font-family: var(--font-title);
    letter-spacing: 0.08em;
    border: 1.5px solid var(--color-gold);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-gold-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-refine:hover {
    background-color: rgba(212, 168, 83, 0.1);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.2);
}

.btn-refine:active {
    transform: scale(0.95);
}

/* 未解锁状态 */
.hero-card-actions .locked-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.lock-icon {
    font-size: 1.1rem;
    color: var(--color-ink-light);
    opacity: 0.4;
}

.lock-text {
    font-size: 0.6rem;
    color: var(--color-ink-light);
    opacity: 0.5;
    text-align: center;
    line-height: 1.3;
}

/* 展开箭头 */
.expand-arrow {
    font-size: 0.7rem;
    color: var(--color-ink-light);
    opacity: 0.4;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.hero-card.expanded .expand-arrow {
    transform: rotate(180deg);
    opacity: 0.7;
}

/* --- 卡片展开详情 --- */
.hero-card-detail {
    display: none;
    padding: 10px 0 6px;
    border-top: 1px solid rgba(44, 44, 44, 0.06);
    margin-top: 8px;
}

.hero-card.expanded .hero-card-detail {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.hero-card-detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.detail-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
}

.detail-stat-label {
    color: var(--color-ink-light);
}

.detail-stat-value {
    font-weight: 600;
    color: var(--color-ink);
}

/* ==========================================
   洗练视图
   ========================================== */

/* --- 顶部标题栏 --- */
.refine-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--color-bg);
    border-bottom: 1px solid rgba(44, 44, 44, 0.08);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.refine-header h1 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--color-ink);
    letter-spacing: 0.1em;
    position: relative;
}

.refine-header h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold), transparent);
}

.refine-header h1 .refine-hero-name {
    color: var(--color-gold-dark);
}

.refine-header h1 .refine-separator {
    margin: 0 6px;
    color: var(--color-ink-light);
    font-weight: 300;
}

/* --- 武将信息摘要卡片 --- */
.refine-hero-summary {
    margin: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(250, 248, 240, 0.9), rgba(232, 224, 204, 0.4));
    border: 1px solid rgba(212, 168, 83, 0.2);
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.refine-hero-summary::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 5px,
            rgba(44, 44, 44, 0.005) 5px,
            rgba(44, 44, 44, 0.005) 6px
        );
    pointer-events: none;
}

.refine-hero-summary-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.refine-hero-big-char {
    font-family: var(--font-title);
    font-size: 3rem;
    color: var(--color-gold);
    text-shadow:
        0 0 16px rgba(212, 168, 83, 0.4),
        0 0 32px rgba(212, 168, 83, 0.15);
    line-height: 1;
}

.refine-hero-level {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-gold-dark);
    padding: 2px 8px;
    border: 1px solid var(--color-gold);
    border-radius: var(--radius-pill);
}

.refine-hero-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.refine-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.refine-stat-label {
    color: var(--color-ink-light);
}

.refine-stat-value {
    font-weight: 700;
    color: var(--color-ink);
}

/* --- 洗练孔位区域 --- */
.refine-slots-section {
    margin: 0 12px 12px;
}

.refine-slots-title {
    font-family: var(--font-title);
    font-size: 0.9rem;
    color: var(--color-ink);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
}

.refine-slots-container {
    display: flex;
    gap: 10px;
}

/* 单个孔位 */
.refine-slot {
    flex: 1;
    min-height: 100px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

/* 孔位 - 已解锁且有词条 */
.refine-slot.filled {
    background: linear-gradient(180deg, rgba(250, 248, 240, 0.95), rgba(232, 224, 204, 0.5));
    border: 2px solid rgba(44, 44, 44, 0.12);
    box-shadow: var(--shadow-ink);
}

.refine-slot.filled:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-ink-heavy);
}

/* 孔位 - 已解锁但为空 */
.refine-slot.empty {
    background: rgba(232, 224, 204, 0.2);
    border: 2px dashed rgba(44, 44, 44, 0.15);
}

.refine-slot.empty:hover {
    border-color: var(--color-gold);
    background: rgba(212, 168, 83, 0.05);
}

/* 孔位 - 未解锁 */
.refine-slot.locked-slot {
    background: rgba(232, 224, 204, 0.15);
    border: 2px solid rgba(44, 44, 44, 0.08);
    opacity: 0.5;
    cursor: default;
}

/* 孔位 - 选中态 */
.refine-slot.selected {
    border: 2px solid var(--color-gold) !important;
    box-shadow: 0 0 16px rgba(212, 168, 83, 0.3), var(--shadow-gold) !important;
}

.refine-slot.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 12px rgba(212, 168, 83, 0.1);
    pointer-events: none;
}

/* 孔位序号 */
.refine-slot-index {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.6rem;
    color: var(--color-ink-light);
    opacity: 0.5;
}

/* 空孔位提示 */
.refine-slot-empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--color-ink-light);
    font-size: 0.72rem;
    opacity: 0.6;
}

.refine-slot-empty-hint .empty-icon {
    font-size: 1.4rem;
    opacity: 0.3;
}

/* 锁定孔位提示 */
.refine-slot-lock-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--color-ink-light);
    font-size: 0.72rem;
}

.refine-slot-lock-hint .lock-slot-icon {
    font-size: 1.3rem;
    opacity: 0.4;
}

.refine-slot-lock-hint .unlock-level {
    font-size: 0.65rem;
    color: var(--color-gold-dark);
    font-weight: 600;
}

/* 词条显示 */
.refine-slot-affix {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.affix-name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.affix-value {
    font-size: 0.88rem;
    font-weight: 700;
}

/* 词条品质颜色 - 白 */
.affix-quality-white .affix-name,
.affix-quality-white .affix-value {
    color: #c8c8c8;
}

.refine-slot.filled.affix-quality-white {
    border-color: rgba(200, 200, 200, 0.4);
}

/* 词条品质颜色 - 绿 */
.affix-quality-green .affix-name,
.affix-quality-green .affix-value {
    color: #4ade80;
}

.refine-slot.filled.affix-quality-green {
    border-color: rgba(74, 222, 128, 0.4);
}

/* 词条品质颜色 - 蓝 */
.affix-quality-blue .affix-name,
.affix-quality-blue .affix-value {
    color: #60a5fa;
}

.refine-slot.filled.affix-quality-blue {
    border-color: rgba(96, 165, 250, 0.4);
}

/* 词条品质颜色 - 紫 */
.affix-quality-purple .affix-name,
.affix-quality-purple .affix-value {
    color: #c084fc;
}

.refine-slot.filled.affix-quality-purple {
    border-color: rgba(192, 132, 252, 0.4);
}

/* 词条品质标签 */
.affix-quality-badge {
    font-size: 0.55rem;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.affix-quality-badge.white {
    background: rgba(200, 200, 200, 0.15);
    color: #c8c8c8;
}

.affix-quality-badge.green {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.affix-quality-badge.blue {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.affix-quality-badge.purple {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
}

/* --- 洗练操作区 --- */
.refine-actions {
    margin: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background-color: rgba(232, 224, 204, 0.2);
    border: 1px solid rgba(44, 44, 44, 0.06);
    min-height: 80px;
}

.refine-actions-empty {
    text-align: center;
    padding: 16px;
    color: var(--color-ink-light);
    font-size: 0.78rem;
    opacity: 0.6;
}

/* 选中词条后显示的操作面板 */
.refine-action-panel {
    display: none;
}

.refine-action-panel.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.refine-action-detail {
    margin-bottom: 12px;
}

.refine-action-detail-title {
    font-size: 0.72rem;
    color: var(--color-ink-light);
    margin-bottom: 6px;
}

.refine-action-current-affix {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background-color: rgba(250, 248, 240, 0.8);
    border: 1px solid rgba(44, 44, 44, 0.08);
}

.current-affix-name {
    font-weight: 600;
    font-size: 0.82rem;
}

.current-affix-value {
    font-weight: 700;
    font-size: 0.82rem;
    margin-left: auto;
}

/* 操作按钮组 */
.refine-action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.btn-refine-do {
    flex: 1;
    padding: 10px 16px;
    font-family: var(--font-title);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 3px 10px var(--color-red-glow);
    position: relative;
    overflow: hidden;
}

.btn-refine-do:hover {
    box-shadow: 0 4px 16px var(--color-red-glow);
}

.btn-refine-do:active {
    transform: scale(0.96);
}

.btn-refine-do:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 洗练按钮水光 */
.btn-refine-do::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 75%, rgba(255, 255, 255, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 35%);
    pointer-events: none;
}

.btn-refine-lock {
    padding: 10px 16px;
    font-family: var(--font-title);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    border: 1.5px solid var(--color-gold);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-gold-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-refine-lock:hover {
    background-color: rgba(212, 168, 83, 0.08);
}

.btn-refine-lock:active {
    transform: scale(0.96);
}

.btn-refine-lock.locked-state {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #fff;
}

/* 灵石余额 */
.refine-resource {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--color-ink-light);
}

.refine-resource-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8ec5fc, #e0c3fc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
}

.refine-resource-count {
    font-weight: 700;
    color: var(--color-purple-dark);
}

/* --- 洗练滚动动画 --- */
.refine-rolling-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(44, 44, 44, 0.7);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.refine-rolling-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.rolling-container {
    width: 280px;
    height: 200px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 40px rgba(212, 168, 83, 0.3);
}

/* 滚动区域 */
.rolling-strip {
    position: absolute;
    left: 0;
    right: 0;
    transition: transform 0;
    will-change: transform;
}

.rolling-strip.animating {
    transition: transform 2.5s cubic-bezier(0.15, 0.8, 0.2, 1);
}

.rolling-item {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 1rem;
    letter-spacing: 0.05em;
    padding: 0 16px;
}

/* 滚动窗口指示线 */
.rolling-indicator {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 60px;
    border: 2px solid var(--color-gold);
    border-radius: var(--radius-md);
    pointer-events: none;
    z-index: 5;
    background-color: rgba(212, 168, 83, 0.05);
}

/* --- 洗练结果弹窗 --- */
.refine-result-popup {
    position: fixed;
    inset: 0;
    background-color: rgba(44, 44, 44, 0.75);
    z-index: 110;
    display: none;
    align-items: center;
    justify-content: center;
}

.refine-result-popup.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.refine-result-card {
    width: 300px;
    padding: 28px 24px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #faf8f0, var(--color-bg));
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 40px rgba(212, 168, 83, 0.25);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: resultPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.refine-result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 6px,
            rgba(44, 44, 44, 0.004) 6px,
            rgba(44, 44, 44, 0.004) 7px
        );
    pointer-events: none;
}

.refine-result-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--color-ink);
    margin-bottom: 16px;
    letter-spacing: 0.1em;
}

.refine-result-affix {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background: rgba(44, 44, 44, 0.03);
    position: relative;
}

.result-affix-name {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 600;
}

.result-affix-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.result-affix-quality {
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.refine-result-buttons {
    display: flex;
    gap: 10px;
}

.btn-result-keep {
    flex: 1;
    padding: 10px 16px;
    font-family: var(--font-title);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-gold);
}

.btn-result-keep:hover {
    box-shadow: 0 3px 16px rgba(212, 168, 83, 0.4);
}

.btn-result-keep:active {
    transform: scale(0.96);
}

.btn-result-reroll {
    flex: 1;
    padding: 10px 16px;
    font-family: var(--font-title);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    border: 1.5px solid rgba(44, 44, 44, 0.15);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-ink);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-result-reroll:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

.btn-result-reroll:active {
    transform: scale(0.96);
}

/* ==========================================
   动画
   ========================================== */

/* 词条出现光效 */
@keyframes affixPulseGreen {
    0% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(74, 222, 128, 0.4), 0 0 40px rgba(74, 222, 128, 0.15);
    }
    100% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }
}

@keyframes affixPulseBlue {
    0% {
        box-shadow: 0 0 0 rgba(96, 165, 250, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(96, 165, 250, 0.4), 0 0 40px rgba(96, 165, 250, 0.15);
    }
    100% {
        box-shadow: 0 0 0 rgba(96, 165, 250, 0);
    }
}

@keyframes affixPulsePurple {
    0% {
        box-shadow: 0 0 0 rgba(192, 132, 252, 0);
    }
    40% {
        box-shadow: 0 0 30px rgba(192, 132, 252, 0.5), 0 0 60px rgba(192, 132, 252, 0.2);
    }
    100% {
        box-shadow: 0 0 0 rgba(192, 132, 252, 0);
    }
}

.refine-slot.affix-quality-green.pulse-anim {
    animation: affixPulseGreen 0.8s ease;
}

.refine-slot.affix-quality-blue.pulse-anim {
    animation: affixPulseBlue 0.8s ease;
}

.refine-slot.affix-quality-purple.pulse-anim {
    animation: affixPulsePurple 1s ease;
}

/* 结果弹出动画 */
@keyframes resultPop {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================
   移动端适配
   ========================================== */

@media screen and (max-width: 375px) {
    .hero-card-char {
        width: 50px;
        min-width: 50px;
    }

    .hero-card-char-inner {
        font-size: 2.4rem;
    }

    .hero-card {
        min-height: 78px;
        padding: 8px 10px;
    }

    .hero-card-actions {
        width: 56px;
        min-width: 56px;
    }

    .refine-hero-big-char {
        font-size: 2.4rem;
    }

    .refine-slots-container {
        gap: 6px;
    }

    .refine-slot {
        min-height: 88px;
        padding: 10px 6px;
    }
}

@media screen and (min-width: 768px) {
    .hero-card-char-inner {
        font-size: 3.5rem;
    }

    .hero-card {
        min-height: 96px;
    }
}
