/* ============================================================
   MiaoVerse Shared Styles
   Centralized styles to reduce duplication across templates.
   ============================================================ */

/* ---------- Body & Background ---------- */
.mm-body {
    font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #fff0f5 0%, #ffffff 50%, #faf5ff 100%);
    min-height: 100vh;
}

/* ---------- Page Transition ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-fade-in { animation: fadeIn 0.5s ease-out; }

/* ---------- Loading Spinner ---------- */
@keyframes pawBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-12px) scale(1.1); }
}
.loading-paw { animation: pawBounce 1s ease-in-out infinite; }

@keyframes spinner {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid #ffe4ec;
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

/* ---------- Nav Link ---------- */
.nav-link { position: relative; }
.nav-link svg { transition: transform 0.2s ease; }
.nav-link:hover svg { transform: scale(1.15); }
.nav-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #ff6b9d;
    border-radius: 1px;
}

/* ---------- Card Component ---------- */
.mm-card {
    background: #fff;
    border: 1px solid #ffe4ec;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mm-card:hover {
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.12);
    transform: translateY(-4px);
}

/* ---------- Badge ---------- */
.mm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
}

/* ---------- Empty State ---------- */
.mm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
}
.mm-empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.mm-empty-text { font-size: 0.875rem; }

/* ---------- Skeleton Loading ---------- */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.mm-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* ---------- Scrollbar ---------- */
.mm-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.mm-scrollbar::-webkit-scrollbar-track { background: transparent; }
.mm-scrollbar::-webkit-scrollbar-thumb { background: #ffb3cc; border-radius: 3px; }
.mm-scrollbar::-webkit-scrollbar-thumb:hover { background: #ff6b9d; }

/* ---------- Scroll Indicator ---------- */
.mm-scroll-hint {
    position: relative;
}
.mm-scroll-hint::after {
    content: '\2192';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6b9d;
    font-size: 1.25rem;
    pointer-events: none;
    animation: scrollHintPulse 2s ease-in-out infinite;
}
@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
    50%      { opacity: 1;   transform: translateY(-50%) translateX(4px); }
}

/* ---------- Collapsible Section ---------- */
.mm-collapsible-chevron { flex-shrink: 0; }
.mm-collapsible-header { user-select: none; }
.mm-collapsible.collapsed > .mm-collapsible-header .mm-collapsible-chevron {
    transform: rotate(-90deg);
}
.mm-collapsible.collapsed > .mm-collapsible-body {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ---------- CTA Button ---------- */
.mm-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, #ff6b9d, #a855f7);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(255, 107, 157, 0.3);
}
.mm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.4);
}

/* ---------- VIP Banner ---------- */
.mm-vip-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ff6b9d, #c084fc, #fbbf24);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    color: #fff;
}
.mm-vip-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Layui Tab Override ---------- */
.layui-tab-brief > .layui-tab-title .layui-this {
    color: #ff6b9d !important;
}
.layui-tab-brief > .layui-tab-title .layui-this::after {
    border-bottom-color: #ff6b9d !important;
    border-bottom-width: 2px !important;
}
.layui-tab-brief > .layui-tab-title {
    border-bottom: 2px solid #ffe4ec !important;
}

/* ---------- Responsive Helpers ---------- */
@media (max-width: 768px) {
    .mm-hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
    .mm-show-mobile-only { display: none !important; }
}

.layui-tables-tool > .layui-btn .layui-btn-sm .layui-btn-primary {
    margin-left: 15px;
}
