:root {
    --bg: #d9efe6;
    --panel: rgba(255, 255, 255, 0.72);
    --card: #ffffff;
    --text: #192126;
    --muted: #67727d;
    --line: rgba(25, 33, 38, 0.08);
    --accent: #07c160;
    --shadow: 0 12px 30px rgba(19, 51, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 32%),
        linear-gradient(180deg, #d9efe6 0%, #cfe7de 100%);
    color: var(--text);
}

img {
    max-width: 100%;
    display: block;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.chat-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 18px 14px 96px;
}

.chat-shell {
    position: relative;
}

.chat-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px 16px;
    border-radius: 24px;
    background: rgba(246, 250, 248, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.chat-header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-header__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.chat-header__subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.chat-header__badge {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(7, 193, 96, 0.12);
    color: #09884a;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.chat-notice {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #fdfefc;
    border: 1px solid rgba(7, 193, 96, 0.12);
    color: #39524a;
    font-size: 13px;
    line-height: 1.55;
}

.platform-strip {
    position: sticky;
    top: 112px;
    z-index: 18;
    margin-top: 14px;
    padding: 2px 0 6px;
}

.platform-strip__scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.platform-strip__scroll::-webkit-scrollbar {
    display: none;
}

.platform-card {
    min-width: 90px;
    padding: 12px 14px;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 20px rgba(34, 59, 48, 0.06);
    cursor: pointer;
    text-align: left;
    color: var(--text);
}

.platform-card__icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.platform-card__name {
    font-size: 14px;
    font-weight: 700;
}

.platform-card__meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}

.platform-card.is-active {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(7, 193, 96, 0.16);
    outline: 2px solid rgba(7, 193, 96, 0.18);
}

.welcome-panel {
    margin: 16px 2px 8px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(247,252,249,0.72));
    box-shadow: var(--shadow);
}

.welcome-panel__label {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(7, 193, 96, 0.12);
    color: #11834e;
    font-size: 11px;
    font-weight: 700;
}

.welcome-panel__text {
    margin-top: 10px;
    font-size: 14px;
    color: #30413c;
    line-height: 1.65;
}

.message-list {
    margin-top: 16px;
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}

.message-avatar,
.message-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    flex-shrink: 0;
}

.message-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(10, 39, 26, 0.12);
}

.message-main {
    min-width: 0;
    max-width: calc(100% - 50px);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 8px;
    color: var(--muted);
    font-size: 12px;
}

.message-sender {
    font-weight: 700;
    color: #39524a;
}

.message-bubble {
    position: relative;
    padding: 12px;
    border-radius: 20px 20px 20px 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.message-bubble::before {
    content: '';
    position: absolute;
    top: 14px;
    left: -6px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom-right-radius: 4px;
    transform: rotate(45deg);
}

.product-platform {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.product-card {
    display: block;
    margin-top: 12px;
    text-decoration: none;
    color: inherit;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fcfefd 100%);
}

.product-card__inner {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
}

.product-card__image {
    width: 110px;
    height: 110px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f3f5, #dde7e1);
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: #1f2a26;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.product-card__subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    min-height: 19px;
}

.product-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 10px;
}

.product-price {
    font-size: 22px;
    font-weight: 800;
    color: #ff4d4f;
}

.product-origin {
    font-size: 12px;
    color: #94a0a8;
    text-decoration: line-through;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.product-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.product-tag--coupon {
    background: #fff1f0;
    color: #d4380d;
}

.product-tag--group {
    background: #eefbf4;
    color: #168d55;
}

.product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 12px 13px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.product-card__action {
    color: var(--accent);
    font-weight: 700;
}

.chat-empty {
    padding: 40px 18px;
    text-align: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--muted);
    box-shadow: var(--shadow);
}

.chat-status {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(25, 33, 38, 0.78);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

@media (max-width: 768px) {
    .chat-page {
        padding: 12px 10px 88px;
    }

    .platform-strip {
        top: 104px;
    }
}

@media (max-width: 520px) {
    .chat-header {
        border-radius: 22px;
        padding: 14px;
    }

    .chat-header__title {
        font-size: 20px;
    }

    .platform-card {
        min-width: 82px;
        padding: 10px 12px;
    }

    .product-card__inner {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 10px;
    }

    .product-card__image {
        width: 86px;
        height: 86px;
        border-radius: 14px;
    }

    .product-card__title {
        font-size: 14px;
    }

    .product-price {
        font-size: 20px;
    }

    .message-item {
        gap: 8px;
    }

    .message-avatar,
    .message-avatar img {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .message-main {
        max-width: calc(100% - 44px);
    }

    .chat-status {
        bottom: 12px;
        width: calc(100% - 24px);
        text-align: center;
    }
}
