/* 组件样式 */

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* 渐变按钮 */
.gradient-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gradient-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #764ba2 0%, #667eea 100%);
    transition: left 0.5s ease;
    z-index: -1;
}

.gradient-btn:hover::before {
    left: 0;
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* 图标动画 */
.icon-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.icon-rotate {
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.icon-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 文字打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #295DFC;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #295DFC;
    }
}

/* 浮动动画 */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* 淡入淡出 */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 1s ease-out forwards;
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 1s ease-out forwards;
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放动画 */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    animation: scaleIn 0.8s ease-out forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 滑入动画 */
.slide-in-left {
    opacity: 0;
    transform: translateX(-100px);
    animation: slideInLeft 1s ease-out forwards;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    opacity: 0;
    transform: translateX(100px);
    animation: slideInRight 1s ease-out forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 弹跳动画 */
.bounce-in {
    opacity: 0;
    transform: scale(0.3);
    animation: bounceIn 1s ease-out forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 旋转进入 */
.rotate-in {
    opacity: 0;
    transform: rotate(-200deg);
    animation: rotateIn 1s ease-out forwards;
}

@keyframes rotateIn {
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

/* 闪烁效果 */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 波浪效果 */
.wave {
    position: relative;
    overflow: hidden;
}

.wave::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: wave 2s infinite;
}

@keyframes wave {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 粒子效果背景 */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    animation: particles 20s ease-in-out infinite;
}

@keyframes particles {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #295DFC, #295DFC);
    border-radius: 2px;
    transition: width 1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* 通知消息 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid #295DFC;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #295DFC;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.warning {
    border-left-color: #f39c12;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ecf0f1;
    color: #2c3e50;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.25rem;
}

.tag.primary {
    background: #295DFC;
    color: white;
}

.tag.success {
    background: #295DFC;
    color: white;
}

.tag.warning {
    background: #f39c12;
    color: white;
}

.tag.danger {
    background: #e74c3c;
    color: white;
}

/* 徽章 */
.badge {
    position: relative;
    display: inline-block;
}

.badge::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 分割线 */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #bdc3c7, transparent);
    margin: 2rem 0;
}

.divider.vertical {
    width: 1px;
    height: 100px;
    background: linear-gradient(180deg, transparent, #bdc3c7, transparent);
    margin: 0 2rem;
}

/* 时间轴 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #295DFC;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: #295DFC;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #295DFC;
}

/* 响应式组件 */
@media (max-width: 992px) {
    .modal-content {
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .modal {
        padding: 20px;
    }
    
    .modal-content {
        margin: 15vh auto;
        width: 95%;
        max-width: 95%;
        padding: 1.5rem;
        position: relative;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        width: auto;
        min-width: auto;
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .timeline {
        padding-left: 1rem;
    }
    
    .timeline::before {
        left: 0.5rem;
    }
    
    .timeline-item {
        padding-left: 1.5rem;
    }
    
    .timeline-item::before {
        left: -1rem;
    }
    
    .tooltip .tooltiptext {
        width: 100px;
        font-size: 0.75rem;
        margin-left: -50px;
    }
    
    .progress-bar {
        height: 3px;
    }
}

@media (max-width: 576px) {
    .modal-content {
        margin: 20vh auto;
        padding: 1.2rem;
        min-height: auto;
    }
    
    .close {
        font-size: 20px;
    }
    
    .timeline {
        padding-left: 0.8rem;
    }
    
    .timeline::before {
        left: 0.3rem;
    }
    
    .timeline-item {
        padding-left: 1.2rem;
    }
    
    .timeline-item::before {
        left: -0.8rem;
        width: 10px;
        height: 10px;
        border: 2px solid white;
        box-shadow: 0 0 0 2px #295DFC;
    }
    
    .divider.vertical {
        display: none;
    }
    
    .tooltip .tooltiptext {
        width: 80px;
        margin-left: -40px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 25vh auto;
        width: 90%;
        padding: 1rem;
    }
    
    .notification {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
    
    .timeline {
        padding-left: 0.6rem;
    }
    
    .timeline::before {
        left: 0.2rem;
        width: 1px;
    }
    
    .timeline-item {
        padding-left: 1rem;
        font-size: 0.9rem;
    }
    
    .timeline-item::before {
        left: -0.6rem;
        width: 8px;
        height: 8px;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
    
    .skeleton-text {
        height: 0.9rem;
    }
    
    .skeleton-avatar {
        width: 40px;
        height: 40px;
    }
    
    .skeleton-image {
        height: 150px;
    }
    
    .divider {
        margin: 1.5rem 0;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .modal-content {
        width: 95%;
        padding: 0.8rem;
    }
    
    .notification {
        font-size: 0.75rem;
        padding: 0.6rem 0.8rem;
    }
    
    .timeline-item {
        font-size: 0.85rem;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }
    
    .skeleton-image {
        height: 120px;
    }
}

/* 主题适配 - 卡片/区块 */
.section-header{ text-align: center; margin-bottom: 18px; }
.section-header p{ color:#64748b; }

.badge, .product-badge{ border-radius:999px; padding:6px 10px; font-weight:700; }

.divider{ height:1px; background: #eef2f7; margin: 16px 0; }

.shadow-soft{ box-shadow:0 10px 30px rgba(0,0,0,.06); }

/* banner按钮一致化 */
.hero .btn-primary{ background: var(--brand-grad); border:none; }

/* 增强触摸体验 */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 优化小屏幕触摸目标大小 */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .nav-link,
    .mobile-menu-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .touch-target-large {
        min-height: 48px;
        min-width: 48px;
    }
}

/* 防止文字在移动设备上过小 */
@media screen and (max-width: 375px) {
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
}
