/**
 * WSCM 发货管理前端样式
 * 
 * @package WSCM
 * @since 3.4.0
 */

/* 订单状态容器 */
.wscm-orders-status {
    margin: 0 0 15px 0;  /* 移除顶部margin，仅保留底部 */
    padding: 0;
    background: transparent;
}

.wscm-orders-status h4 {
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
    color: white !important;
    font-size: 16px;
    font-weight: 500;
    padding: 0 15px;
    height: 40px;
    display: flex;
    align-items: center;
    border-left: none;
    margin-bottom: 15px !important;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(17, 153, 142, 0.3);
}

/* 订单卡片 */
.wscm-order-card {
    background: var(--main-bg-color, #fff);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wscm-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 订单卡片装饰条 - 已移除 */

/* 订单头部 */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);  /* 更明显的分割线 */
}

.order-header strong {
    color: #333;
    font-size: 13px;  /* 微信昵称字号 */
    margin-right: 10px;
}

.order-header span {
    color: #667eea;  /* 改为主题色 */
    font-size: 15px;  /* 商品名称字号 */
    background: #f0f4ff;  /* 添加淡紫色背景 */
    padding: 4px 8px;  /* 添加内边距 */
    border-radius: 4px;  /* 圆角 */
    display: inline-block;  /* 确保背景色正确显示 */
}

.order-time {
    color: #999;
    font-size: 12px;
}

/* 订单号 */
.order-number {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    display: inline-block;
}

/* 状态样式 */
.status-need-address {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffc107;
}

.status-need-address .status-text {
    color: #856404;
    font-weight: 500;
}

.status-pending {
    padding: 10px;
    background: #d1ecf1;
    border-radius: 6px;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.status-shipped {
    padding: 10px;
    background: #d4edda;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
}

.status-shipped .status-text {
    color: #155724;
    font-weight: 500;
    margin-bottom: 10px;
}

.status-delivered {
    padding: 10px;
    background: #cce5ff;
    border-radius: 6px;
    border: 1px solid #b8daff;
    color: #004085;
}

/* 物流信息 */
.tracking-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.tracking-info span {
    flex: 1;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
}

/* 按钮样式 */
.wscm-fill-address {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);  /* 统一使用红色渐变 */
    color: white !important;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wscm-fill-address:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4040 100%);  /* 悬停时更深的红色 */
    transform: translateY(-1px);
}

