/* ========== 全局 ========== */
:root {
    --color-bg-1: #0f0c29;
    --color-bg-2: #302b63;
    --color-bg-3: #24243e;
    --color-N: #9ca3af;
    --color-R: #3b82f6;
    --color-SR: #a855f7;
    --color-SSR: #fbbf24;
    --color-fire: #ef4444;
    --color-ice: #06b6d4;
    --color-thunder: #facc15;
    --color-light: #fef3c7;
    --color-dark: #6366f1;
    --color-nature: #22c55e;
    --color-rock: #92400e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--color-bg-1) 0%,
                                var(--color-bg-2) 50%, var(--color-bg-3) 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== 星空 ========== */
.stars {
    position: fixed; inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20% 30%, #fff, transparent),
        radial-gradient(1px 1px at 40% 70%, #fff, transparent),
        radial-gradient(1px 1px at 60% 20%, #fff, transparent),
        radial-gradient(2px 2px at 80% 50%, #fff, transparent),
        radial-gradient(1px 1px at 10% 80%, #fff, transparent),
        radial-gradient(1px 1px at 90% 10%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 30% 90%, #fff, transparent),
        radial-gradient(1px 1px at 70% 40%, #fff, transparent);
    opacity: 0.35;
    animation: twinkle 8s ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{opacity:.3} 50%{opacity:.55} }

/* ========== 顶部导航 ========== */
.nav {
    background: rgba(15, 12, 41, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 16px;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
}
.nav-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-tab {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    font-size: 0.95rem;
}
.nav-tab:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-tab.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ========== 状态栏 ========== */
.status-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    min-width: 150px;
}
.status-icon { font-size: 1.6rem; }
.status-info { display: flex; flex-direction: column; }
.status-label { font-size: 0.8rem; color: #94a3b8; }
.status-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
}

/* ========== 标签页 ========== */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 按钮面板 ========== */
.action-panel {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.draw-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 28px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25),
                                       rgba(236, 72, 153, 0.25));
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 150px;
    font-family: inherit;
}
.draw-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.45);
    border-color: rgba(255, 255, 255, 0.4);
}
.draw-btn:active:not(:disabled) { transform: translateY(0); }
.draw-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.draw-btn.ten {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25),
                                       rgba(239, 68, 68, 0.25));
}
.draw-btn.ten:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.45);
}
.draw-btn.reset {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.25),
                                       rgba(71, 85, 105, 0.25));
}
.draw-btn.sound {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25),
                                       rgba(59, 130, 246, 0.25));
}
.draw-btn.battle {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25),
                                       rgba(132, 204, 22, 0.25));
}
.draw-btn.battle.hard {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25),
                                       rgba(239, 68, 68, 0.25));
}
.draw-btn.battle.nightmare {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.4),
                                       rgba(0, 0, 0, 0.4));
}
.draw-btn.save {
    margin-top: 16px;
    width: 100%;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3),
                                       rgba(16, 185, 129, 0.3));
}
.btn-icon { font-size: 1.6rem; }
.btn-title { font-size: 1.05rem; font-weight: 700; }
.btn-cost { font-size: 0.78rem; opacity: 0.75; }

/* ========== 抽卡动画舞台 ========== */
.draw-stage {
    height: 0;
    overflow: visible;
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.card-back {
    width: 200px;
    height: 280px;
    background: linear-gradient(135deg, #1e1b4b, #312e81, #1e1b4b);
    background-size: 200% 200%;
    border: 4px solid #fbbf24;
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.6),
                inset 0 0 20px rgba(251, 191, 36, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    opacity: 0;
    transform: scale(0.5) rotateY(0deg);
}
.card-back.show {
    opacity: 1;
    animation: cardBackAppear 0.5s ease-out forwards,
               cardBackGlow 2s ease-in-out infinite;
}
@keyframes cardBackAppear {
    from { opacity: 0; transform: scale(0.3) rotateY(0deg); }
    to   { opacity: 1; transform: scale(1)   rotateY(0deg); }
}
@keyframes cardBackGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.6),
                           inset 0 0 20px rgba(251, 191, 36, 0.2); }
    50%      { box-shadow: 0 0 80px rgba(251, 191, 36, 1),
                           inset 0 0 30px rgba(251, 191, 36, 0.4); }
}
.card-back.flipping {
    animation: cardFlip 0.8s ease-in-out forwards;
}
@keyframes cardFlip {
    0%   { transform: scale(1)   rotateY(0deg); }
    100% { transform: scale(1.2) rotateY(1800deg); opacity: 0; }
}
.card-back-pattern {
    font-size: 4rem;
    color: #fbbf24;
    animation: spin 3s linear infinite;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
}
@keyframes spin { to { transform: rotate(360deg); } }
.card-back-text {
    margin-top: 16px;
    font-size: 1.5rem;
    color: #fbbf24;
    letter-spacing: 8px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

/* ========== 区块标题 ========== */
.section-title {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #e2e8f0;
    letter-spacing: 4px;
    font-weight: 600;
}

/* ========== 抽卡结果 ========== */
.result-section { margin-bottom: 30px; }
.card-display {
    min-height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 26px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.empty-state { text-align: center; color: #64748b; }
.empty-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1);opacity:.5} 50%{transform:scale(1.1);opacity:.7} }

