/* lh-card.css - 完整版通用卡片样式库 */
/* 版本: 1.3.0 - 支持多种对齐方式 */

/* ===== 基础卡片样式 ===== */
.lh-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    /* 默认左对齐 */
    text-align: left;
}

.lh-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ===== 对齐方式 ===== */
.lh-card-align-left {
    text-align: left;
    align-items: flex-start;
}

.lh-card-align-center {
    text-align: center;
    align-items: center;
}

.lh-card-align-right {
    text-align: right;
    align-items: flex-end;
}

/* ===== 卡片布局变体 ===== */
.lh-card-horizontal {
    flex-direction: row;
    align-items: center;
}

.lh-card-vertical {
    flex-direction: column;
}

.lh-card-inline {
    display: inline-flex;
    width: auto;
}

.lh-card-block {
    width: 100%;
}

/* ===== 卡片尺寸 ===== */
.lh-card-sm {
    max-width: 280px;
    padding: 16px;
}

.lh-card-md {
    max-width: 360px;
    padding: 20px;
}

.lh-card-lg {
    max-width: 480px;
    padding: 24px;
}

.lh-card-xl {
    max-width: 600px;
    padding: 32px;
}

.lh-card-full {
    max-width: 100%;
    padding: 24px;
}

/* ===== 卡片边框样式 ===== */
.lh-card-border-none {
    border: none;
}

.lh-card-border-thin {
    border-width: 1px;
    border-style: solid;
    border-color: #e0e0e0;
}

.lh-card-border-thick {
    border-width: 2px;
    border-style: solid;
    border-color: #d0d0d0;
}

.lh-card-border-dashed {
    border-style: dashed;
}

.lh-card-border-dotted {
    border-style: dotted;
}

/* ===== 卡片圆角 ===== */
.lh-card-rounded-none {
    border-radius: 0;
}

.lh-card-rounded-sm {
    border-radius: 6px;
}

.lh-card-rounded-md {
    border-radius: 12px;
}

.lh-card-rounded-lg {
    border-radius: 16px;
}

.lh-card-rounded-full {
    border-radius: 24px;
}

/* ===== 卡片阴影 ===== */
.lh-card-shadow-none {
    box-shadow: none;
}

.lh-card-shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lh-card-shadow-md {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.lh-card-shadow-lg {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* ===== 渐变背景 ===== */
.lh-card-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.lh-card-gradient-success {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.lh-card-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.lh-card-gradient-danger {
    background: linear-gradient(135deg, #ff5858 0%, #f09819 100%);
    color: white;
}

.lh-card-gradient-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
}

/* ===== 渐变边框 ===== */
.lh-card-gradient-border {
    position: relative;
    background: white;
    border: none;
}

.lh-card-gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24, #fbc531, #44bd32, #0097e6, #8c7ae6, #e84118);
    border-radius: inherit;
    z-index: -1;
    animation: lh-gradient-border 3s ease infinite;
    background-size: 400% 400%;
}

@keyframes lh-gradient-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== 卡片图片 ===== */
.lh-card-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.lh-card-img-top {
    border-radius: 12px 12px 0 0;
    margin-bottom: 16px;
}

.lh-card-img-bottom {
    border-radius: 0 0 12px 12px;
    margin-top: 16px;
}

.lh-card-img-left {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    margin-right: 16px;
}

.lh-card-img-right {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    margin-left: 16px;
    order: 2;
}

.lh-card-img-round {
    border-radius: 50%;
}

/* ===== 卡片内容区域 ===== */
.lh-card-header {
    padding: 0 0 16px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.lh-card-body {
    flex: 1;
    padding: 0;
}

.lh-card-footer {
    padding: 16px 0 0 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 16px;
}

/* ===== 卡片标题 ===== */
.lh-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 8px 0;
    line-height: 1.4;
    width: 100%;
}

.lh-card-title-left {
    text-align: left;
}

.lh-card-title-center {
    text-align: center;
}

.lh-card-title-right {
    text-align: right;
}

.lh-card-title-lg {
    font-size: 1.5rem;
    font-weight: 700;
}

.lh-card-title-sm {
    font-size: 1.125rem;
    font-weight: 500;
}

.lh-card-subtitle {
    font-size: 0.875rem;
    color: #718096;
    margin: -4px 0 12px 0;
    font-weight: 400;
    width: 100%;
}

.lh-card-subtitle-left {
    text-align: left;
}

.lh-card-subtitle-center {
    text-align: center;
}

.lh-card-subtitle-right {
    text-align: right;
}

/* ===== 卡片文本 ===== */
.lh-card-text {
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 12px 0;
    width: 100%;
}

.lh-card-text:last-child {
    margin-bottom: 0;
}

.lh-card-text-left {
    text-align: left;
}

.lh-card-text-center {
    text-align: center;
}

.lh-card-text-right {
    text-align: right;
}

.lh-card-text-sm {
    font-size: 0.875rem;
}

.lh-card-text-lg {
    font-size: 1.125rem;
}

/* ===== 简单卡片 - 标题和价格在一行 ===== */
.lh-card-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    min-height: auto;
}

.lh-card-simple-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* 简单卡片的对齐方式 */
.lh-card-simple-align-left .lh-card-simple-content {
    justify-content: flex-start;
}

.lh-card-simple-align-center .lh-card-simple-content {
    justify-content: center;
}

.lh-card-simple-align-right .lh-card-simple-content {
    justify-content: flex-end;
}

.lh-card-simple-align-space-between .lh-card-simple-content {
    justify-content: space-between;
    width: 100%;
}

.lh-card-simple-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
}

.lh-card-simple-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.lh-card-simple-price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e53e3e;
}