.wscm-track-logistics {
    background: #28a745;
    color: white !important;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wscm-track-logistics:hover {
    background: #2eb050;
    transform: translateY(-1px);
}

/* 状态描述 */
.status-desc {
    margin-left: 10px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* 紧凑模式 - 表单展开时 */
.status-need-address.compact-mode {
    padding: 5px 10px !important;  /* 减少内边距 */
    margin-bottom: 10px !important;  /* 减少底部间距 */
}

.status-need-address.compact-mode .status-text {
    margin-bottom: 0 !important;  /* 移除文字底部间距 */
    font-size: 14px;  /* 稍微减小字号 */
}

/* 按钮默认间距 */
.status-need-address .wscm-fill-address {
    margin-top: 10px;
}

/* 减少表单顶部间距 */
.wscm-inline-form .form-group:first-child,
.wscm-inline-form .field-group:first-child,
.wscm-inline-form .xintheme-form > div:first-child {
    margin-top: 0 !important;  /* 去掉顶部间距 */
}

/* 如果是form-xintheme表单 */
.wscm-inline-form form {
    padding-top: 0 !important;  /* 去掉顶部内边距 */
}

/* 表单弹窗样式 */
.wscm-form-modal-overlay {
    animation: fadeIn 0.3s ease;
}

.wscm-form-modal {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 自定义地址表单样式 */
.wscm-custom-address-form {
    padding: 10px;
}

.wscm-custom-address-form .form-group {
    margin-bottom: 20px;
}

.wscm-custom-address-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.wscm-custom-address-form label .required {
    color: #ff4d4f;
    margin-left: 2px;
}

.wscm-custom-address-form input[type="text"],
.wscm-custom-address-form input[type="tel"],
.wscm-custom-address-form select,
.wscm-custom-address-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.wscm-custom-address-form input[type="text"]:focus,
.wscm-custom-address-form input[type="tel"]:focus,
.wscm-custom-address-form select:focus,
.wscm-custom-address-form textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.wscm-custom-address-form .form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.wscm-custom-address-form .btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.wscm-custom-address-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.wscm-custom-address-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wscm-custom-address-form .btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.wscm-custom-address-form .btn-secondary:hover {
    background: #e8e8e8;
}

/* form-xintheme 表单样式优化 */
.wscm-form-body form {
    max-width: 100%;
}

.wscm-form-body .xt-form-field {
    margin-bottom: 20px;
}

.wscm-form-body .xt-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.wscm-form-body .xt-form-input,
.wscm-form-body .xt-form-select,
.wscm-form-body .xt-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
}

.wscm-form-body .xt-form-input:focus,
.wscm-form-body .xt-form-select:focus,
.wscm-form-body .xt-form-textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* 内嵌表单样式 */
.wscm-inline-form {
    padding: 8px 20px 20px 20px;  /* 顶部10px，左右和底部保持20px */
    background: #f9f9f9;
    border-top: 1px solid rgba(0, 0, 0, 0.12);  /* 与订单头部分割线一致 */
    margin-top: 15px;
    border-radius: 0 0 8px 8px;
    display: none;
    animation: slideDown 0.3s ease;
}

.wscm-inline-form.active {
    display: block;
}

.wscm-inline-form .form-loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 16px;
}

.wscm-inline-form .form-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.wscm-inline-form .form-error {
    text-align: center;
    padding: 20px;
    color: #ff4d4f;
    background: #fff2f0;
    border-radius: 4px;
    margin: 10px 0;
}

/* 内嵌表单中的form-xintheme样式调整 */
.wscm-inline-form .xintheme-form {
    background: transparent;
    padding: 0;
}

.wscm-inline-form .field-group {
    margin-bottom: 20px;
}

.wscm-inline-form .field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.wscm-inline-form input[type="text"],
.wscm-inline-form input[type="tel"],
.wscm-inline-form input[type="email"],
.wscm-inline-form select,
.wscm-inline-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.wscm-inline-form input:focus,
.wscm-inline-form select:focus,
.wscm-inline-form textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.wscm-inline-form .form-submit-wrapper {
    display: flex;
    justify-content: flex-start;  /* 按钮左对齐，与默认表单一致 */
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);  /* 与订单头部分割线一致 */
}

.wscm-inline-form button[type="submit"] {
    display: inline-block;  /* 改为 inline-block，自适应宽度 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.wscm-inline-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wscm-inline-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wscm-inline-form .btn-cancel {
    display: inline-block;  /* 自适应宽度 */
    background: #f5f5f5;
    color: #666;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.wscm-inline-form .btn-cancel:hover {
    background: #e8e8e8;
}

/* 已完成标签样式 */
.badge-completed {
    display: inline-block;
    margin-left: 12px;
    padding: 2px 10px;
    background: #52c41a;
    background-color: #52c41a;
    color: white;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
    vertical-align: middle;
}

/* 暗黑模式下的绿色标签 - 增强特异性 */
[data-theme="dark"] .badge-completed,
.dark-theme .badge-completed,
body[data-theme="dark"] .badge-completed,
.dark .badge-completed {
    background: #5dbe2a !important;
    background-color: #5dbe2a !important;
    color: white !important;
    border: 1px solid #5dbe2a !important;
}

/* 订单卡片调整 */
.wscm-order-card {
    overflow: visible;
    transition: all 0.3s ease;
}