/* ========== 卡牌样式 ========== */
.card {
    width: 200px;
    height: 280px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 3px solid;
    animation: cardEnter 0.6s ease-out backwards;
    transform-style: preserve-3d;
    perspective: 1000px;
}
@keyframes cardEnter {
    0%   { opacity: 0; transform: scale(0.3) rotateY(180deg); }
    100% { opacity: 1; transform: scale(1) rotateY(0deg); }
}
.card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.card.rarity-N   { border-color: var(--color-N); }
.card.rarity-R   { border-color: var(--color-R); }
.card.rarity-SR  { border-color: var(--color-SR); }
.card.rarity-SSR {
    border-color: var(--color-SSR);
    box-shadow:
        0 0 30px rgba(251, 191, 36, 0.7),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

/* SSR 卡片流光 */
.card.rarity-SSR::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 30%,
                                rgba(255, 255, 255, 0.35) 50%,
                                transparent 70%);
    animation: shine 3s infinite;
    pointer-events: none;
}
@keyframes shine {
    0%   { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%)  translateY(100%); }
}

.card-bg {
    position: absolute; inset: 0;
    opacity: 0.35;
    z-index: 0;
}
.card-content {
    position: relative;
    z-index: 1;
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.card-rarity {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    align-self: flex-start;
    letter-spacing: 1px;
}
.rarity-N  .card-rarity { background: var(--color-N);  color: #000; }
.rarity-R  .card-rarity { background: var(--color-R);  color: #fff; }
.rarity-SR .card-rarity { background: var(--color-SR); color: #fff; }
.rarity-SSR .card-rarity {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}
.card-icon {
    font-size: 4rem;
    text-align: center;
    margin: 10px 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.card-name {
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.card-element {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.85;
    margin-bottom: 8px;
}
.card-stats {
    display: flex;
    justify-content: space-around;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    margin-bottom: 6px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-icon { font-size: 0.9rem; }
.stat-value { font-weight: 700; font-size: 0.9rem; }
.stat.atk .stat-value { color: #ef4444; }
.stat.def .stat-value { color: #3b82f6; }
.card-desc {
    font-size: 0.7rem;
    text-align: center;
    opacity: 0.88;
    margin-top: auto;
    padding: 6px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    line-height: 1.4;
}

/* ========== 稀有度统计 ========== */
.rarity-stats {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.rarity-stat {
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid;
    min-width: 110px;
}
.rarity-N   { border-color: var(--color-N); }
.rarity-R   { border-color: var(--color-R); }
.rarity-SR  { border-color: var(--color-SR); }
.rarity-SSR { border-color: var(--color-SSR); }
.rarity-name { font-size: 0.82rem; margin-bottom: 4px; opacity: 0.85; }
.rarity-count { font-size: 1.4rem; font-weight: 700; }

/* ========== 过滤器 ========== */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.filter-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.filter-btn.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    border-color: transparent;
}

/* ========== 收藏网格 ========== */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 180px;
}
.empty-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    padding: 40px;
}

.collection-card {
    width: 100%;
    aspect-ratio: 5 / 7;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    transition: transform 0.3s ease;
    cursor: pointer;
    animation: cardEnter 0.5s ease-out backwards;
}
.collection-card:hover {
    transform: scale(1.06) translateY(-4px);
}
.collection-card .card-icon  { font-size: 2.4rem; margin: 4px 0; }
.collection-card .card-name  { font-size: 0.8rem; }
.collection-card .card-rarity { font-size: 0.6rem; padding: 2px 7px; }
.collection-card .card-element { font-size: 0.68rem; margin-bottom: 4px; }
.collection-card .card-stats { padding: 3px; }
.collection-card .card-desc { display: none; }
.collection-count {
    position: absolute;
    top: 6px; right: 6px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
    z-index: 2;
}

/* ========== 卡组编成 ========== */
.deck-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
.deck-side {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.deck-side h3 {
    margin-bottom: 14px;
    color: #fbbf24;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.deck-count { color: #94a3b8; font-size: 0.9rem; }
.deck-collection, .deck-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    padding: 6px;
}
.deck-slots {
    background: rgba(251, 191, 36, 0.05);
    border: 2px dashed rgba(251, 191, 36, 0.2);
    border-radius: 10px;
}
.mini-card {
    aspect-ratio: 5 / 7;
    border-radius: 8px;
    border: 2px solid;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    text-align: center;
}
.mini-card:hover { transform: scale(1.05); }
.mini-card.in-deck {
    border-style: dashed;
    opacity: 0.5;
}
.mini-card .mini-icon { font-size: 1.8rem; }
.mini-card .mini-name { font-size: 0.75rem; font-weight: 700; }
.mini-card .mini-stats { font-size: 0.65rem; opacity: 0.8; }
.mini-card .mini-rarity {
    position: absolute;
    top: 4px; left: 4px;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}
.deck-stats {
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    font-size: 0.95rem;
}
.deck-stats p {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
}
.deck-stats span { color: #fbbf24; font-weight: 700; }

/* ========== 对战 ========== */
.battle-arena {
    display: grid;
    grid-template-columns: 1fr 200px 1fr;
    gap: 20px;
    margin-bottom: 20px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 320px;
}
.battle-side h3 {
    text-align: center;
    margin-bottom: 12px;
    color: #fbbf24;
    font-size: 1.1rem;
}
.enemy-side h3 { color: #ef4444; }
.battle-info { margin-bottom: 14px; }
.hp-bar {
    position: relative;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    transition: width 0.5s ease;
    width: 100%;
}
.hp-fill.enemy { background: linear-gradient(90deg, #ef4444, #f87171); }
.hp-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.battle-hand {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    min-height: 130px;
}
.battle-card {
    aspect-ratio: 5 / 7;
    border-radius: 8px;
    border: 2px solid;
    padding: 4px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.7rem;
    text-align: center;
}
.battle-card:not(.used):not(.enemy-hidden):hover {
    transform: translateY(-4px) scale(1.05);
}
.battle-card.used {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(0.8);
}
.battle-card.enemy-hidden {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: transparent;
}
.battle-card .bc-icon { font-size: 1.4rem; }
.battle-card .bc-name { font-weight: 700; margin: 2px 0; }
.battle-card .bc-atk { color: #ef4444; font-weight: 700; }

.battle-log {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 14px;
    height: 320px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.battle-log p { margin-bottom: 6px; opacity: 0.9; }
.battle-log .log-damage { color: #ef4444; }
.battle-log .log-heal   { color: #22c55e; }
.battle-log .log-info   { color: #fbbf24; }
.battle-log .log-win    { color: #fbbf24; font-weight: 700; font-size: 1rem; }

.battle-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ========== 成就 ========== */
.achievement-progress {
    text-align: center;
    margin-bottom: 24px;
}
.achievement-progress p { margin-bottom: 10px; font-size: 1.05rem; }
.progress-bar {
    width: 100%;
    max-width: 500px;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    margin: 0 auto;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 0.5s ease;
    width: 0%;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.achievement {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
    opacity: 0.5;
}
.achievement.unlocked {
    opacity: 1;
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}
.achievement-icon {
    font-size: 2.5rem;
    width: 50px;
    text-align: center;
}
.achievement-info { flex: 1; }
.achievement-name {
    font-weight: 700;
    margin-bottom: 4px;
}
.achievement-desc {
    font-size: 0.82rem;
    opacity: 0.7;
    margin-bottom: 6px;
}
.achievement-reward {
    font-size: 0.78rem;
    color: #fbbf24;
}
.achievement-status {
    font-size: 1.5rem;
}

/* ========== 通知 ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 22px;
    background: rgba(15, 12, 41, 0.95);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    animation: toastSlide 0.4s ease, toastFade 0.5s ease 3.5s forwards;
    max-width: 340px;
    min-width: 220px;
}
.toast.success { border-color: #22c55e; }
.toast.error   { border-color: #ef4444; }
.toast-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: #fbbf24;
}
.toast.success .toast-title { color: #22c55e; }
.toast.error   .toast-title { color: #ef4444; }
.toast-msg { font-size: 0.88rem; opacity: 0.9; }

@keyframes toastSlide {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@keyframes toastFade { to { opacity: 0; transform: translateX(400px); } }

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    color: #64748b;
    padding: 30px 0;
    font-size: 0.9rem;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .deck-builder { grid-template-columns: 1fr; }
    .battle-arena { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .status-item { min-width: 130px; padding: 8px 12px; }
    .draw-btn    { padding: 12px 20px; min-width: 120px; }
    .card        { width: 160px; height: 225px; }
    .card-icon   { font-size: 3rem; }
    .nav         { padding: 10px 12px; }
    .nav-logo    { font-size: 1.1rem; }
    .nav-tab     { padding: 6px 12px; font-size: 0.85rem; }
}
/* ========== 卡牌图片支持 ========== */

/* 卡牌立绘容器 */
.card-image {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
}

/* 主卡牌图（大卡） */
.card .card-image {
    border-radius: 11px;
    overflow: hidden;
}

.card .card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.5) 80%,
        rgba(0, 0, 0, 0.85) 100%);
    pointer-events: none;
}

/* 收藏小卡用 img 标签 */
.collection-card .card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.collection-card .card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.7) 100%);
}

/* 战斗用卡牌小图 */
.battle-card .bc-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    z-index: 0;
    opacity: 0.7;
}

.battle-card .bc-content {
    position: relative;
    z-index: 1;
}

/* 卡背图片支持 */
.card-back-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}
