/* 激活码销售系统 - 前端样式 */

/* 课程列表样式 */
.acs-course-list {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.acs-no-courses {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.acs-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* 课程卡片 */
.acs-course-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.acs-course-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.acs-course-description {
    color: #666;
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.5;
}

.acs-course-price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    margin: 12px 0;
}

.acs-course-stock {
    color: #666;
    font-size: 14px;
    margin: 8px 0 16px 0;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.acs-course-actions {
    margin-top: 16px;
}

.acs-course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.acs-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.acs-course-info {
    position: relative;
}

.acs-course-title {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.acs-course-description {
    color: #6c757d;
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.5;
}

.acs-course-price {
    font-size: 28px;
    font-weight: 700;
    color: #e74c3c;
    margin: 16px 0;
    display: flex;
    align-items: baseline;
}

.acs-course-price::before {
    content: '¥';
    font-size: 18px;
    margin-right: 2px;
}

.acs-course-stock {
    color: #6c757d;
    font-size: 13px;
    margin: 12px 0;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    display: inline-block;
}

.acs-course-actions {
    margin-top: 20px;
}

/* 按钮样式 */
.acs-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.acs-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.acs-btn:hover::before {
    left: 100%;
}

.acs-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.acs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.acs-btn-secondary {
    background: #6c757d;
    color: white;
}

.acs-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.acs-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.acs-btn:disabled::before {
    display: none;
}

/* 模态框样式 */
.acs-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: acs-modal-fade-in 0.3s ease-out;
}

@keyframes acs-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.acs-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: acs-modal-slide-in 0.3s ease-out;
    overflow: hidden;
}

@keyframes acs-modal-slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.acs-modal-content h3 {
    margin: 0;
    padding: 24px 24px 16px 24px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.acs-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
}

.acs-modal-close:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

/* 表单样式 */
#acs-purchase-form,
#acs-payment-modal .acs-modal-content {
    padding: 24px;
}

.acs-course-info-display {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.acs-course-info-display h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 16px;
}

.acs-course-info-display p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.acs-form-group {
    margin: 20px 0;
}

.acs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.acs-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.acs-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.acs-form-group small {
    display: block;
    margin-top: 4px;
    color: #6c757d;
    font-size: 12px;
}

.acs-total-price {
    font-weight: 700;
    color: #e74c3c;
    margin-left: 12px;
    font-size: 16px;
}

.acs-form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.acs-form-actions .acs-btn {
    margin-left: 12px;
}

/* 支付模态框样式 */
.acs-payment-info {
    text-align: center;
    padding: 20px;
}

#acs-qr-code {
    display: inline-block;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.acs-payment-tip {
    margin: 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.acs-payment-status {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acs-status-text {
    color: #6c757d;
    font-weight: 500;
}

.acs-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: acs-spin 1s linear infinite;
    margin-left: 12px;
}

@keyframes acs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.acs-success {
    color: #28a745;
    font-weight: 600;
}

.acs-payment-actions {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .acs-courses-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .acs-course-card {
        padding: 20px;
    }
    
    .acs-course-title {
        font-size: 18px;
    }
    
    .acs-course-price {
        font-size: 24px;
    }
    
    .acs-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .acs-btn {
        width: 100%;
        margin: 8px 0;
    }
    
    .acs-form-actions {
        text-align: center;
    }
    
    .acs-form-actions .acs-btn {
        margin: 8px 0;
    }
}

@media (max-width: 480px) {
    .acs-course-card {
        padding: 16px;
    }
    
    .acs-modal-content {
        margin: 20px auto;
        width: calc(100% - 40px);
    }
    
    #acs-purchase-form,
    #acs-payment-modal .acs-modal-content {
        padding: 20px;
    }
}

/* 可访问性增强 */
@media (prefers-reduced-motion: reduce) {
    .acs-course-card,
    .acs-btn,
    .acs-modal,
    .acs-modal-content {
        transition: none;
        animation: none;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .acs-course-card {
        border-width: 2px;
        border-color: #000;
    }
    
    .acs-btn-primary {
        background: #0066cc;
        border: 2px solid #003d7a;
    }
    
    .acs-btn:disabled {
        background: #ccc;
        color: #666;
        border: 2px solid #999;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .acs-course-card {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .acs-course-title {
        color: #ecf0f1;
    }
    
    .acs-course-description {
        color: #bdc3c7;
    }
    
    .acs-course-stock {
        background: #34495e;
        color: #bdc3c7;
    }
    
    .acs-modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .acs-modal-content h3 {
        color: #ecf0f1;
        border-bottom-color: #34495e;
    }
    
    .acs-course-info-display {
        background: #34495e;
        color: #ecf0f1;
    }
    
    .acs-form-group input {
        background: #34495e;
        border-color: #4a6741;
        color: #ecf0f1;
    }
    
    .acs-form-group input:focus {
        border-color: #667eea;
    }
    
    .acs-payment-status {
        background: #34495e;
    }
    
    #acs-qr-code {
        background: #ecf0f1;
    }
}

/* 分类标签样式 */
.acs-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 16px;
}

.acs-category-tab {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.acs-category-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.acs-category-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.acs-category-count {
    font-size: 12px;
    opacity: 0.8;
}

/* 课程分类标签 */
.acs-course-category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #667eea;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1;
}

/* 课程介绍样式 */
.acs-course-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.acs-course-description {
    margin: 12px 0;
}

.acs-description-preview {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.acs-description-toggle {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.acs-description-toggle:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.acs-description-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.acs-toggle-icon {
    transition: transform 0.2s ease;
}

.acs-description-full {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

/* 课程元信息布局 */
.acs-course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
}

.acs-course-price {
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
}

.acs-course-stock {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6c757d;
}

.stock-label {
    color: #6c757d;
}

.stock-count {
    color: #28a745;
    font-weight: 600;
}

/* 响应式更新 */
@media (max-width: 768px) {
    .acs-category-tabs {
        gap: 6px;
    }
    
    .acs-category-tab {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .acs-course-category-badge {
        top: 8px;
        right: 8px;
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .acs-course-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .acs-category-tabs {
        margin-bottom: 16px;
    }
    
    .acs-course-meta {
        gap: 6px;
    }
}