.wscm-order-card.form-expanded {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

/* 按钮状态切换 */
.wscm-fill-address {
    transition: all 0.3s ease;
}

.wscm-fill-address.form-open {
    background: #f5f5f5;
    color: #666;
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .wscm-orders-status {
        padding: 0;  /* 移除内边距，与桌面端保持一致 */
        margin: 0 0 10px 0;  /* 仅保留底部margin */
        border-radius: 0;
    }
    
    .wscm-orders-status h4 {
        font-size: 15px;  /* 移动端字号 */
        height: 36px;  /* 移动端高度 */
        padding: 0 12px;  /* 移动端内边距 */
        margin-bottom: 12px !important;  /* 减少底部间距 */
    }
    
    .wscm-order-card {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-time {
        margin-top: 5px;
    }
    
    .tracking-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .tracking-info span {
        width: 100%;
    }
    
    .status-need-address {
        flex-direction: column;
        gap: 10px;
    }
    
    .wscm-fill-address,
    .wscm-track-logistics {
        display: inline-block;
        text-align: center;
        width: auto;  /* 确保宽度自适应 */
    }
    
    /* 确保收起表单状态也是自适应宽度 */
    .wscm-fill-address.form-open {
        display: inline-block;
        width: auto;
    }
}

/* 暗黑模式适配 */
/* 订单状态容器标题暗黑模式 */
body.dark-theme .wscm-orders-status h4,
.dark-theme .wscm-orders-status h4,
[data-theme="dark"] .wscm-orders-status h4 {
    background: linear-gradient(90deg, #0f8b80 0%, #2dd969 100%);
    color: white !important;
    border-left: none;
    box-shadow: 0 2px 10px rgba(17, 153, 142, 0.2);
}

/* 订单卡片使用CSS变量自动适配 */
.wscm-order-card {
    background: var(--card-bg, var(--body-bg-color));  /* 使用卡片背景变量 */
}
body.dark-theme .wscm-order-card,
.dark-theme .wscm-order-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);  /* 暗黑模式保留阴影 */
    border: 1px solid var(--border-color, #34495e);  /* 使用CSS变量，与商品选择器一致 */
}

body.dark-theme .order-header strong,
.dark-theme .order-header strong {
    color: #fff;
}

body.dark-theme .order-header span,
.dark-theme .order-header span {
    color: #9ca3ff;  /* 亮紫色，提高对比度 */
    background: #2a2d3a;  /* 深紫色背景 */
}

/* 订单号使用CSS变量 */
.order-number {
    background: var(--muted-bg-color, #f8f9fa);  /* 使用次要背景色变量 */
}
body.dark-theme .order-number,
.dark-theme .order-number {
    color: #ccc;  /* 暗黑模式文字颜色 */
}

/* 确保订单号内的标签正常显示 */
.order-number .badge-completed {
    display: inline-block !important;
    background: #52c41a !important;
    background-color: #52c41a !important;
}

[data-theme="dark"] .order-number .badge-completed,
.dark-theme .order-number .badge-completed,
body[data-theme="dark"] .order-number .badge-completed {
    background: #5dbe2a !important;
    background-color: #5dbe2a !important;
}

/* 物流信息使用CSS变量 */
.tracking-info span {
    background: var(--muted-bg-color, #f8f9fa);  /* 使用次要背景色变量 */
}
body.dark-theme .tracking-info span,
.dark-theme .tracking-info span {
    color: #ccc;  /* 暗黑模式文字颜色 */
}

/* 按钮暗黑模式 - 立即填写按钮使用醒目的红色 */
body.dark-theme .wscm-fill-address,
.dark-theme .wscm-fill-address {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);  /* 醒目的红色渐变 */
    color: white !important;  /* 确保文字是白色 */
}

body.dark-theme .wscm-fill-address:hover,
.dark-theme .wscm-fill-address:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4040 100%);  /* 悬停时更亮的红色 */
    transform: translateY(-1px);  /* 保持悬浮效果 */
}

/* 订单卡片细节暗黑模式 */
/* 订单头部边框使用CSS变量 - 已移除，在前面已定义 */

/* 暗黑模式下订单头部分割线 */
body.dark-theme .order-header,
.dark-theme .order-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);  /* 使用半透明白色，更明显 */
}

body.dark-theme .order-time,
.dark-theme .order-time {
    color: #adb5bd;
}

