/* ly俱乐部前台全局样式 */
@font-face {
    font-family: 'AlibabaPuHuiTi';
    src: url('https://resource-static.bj.bcebos.com/fonts-skill/AlibabaPuHuiTi_Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563EB;
    --primary-dark: #1d4ed8;
    --on-primary: #FFFFFF;
    --accent: #F59E0B;
    --on-accent: #FFFFFF;
    --background: #FFFFFF;
    --foreground: #1A1A2E;
    --muted: #F5F6FA;
    --border: #E2E8F0;
    --secondary: #64748B;
    --danger: #EF4444;
    --success: #22C55E;
    --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --nav-height: 56px;
    --header-height: 48px;
}

html { font-size: 16px; }
body {
    font-family: 'AlibabaPuHuiTi', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--muted);
    color: var(--foreground);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }

/* 顶部标题栏 */
.top-bar {
    position: fixed;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    height: var(--header-height);
    background: var(--background);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}
.top-bar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    flex: 1;
    text-align: center;
}
.top-bar-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--foreground);
    font-size: 20px;
}
.top-bar-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary);
    border: none;
    background: transparent;
}

/* 主内容区 */
.main-content {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + 8px);
    min-height: 100vh;
}
.main-content.no-header { padding-top: 0; }
.main-content.no-nav { padding-bottom: 0; }

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    height: var(--nav-height);
    background: var(--background);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 100;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 0;
    color: var(--secondary);
    font-size: 11px;
    border: none;
    background: transparent;
    transition: color .15s;
    text-decoration: none;
    position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 22px; height: 22px; }
.nav-badge {
    position: absolute;
    top: 4px; right: calc(50% - 20px);
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* 卡片 */
.card {
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-body { padding: 16px; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    border: none;
    transition: all .15s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.97); }
.btn-secondary { background: var(--muted); color: var(--foreground); border: 1px solid var(--border); }
.btn-secondary:active { transform: scale(.97); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; display: flex; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--secondary); margin-bottom: 6px; font-weight: 500; }
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
.form-input:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* 商品卡片 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
}
.product-card {
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .15s;
}
.product-card:active { transform: scale(.98); }
.product-card-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--muted);
}
.product-card-img-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 13px;
}
.product-card-body { padding: 8px 10px 10px; }
.product-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.product-card-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
}
.product-card-price::before { content: '¥'; font-size: 11px; }

/* 轮播图 */
.swiper-wrap { position: relative; overflow: hidden; background: var(--muted); }
.swiper-track { display: flex; transition: transform .35s ease; }
.swiper-slide { min-width: 100%; }
.swiper-slide img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.swiper-dots {
    position: absolute; bottom: 8px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 6px;
}
.swiper-dot {
    width: 6px; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,.6);
    transition: width .2s, background .2s;
}
.swiper-dot.active { width: 16px; background: #fff; }

/* 公告栏 */
.notice-bar {
    display: flex; align-items: center; gap: 8px;
    background: #eff6ff;
    border-bottom: 1px solid #dbeafe;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--primary);
    overflow: hidden;
}
.notice-bar-icon { flex-shrink: 0; font-size: 14px; }
.notice-bar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 分类页左右布局 */
.category-layout { display: flex; height: calc(100vh - var(--header-height) - var(--nav-height)); }
.category-sidebar {
    width: 88px;
    flex-shrink: 0;
    background: var(--muted);
    overflow-y: auto;
    border-right: 1px solid var(--border);
}
.category-sidebar-item {
    padding: 14px 8px;
    font-size: 13px;
    color: var(--secondary);
    text-align: center;
    cursor: pointer;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--border);
    transition: all .15s;
    word-break: break-all;
}
.category-sidebar-item.active {
    color: var(--primary);
    background: var(--background);
    border-left-color: var(--primary);
    font-weight: 500;
}
.category-content { flex: 1; overflow-y: auto; padding: 8px; }
.category-content .product-grid { padding: 0; gap: 8px; }

/* 打手列表 */
.fighter-list { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.fighter-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    transition: transform .15s;
}
.fighter-card:active { transform: scale(.98); }
.fighter-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--muted);
    flex-shrink: 0;
}
.fighter-info { flex: 1; min-width: 0; }
.fighter-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.fighter-tag {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
}

/* 我的页面 */
.mine-header {
    background: var(--primary);
    padding: 44px 16px 32px;
    color: #fff;
    position: relative;
}
.mine-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.mine-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.5);
    background: rgba(255,255,255,.2);
}
.mine-username { font-size: 18px; font-weight: 600; }
.mine-group-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mine-group-tag {
    background: rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
}
.mine-balance-row {
    display: flex;
    gap: 24px;
    background: rgba(255,255,255,.12);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 4px;
}
.mine-balance-item { text-align: center; }
.mine-balance-value { font-size: 20px; font-weight: 700; }
.mine-balance-label { font-size: 11px; opacity: .8; margin-top: 2px; }
.mine-menu { background: var(--background); margin-top: -16px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.mine-menu-section { padding: 0 16px; }
.mine-menu-title { font-size: 12px; color: var(--secondary); padding: 14px 0 6px; }
.mine-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--foreground);
    text-decoration: none;
    cursor: pointer;
}
.mine-menu-item:last-child { border-bottom: none; }
.mine-menu-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--muted);
}
.mine-menu-icon svg { width: 18px; height: 18px; }
.mine-menu-label { flex: 1; }
.mine-menu-arrow { color: var(--secondary); font-size: 16px; }
.mine-menu-badge {
    background: var(--danger); color: #fff;
    border-radius: 20px; padding: 1px 6px;
    font-size: 11px; margin-right: 4px;
}

