/* 担保交易 — 对齐子比主题变量 */

.escrow-hall-page .escrow-item,
.escrow-user-center .escrow-item {
    transition: box-shadow 0.2s ease;
    border-radius: var(--main-radius, 8px);
}

.escrow-hall-page .escrow-item:hover {
    box-shadow: 0 4px 16px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

.escrow-item .badg.c-blue {
    background: color-mix(in srgb, var(--focus-color, #1e73be) 14%, transparent);
    color: var(--focus-color, #1e73be);
}

.escrow-item .badg.c-yellow {
    background: rgba(255, 193, 7, 0.15);
    color: #c88700;
}

.escrow-item .badg.c-green {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
}

.escrow-create-form textarea.form-control,
.escrow-listing-form textarea.form-control,
.escrow-deliver-form textarea.form-control,
.escrow-dispute-form textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.escrow-action-btn + .escrow-action-btn,
.escrow-action-btn + a.but,
.escrow-card-actions .but + .but,
.escrow-card-actions .but + a.but,
.escrow-card-actions a.but + .but,
.escrow-card-actions a.but + a.but {
    margin-left: 6px;
}

.escrow-dispute-reason {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border: 1px solid var(--main-border-color, #eee);
    border-radius: var(--main-radius, 8px);
}

.escrow-seller-selected {
    line-height: 1.6;
}

.escrow-seller-item:hover {
    background: color-mix(in srgb, var(--focus-color, #1e73be) 6%, transparent);
}

.escrow-proof-preview {
    flex-wrap: wrap;
}

.escrow-proof-item,
.escrow-proof-thumb {
    position: relative;
    display: inline-block;
    width: 72px;
    height: 72px;
    overflow: hidden;
}

.escrow-proof-item img,
.escrow-proof-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
}

.escrow-proof-thumb {
    cursor: zoom-in;
}

.escrow-proof-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.escrow-proof-images {
    flex-wrap: wrap;
}

.escrow-status-filters .but {
    margin: 0 6px 6px 0;
}

.escrow-timeline {
    position: relative;
    padding-left: 18px;
}

.escrow-timeline-item {
    position: relative;
    padding: 0 0 16px 14px;
    border-left: 2px solid var(--main-border-color, #eee);
}

.escrow-timeline-item:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.escrow-timeline-dot {
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted-bg-color, #eee);
    border: 2px solid var(--main-bg-color, #fff);
}

.escrow-timeline-item.done .escrow-timeline-dot {
    background: var(--focus-color, #1e73be);
}

.escrow-timeline-item.pending .escrow-timeline-dot {
    background: #ffc107;
}

.escrow-detail-modal .escrow-proof-thumb {
    cursor: zoom-in;
}

.escrow-hall-page .title-theme.mb0 h2 {
    margin: 0;
}

.escrow-hall-actions .but {
    margin-bottom: 6px;
}

/* 介绍区 */
.escrow-hall-intro {
    padding: 16px 18px;
}

.escrow-hall-intro .badg.c-red {
    background: rgba(244, 67, 54, 0.1);
    color: #e53935;
}

.escrow-flow {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 10px;
}

.escrow-flow > .escrow-flow-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--main-radius, 8px);
    background: var(--body-bg-color, #f5f6f7);
    float: none;
    width: auto;
}

.escrow-flow-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: var(--focus-color, #1e73be);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.escrow-flow-text {
    min-width: 0;
}

.escrow-rule-line {
    padding-top: 12px;
    border-top: 1px dashed var(--main-border-color, #eee);
}

.escrow-hall-tabs .tab-nav-theme {
    margin-bottom: 12px;
}

/* 用户中心 — 我的担保 */
.escrow-user-center .title-theme.mb0 {
    margin-bottom: 0;
}

.escrow-user-head .badg.c-red {
    background: rgba(244, 67, 54, 0.1);
    color: #e53935;
}

.escrow-user-actions {
    gap: 8px;
}

.escrow-user-actions .but {
    margin: 0 0 6px !important;
}

.escrow-user-tip {
    padding: 14px 16px;
}

.escrow-legend {
    gap: 16px;
    flex-wrap: wrap;
}

.escrow-legend-item {
    display: inline-flex;
    align-items: center;
}

.escrow-user-subtabs .tab-nav-theme,
.escrow-user-tabs .tab-nav-theme {
    margin-bottom: 4px;
}

.escrow-status-filters {
    gap: 8px;
    padding: 2px 0 4px;
}

.escrow-status-filters .but {
    margin: 0 !important;
    border-radius: 999px;
    padding: 4px 12px;
    line-height: 1.5;
}

.escrow-user-center .escrow-list-pager,
.escrow-user-center .escrow-listing-pager {
    min-height: 120px;
}

/* 列表卡片 */
.escrow-card-inner {
    gap: 14px;
    padding: 2px;
    align-items: stretch;
}

.escrow-card-cover {
    width: 96px;
}

.escrow-cover-img,
.escrow-cover-placeholder {
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: var(--main-radius, 8px);
}

.escrow-cover-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.escrow-cover-placeholder {
    background: var(--body-bg-color, #f5f6f7);
    color: var(--focus-color, #1e73be);
    font-size: 26px;
}

.escrow-cover-placeholder.is-task {
    color: #c88700;
}

.escrow-card-body {
    min-width: 0;
    padding: 2px 2px 2px 0;
}

.escrow-card-desc {
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.escrow-meta-row {
    gap: 4px;
    flex-wrap: wrap;
}

.escrow-meta-user .avatar-img,
.escrow-meta-user img {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50%;
}

.escrow-meta-dot {
    opacity: 0.4;
    margin: 0 2px;
}

.escrow-card-foot {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
}

.escrow-price {
    line-height: 1.2;
}

.escrow-skeleton .escrow-card-cover.placeholder {
    width: 96px;
    height: 96px;
    border-radius: var(--main-radius, 8px);
}

.flex.xx {
    flex-direction: column;
}

.mb0 {
    margin-bottom: 0 !important;
}

.mb8 {
    margin-bottom: 8px;
}

.mb12 {
    margin-bottom: 12px;
}

.radius8 {
    border-radius: var(--main-radius, 8px);
}

.padding-h10 {
    padding: 10px;
}

/* 在售商品详情 — 图库 */
.escrow-listing-detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.escrow-listing-gallery {
    flex: 0 0 380px;
    width: 380px;
    max-width: 100%;
    min-width: 0;
}

.escrow-listing-info {
    min-width: 0;
}

.escrow-product-gallery {
    width: 100%;
}

.escrow-pg-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--muted-bg-color, rgba(0, 0, 0, 0.04));
}

.escrow-pg-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.escrow-pg-slide {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    display: none;
    margin: 0 !important;
    cursor: zoom-in;
}

.escrow-pg-slide.is-active {
    display: block;
}

.escrow-pg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 32px;
    text-align: center;
}

.escrow-pg-stage:hover .escrow-pg-nav,
.escrow-pg-stage:focus-within .escrow-pg-nav {
    opacity: 1;
}

.escrow-pg-prev {
    left: 10px;
}

.escrow-pg-next {
    right: 10px;
}

.escrow-pg-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.escrow-pg-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.escrow-pg-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: var(--muted-bg-color, rgba(0, 0, 0, 0.04));
    cursor: pointer;
    opacity: 0.7;
}

.escrow-pg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* 灯箱关闭按钮更明显，避免难找 */
#mini-imgbox.show .imgbox-an .icon-close {
    background: rgba(0, 0, 0, 0.75) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

#mini-imgbox.show .imgbox-an .icon-close:hover {
    background: rgba(220, 53, 69, 0.9) !important;
}

.escrow-pg-thumb.is-active,
.escrow-pg-thumb:hover {
    opacity: 1;
    border-color: var(--theme-color, #3498db);
}

.escrow-listing-buy-bar .but {
    margin: 0 8px 8px 0;
}

@media (max-width: 900px) {
    .escrow-listing-detail-layout {
        flex-direction: column;
    }

    .escrow-listing-gallery {
        flex: none;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }
}

/* 订单详情单页 */
.escrow-detail-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.escrow-detail-main {
    flex: 1;
    min-width: 0;
}

.escrow-detail-side {
    flex: 0 0 360px;
    width: 360px;
    position: sticky;
    top: 80px;
}

.escrow-detail-page .escrow-chat-box {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.escrow-detail-page .escrow-chat-list {
    max-height: min(55vh, 480px);
    min-height: 280px;
}

.escrow-detail-actions {
    border-top: 1px solid var(--main-border-color, #eee);
}

.escrow-detail-actions .but {
    margin: 0 8px 8px 0;
}

@media (max-width: 900px) {
    .escrow-detail-layout {
        flex-direction: column;
    }

    .escrow-detail-side {
        flex: none;
        width: 100%;
        position: static;
    }

    .escrow-detail-page .escrow-chat-list {
        max-height: 320px;
        min-height: 200px;
    }
}

/* 订单内聊天 */
.escrow-chat-box {
    border-top: 1px solid var(--main-border-color, #eee);
    padding-top: 12px;
}

.escrow-chat-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    background: var(--muted-bg-color, rgba(0, 0, 0, 0.03));
    border-radius: var(--main-radius, 8px);
}

.escrow-chat-msg {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.escrow-chat-msg.is-me {
    flex-direction: row-reverse;
}

.escrow-chat-avatar .avatar-img,
.escrow-chat-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.escrow-chat-bubble {
    max-width: 78%;
}

.escrow-chat-msg.is-me .escrow-chat-meta {
    text-align: right;
}

.escrow-chat-text {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--main-border-color, #e8e8e8);
    word-break: break-word;
    line-height: 1.5;
    font-size: 13px;
}

.escrow-chat-msg.is-me .escrow-chat-text {
    background: var(--theme-color, #3498db);
    color: #fff;
    border-color: transparent;
}

.escrow-chat-send .escrow-chat-input {
    flex: 1;
    resize: none;
    min-height: 54px;
}

.escrow-chat-empty {
    padding: 20px 10px;
}

@media (max-width: 640px) {
    .escrow-flow {
        flex-direction: column;
    }

    .escrow-card-cover,
    .escrow-cover-img,
    .escrow-cover-placeholder,
    .escrow-skeleton .escrow-card-cover.placeholder {
        width: 76px;
        height: 76px;
    }

    .escrow-hall-actions,
    .escrow-user-actions {
        width: 100%;
    }

    .escrow-hall-actions .but,
    .escrow-user-actions .but {
        margin: 0 8px 8px 0 !important;
    }

    .escrow-user-head {
        align-items: flex-start !important;
    }
}