/* 装饰条使用CSS变量 - 已移除 */

/* 状态样式暗黑模式 */
body.dark-theme .status-need-address,
.dark-theme .status-need-address {
    background: rgba(255, 243, 205, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

body.dark-theme .status-need-address .status-text,
.dark-theme .status-need-address .status-text {
    color: #ffc107;
}

body.dark-theme .status-pending,
.dark-theme .status-pending {
    background: rgba(209, 236, 241, 0.1);
    border-color: rgba(190, 229, 235, 0.3);
    color: #5bc0de;
}

body.dark-theme .status-shipped,
.dark-theme .status-shipped {
    background: rgba(212, 237, 218, 0.1);
    border-color: rgba(195, 230, 203, 0.3);
}

body.dark-theme .status-shipped .status-text,
.dark-theme .status-shipped .status-text {
    color: #5cb85c;
}

body.dark-theme .status-delivered,
.dark-theme .status-delivered {
    background: rgba(204, 229, 255, 0.1);
    border-color: rgba(184, 218, 255, 0.3);
    color: #5bc0de;
}

/* 查询物流按钮暗黑模式 */
body.dark-theme .wscm-track-logistics,
.dark-theme .wscm-track-logistics {
    background: #28a745;
    color: white !important;
}

body.dark-theme .wscm-track-logistics:hover,
.dark-theme .wscm-track-logistics:hover {
    background: #2eb050;
}

/* 状态描述暗黑模式 */
body.dark-theme .status-desc,
.dark-theme .status-desc {
    color: #888;
}

/* 表单容器 - 使用CSS变量自动适配 */
.wscm-inline-form {
    background: var(--body-bg-color);  /* 使用主题背景色变量 */
}

/* 暗黑模式下表单顶部分割线 */
body.dark-theme .wscm-inline-form,
.dark-theme .wscm-inline-form {
    border-top: 1px solid rgba(255, 255, 255, 0.12);  /* 与订单头部分割线一致 */
}

/* 暗黑模式下表单提交区域分割线 */
body.dark-theme .wscm-inline-form .form-submit-wrapper,
.dark-theme .wscm-inline-form .form-submit-wrapper {
    border-top: 1px solid rgba(255, 255, 255, 0.12);  /* 与订单头部分割线保持一致 */
}

/* 空订单提示暗黑模式 */
body.dark-theme .wscm-no-orders,
.dark-theme .wscm-no-orders {
    color: #888;
}

body.dark-theme .wscm-no-orders i,
.dark-theme .wscm-no-orders i {
    color: #555;
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wscm-order-card {
    animation: slideInUp 0.4s ease;
}

.wscm-order-card:nth-child(2) {
    animation-delay: 0.1s;
}

.wscm-order-card:nth-child(3) {
    animation-delay: 0.2s;
}

.wscm-order-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* 图标样式 */
.wscm-orders-status .fa,
.wscm-order-card .fa {
    margin-right: 6px;
}

/* 空状态提示 */
.wscm-no-orders {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.wscm-no-orders i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

.wscm-no-orders p {
    font-size: 16px;
    margin: 0;
}

/* ========================================
   订单展开/收起功能样式
   使用与"立即填写"相同的红色渐变样式
   ======================================== */
.wscm-toggle-container {
    text-align: center;
    margin: 20px 0 10px;
}

.wscm-toggle-btn {
    /* 使用与立即填写相同的红色渐变 */
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white !important;
    border: none;
    padding: 8px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.wscm-toggle-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4040 100%);
    transform: translateY(-1px);
}

.wscm-toggle-btn:focus {
    outline: none;
}

.wscm-toggle-btn .toggle-icon {
    margin-left: 8px;
    transition: transform 0.3s ease;
    font-size: 12px;
    vertical-align: middle;
}

/* 暗黑模式 - 保持相同的红色（醒目） */
body.dark-theme .wscm-toggle-btn,
.dark-theme .wscm-toggle-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white !important;
}

body.dark-theme .wscm-toggle-btn:hover,
.dark-theme .wscm-toggle-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4040 100%);
    transform: translateY(-1px);
}

