/* 卡密管理通用样式 */
.card-stats {
    display: flex;
    margin-bottom: 20px;
}

.stat-item {
    align-items: center;
    border-radius: 5px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 15px;
    padding: 12px 20px;
    text-align: center;
}

.all-count {
    background-color: #5c7cfa;
}

.valid-count {
    background-color: #20c997;
}

.invalid-count {
    background-color: #ff6b6b;
}

.stat-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
}

.card-table-container {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 0;
}

.card-data-table {
    border-collapse: collapse;
    width: 100%;
}

.card-data-table th {
    background-color: #f5f6fa;
    border-bottom: 2px solid #e9ecef;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
}

.card-data-table td {
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    padding: 12px 15px;
    vertical-align: middle;
}

.card-row:hover {
    background-color: #f8f9fa;
}

.code-column, .key-column {
    font-family: monospace;
    font-size: 13px;
}

.status-column {
    font-weight: 500;
}

.status-column .view-order-btn {
    background: #339af0;
    border-radius: 3px;
    color: white;
    display: inline-block;
    font-size: 12px;
    margin-left: 8px;
    padding: 3px 8px;
    text-decoration: none;
}

.status-column .view-order-btn:hover {
    background: #228be6;
}

.row-actions {
    color: #999;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.card-row:hover .row-actions {
    opacity: 1;
}

.empty-notice {
    background-color: #fff3f3;
    border-left: 4px solid #ff6b6b;
    border-radius: 4px;
    color: #e03131;
    font-size: 14px;
    margin: 15px 0;
    padding: 12px 15px;
    text-align: center;
}

.empty-notice .dashicons {
    font-size: 18px;
    margin-right: 5px;
    vertical-align: -4px;
}

/* 添加卡密表单样式 */
.add-card-form {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 20px;
    padding: 20px;
}

.form-title {
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 16px;
    margin: 0 0 15px;
    padding-bottom: 10px;
}

.form-title .dashicons {
    color: #339af0;
    font-size: 20px;
    margin-right: 5px;
    vertical-align: -5px;
}

.form-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.textarea-container {
    margin-bottom: 15px;
}

.card-textarea {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    padding: 12px;
    transition: border 0.3s, box-shadow 0.3s;
    width: 100%;
}

.card-textarea:focus {
    border-color: #339af0;
    box-shadow: 0 0 0 2px rgba(51, 154, 240, 0.25);
    outline: none;
}

.form-actions {
    text-align: center;
}

.submit-button {
    background: #339af0;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #228be6;
}

.submit-button .dashicons {
    font-size: 16px;
    margin-right: 5px;
    vertical-align: -3px;
}

/* 用户中心卡密页面 */
.user-cardcode-section {
    margin-bottom: 30px;
}

.cardcode-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 25px;
    position: relative;
    text-align: center;
}

.cardcode-stats h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 15px;
}

.cardcode-stats .count {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.cardcode-stats .decorative-circle {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    height: 100px;
    position: absolute;
    width: 100px;
}

.cardcode-stats .circle-1 {
    bottom: -20px;
    left: -20px;
}

.cardcode-stats .circle-2 {
    height: 60px;
    opacity: 0.7;
    right: 40px;
    top: 10px;
    width: 60px;
}

.cardcode-list {
    margin-top: 20px;
}

.cardcode-list .title {
    border-bottom: 2px solid #f0f0f0;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.cardcode-item {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    padding: 15px;
}

.cardcode-item .product-title {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.cardcode-item .card-code,
.cardcode-item .card-key {
    background: #f5f6fa;
    border-radius: 4px;
    display: inline-block;
    font-family: monospace;
    margin: 5px 10px 5px 0;
    padding: 8px 12px;
}

.cardcode-item .card-code {
    border-left: 3px solid #339af0;
}

.cardcode-item .card-key {
    border-left: 3px solid #ff6b6b;
}

.cardcode-item .order-meta {
    color: #666;
    display: flex;
    font-size: 13px;
    justify-content: space-between;
    margin-top: 10px;
}

.cardcode-item .order-number {
    color: #888;
}

.cardcode-item .order-price {
    font-weight: 500;
}

/* 已购卡密弹窗 */
.coolo-cardcode-modal {
    z-index: 1050;
}
.coolo-cardcode-modal:not(.in) {
    display: none !important;
    pointer-events: none !important;
}
.coolo-cardcode-modal.in {
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
.coolo-cardcode-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.coolo-cardcode-modal .modal-body {
    padding: 22px 22px 18px;
}
.coolo-cardcode-modal .abs-close {
    position: absolute;
    right: 14px;
    top: 12px;
    z-index: 2;
    opacity: 0.55;
}
.coolo-cardcode-modal-list .ajax-item {
    background: var(--main-bg-color, #f7f9fc);
    border: 1px solid rgba(0, 140, 255, 0.18) !important;
    border-radius: 10px;
    padding: 12px 14px !important;
    margin-bottom: 10px;
}
.coolo-cardcode-modal-list .ajax-item:last-child {
    margin-bottom: 0;
}
.coolo-cardcode-modal-list .but {
    margin-bottom: 6px;
}

/* 产品区：已购 / 购买按钮排版 */
.products-faka-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}
.products-faka-bought {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}
.products-faka-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    line-height: 1.4;
}
.products-faka-bought .coolo-cardcode-open {
    margin: 0 !important;
}
.products-faka-buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.products-faka-buy .cashier-link,
.products-faka-buy .but {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.products-pay .products-faka-actions {
    margin-top: 4px;
}
.pay-box .products-faka-actions {
    margin-top: 8px;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .card-stats {
        flex-direction: column;
    }
    
    .stat-item {
        margin-bottom: 10px;
        margin-right: 0;
        width: 100%;
    }
    
    .code-column, .key-column {
        font-size: 12px;
    }
    
    .status-column .view-order-btn {
        display: block;
        margin: 5px 0 0;
        text-align: center;
    }
}