/* ===================== 基础 Reset（取代 Tailwind preflight，手写） ===================== */
*, ::before, ::after { box-sizing: border-box; }
* { margin: 0; }
html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    -webkit-tap-highlight-color: transparent;
}
body { margin: 0; line-height: inherit; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
small { font-size: 80%; }
button, input, optgroup, select, textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
button { cursor: pointer; }
button:disabled { cursor: default; }
[role="button"], button { cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { opacity: 1; color: #9ca3af; }
fieldset { margin: 0; padding: 0; }

/* 行为类：由 JS 动态切换，属于项目自有语义（保留定义） */
.hidden { display: none !important; }
.active { }
.toggled { }

/* ===================== 全局主题 ===================== */
:root {
    --theme-blue: #3b82f6;
    --theme-blue-dark: #2563eb;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    background-color: #e5e7eb;
}

.main-container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    body {
        padding: 1.5rem;
        background: linear-gradient(180deg, #e2e8f0, #f1f5f9);
    }
    .main-container {
        max-width: 880px;
        margin: 0 auto;
        border-radius: 1rem;
        overflow: hidden;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
        min-height: calc(100vh - 3rem);
        background-color: #f9fafb;
    }
}

/* 移动端底部留出安全区域（刘海屏 Home 条 / 导航栏） */
footer.sticky {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
}
header.app-header {
    padding-top: max(1rem, env(safe-area-inset-top));
}

/* ===================== 顶栏 & 标题 ===================== */
.app-header {
    padding: 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.title-row {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
}
.app-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    user-select: none;
}
.icon-btn {
    position: absolute;
    right: 0;
    top: 0;
    padding: 0.25rem;
    color: #6b7280;
    background: transparent;
}
.icon-btn:hover { color: var(--theme-blue); }
.icon-btn svg { width: 1.5rem; height: 1.5rem; }

/* ===================== 统计信息卡 ===================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    text-align: center;
}
@media (min-width: 768px) {
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-card {
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}
.stat-coins { background-color: #dbeafe; }
.stat-shards { background-color: #fce7f3; }
.stat-click { background-color: #dcfce7; }
.stat-idle { background-color: #f3e8ff; }
.stat-label { font-size: 0.875rem; }
.stat-value { font-size: 1.125rem; font-weight: 600; }
.stat-coins .stat-value, .stat-shards .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-coins .stat-label { color: #1e40af; }
.stat-coins .stat-value { color: #1e3a8a; }
.stat-shards .stat-label { color: #9d174d; }
.stat-shards .stat-value { color: #831843; }
.stat-click .stat-label { color: #166534; }
.stat-click .stat-value { color: #14532d; }
.stat-idle .stat-label { color: #6b21a8; }
.stat-idle .stat-value { color: #581c87; }

.status-line {
    text-align: center;
    font-size: 0.875rem;
    color: #4f46e5;
    margin-top: 0.5rem;
}

/* ===================== 顶部标签导航（桌面） ===================== */
.desktop-tabs {
    display: none;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 0.5rem;
    overflow-x: auto;
}
@media (min-width: 768px) {
    .desktop-tabs { display: flex; }
}
.nav-tab {
    flex: 1 1 0%;
    padding: 0.75rem 0;
    text-align: center;
    font-weight: 600;
    border-bottom: 4px solid transparent;
}

/* ===================== 点击区 ===================== */
.clicker-area {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}
.clicker-area > * + * { margin-top: 1rem; }
.clicker-wrap { width: 100%; max-width: 24rem; }
.clicker-wrap > * + * { margin-top: 1rem; }
.frenzy-timer {
    text-align: center;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #ea580c;
}
.frenzy-bar-bg {
    width: 100%;
    height: 1rem;
    border-radius: 9999px;
    background-color: #e5e7eb;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.frenzy-bar-fg {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #fef08a, #f97316);
    transition: width 0.1s linear;
}
.frenzy-active { box-shadow: 0 0 25px #f97316; }

.clicker-button {
    width: 12rem;
    height: 12rem;
    background-color: #3b82f6;
    color: #ffffff;
    border-radius: 9999px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.15s ease-in-out;
}
.clicker-button:hover { background-color: #2563eb; }
.clicker-button .clicker-label {
    font-size: 2.25rem;
    font-weight: 700;
    user-select: none;
}
.clicker-button.pressed { transform: scale(0.95); }

/* ===================== 区块内容 ===================== */
.tab-content { flex-grow: 1; }
.scroll-panel {
    flex-grow: 1;
    padding: 1rem;
    background-color: #f9fafb;
    overflow-y: auto;
    min-height: 350px;
}
.section-center { text-align: center; }
.title-page { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.title-section { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; text-align: center; }
.title-block { font-size: 1.125rem; font-weight: 700; }
.text-muted { color: #6b7280; }
.text-hint { color: #6b7280; font-size: 0.875rem; }
.field-block { width: 100%; max-width: 20rem; }
.field-block > * + * { margin-top: 1rem; }

/* ===================== 按钮 ===================== */
.btn {
    display: inline-block;
    font-weight: 700;
    text-align: center;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #ffffff;
    border: 0;
    line-height: inherit;
}
.btn:hover { }
.btn:disabled {
    background-color: #9ca3af !important;
    cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-lg { padding: 0.75rem 1.5rem; }

/* 颜色 */
.btn-blue { background-color: #3b82f6; }
.btn-blue:hover { background-color: #2563eb; }
.btn-green { background-color: #22c55e; }
.btn-green:hover { background-color: #16a34a; }
.btn-red { background-color: #ef4444; }
.btn-red:hover { background-color: #dc2626; }
.btn-indigo { background-color: #6366f1; }
.btn-indigo:hover { background-color: #4f46e5; }
.btn-purple { background-color: #9333ea; }
.btn-purple:hover { background-color: #7e22ce; }
.btn-cyan { background-color: #06b6d4; }
.btn-cyan:hover { background-color: #0891b2; }
.btn-yellow { background-color: #eab308; }
.btn-yellow:hover { background-color: #ca8a04; }
.btn-orange { background-color: #f97316; }
.btn-orange:hover { background-color: #ea580c; }
.btn-pink { background-color: #ec4899; }
.btn-pink:hover { background-color: #db2777; }
.btn-gray-soft { background-color: #d1d5db; color: #000; }
.btn-gray-soft:hover { background-color: #9ca3af; }
.btn-gray { background-color: #4b5563; }
.btn-gray:hover { background-color: #374151; }
.btn-gray-mid { background-color: #9ca3af; }
.btn-gray-mid:hover { background-color: #6b7280; }

/* 大按钮（点击区 / 主操作） */
.big-action {
    width: 100%;
}
.big-action:hover { transform: scale(1.05); }
.shadow-btn { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

/* ===================== 网格布局 ===================== */
.slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; }
@media (min-width: 640px) {
    .inventory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 640px) {
    .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.vstack { }
.vstack > * + * { margin-top: 0.5rem; }
.vstack-3 > * + * { margin-top: 0.75rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.grow { flex-grow: 1; }

/* ===================== 面板 / 卡片 ===================== */
.panel {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.modal-shell {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    width: 100%;
}
.title-modal { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.title-modal-sm { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.divider-top { border-top: 1px solid #e5e7eb; padding-top: 1rem; margin-top: 1.5rem; }

/* ===================== 表单输入 ===================== */
.input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: #ffffff;
}
.input-mb-2 { margin-bottom: 0.5rem; }
.input-mb-3 { margin-bottom: 0.75rem; }
.textarea {
    width: 100%;
    height: 8rem;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    background-color: #ffffff;
}
.textarea-mono-gray { background-color: #f3f4f6; }
.text-break { word-break: break-all; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; align-items: center; }/* ===================== Toast ===================== */
.toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 50;
    padding: 0.5rem 1rem;
    color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
}
.toast-success { background-color: #22c55e; }
.toast-info { background-color: #3b82f6; }
.toast-error { background-color: #ef4444; }
.toast-hidden { opacity: 0; transform: translateY(0.5rem); }

/* ===================== 底部标签导航（移动） ===================== */
.mobile-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
    position: sticky;
    bottom: 0;
}
@media (min-width: 768px) {
    .mobile-tabs { display: none; }
}
.footer-tab {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    border-bottom: 4px solid transparent;
}

/* ===================== 界面标签 ===================== */
.tab-button.active {
    border-bottom-color: var(--theme-blue);
    color: var(--theme-blue);
}

/* ===================== 卡牌 ===================== */
.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border-width: 2px;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    user-select: none;
}
.card.selected {
    box-shadow: 0 0 15px 3px var(--theme-blue);
    transform: translateY(-2px) scale(1.02);
}
.card.swappable-glow {
    animation: float-animation 1.5s ease-in-out infinite, glow-animation 1.5s ease-in-out infinite;
}
.card-desc-wrap { flex-grow: 1; display: flex; align-items: center; justify-content: center; }
.card-desc { font-size: 0.75rem; color: #6b7280; }
.rarity-N { border-color: #9ca3af; background-color: #f3f4f6; }
.rarity-R { border-color: #60a5fa; background-color: #dbeafe; }
.rarity-SR { border-color: #facc15; background-color: #fef9c3; }
.rarity-SSR {
    border-image: linear-gradient(45deg, #fde047, #f97316, #ec4899, #8b5cf6) 1;
    background: linear-gradient(45deg, #fffbeb, #fef2f2, #fdf4ff, #faf5ff);
    border-radius: 0;
}

/* ===================== 弹窗 ===================== */
body.popup-lock { overflow: hidden; }
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 50;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    touch-action: none; /* 弹窗打开时阻止背景触摸滑动/拖动 */
    overscroll-behavior: contain;
}
.popup-overlay.popup-show { display: flex; }
.popup-content {
    animation: popup-appear 0.3s ease-out forwards;
    width: 100%;
    max-width: 32rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y; /* 仅允许弹窗内部纵向滚动，不传递给背景 */
    margin-left: auto;
    margin-right: auto;
}
.scroll-inner { overflow-y: auto; }
@keyframes popup-appear { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

.click-feedback {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #facc15;
    text-shadow: 0 0 5px white;
    pointer-events: none;
    animation: float-up 0.8s ease-out forwards;
}
@keyframes float-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-60px); } }

/* ===================== 装备卡槽 ===================== */
.equipped-slot {
    padding: 0.25rem;
    border-radius: 0.5rem;
    border-width: 2px;
    border-color: #e5e7eb;
    min-height: 120px;
    transition: background-color 0.15s ease-in-out;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-style: solid;
}
.equipped-slot .slot-hint { color: #9ca3af; font-size: 0.75rem; text-align: center; }/* ===================== 状态组件 ===================== */
.custom-toggle { width: 44px; height: 24px; }
.custom-toggle-bg {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #d1d5db;
    border-radius: 9999px;
    transition: background-color 0.2s ease-in-out;
}
.custom-toggle-handle {
    position: absolute;
    left: 0.125rem;
    top: 0.125rem;
    background-color: #ffffff;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}
.custom-toggle.toggled .custom-toggle-bg { background-color: #4ade80; }
.custom-toggle.toggled .custom-toggle-handle { transform: translateX(20px); }

/* ===================== 卡牌融合 / 拆分浮层 ===================== */
.fuse-overlay {
    position: absolute; inset: 0; color: white;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem; font-weight: bold; cursor: pointer;
    animation: pulse 1.5s infinite; border-radius: 0.375rem;
    background-color: rgba(168, 85, 247, 0.8);
}
.split-overlay-container {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    font-size: 1.25rem; font-weight: bold; color: white; cursor: pointer;
}
.split-overlay-half { flex: 1; display: flex; justify-content: center; align-items: center; transition: background-color 0.2s; }
.split-overlay-top { background-color: rgba(59, 130, 246, 0.8); border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; }
.split-overlay-top:hover { background-color: rgba(37, 99, 235, 0.9); }
.split-overlay-bottom { background-color: rgba(239, 68, 68, 0.8); border-bottom-left-radius: 0.375rem; border-bottom-right-radius: 0.375rem; }
.split-overlay-bottom:hover { background-color: rgba(220, 38, 38, 0.9); }
.ssr-overlay-fix { border-radius: 0 !important; }

.unequip-button {
    position: absolute; display: none; z-index: 10; transform: translateX(-50%);
    background-color: #ef4444; color: white; font-weight: bold; padding: 0.25rem 0.75rem;
    border-radius: 9999px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); cursor: pointer;
    transition: transform 0.2s, top 0.2s;
}
.unequip-button:active { transform: translateX(-50%) scale(0.95); }

.coin-pulse { animation: coin-pulse 0.3s ease-in-out; }
@keyframes float-animation { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes glow-animation {
    0%, 100% { box-shadow: 0 0 8px 2px var(--theme-blue); }
    50% { box-shadow: 0 0 15px 5px #60a5fa; }
}
@keyframes coin-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.flying-card {
    position: fixed; z-index: 100; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1; transform: scale(1); border-radius: 4px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.power-up-animation { animation: power-up 0.4s ease-out; }
@keyframes power-up {
    0% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(5deg); filter: brightness(1.5); box-shadow: 0 0 25px 8px #fde047; }
    100% { transform: scale(1); }
}
.shard-pulse { animation: shard-pulse 0.3s ease-in-out; }
@keyframes shard-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.card-dissolve { animation: dissolve 0.25s ease-out forwards; }
@keyframes dissolve { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.5) rotate(-15deg); } }
.shard-particle {
    position: fixed; z-index: 100; pointer-events: none;
    background-image: radial-gradient(circle, #fecdd3, #f472b6, #db2777);
    border-radius: 50%; transition: all 0.5s cubic-bezier(0.5, -0.2, 0.8, 1);
    width: 20px; height: 20px; box-shadow: 0 0 10px #f472b6;
}

.card-level {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: #facc15;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
}
.card-stack-count {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
}

/* ===================== 装备卡槽（game.js 生成） ===================== */
.unlock-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 2px dashed;
    min-height: 120px;
    text-align: center;
}
.unlock-afford { background-color: #c7d2fe; border-color: #818cf8; cursor: pointer; }
.unlock-afford:hover { background-color: #a5b4fc; }
.unlock-deny { background-color: #e5e7eb; border-color: #d1d5db; }
.unlock-price { font-size: 0.75rem; }
.unlock-price-avail { color: #3730a3; }
.unlock-price-deny { color: #6b7280; }
.slot-hint-wrap { display: flex; align-items: center; justify-content: center; height: 100%; }
.slot-hint-text { color: #9ca3af; font-size: 0.75rem; text-align: center; }

/* ===================== 商店 / 设置 通用间距 ===================== */
.section-margin { margin-top: 1.5rem; }
.shop-desc { color: #6b7280; }
.purchased-badge { font-weight: 600; color: #16a34a; }
.divider-top { border-top: 1px solid #e5e7eb; padding-top: 1rem; }
.vstack-3 > * + * { margin-top: 0.75rem; }
.row-between + .row-between { margin-top: 0.75rem; }
.btn-close { width: 100%; }
.login-input { width: 100%; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 0.5rem; font-size: 0.875rem; background: #fff; }

/* ===================== Game.js 弹窗/工具等语义类 ===================== */
/* 弹窗内部 */
.modal-actions { display: flex; justify-content: center; gap: 1rem; }
.modal-desc { color: #6b7280; margin-bottom: 1.5rem; }
.modal-narrow { max-width: 28rem; }
.stack-4 { }
.stack-4 > * + * { margin-top: 1rem; }

/* 各类按钮规格 */
.wide-btn { width: 100%; }
.grow-flex { flex: 1 1 0%; }
.input-row { display: flex; gap: 0.5rem; }
.hint-text { font-size: 0.75rem; color: #6b7280; margin-bottom: 0.5rem; }
.note-text { font-size: 0.875rem; color: #6b7280; margin-bottom: 0.5rem; }
.block-narrow { display: block; width: 100%; max-width: 20rem; margin-left: auto; margin-right: auto; }
.block-narrow-mb { display: block; width: 100%; max-width: 20rem; margin: 0 auto 0.5rem; }
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}
.btn-slim { padding: 0.5rem 0.75rem; }

/* 设置弹窗云存档区块 */
.cloud-section { border-top: 1px solid #e5e7eb; padding-top: 1rem; }
.cloud-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.user-name { font-weight: 600; color: #2563eb; }
.settings-row { border-top: 1px solid #e5e7eb; padding-top: 1rem; }
.btn-lg-block { display: block; width: 100%; max-width: 20rem; margin: 0 auto; }

/* 模块化通用工具 */
.tcenter { text-align: center; }
.err-text { color: #dc2626; }
.mb-2 { margin-bottom: 0.5rem; }
.row-between + .row-between { margin-top: 0.75rem; }

/* ===================== index.html 用到的骨架类 ===================== */
.tab-view { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.lineup-view { display: flex; flex-direction: column; height: 100%; }
.inventory-panel { flex-grow: 1; background-color: #e5e7eb; padding: 0.5rem; border-radius: 0.5rem; overflow-y: auto; margin-top: 0.25rem; }
.relative { position: relative; }

/* ===================== game.js 用到的卡牌/卡槽/商店/自动化/弹窗类 ===================== */
.card-fetch { text-align: center; font-size: 0.875rem; }
.card-name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 0.25rem; }
.card-rarity { font-size: 0.75rem; margin-bottom: 0.25rem; }
.slot-empty { border-style: dashed; border-color: #d1d5db; }
.unlock-title { font-weight: 700; }
.inv-empty { grid-column: 1 / -1; text-align: center; color: #6b7280; margin: 1rem 0; }

/* 商店 */
.shop-item { background-color: #ffffff; padding: 1rem; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.shop-item > * + * { margin-top: 0.75rem; }
.shop-head { display: flex; justify-content: space-between; align-items: center; }
.shop-info { }
.shop-body { }
.shop-buy { margin-top: 0.5rem; }
.shop-btns { display: flex; gap: 0.5rem; }
.shop-name { font-size: 1.125rem; font-weight: 700; }
.shop-level { font-size: 0.875rem; color: #6b7280; }

/* 自动分解设置 */
.auto-title { font-size: 1.125rem; font-weight: 700; text-align: center; margin-bottom: 0.75rem; }
.auto-list { }
.auto-list > * + * { margin-top: 0.5rem; }
.auto-row { display: flex; align-items: center; justify-content: space-between; background-color: #ffffff; padding: 0.75rem; border-radius: 0.5rem; }
.auto-label { font-weight: 700; color: #4338ca; }
.auto-sub { font-weight: 500; }
.toggle-pos { position: relative; border-radius: 9999px; cursor: pointer; }

/* 弹窗内杂项 */
.dim-disabled { opacity: 0.5; cursor: not-allowed; }
.modal-close { margin-top: 2rem; }
.dev-close { margin-top: 1.5rem; }
.export-close { margin-top: 1rem; }
.result-confirm { margin-top: 1rem; }
.result-wrap { background-color: #ffffff; padding: 1rem; border-radius: 0.75rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); max-height: 80vh; overflow-y: auto; }
.result-card { text-align: center; padding: 0.5rem; }
.import-actions { display: flex; gap: 1rem; margin-top: 1rem; }
.dropdown-left { text-align: left; }