/* 隐藏订单容器 */
.wscm-hidden-orders {
    overflow: hidden;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .wscm-toggle-btn {
        width: auto;
        display: inline-block;
    }
    
    .wscm-toggle-container {
        padding: 0 15px;
    }
}

/* ========================================
   物流查询弹窗样式 - Apple Design
   使用CSS变量实现主题适配
   ======================================== */

/* 弹窗遮罩层 - 毛玻璃效果 */
.wscm-tracking-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 999998;
    display: flex;
    display: -webkit-flex;
    align-items: center !important;
    justify-content: center !important;
    -webkit-align-items: center !important;
    -webkit-justify-content: center !important;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wscm-tracking-modal-overlay.show {
    opacity: 1;
}

/* 弹窗主体 - Apple风格卡片 */
.wscm-tracking-modal {
    background: var(--main-bg-color, #ffffff);
    border-radius: 18px;
    box-shadow: 0 50px 100px -20px rgba(50, 50, 93, 0.25),
                0 30px 60px -30px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    -webkit-transform: scale(0.95) translateY(20px);
    -ms-transform: scale(0.95) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    position: relative;
}

.wscm-tracking-modal-overlay.show .wscm-tracking-modal {
    transform: scale(1) translateY(0);
    -webkit-transform: scale(1) translateY(0);
    -ms-transform: scale(1) translateY(0);
}

/* 弹窗头部 - Apple风格 */
.wscm-tracking-header {
    padding: 20px 24px;
    background: linear-gradient(180deg, 
                rgba(255, 255, 255, 0.65) 0%, 
                rgba(255, 255, 255, 0) 100%);
    backdrop-filter: saturate(200%) blur(30px);
    -webkit-backdrop-filter: saturate(200%) blur(30px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.wscm-tracking-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--main-color, #000000);
}

/* 关闭按钮 - Apple风格 */
.wscm-close-tracking {
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted-color, #3c3c43);
    font-size: 20px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wscm-close-tracking:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.wscm-close-tracking:active {
    transform: scale(0.95);
}

/* 物流摘要信息 - Apple风格卡片 */
.wscm-tracking-summary {
    padding: 16px 24px;
    background: linear-gradient(135deg, 
                rgba(242, 242, 247, 0.6) 0%, 
                rgba(242, 242, 247, 0.3) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    flex-shrink: 0;
}

.wscm-summary-item {
    color: var(--main-color, #000000);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;  /* 加粗快递公司名称 */
}

.wscm-summary-divider {
    color: rgba(0, 0, 0, 0.15);
    font-weight: 300;
}

/* 运单号码样式 - 加粗显示 */
.wscm-tracking-number {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--main-color, #000000);
    font-weight: 700;  /* 加粗字体 */
    font-size: 15px;  /* 稍微增大字号 */
    background: rgba(0, 122, 255, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* 物流状态样式 - Apple风格徽章 */
.wscm-status {
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wscm-status.status-delivered {
    color: #fff;
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

.wscm-status.status-shipping {
    color: #fff;
    background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
}

.wscm-status.status-pending {
    color: #fff;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
}

/* 物流轨迹区域 - 优雅滚动 */
.wscm-tracking-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    /* Apple风格滚动条 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.wscm-tracking-body::-webkit-scrollbar {
    width: 6px;
}

.wscm-tracking-body::-webkit-scrollbar-track {
    background: transparent;
}

.wscm-tracking-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.wscm-tracking-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* 物流时间线 - Apple风格 */
.wscm-tracking-timeline {
    position: relative;
    padding-left: 32px;
}

.wscm-timeline-item {
    position: relative;
    padding-bottom: 20px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
    margin-left: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wscm-timeline-item:last-child {
    border-left: none;
    padding-bottom: 0;
}

/* 时间线节点 - Apple风格 */
.wscm-timeline-dot {
    position: absolute;
    left: -10px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wscm-timeline-dot.active {
    width: 16px;
    height: 16px;
    left: -12px;
    background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3),
                0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* 时间线内容 - Apple风格卡片 */
.wscm-timeline-content {
    margin-left: 20px;
    padding: 12px 16px;
    background: rgba(242, 242, 247, 0.5);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wscm-timeline-item.latest .wscm-timeline-content {
    background: linear-gradient(135deg, 
                rgba(0, 122, 255, 0.08) 0%, 
                rgba(90, 200, 250, 0.08) 100%);
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.1);
}

.wscm-timeline-item:hover .wscm-timeline-content {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 时间文本 */
.wscm-trace-time {
    font-size: 12px;
    color: var(--muted-color, #8e8e93);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

/* 描述文本 */
.wscm-trace-desc {
    font-size: 15px;
    color: var(--main-color, #000000);
    line-height: 1.5;
    letter-spacing: -0.3px;
}

.wscm-timeline-item.latest .wscm-trace-desc {
    font-weight: 600;
    color: #007aff;
}

/* 空状态 - Apple风格 */
.wscm-tracking-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted-color, #8e8e93);
}

.wscm-tracking-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.2;
    background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wscm-tracking-empty p {
    font-size: 15px;
    margin: 0;
    letter-spacing: -0.3px;
}

/* ========================================
   暗黑模式适配 - Apple Dark Mode
   ======================================== */

/* 弹窗遮罩暗黑模式 */
body.dark-theme .wscm-tracking-modal-overlay,
.dark-theme .wscm-tracking-modal-overlay,
[data-theme="dark"] .wscm-tracking-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* 弹窗主体暗黑模式 */
body.dark-theme .wscm-tracking-modal,
.dark-theme .wscm-tracking-modal,
[data-theme="dark"] .wscm-tracking-modal {
    background: var(--main-bg-color);
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5),
                0 30px 60px -30px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 头部暗黑模式 */
body.dark-theme .wscm-tracking-header,
.dark-theme .wscm-tracking-header,
[data-theme="dark"] .wscm-tracking-header {
    background: linear-gradient(180deg, 
                rgba(255, 255, 255, 0.05) 0%, 
                rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* 关闭按钮暗黑模式 */
body.dark-theme .wscm-close-tracking,
.dark-theme .wscm-close-tracking,
[data-theme="dark"] .wscm-close-tracking {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

body.dark-theme .wscm-close-tracking:hover,
.dark-theme .wscm-close-tracking:hover,
[data-theme="dark"] .wscm-close-tracking:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* 摘要信息暗黑模式 */
body.dark-theme .wscm-tracking-summary,
.dark-theme .wscm-tracking-summary,
[data-theme="dark"] .wscm-tracking-summary {
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.06) 0%, 
                rgba(255, 255, 255, 0.03) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-theme .wscm-tracking-number,
.dark-theme .wscm-tracking-number,
[data-theme="dark"] .wscm-tracking-number {
    background: rgba(10, 132, 255, 0.15);
}

/* 物流状态标签暗黑模式 - 保持鲜艳的颜色 */
body.dark-theme .wscm-status.status-delivered,
.dark-theme .wscm-status.status-delivered,
[data-theme="dark"] .wscm-status.status-delivered {
    color: #fff;
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

body.dark-theme .wscm-status.status-shipping,
.dark-theme .wscm-status.status-shipping,
[data-theme="dark"] .wscm-status.status-shipping {
    color: #fff;
    background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
}

body.dark-theme .wscm-status.status-pending,
.dark-theme .wscm-status.status-pending,
[data-theme="dark"] .wscm-status.status-pending {
    color: #fff;
    background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
}

/* 时间线暗黑模式 */
body.dark-theme .wscm-timeline-item,
.dark-theme .wscm-timeline-item,
[data-theme="dark"] .wscm-timeline-item {
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .wscm-timeline-dot,
.dark-theme .wscm-timeline-dot,
[data-theme="dark"] .wscm-timeline-dot {
    background: var(--main-bg-color);
    border: 2px solid rgba(255, 255, 255, 0.12);
}

body.dark-theme .wscm-timeline-dot.active,
.dark-theme .wscm-timeline-dot.active,
[data-theme="dark"] .wscm-timeline-dot.active {
    background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
    border: 2px solid var(--main-bg-color);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4),
                0 0 0 4px rgba(10, 132, 255, 0.15);
}

body.dark-theme .wscm-timeline-content,
.dark-theme .wscm-timeline-content,
[data-theme="dark"] .wscm-timeline-content {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-theme .wscm-timeline-item.latest .wscm-timeline-content,
.dark-theme .wscm-timeline-item.latest .wscm-timeline-content,
[data-theme="dark"] .wscm-timeline-item.latest .wscm-timeline-content {
    background: linear-gradient(135deg, 
                rgba(10, 132, 255, 0.12) 0%, 
                rgba(94, 92, 230, 0.12) 100%);
    box-shadow: 0 2px 12px rgba(10, 132, 255, 0.2);
}

body.dark-theme .wscm-timeline-item.latest .wscm-trace-desc,
.dark-theme .wscm-timeline-item.latest .wscm-trace-desc,
[data-theme="dark"] .wscm-timeline-item.latest .wscm-trace-desc {
    color: #0a84ff;
}

/* ========================================
   响应式样式
   ======================================== */

/* 强化桌面端居中样式 */
@media (min-width: 769px) {
    .wscm-tracking-modal-overlay {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .wscm-tracking-modal {
        position: relative !important;
        transform: scale(0.95) translateY(20px);
        margin: auto !important;
    }
    
    .wscm-tracking-modal-overlay.show .wscm-tracking-modal {
        transform: scale(1) translateY(0) !important;
    }
}

/* 移动端样式 - Apple iOS风格 */
@media (max-width: 768px) {
    /* 弹窗遮罩层移动端 */
    .wscm-tracking-modal-overlay {
        padding: 0;
        align-items: flex-end;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }
    
    /* 弹窗主体移动端 - iOS风格底部卡片 */
    .wscm-tracking-modal {
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    .wscm-tracking-modal-overlay.show .wscm-tracking-modal {
        transform: translateY(0);
    }
    
    /* iOS风格拖拽指示条 */
    .wscm-tracking-modal::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2.5px;
        z-index: 1;
    }
    
    /* 头部移动端调整 - 保持Apple风格 */
    .wscm-tracking-header {
        padding: 24px 20px 16px;
        border-radius: 20px 20px 0 0;
        background: linear-gradient(180deg, 
                    rgba(255, 255, 255, 0.65) 0%, 
                    rgba(255, 255, 255, 0) 100%);
        backdrop-filter: saturate(200%) blur(30px);
        -webkit-backdrop-filter: saturate(200%) blur(30px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    
    .wscm-tracking-title {
        font-size: 17px;
        font-weight: 600;
        letter-spacing: -0.4px;
    }
    
    /* 关闭按钮移动端 */
    .wscm-close-tracking {
        width: 30px;
        height: 30px;
        border-radius: 15px;
        background: rgba(0, 0, 0, 0.06);
    }
    
    /* 摘要信息移动端 - 保持Apple风格 */
    .wscm-tracking-summary {
        padding: 14px 20px;
        background: linear-gradient(135deg, 
                    rgba(242, 242, 247, 0.6) 0%, 
                    rgba(242, 242, 247, 0.3) 100%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        font-size: 13px;
        gap: 10px;
    }
    
    /* 移动端快递公司和单号加粗 */
    .wscm-summary-item {
        font-weight: 600;
        color: var(--main-color, #000000);
    }
    
    .wscm-tracking-number {
        font-weight: 700;
        font-size: 14px;
        padding: 2px 8px;
    }
    
    /* 调整状态徽章 */
    .wscm-status {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 8px;
    }
    
    /* 物流轨迹移动端 */
    .wscm-tracking-body {
        padding: 20px;
    }
    
    .wscm-tracking-timeline {
        padding-left: 28px;
    }
    
    .wscm-timeline-item {
        padding-bottom: 18px;
        border-left: 2px solid rgba(0, 0, 0, 0.08);
    }
    
    /* 时间线节点移动端 */
    .wscm-timeline-dot {
        width: 10px;
        height: 10px;
        left: -9px;
        border: 2px solid rgba(0, 0, 0, 0.12);
    }
    
    .wscm-timeline-dot.active {
        width: 14px;
        height: 14px;
        left: -11px;
        background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
        border: 2px solid #ffffff;
        box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3),
                    0 0 0 3px rgba(0, 122, 255, 0.1);
    }
    
    /* 时间线内容移动端 */
    .wscm-timeline-content {
        margin-left: 16px;
        padding: 10px 14px;
        background: rgba(242, 242, 247, 0.5);
        border-radius: 10px;
    }
    
    .wscm-timeline-item.latest .wscm-timeline-content {
        background: linear-gradient(135deg, 
                    rgba(0, 122, 255, 0.08) 0%, 
                    rgba(90, 200, 250, 0.08) 100%);
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.1);
    }
    
    /* 时间和描述文本移动端 */
    .wscm-trace-time {
        font-size: 11px;
        color: var(--muted-color, #8e8e93);
        margin-bottom: 4px;
        font-weight: 500;
    }
    
    .wscm-trace-desc {
        font-size: 14px;
        line-height: 1.4;
        letter-spacing: -0.2px;
    }
    
    .wscm-timeline-item.latest .wscm-trace-desc {
        font-weight: 600;
        color: #007aff;
    }
    
    /* 空状态移动端 */
    .wscm-tracking-empty {
        padding: 40px 20px;
    }
    
    .wscm-tracking-empty i {
        font-size: 36px;
        background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    /* 暗黑模式下的拖拽条 */
    body.dark-theme .wscm-tracking-modal::before,
    .dark-theme .wscm-tracking-modal::before,
    [data-theme="dark"] .wscm-tracking-modal::before {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* 移动端暗黑模式下的加粗文字 */
    body.dark-theme .wscm-summary-item,
    .dark-theme .wscm-summary-item,
    [data-theme="dark"] .wscm-summary-item {
        color: var(--main-color);
        font-weight: 600;
    }
    
    body.dark-theme .wscm-tracking-number,
    .dark-theme .wscm-tracking-number,
    [data-theme="dark"] .wscm-tracking-number {
        font-weight: 700;
    }
    
    /* 移动端暗黑模式状态标签 - 确保颜色正确显示 */
    body.dark-theme .wscm-status.status-delivered,
    .dark-theme .wscm-status.status-delivered,
    [data-theme="dark"] .wscm-status.status-delivered {
        color: #fff !important;
        background: linear-gradient(135deg, #34c759 0%, #30d158 100%) !important;
    }
    
    body.dark-theme .wscm-status.status-shipping,
    .dark-theme .wscm-status.status-shipping,
    [data-theme="dark"] .wscm-status.status-shipping {
        color: #fff !important;
        background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%) !important;
    }
    
    body.dark-theme .wscm-status.status-pending,
    .dark-theme .wscm-status.status-pending,
    [data-theme="dark"] .wscm-status.status-pending {
        color: #fff !important;
        background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%) !important;
    }
}

/* 小屏设备优化 */
@media (max-width: 375px) {
    .wscm-tracking-header {
        padding: 18px 14px 10px;
    }
    
    .wscm-tracking-title {
        font-size: 14px;
    }
    
    .wscm-tracking-summary {
        padding: 8px 14px;
        font-size: 11px;
    }
    
    /* 小屏设备也保持加粗 */
    .wscm-summary-item {
        font-weight: 600;
    }
    
    .wscm-tracking-number {
        font-weight: 700;
        font-size: 12px;
        padding: 2px 6px;
    }
    
    .wscm-tracking-body {
        padding: 14px;
    }
    
    .wscm-trace-time {
        font-size: 11px;
    }
    
    .wscm-trace-desc {
        font-size: 13px;
    }
}