/* 通用列表 */
.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    text-decoration: none;
    color: var(--foreground);
}
.list-item:active { background: var(--muted); }

/* 徽章/状态标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.badge-blue { background: #eff6ff; color: var(--primary); }
.badge-orange { background: #fffbeb; color: #d97706; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-red { background: #fef2f2; color: var(--danger); }
.badge-gray { background: var(--muted); color: var(--secondary); }

/* 订单卡片 */
.order-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    overflow: hidden;
}
.order-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 12px; color: var(--secondary);
}
.order-card-body { padding: 12px 14px; display: flex; gap: 10px; }
.order-card-img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: var(--muted); flex-shrink: 0; }
.order-card-info { flex: 1; min-width: 0; }
.order-card-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.order-card-price { font-size: 13px; color: var(--danger); font-weight: 600; }
.order-card-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 8px 14px 12px;
}

/* 聊天室 */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--header-height)); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 8px; max-width: 85%; }
.chat-msg.self { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.other { align-self: flex-start; }
.chat-msg.system { align-self: center; max-width: 80%; }
.chat-msg-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--muted); flex-shrink: 0; }
.chat-msg-content { background: var(--muted); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.chat-msg.self .chat-msg-content { background: var(--primary); color: #fff; border-radius: 12px 4px 12px 12px; }
.chat-msg.other .chat-msg-content { border-radius: 4px 12px 12px 12px; }
.chat-msg-system { background: rgba(0,0,0,.05); border-radius: 20px; padding: 6px 14px; font-size: 12px; color: var(--secondary); }
.chat-msg-name { font-size: 11px; color: var(--secondary); margin-bottom: 4px; }
.chat-input-bar {
    padding: 10px 12px;
    background: var(--background);
    border-top: 1px solid var(--border);
    display: flex; gap: 8px; align-items: flex-end;
}
.chat-input { flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 8px 14px; font-size: 14px; resize: none; max-height: 100px; outline: none; font-family: inherit; }
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; border: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* 购物车 */
.cart-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}
.cart-check { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--primary); }
.cart-img { width: 60px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; background: var(--muted); flex-shrink: 0; }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-price { font-size: 14px; color: var(--danger); font-weight: 600; }
.qty-control { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--background); font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--foreground); }
.qty-num { font-size: 14px; font-weight: 500; min-width: 20px; text-align: center; }
.cart-footer {
    position: fixed; bottom: var(--nav-height); left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--background);
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    display: flex; align-items: center; gap: 12px;
}
.cart-total { flex: 1; font-size: 14px; color: var(--secondary); }
.cart-total strong { color: var(--danger); font-size: 16px; }

/* 星级评分 */
.star-row { display: flex; gap: 4px; }
.star-btn { font-size: 28px; background: none; border: none; cursor: pointer; color: #ddd; transition: color .1s; }
.star-btn.active { color: var(--accent); }

/* toast消息 */
.toast-container {
    position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    background: rgba(26,26,46,.88);
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* 弹窗 */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
    background: var(--background);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%; max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .25s ease;
    padding-bottom: 16px;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border: none; background: var(--muted); border-radius: 50%; font-size: 16px; color: var(--secondary); display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 16px; }

/* 购物车浮动图标 */
.cart-float {
    position: fixed;
    bottom: calc(var(--nav-height) + 12px);
    left: 16px;
    width: 48px; height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    color: #fff;
    z-index: 50;
    text-decoration: none;
}
.cart-float-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    background: var(--danger); color: #fff;
    border-radius: 9px;
    font-size: 10px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* 空状态 */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: .3; }
.empty-state-text { color: var(--secondary); font-size: 14px; }

/* 分割线 */
.divider { height: 8px; background: var(--muted); }

