/**
 * 移动端卡片系统样式
 * 为移动设备提供简化版卡片和交互方式
 */

/* 移动端卡片基础样式 */
@media (max-width: 768px) {
    /* 简化卡片容器 */
    .card-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    /* 简化卡片样式 */
    .card {
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(250, 250, 250, 0.95));
        padding: 1rem;
        transition: all 0.3s ease;
        border: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;
    }
    
    /* 卡片悬停效果 */
    .card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    /* 卡片头部 */
    .card-header {
        display: flex;
        align-items: center;
        margin-bottom: 0.8rem;
        gap: 0.8rem;
    }
    
    /* 卡片图标 */
    .card-icon {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    
    /* 卡片标题 */
    .card-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #1d1d1f;
        margin: 0;
        flex: 1;
    }
    
    /* 卡片内容 */
    .card-content {
        font-size: 0.9rem;
        color: #86868b;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    /* 卡片操作区 */
    .card-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.8rem;
    }
    
    /* 卡片按钮 */
    .card-button {
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-size: 0.9rem;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* 主要按钮 */
    .card-button-primary {
        background-color: #0066cc;
        color: white;
    }
    
    /* 次要按钮 */
    .card-button-secondary {
        background-color: rgba(0, 0, 0, 0.05);
        color: #1d1d1f;
    }
    
    /* 卡片按钮悬停效果 */
    .card-button:active {
        transform: scale(0.95);
    }
    
    /* 卡片分隔线 */
    .card-divider {
        height: 1px;
        background-color: rgba(0, 0, 0, 0.05);
        margin: 1rem 0;
    }
    
    /* 卡片标签 */
    .card-tag {
        display: inline-block;
        padding: 0.3rem 0.8rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 500;
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
        background-color: rgba(0, 0, 0, 0.05);
        color: #1d1d1f;
    }
    
    /* 卡片徽章 */
    .card-badge {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.2rem 0.6rem;
        border-radius: 6px;
        font-size: 0.7rem;
        font-weight: 600;
        color: white;
    }
    
    /* 新内容徽章 */
    .badge-new {
        background-color: #34c759;
    }
    
    /* 重要徽章 */
    .badge-important {
        background-color: #ff3b30;
    }
    
    /* 推荐徽章 */
    .badge-recommended {
        background-color: #ff9500;
    }
    
    /* 卡片列表 */
    .card-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .card-list-item {
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }
    
    .card-list-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    /* 卡片网格 */
    .card-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    /* 小型卡片 */
    .card-small {
        padding: 0.8rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .card-small .card-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .card-small .card-title {
        font-size: 0.9rem;
        text-align: center;
    }
    
    /* 卡片滑动容器 */
    .card-swipe-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0;
        margin: 0 -1rem;
        padding: 0 1rem;
        display: flex;
        gap: 1rem;
        scrollbar-width: none; /* Firefox */
    }
    
    .card-swipe-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }
    
    /* 滑动卡片 */
    .card-swipe {
        min-width: 200px;
        flex: 0 0 auto;
    }
    
    /* 卡片展开/折叠 */
    .card-expandable .card-content {
        max-height: 3rem;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .card-expandable.expanded .card-content {
        max-height: 1000px;
    }
    
    .card-expand-toggle {
        text-align: center;
        color: #0066cc;
        font-size: 0.9rem;
        font-weight: 500;
        padding: 0.5rem;
        cursor: pointer;
    }
    
    /* 卡片加载动画 */
    .card-loading {
        display: flex;
        justify-content: center;
        padding: 1rem;
    }
    
    .card-loading-spinner {
        width: 1.5rem;
        height: 1.5rem;
        border: 2px solid rgba(0, 102, 204, 0.1);
        border-radius: 50%;
        border-top-color: #0066cc;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }
    
    /* 卡片颜色变体 */
    .card-blue .card-icon {
        background: linear-gradient(135deg, #0066cc, #5ac8fa);
    }
    
    .card-green .card-icon {
        background: linear-gradient(135deg, #34c759, #30d158);
    }
    
    .card-orange .card-icon {
        background: linear-gradient(135deg, #ff9500, #ff3b30);
    }
    
    .card-purple .card-icon {
        background: linear-gradient(135deg, #af52de, #5e5ce6);
    }
    
    /* 发现红点页面的卡片样式 */
    .discover-card-container {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        padding: 1rem 0;
    }
    
    .discover-card {
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
        background: white;
        transition: all 0.3s ease;
    }
    
    .discover-card-image {
        height: 120px;
        background-size: cover;
        background-position: center;
        position: relative;
    }
    
    .discover-card-image::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50%;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    }
    
    .discover-card-content {
        padding: 1rem;
    }
    
    .discover-card-title {
        font-size: 1.2rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #1d1d1f;
    }
    
    .discover-card-description {
        font-size: 0.9rem;
        color: #86868b;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .discover-card-button {
        display: inline-block;
        padding: 0.6rem 1.2rem;
        background-color: #0066cc;
        color: white;
        border-radius: 8px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    /* 规划工坊卡片样式 */
    .planning-card-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .planning-card {
        border-radius: 16px;
        padding: 1.2rem;
        background: white;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .planning-card-header {
        display: flex;
        align-items: center;
        margin-bottom: 1rem;
        gap: 1rem;
    }
    
    .planning-card-number {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        background: linear-gradient(135deg, #0066cc, #5ac8fa);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    
    .planning-card-title {
        font-size: 1.2rem;
        font-weight: 600;
        color: #1d1d1f;
        margin: 0;
    }
    
    .planning-card-description {
        font-size: 0.9rem;
        color: #86868b;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .planning-card-progress {
        height: 6px;
        background-color: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
        margin-bottom: 0.8rem;
        overflow: hidden;
    }
    
    .planning-card-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #5ac8fa, #0066cc);
        border-radius: 3px;
        transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .planning-card-status {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
        color: #86868b;
        margin-bottom: 1rem;
    }
    
    .planning-card-button {
        display: block;
        width: 100%;
        padding: 0.8rem;
        text-align: center;
        background-color: #0066cc;
        color: white;
        border-radius: 8px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    /* 卡片系统样式 */
    .card-system-container {
        padding: 0.5rem;
    }
    
    .card-system-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .card-system-item {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.8rem;
        transition: all 0.3s ease;
    }
    
    .card-system-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
    }
    
    .card-system-title {
        font-size: 1rem;
        font-weight: 600;
        color: #1d1d1f;
        margin: 0;
    }
    
    .card-system-description {
        font-size: 0.8rem;
        color: #86868b;
        line-height: 1.4;
    }
}

/* 移动端触摸交互优化 */
@media (max-width: 768px) {
    /* 增加触摸区域大小 */
    .card-button,
    .card-expand-toggle,
    .discover-card-button,
    .planning-card-button {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 减少悬停状态，增加活动状态 */
    .card:hover,
    .card-button:hover,
    .discover-card:hover,
    .planning-card:hover,
    .card-system-item:hover {
        transform: none;
    }
    
    .card:active,
    .card-button:active,
    .discover-card:active,
    .planning-card:active,
    .card-system-item:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
    
    /* 滑动手势提示 */
    .swipe-hint {
        text-align: center;
        color: #86868b;
        font-size: 0.8rem;
        margin: 0.5rem 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .swipe-hint i {
        animation: swipe-animation 1.5s infinite;
    }
    
    @keyframes swipe-animation {
        0% {
            transform: translateX(0);
        }
        50% {
            transform: translateX(10px);
        }
        100% {
            transform: translateX(0);
        }
    }
    
    /* 触摸反馈 */
    .touch-ripple {
        position: relative;
        overflow: hidden;
    }
    
    .touch-ripple::after {
        content: '';
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        pointer-events: none;
        background-image: radial-gradient(circle, rgba(0, 0, 0, 0.1) 10%, transparent 10.01%);
        background-repeat: no-repeat;
        background-position: 50%;
        transform: scale(10, 10);
        opacity: 0;
        transition: transform 0.5s, opacity 0.5s;
    }
    
    .touch-ripple:active::after {
        transform: scale(0, 0);
        opacity: 0.3;
        transition: 0s;
    }
}
