/**
 * ailewo 爱礼物 - Component Styles
 * ================================================
 * 卡片、Toast、标签、按钮、弹窗等通用组件样式。
 * 所有页面共享。
 */

/* ==================== 卡片 ==================== */
.card-standard {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #F0F0F0 !important;
    padding: 20px !important;
    position: relative;
}

/* ==================== Hover Lift ==================== */
.hover-lift {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-lift:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.2s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==================== 标签 ==================== */
.studio-tag {
    background: white;
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 99px;
}

.plan-type-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
}

.tag-private { background: #F3F4F6; color: #6B7280; }
.tag-public { background: #FDE8F0; color: #e84b8a; }

/* ==================== 按钮 ==================== */
.btn-pink {
    background-color: var(--accent-pink);
    color: white;
    border-radius: 8px;
    transition: opacity 0.2s;
}

.btn-pink:hover { opacity: 0.9; }

.btn-outline {
    border: 1px solid #e5e7eb;
    color: #4b5563;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-outline:hover { background-color: #f9fafb; }

/* ==================== 弹窗遮罩 ==================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-backdrop.hidden {
    display: none;
}

/* ==================== Sticky Column ==================== */
.sticky-column {
    position: sticky;
    top: 0;
}

/* ==================== 套餐卡片选中态 ==================== */
.package-card.active {
    border-color: #e84b8a !important;
    background-color: #FDE8F0 !important;
}

.package-card.active span:first-child {
    color: #e84b8a !important;
}

/* ==================== Recent Card Overlay ==================== */
.recent-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.recent-card:hover .recent-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== Card Hover Tip ==================== */
.card-hover-tip {
    position: absolute;
    bottom: 8px;
    right: 20px;
    font-size: 10px;
    color: var(--accent-pink);
    opacity: 0;
    transition: opacity 0.15s;
}

.card-standard:hover .card-hover-tip {
    opacity: 1;
}

/* ==================== Lightbox ==================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; }

/* ==================== 统一 Z-Index 层级规范 ==================== */
/*
 * 层级体系（从低到高）：
 * z-10/20/30/40/50  - 页面内元素（sticky表头、下拉菜单等）
 * z-[1000]          - 普通弹窗遮罩（modal-backdrop / panel-backdrop）
 * z-[1001]          - 普通弹窗内容 / 侧边面板
 * z-[1100]          - 确认弹窗（在普通弹窗之上，如删除确认）
 * z-[9999]          - Toast 提示
 * z-[10000]         - Lightbox 图片放大
 */
.modal-overlay-unified {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-overlay-unified.active { display: flex; }

.confirm-overlay-unified {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
}
.confirm-overlay-unified.active { display: flex; }

/* ==================== 通用 Loading 状态 ==================== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}
@keyframes btnSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.page-loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.95);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.3s ease;
}
.page-loading.active { display: flex; }
.page-loading.fade-out { opacity: 0; }
.page-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #FDE8F0;
    border-top-color: #e84b8a;
    border-radius: 50%;
    animation: pageSpin 0.8s linear infinite;
}
@keyframes pageSpin {
    to { transform: rotate(360deg); }
}
.page-loading p { font-size: 13px; color: #949699; }

/* 页面内容淡入动画（极快，无感知） */
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
main {
    animation: contentFadeIn 0.12s ease-out;
}

/* 列表项入场淡入（gallery / platform-gift 卡片使用，P0-2 补全缺失定义） */
.animate-fade-in {
    animation: contentFadeIn 0.4s ease-out both;
}

/* ==================== 商城管理：操作按钮 / 单元格 / 徽章 / 单选 chip ==================== */
/* 表格操作列：按钮不换行、内容居中 */
.op-cell {
    white-space: nowrap;
    text-align: center;
}

/* 表格内小操作按钮（编辑/关单/查单/退款/确认发放等） */
.op-btn {
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #4B5563;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.op-btn:hover { background: #F8FAFC; border-color: #CBD5E1; }

/* 粉色徽章（默认/一级/模板等状态） */
.b-pink { background: #FDE8F0; color: #B0215A; }

/* 单选 chip 容器（包裹 .cat-pill） */
.chip-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ==================== 补全缺失的 Tailwind 工具类 ==================== */
/* 商城/管理页新增但静态 CSS 未编译出的类（P0 修复） */
.overflow-auto { overflow: auto; }
.inline-flex { display: inline-flex; }
.text-orange-600 { color: #ea580c; }
.text-pink-500 { color: #ec4899; }
.bg-blue-700 { background-color: #1d4ed8; }
.hover\:bg-blue-800:hover { background-color: #1e40af; }
.border-red-200 { border-color: #fecaca; }
.border-pink-200 { border-color: #fbcfe8; }
.text-pink-700 { color: #be185d; }
.w-56 { width: 14rem; }
.max-h-64 { max-height: 16rem; }
.max-h-48 { max-height: 12rem; }
.mt-20 { margin-top: 5rem; }
.w-\[620px\] { width: 620px; }
