/**
 * XDKS前台样式
 *
 * @package XDKS
 * @since 1.0.0
 */

/* ==========================================================================
   基础样式
   ========================================================================== */

.xdks-products-container,
.xdks-single-product,
.xdks-order-query,
.xdks-order-result,
.xdks-page-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.xdks-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.xdks-page-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* ==========================================================================
   商品列表样式
   ========================================================================== */

/* 商品列表容器 - 重置列表默认样式 */
.xdks-products-container,
.wp-block-xdks-products .xdks-products-container {
    list-style: none !important;
    margin: 20px 0 !important;
    padding: 0 !important;
    display: grid;
    gap: 20px;
}

/* 网格布局 */
.xdks-products-container.xdks-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.xdks-products-container.xdks-layout-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.xdks-products-container.xdks-layout-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* 列表布局 - 优化间距 */
.xdks-products-container.xdks-layout-list {
    grid-template-columns: 1fr;
}

.xdks-products-container.xdks-layout-list .xdks-product-item {
    display: flex;
    align-items: center;
    padding: 15px; /* 从20px减少到15px */
}

.xdks-products-container.xdks-layout-list .xdks-product-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.xdks-products-container.xdks-layout-list .xdks-product-title {
    flex: 1;
    margin: 0;
}

.xdks-products-container.xdks-layout-list .xdks-product-meta {
    flex: 0 0 auto;
}

.xdks-products-container.xdks-layout-list .xdks-product-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

/* 商品项样式 - 优化间距 */
.xdks-product-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px; /* 从20px减少到15px */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.xdks-product-item:hover {
    border-color: #007cba;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.1);
    transform: translateY(-2px);
}

.xdks-product-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #2c3e50;
    text-align: center; /* 商品名称居中 */
}

.xdks-product-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.xdks-product-meta {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* 整个meta区域居中 */
    gap: 8px;
}

/* 价格和库存在同一行显示 */
.xdks-product-price-stock {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    flex-wrap: nowrap !important;
    width: 100%;
}

.xdks-product-price {
    margin-bottom: 0 !important; /* 移除底部边距 */
    display: inline-block;
}

.xdks-product-stock {
    display: inline-block;
    margin-bottom: 0 !important;
}

.xdks-price-label {
    color: #666;
    font-size: 14px;
}

.xdks-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
}

.xdks-product-stock {
    font-size: 14px;
    display: inline-block !important;
    margin: 0 !important;
}

.xdks-stock-available {
    color: #27ae60;
    font-weight: 500;
}

.xdks-stock-empty {
    color: #e74c3c;
    font-weight: 500;
}

.xdks-product-actions {
    text-align: center;
}

/* 无商品提示 */
.xdks-no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* ==========================================================================
   单个商品样式
   ========================================================================== */

.xdks-single-product {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.xdks-product-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.xdks-single-product .xdks-product-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: white;
}

/* 单个商品页面的价格样式 */
.xdks-single-product .xdks-product-price {
    font-size: 32px;
    font-weight: 700;
}

/* 商品列表中的价格样式 */
.xdks-products-container .xdks-product-price {
    font-size: 16px;
    font-weight: 600;
    display: inline-block !important;
    margin: 0 !important;
}

.xdks-price-symbol {
    font-size: 24px;
    vertical-align: top;
}

.xdks-product-description {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.xdks-product-info {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.xdks-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.xdks-info-item:last-child {
    margin-bottom: 0;
}

.xdks-info-label {
    font-weight: 500;
    color: #666;
}

.xdks-product-type {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* ==========================================================================
   表单样式
   ========================================================================== */

.xdks-purchase-form {
    padding: 30px;
}

.xdks-form {
    max-width: 100%;
}

.xdks-form-group {
    margin-bottom: 20px;
}

.xdks-label,
.xdks-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2c3e50;
    text-align: center;
}

.xdks-input,
.xdks-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.xdks-input:focus,
.xdks-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.xdks-help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.required {
    color: #e74c3c;
}

/* 支付方式选择 */
.xdks-payment-methods {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.xdks-payment-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-width: 120px;
    max-width: 100%;
    box-sizing: border-box;
}

.xdks-payment-option:hover {
    border-color: #007cba;
}

.xdks-payment-option input[type="radio"] {
    display: none;
}

.xdks-payment-option input[type="radio"]:checked + .xdks-payment-icon + .xdks-payment-label {
    color: #007cba;
    font-weight: 600;
}

.xdks-payment-option input[type="radio"]:checked ~ * {
    color: #007cba;
}

.xdks-payment-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f0f8ff;
}

.xdks-payment-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 4px;
    display: inline-block;
}