/* 通用页头 */
.page-section { padding: 12px; }
.section-title { font-size: 16px; font-weight: 600; color: var(--foreground); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* 响应式：PC端适配 */
@media (min-width: 480px) {
    body { box-shadow: 0 0 30px rgba(0,0,0,.08); }
    .top-bar { width: 480px; }
    .bottom-nav { width: 480px; }
    .cart-footer { width: 480px; }
    .toast-container { width: 480px; }
    .modal { max-width: 480px; }
}

/* 后台管理 */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1e293b;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 10;
}
.admin-sidebar-logo {
    padding: 20px 16px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar-menu { flex: 1; padding: 8px 0; }
.admin-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    font-size: 14px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.admin-menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-menu-item.active { background: rgba(37,99,235,.25); color: #fff; border-left-color: var(--primary); }
.admin-menu-group { padding: 14px 20px 4px; font-size: 11px; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .8px; }
.admin-content {
    margin-left: 220px;
    flex: 1;
    background: var(--muted);
    min-height: 100vh;
}
.admin-topbar {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 52px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
.admin-topbar-title { font-size: 15px; font-weight: 600; }
.admin-main { padding: 20px; }
.admin-card {
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
}
.admin-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 15px; font-weight: 600;
}
.admin-card-body { padding: 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { background: var(--muted); padding: 10px 12px; text-align: left; color: var(--secondary); font-weight: 500; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--foreground); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--muted); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 20px; }
.admin-stat-card { background: var(--background); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 16px 20px; }
.admin-stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.admin-stat-label { font-size: 13px; color: var(--secondary); margin-top: 4px; }
.admin-search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-search-input { flex: 1; min-width: 160px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; outline: none; }
.admin-search-input:focus { border-color: var(--primary); }
@media (max-width: 768px) {
    .admin-sidebar { width: 0; transform: translateX(-100%); transition: transform .25s; }
    .admin-sidebar.open { width: 220px; transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .admin-topbar { padding: 0 12px; }
    .admin-main { padding: 12px; }
}

/* ========= 红点 / 未读徽章 ========= */
.unread-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 4px;
    flex-shrink: 0;
}
.unread-count-badge {
    display: inline-flex;
    align-items: center; justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 6px;
}
/* 消息列表项 */
.msg-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background .15s;
}
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: var(--muted); }
.msg-item.unread .msg-item-title { font-weight: 600; color: var(--foreground); }
.msg-item-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.msg-item-body { flex: 1; min-width: 0; }
.msg-item-title { font-size: 14px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item-preview { font-size: 12px; color: var(--secondary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item-time { font-size: 11px; color: #94a3b8; white-space: nowrap; }

/* ========= 聊天室补充样式 ========= */
.chat-confirm-bar {
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 13px; color: #92400e;
}
.chat-confirm-bar .btn { padding: 7px 18px; font-size: 13px; }
.chat-typing {
    font-size: 12px; color: var(--secondary); padding: 0 16px 6px;
    min-height: 20px;
    display: flex; align-items: center; gap: 6px;
}
.chat-typing-dots span {
    display: inline-block; width: 6px; height: 6px;
    background: var(--secondary); border-radius: 50%;
    animation: typingBounce .9s infinite ease-in-out;
}
.chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-5px)} }
.chat-status-bar {
    background: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: 7px 16px;
    font-size: 12px; color: var(--secondary);
    display: flex; align-items: center; gap: 8px;
}
.chat-online-dot {
    width: 7px; height: 7px;
    border-radius: 50%; background: #22c55e;
    display: inline-block; flex-shrink: 0;
}
.chat-msg-time { font-size: 10px; color: rgba(0,0,0,.35); margin-top: 4px; text-align: right; }
.chat-msg.self .chat-msg-time { color: rgba(255,255,255,.6); }

/* ========= 收益明细 ========= */
.earnings-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.earnings-item:last-child { border-bottom: none; }
.earnings-amount.positive { color: #16a34a; font-weight: 600; }
.earnings-amount.negative { color: var(--danger); font-weight: 600; }
.earnings-reason { font-size: 12px; color: var(--secondary); margin-top: 3px; }
.earnings-time   { font-size: 11px; color: #94a3b8; white-space: nowrap; }

/* ========= 订单状态步进条 ========= */
.order-steps {
    display: flex; align-items: center;
    padding: 16px 12px;
    gap: 0;
}
.order-step {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; position: relative;
}
.order-step::after {
    content: '';
    position: absolute; top: 12px; left: 50%; width: 100%;
    height: 2px; background: var(--border); z-index: 0;
}
.order-step:last-child::after { display: none; }
.order-step-dot {
    width: 24px; height: 24px;
    border-radius: 50%; background: var(--muted); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--secondary); position: relative; z-index: 1;
}
.order-step.done .order-step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.order-step.active .order-step-dot { background: var(--background); border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.order-step-label { font-size: 10px; color: var(--secondary); margin-top: 5px; text-align: center; white-space: nowrap; }
.order-step.done .order-step-label, .order-step.active .order-step-label { color: var(--primary); font-weight: 500; }

/* ========= 评价星星 ========= */
.star-rating { display: flex; gap: 6px; }
.star-rating .star {
    font-size: 28px; cursor: pointer; color: #e2e8f0;
    transition: color .15s; user-select: none;
}
.star-rating .star.on { color: #f59e0b; }

/* ========= 后台 badge ========= */
.admin-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; font-size: 11px; font-weight: 600;
    background: var(--danger); color: #fff;
    margin-left: 6px; vertical-align: middle;
}
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-approved { background: #dcfce7; color: #16a34a; }
.badge-rejected { background: #fee2e2; color: #dc2626; }

/* ========= 空状态补充 ========= */
.empty-state { padding: 40px 20px; text-align: center; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state-text { font-size: 14px; color: var(--secondary); }

/* ========= 通用toast动画 ========= */
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
.toast { animation: slideUp .25s ease; }