.lh-card-simple-price-period {
    font-size: 0.875rem;
    color: #718096;
    margin-left: 4px;
}

.lh-card-simple-action {
    margin-left: 16px;
    white-space: nowrap;
}

/* ===== 价格显示 ===== */
.lh-card-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 8px 0;
    width: 100%;
}

.lh-card-price-left {
    justify-content: flex-start;
}

.lh-card-price-center {
    justify-content: center;
}

.lh-card-price-right {
    justify-content: flex-end;
}

.lh-card-price-currency {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.lh-card-price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e53e3e;
}

.lh-card-price-period {
    font-size: 0.875rem;
    color: #718096;
    margin-left: 4px;
}

.lh-card-price-old {
    font-size: 1rem;
    color: #a0aec0;
    text-decoration: line-through;
    margin-left: 8px;
}

/* ===== ICON支持 ===== */
.lh-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
}

.lh-card-icon i,
.lh-card-icon iconify-icon {
    font-size: 1.5rem;
    color: inherit;
}

.lh-card-icon-primary {
    background: rgba(66, 153, 225, 0.1);
    color: #4299e1;
}

.lh-card-icon-success {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
}

.lh-card-icon-warning {
    background: rgba(237, 137, 54, 0.1);
    color: #ed8936;
}

.lh-card-icon-danger {
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
}

.lh-card-icon-purple {
    background: rgba(159, 122, 234, 0.1);
    color: #9f7aea;
}

.lh-card-icon-lg {
    width: 60px;
    height: 60px;
}

.lh-card-icon-lg i,
.lh-card-icon-lg iconify-icon {
    font-size: 2rem;
}

.lh-card-icon-sm {
    width: 32px;
    height: 32px;
}

.lh-card-icon-sm i,
.lh-card-icon-sm iconify-icon {
    font-size: 1.25rem;
}

/* 简单卡片专用ICON */
.lh-card-simple-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.lh-card-simple-icon i,
.lh-card-simple-icon iconify-icon {
    font-size: 1.25rem;
    color: inherit;
}

.lh-card-simple-icon-primary {
    background: rgba(66, 153, 225, 0.1);
    color: #4299e1;
}

.lh-card-simple-icon-success {
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
}

.lh-card-simple-icon-warning {
    background: rgba(237, 137, 54, 0.1);
    color: #ed8936;
}

.lh-card-simple-icon-danger {
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
}

/* ICON位置变体 */
.lh-card-with-icon {
    display: flex;
    align-items: flex-start;
}

.lh-card-icon-top {
    align-self: flex-start;
    margin-bottom: 12px;
}

.lh-card-icon-center {
    align-self: center;
}

/* ===== TAG标签系统 ===== */
.lh-card-tag {
    position: absolute;
    z-index: 10;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* TAG位置 */
.lh-card-tag-top-left {
    top: 12px;
    left: 12px;
}

.lh-card-tag-top-right {
    top: 12px;
    right: 12px;
}

.lh-card-tag-bottom-left {
    bottom: 12px;
    left: 12px;
}

.lh-card-tag-bottom-right {
    bottom: 12px;
    right: 12px;
}

.lh-card-tag-top-center {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

/* TAG颜色 */
.lh-card-tag-primary { background: #4299e1; }
.lh-card-tag-success { background: #48bb78; }
.lh-card-tag-warning { background: #ed8936; }
.lh-card-tag-danger { background: #f56565; }
.lh-card-tag-purple { background: #9f7aea; }
.lh-card-tag-pink { background: #ed64a6; }
.lh-card-tag-dark { background: #2d3748; }
.lh-card-tag-light { background: #f7fafc; color: #4a5568; }

/* TAG尺寸 */
.lh-card-tag-sm {
    font-size: 0.6875rem;
    padding: 2px 8px;
}

.lh-card-tag-lg {
    font-size: 0.875rem;
    padding: 6px 16px;
}

/* ===== 卡片动作区域 ===== */
.lh-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.lh-card-action {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #4299e1;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lh-card-action:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

/* ===== 悬停动画效果 ===== */
.lh-card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.lh-card-hover-scale:hover {
    transform: scale(1.05);
}

.lh-card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(66, 153, 225, 0.3);
}

.lh-card-hover-rotate:hover {
    transform: rotate(2deg);
}

.lh-pulse {
    animation: lh-pulse 2s infinite;
}

@keyframes lh-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== 特殊效果 ===== */
.lh-card-glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.lh-card-neon {
    box-shadow: 0 0 20px rgba(66, 153, 225, 0.3);
    border: 1px solid rgba(66, 153, 225, 0.3);
}

.lh-card-flat {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .lh-card-horizontal {
        flex-direction: column;
    }

    .lh-card-simple {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .lh-card-simple-content {
        width: 100%;
        justify-content: space-between;
    }

    .lh-card-simple-action {
        margin-left: 0;
        width: 100%;
    }

    .lh-card-sm,
    .lh-card-md,
    .lh-card-lg,
    .lh-card-xl {
        max-width: 100%;
        margin: 0 16px;
    }
}

/* ===== 工具类 ===== */
.lh-text-center { text-align: center; }
.lh-text-left { text-align: left; }
.lh-text-right { text-align: right; }

.lh-mt-16 { margin-top: 16px; }
.lh-mb-16 { margin-bottom: 16px; }
.lh-ml-16 { margin-left: 16px; }
.lh-mr-16 { margin-right: 16px; }

.lh-p-16 { padding: 16px; }
.lh-p-24 { padding: 24px; }

.lh-gap-8 { gap: 8px; }
.lh-gap-16 { gap: 16px; }
.lh-gap-24 { gap: 24px; }
