/**
 * 手风琴折叠样式
 */

.template-card {
    background: white;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(233, 30, 99, 0.08);
    border: 1px solid rgba(233, 30, 99, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: rgba(233, 30, 99, 0.2);
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.12);
}

.template-card.expanded {
    background: linear-gradient(135deg, #fff5f8, #fffafc);
    border: 2px solid #e91e63;
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.2);
    margin-bottom: 20px;
}

/* 可点击的头部 */
.template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    background: transparent;
}

.template-header:hover {
    background: linear-gradient(135deg, rgba(252, 228, 236, 0.4), rgba(248, 187, 208, 0.3));
}

.template-card.expanded .template-header {
    background: linear-gradient(135deg, #e91e63, #d81b60);
    border-bottom: 2px solid rgba(233, 30, 99, 0.3);
    padding: 14px 18px;
}

.template-info {
    flex: 1;
}

.template-name {
    font-size: 15px;
    font-weight: 600;
    color: #e91e63;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.template-card.expanded .template-name {
    color: white;
}

.template-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.template-card.expanded .template-desc {
    color: rgba(255, 255, 255, 0.9);
}

.template-summary {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    padding: 6px 10px;
    background: rgba(233, 30, 99, 0.05);
    border-radius: 6px;
    border-left: 2px solid #e91e63;
    transition: all 0.3s ease;
}

.template-card.expanded .template-summary {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
    color: white;
}

/* 展开/收起图标 */
.template-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(233, 30, 99, 0.1);
    border-radius: 6px;
    margin-left: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.template-card:hover .template-toggle {
    background: rgba(233, 30, 99, 0.2);
}

.template-card.expanded .template-toggle {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.toggle-icon {
    color: #e91e63;
    font-size: 12px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.template-card.expanded .toggle-icon {
    color: white;
}

/* 折叠的内容区域 */
.template-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 16px;
}

.template-card.expanded .template-body {
    max-height: 3000px;
    padding: 16px;
    border-top: none;
}

.template-content {
    background: #f9f9f9;
    border: 1px solid #f0f0f0;
    padding: 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
}

.template-body .copy-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.template-body .copy-btn:hover {
    background: linear-gradient(135deg, #c2185b, #ad1457);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

.template-body .copy-btn:active {
    transform: translateY(0);
}

/* 手机端优化 */
@media (max-width: 768px) {
    .template-card {
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .template-header {
        padding: 10px 12px;
    }
    
    .template-name {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .template-desc {
        font-size: 11px;
        margin-bottom: 5px;
    }
    
    .template-summary {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .template-toggle {
        width: 24px;
        height: 24px;
        margin-left: 8px;
        border-radius: 6px;
    }
    
    .toggle-icon {
        font-size: 10px;
    }
    
    .template-card.expanded .template-body {
        padding: 12px;
    }
    
    .template-content {
        font-size: 12px;
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .template-body .copy-btn {
        padding: 9px;
        font-size: 13px;
    }
}
