/* Components - 崩坏:星穹铁道 原生组件 (Authentic Components) */

/* ============ 资源图标 (SVG) ============ */
.resource-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.resource-icon-svg.small {
    width: 16px;
    height: 16px;
}

/* ============ 跃迁按钮 ============ */
.warp-btn {
    position: relative;
    height: 56px;
    min-width: 200px;
    border: none;
    border-radius: 28px;
    /* 胶囊形 */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease;
    overflow: hidden;
}

.warp-btn:active {
    transform: scale(0.95);
}

/* 10连按钮 */
.warp-btn.ten {
    background: var(--btn-warp-10-bg);
    color: #3B3B3B;
    box-shadow: 0 0 15px rgba(219, 194, 145, 0.3);
}

.warp-btn.ten::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.5s;
}

.warp-btn.ten:hover::after {
    transform: rotate(45deg) translateX(100%);
}

/* 单抽按钮 */
.warp-btn.single {
    background: var(--btn-warp-1-bg);
    color: #3B3B3B;
}

.warp-btn.single:hover {
    background: #FFFFFF;
}

.btn-label {
    font-size: var(--font-lg);
    font-weight: 700;
    line-height: 1.2;
}

.btn-cost {
    font-size: var(--font-xs);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============ 保底 HUD (Heads-Up Display) ============ */
.pity-hud {
    position: absolute;
    bottom: 160px;
    /* 位于底部栏上方 */
    left: var(--spacing-xl);
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 20px;
    border-radius: 4px;
    border-left: 3px solid var(--color-gold);
    color: var(--color-text);
    font-size: var(--font-sm);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: var(--font-md);
}

.pity-row.small {
    font-size: var(--font-xs);
    opacity: 0.8;
}

.guarantee-badge {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFD700;
    font-size: var(--font-xs);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

/* ============ 中心横幅展示 (Banner Display) ============ */
.banner-display {
    width: 80%;
    height: 60%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.banner-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.banner-title {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.banner-subtitle {
    font-size: 20px;
    color: var(--color-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============ 模态页通用样式 (Modal) ============ */
.modal-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /*以此为基础的深色背景*/
    backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    padding: 40px 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-page.active {
    opacity: 1;
    pointer-events: auto;
}

/* ============ 历史记录列表 (Redesign) ============ */
.history-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--color-text);
    font-size: 14px;
}

.history-table thead {
    background: rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
}

.history-table th {
    text-align: left;
    padding: 16px 24px;
    border-bottom: 2px solid rgba(219, 194, 145, 0.3);
    /* 金色分割线 */
    color: #DBC291;
    /* 金色表头 */
    font-weight: 500;
    font-size: 16px;
}

.history-table td {
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-row {
    transition: background 0.2s;
}

.history-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.history-row:hover {
    background: rgba(219, 194, 145, 0.1);
    /* 悬停金色高亮 */
}

/* 稀有度颜色 */
.history-row.rarity-5 td {
    color: #DBC291;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(219, 194, 145, 0.3);
}

.history-row.rarity-4 td {
    color: #9C6DE5;
    font-weight: 500;
}

.history-row.rarity-3 td {
    color: #AAAAAA;
}

/* 滚动条美化 */
.history-scroll-area {
    flex: 1;
    overflow-y: auto;
}

.history-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.history-scroll-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.history-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.history-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ============ 筛选器与头部 ============ */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-title {
    font-size: 24px;
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: #DBC291;
}

.filter-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.filter-select:hover {
    border-color: #DBC291;
}

.action-btn {
    padding: 8px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.action-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* ============ 统计卡片 (极简风格) ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border-top: 2px solid transparent;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-top-color: var(--color-gold);
}

.stat-label {
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    margin-bottom: 8px;
}

.stat-value {
    font-size: var(--font-xl);
    font-weight: 700;
}

/* ============ 抽卡结果展示 ============ */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-modal);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.result-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.result-card {
    width: 160px;
    height: 280px;
    /* 竖长比例 */
    background: #1a1a1a;
    border: 1px solid #333;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-card.show {
    transform: scale(1);
    opacity: 1;
}

.result-card.rarity-5 {
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 30px rgba(219, 194, 145, 0.3);
}

.result-card.rarity-4 {
    border: 2px solid var(--color-purple);
}

.result-card.rarity-3 {
    border: 2px solid var(--color-blue);
}

.close-results {
    position: absolute;
    top: 40px;
    right: 40px;
    color: #fff;
    background: transparent;
    border: 1px solid #fff;
    padding: 8px 24px;
    border-radius: 20px;
    cursor: pointer;
}

/* ============ 统计值颜色 ============ */
.stat-value.gold {
    color: var(--color-gold);
}

.stat-value.purple {
    color: var(--color-purple);
}

.stat-value.blue {
    color: var(--color-blue);
}

/* ============ 图表网格 ============ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.chart-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    height: 300px;
    position: relative;
    overflow: hidden;
}

.chart-title {
    color: var(--color-text-gold);
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
    letter-spacing: 1px;
}

.chart-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.3);
    font-size: var(--font-sm);
}

/* ============ 详情页 ============ */
#details-content {
    overflow-y: auto;
    flex: 1;
}

.details-section {
    margin-bottom: var(--spacing-xl);
}

.details-section-title {
    color: var(--color-gold);
    font-size: var(--font-lg);
    font-weight: 500;
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(219, 194, 145, 0.3);
}

.details-pool-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.details-pool-name {
    font-size: var(--font-xl);
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--spacing-sm);
}

.details-pool-meta {
    display: flex;
    gap: var(--spacing-xl);
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
}

.details-pool-meta strong {
    color: #fff;
}

.details-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.details-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.details-item.rarity-5-bg {
    border-color: rgba(219, 194, 145, 0.4);
    background: rgba(219, 194, 145, 0.08);
}

.details-item.rarity-4-bg {
    border-color: rgba(156, 109, 229, 0.4);
    background: rgba(156, 109, 229, 0.08);
}

.details-item-name {
    font-weight: 600;
    color: #fff;
    font-size: var(--font-md);
}

.details-item-type {
    font-size: var(--font-xs);
    color: var(--color-text-secondary);
}

.details-subsection h4 {
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    font-weight: 500;
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.details-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-sm);
    padding: var(--spacing-lg) 0;
}

/* 保底进度 */
.details-pity-status {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.pity-status-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.pity-status-label {
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    min-width: 100px;
}

.pity-status-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.pity-status-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.pity-status-bar.gold {
    background: linear-gradient(to right, rgba(219, 194, 145, 0.6), var(--color-gold));
}

.pity-status-bar.purple {
    background: linear-gradient(to right, rgba(156, 109, 229, 0.6), var(--color-purple));
}

.pity-status-count {
    font-size: var(--font-sm);
    color: #fff;
    min-width: 60px;
    text-align: right;
}

.pity-status-value {
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
}

.pity-status-value.active {
    color: var(--color-gold);
    font-weight: 600;
}

/* 概率表格 */
.details-rate-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--color-text);
    font-size: var(--font-sm);
}

.details-rate-table th,
.details-rate-table td {
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.details-rate-table th {
    color: var(--color-gold);
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
}

.details-rate-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* 规则说明 */
.details-rules {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.details-rule-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--color-gold);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.rule-title {
    color: #fff;
    font-weight: 600;
    font-size: var(--font-md);
    margin-bottom: 4px;
}

.rule-desc {
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .details-pool-meta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .pity-status-item {
        flex-wrap: wrap;
    }
}