.xdks-payment-icon.xdks-payment-alipay {
    background: linear-gradient(135deg, #1677ff, #0958d9);
}

.xdks-payment-icon.xdks-payment-wxpay {
    background: linear-gradient(135deg, #07c160, #059748);
}

.xdks-payment-icon.xdks-payment-qqpay {
    background: linear-gradient(135deg, #12b7f5, #0e8cc8);
}

.xdks-payment-label {
    font-weight: 500;
}

/* 总计金额 */
.xdks-total-amount {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e1e5e9;
}

.xdks-total-label {
    font-size: 16px;
    color: #666;
}

.xdks-total-price {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
    margin-left: 10px;
}

/* ==========================================================================
   按钮样式
   ========================================================================== */

.xdks-btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 0;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.xdks-btn-primary {
    background: #007cba;
    color: #fff;
}

.xdks-btn-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.xdks-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.xdks-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.xdks-btn-disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.xdks-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.xdks-form-actions .xdks-btn-large {
    width: 100%;
}

.xdks-form-actions-center .xdks-btn-large {
    width: auto;
    min-width: 200px;
}

.xdks-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.xdks-btn-loading {
    display: none;
}

.xdks-btn.loading .xdks-btn-text {
    display: none;
}

.xdks-btn.loading .xdks-btn-loading {
    display: inline;
}

.xdks-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ==========================================================================
   订单查询样式
   ========================================================================== */

.xdks-order-query {
    max-width: 600px;
    margin: 20px auto;
}

.xdks-query-header {
    text-align: center;
    margin-bottom: 30px;
}

.xdks-query-header h2,
.xdks-query-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.xdks-query-description {
    color: #666;
    margin: 0;
}

.xdks-query-results {
    margin-top: 30px;
}

/* 订单列表 */
.xdks-orders-list h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.xdks-order-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.xdks-order-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.xdks-order-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e5e9;
}

.xdks-order-id {
    font-weight: 600;
    color: #2c3e50;
}

.xdks-order-details {
    padding: 20px;
}

.xdks-order-product {
    font-size: 16px;
    margin-bottom: 10px;
}

.xdks-order-quantity {
    color: #666;
    margin-left: 10px;
}

.xdks-order-amount {
    font-size: 18px;
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 10px;
}

.xdks-order-time,
.xdks-order-paid-time {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

/* 卡密信息样式 */
.xdks-order-card-data {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xdks-order-card-data strong {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
    border-bottom: 2px solid #28a745;
    padding-bottom: 8px;
}

.xdks-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xdks-card-content code {
    flex: 1;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    color: #212529;
    word-break: break-all;
    user-select: all;
}

/* 成功状态样式 */
.xdks-success {
    text-align: center;
    padding: 30px 20px;
}

.xdks-success .success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 15px;
    display: block;
}

.xdks-success h2 {
    color: #28a745;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.xdks-copy-card {
    background: #007cba;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.xdks-copy-card:hover {
    background: #005a87;
}

.xdks-copy-card:active {
    background: #004c75;
}

.xdks-order-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* 状态徽章 */
.xdks-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xdks-status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.xdks-status-paid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.xdks-status-shipped {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #99d6ff;
}

.xdks-status-completed {
    background: #e2e3ff;
    color: #383d41;
    border: 1px solid #c7c8ff;
}

.xdks-status-expired {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.xdks-status-cancelled {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* ==========================================================================
   订单结果页面
   ========================================================================== */

.xdks-order-result {
    text-align: center;
    padding: 40px 20px;
}

.xdks-result-success,
.xdks-result-error {
    max-width: 800px;
    margin: 0 auto;
}

.xdks-result-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.xdks-result-success .xdks-result-icon {
    color: #27ae60;
}

.xdks-result-error .xdks-result-icon {
    color: #e74c3c;
}

.xdks-result-success h2 {
    color: #27ae60;
    font-size: 28px;
    margin-bottom: 20px;
}

.xdks-result-error h2 {
    color: #e74c3c;
    font-size: 28px;
    margin-bottom: 20px;
}

/* 订单信息区域 */
.xdks-order-info {
    text-align: left;
    margin: 30px 0;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xdks-order-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.xdks-order-info .info-row:last-child {
    border-bottom: none;
}

.xdks-order-info .info-label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
}

.xdks-order-info .info-value {
    color: #333;
    text-align: right;
    flex: 1;
}

.xdks-info-section {
    margin-bottom: 25px;
}

.xdks-info-section:last-child {
    margin-bottom: 0;
}

.xdks-info-section h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #007cba;
}

.xdks-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.xdks-info-label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
    margin-right: 10px;
}

.xdks-info-value {
    color: #212529;
    flex: 1;
}

/* 卡密项目样式 */
.xdks-card-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.xdks-card-item:last-child {
    margin-bottom: 0;
}

.xdks-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.xdks-card-code {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #495057;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
    user-select: all;
}

/* 复制按钮样式 */
.xdks-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.xdks-copy-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

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

.xdks-copy-btn .copy-icon {
    font-size: 14px;
}

.xdks-copy-btn .copy-text {
    font-size: 12px;
}

/* 商品项目样式 */
.xdks-product-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.xdks-product-item:last-child {
    margin-bottom: 0;
}

.xdks-product-info {
    margin-bottom: 15px;
}

.xdks-card-info {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.xdks-card-content {
    margin-top: 5px;
}

.xdks-card-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.xdks-card-code {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #495057;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}

.xdks-card-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xdks-status-delivered {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.xdks-status-pending {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.xdks-card-empty {
    color: #6c757d;
    font-style: italic;
}

.xdks-result-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   错误和提示样式
   ========================================================================== */

/* 支付方式错误提醒样式 */
.xdks-payment-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.xdks-payment-error:before {
    content: "⚠";
    margin-right: 6px;
    font-weight: bold;
}

.xdks-payment-error:empty {
    display: none !important;
}

.xdks-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
}

.xdks-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin: 20px 0;
}

.xdks-warning {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    margin: 20px 0;
}

.xdks-info {
    background: #cce7ff;
    color: #004085;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #99d6ff;
    margin: 20px 0;
}

/* 表单错误提示样式 */
.xdks-form-error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.xdks-form-error::before {
    content: "⚠";
    font-size: 14px;
    color: #dc3545;
}

/* ==========================================================================
   加载动画
   ========================================================================== */

.xdks-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: xdks-spin 1s linear infinite;
}

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

.xdks-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.xdks-loading-overlay .xdks-loading {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* 轮询加载状态样式 */
.xdks-polling-status {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.xdks-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: xdks-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.xdks-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.xdks-loading-subtitle {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* 订单内容包装器 */
.xdks-order-content-wrapper {
    transition: opacity 0.3s ease;
}

.xdks-order-content-wrapper.xdks-hidden {
    opacity: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .xdks-polling-status {
        padding: 30px 15px;
    }
    
    .xdks-loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
        margin-bottom: 15px;
    }
    
    .xdks-loading-text {
        font-size: 16px;
    }
    
    .xdks-loading-subtitle {
        font-size: 13px;
    }
    
    /* 移动端购买框优化 */
    .xdks-modal .xdks-btn-large {
        padding: 18px 32px;
        font-size: 20px;
        font-weight: 700;
        min-height: 56px;
        border-radius: 8px;
    }
    
    /* 支付方式移动端优化 - 同一行显示 */
    .xdks-modal .xdks-payment-methods {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .xdks-modal .xdks-payment-option {
        flex: 1;
        min-width: 0;
        padding: 16px 12px;
        justify-content: center;
        text-align: center;
    }
    
    .xdks-modal .xdks-payment-icon {
        margin-right: 6px;
        width: 20px;
        height: 20px;
    }
    
    .xdks-modal .xdks-payment-label {
        font-size: 14px;
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    .xdks-page-container {
        padding: 10px;
    }
    
    .xdks-page-content {
        padding: 20px;
    }
    
    /* 商品列表 - 移动端强制使用列表式布局 */
    .xdks-products-container.xdks-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* 移动端商品项统一列表式布局 */
    .xdks-product-item {
        display: flex !important;
        align-items: stretch !important;
        padding: 15px !important;
        margin-bottom: 10px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        background: #fff !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
    
    /* 商品内容容器 - 水平列表式布局 */
    .xdks-product-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 15px !important;
        min-height: 50px !important;
    }
    
    /* 商品标题区域 */
    .xdks-product-title {
        flex: 1 1 auto !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
        line-height: 1.4 !important;
        color: #333 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* 商品元信息区域 */
    .xdks-product-meta {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
    }
    
    /* 价格库存容器 */
    .xdks-product-price-stock {
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
        margin: 0 !important;
    }
    
    /* 价格样式 */
    .xdks-product-price {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        color: #e74c3c !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }
    
    .xdks-price-label,
    .xdks-price-value {
        display: inline !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: inherit !important;
    }
    
    /* 移动端隐藏库存信息 */
    .xdks-product-stock {
        display: none !important;
    }
    
    /* 购买按钮区域 */
    .xdks-product-actions {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 购买按钮样式 */
    .xdks-btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        border-radius: 4px !important;
        border: none !important;
        background: #3498db !important;
        color: #fff !important;
        cursor: pointer !important;
        white-space: nowrap !important;
        min-width: 80px !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .xdks-btn:hover {
        background: #2980b9 !important;
    }
    
    /* 列表布局兼容性 */
    .xdks-products-container.xdks-layout-list .xdks-product-content {
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    .xdks-products-container.xdks-layout-list .xdks-product-actions {
        margin-left: 0 !important;
        width: auto !important;
    }
    
    /* 单个商品 */
    .xdks-single-product {
        margin: 10px;
    }
    
    .xdks-product-header {
        padding: 20px;
    }
    
    .xdks-single-product .xdks-product-title {
        font-size: 20px;
    }
    
    .xdks-single-product .xdks-product-price {
        font-size: 24px;
    }
    
    .xdks-product-description,
    .xdks-product-info,
    .xdks-purchase-form {
        padding: 20px;
    }
    
    /* 支付方式 */
    .xdks-payment-methods {
        flex-direction: column;
        gap: 10px;
    }
    
    .xdks-payment-option {
        width: 100%;
        min-width: auto;
        max-width: 100%;
        padding: 10px 12px;
        justify-content: flex-start;
        box-sizing: border-box;
    }
    
    /* 订单查询 */
    .xdks-order-query {
        margin: 10px;
    }
    
    /* 移动端订单查询块紧凑样式 */
    .xdks-query-wrapper {
        padding: 20px 15px !important;
    }
    
    .xdks-query-header {
        margin-bottom: 15px !important;
    }
    
    .xdks-query-title {
        font-size: 18px !important;
        margin: 0 0 5px 0 !important;
        line-height: 1.2 !important;
    }
    
    .xdks-query-description {
        font-size: 12px !important;
        margin: 0 !important;
        line-height: 1.3 !important;
    }
    
    .xdks-form-group {
        margin-bottom: 15px !important;
    }
    
    .xdks-input {
        padding: 10px 12px !important;
        font-size: 16px !important;
    }
    
    /* 订单查询表单按钮居中 */
    .xdks-form-actions-center {
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-top: 20px !important;
    }
    
    .xdks-form-actions-center .xdks-btn {
        display: inline-block !important;
        margin: 0 !important;
        width: auto !important;
        min-width: 200px !important;
        flex: none !important;
    }
    
    /* 确保居中容器中的按钮不受移动端flex样式影响 */
    .xdks-form-actions-center .xdks-btn-large {
        display: inline-block !important;
        width: auto !important;
        min-width: 200px !important;
        margin: 0 !important;
    }
    
    .xdks-order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .xdks-order-details {
        padding: 15px;
    }
    
    /* 结果页面 */
    .xdks-result-actions {
        flex-direction: column;
    }
    
    .xdks-result-actions .xdks-btn {
        width: 100%;
    }
    
    /* 订单信息响应式 */
    .xdks-order-info {
        padding: 15px;
        margin: 20px 0;
    }
    
    .xdks-info-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .xdks-info-label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .xdks-card-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .xdks-card-code {
        min-width: auto;
        width: 100%;
        font-size: 12px;
    }
    
    /* 表单 */
    .xdks-input,
    .xdks-select {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

@media (max-width: 480px) {
    /* 更小屏幕的优化 */
    .xdks-product-header {
        padding: 15px;
    }
    
    .xdks-single-product .xdks-product-title {
        font-size: 18px;
    }
    
    .xdks-product-price {
        font-size: 20px;
    }
    
    .xdks-total-price {
        font-size: 20px;
    }
    
    .xdks-btn-large {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    /* 商品列表进一步优化 */
    .xdks-product-item {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }
    
    .xdks-product-title {
        font-size: 13px !important;
    }
    
    .xdks-product-price {
         font-size: 13px !important;
         display: flex !important;
         align-items: center !important;
         gap: 2px !important;
         white-space: nowrap !important;
         margin: 0 !important;
         line-height: 1.3 !important;
     }
     
     .xdks-price-label,
     .xdks-price-value {
         display: inline !important;
         margin: 0 !important;
         padding: 0 !important;
     }
     
     .xdks-btn {
         padding: 6px 10px !important;
         font-size: 11px !important;
         min-width: 60px !important;
         line-height: 1.3 !important;
     }
     
     .xdks-product-actions {
         display: flex !important;
         align-items: center !important;
     }
    
    .xdks-product-meta {
        min-width: 70px !important;
    }
}

/* ==========================================================================
   打印样式
   ========================================================================== */

@media print {
    .xdks-product-actions,
    .xdks-purchase-form,
    .xdks-order-actions {
        display: none;
    }
    
    .xdks-page-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .xdks-product-header {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
}

/* ==========================================================================
   无障碍访问
   ========================================================================== */

.xdks-btn:focus,
.xdks-input:focus,
.xdks-select:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.xdks-payment-option:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .xdks-product-item {
        border-width: 2px;
    }
    
    .xdks-btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .xdks-status-badge {
        border-width: 2px;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .xdks-product-item,
    .xdks-btn,
    .xdks-payment-option,
    .xdks-input,
    .xdks-select {
        transition: none;
    }
    
    .xdks-loading {
        animation: none;
    }
    
    .xdks-btn-primary:hover {
        transform: none;
    }
    
    .xdks-product-item:hover {
        transform: none;
    }
}