/* 移动端业务组件样式 */

/* === 登录页 === */
.login-page, .register-page { background: linear-gradient(180deg, #f5f5f5 0%, #fff 100%); min-height: 100vh; }
.login-container { padding: 40px 24px 24px; max-width: 480px; margin: 0 auto; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo i { font-size: 56px; margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; color: #212121; margin-bottom: 4px; }
.login-logo p { color: #9E9E9E; font-size: 13px; }
.login-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #E0E0E0; }
.login-tab { flex: 1; text-align: center; padding: 12px; color: #616161; font-size: 15px; position: relative; }
.login-tab.active { color: var(--theme, #2E7D32); font-weight: 600; }
.login-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 2px; background: var(--theme, #2E7D32);
}
.btn-login {
    width: 100%; height: 48px; background: var(--theme, #2E7D32); color: #fff;
    border: none; border-radius: 24px; font-size: 16px; font-weight: 500; margin-top: 12px; cursor: pointer;
}
.btn-login:active { opacity: 0.85; }
.login-footer { text-align: center; margin-top: 16px; font-size: 13px; color: #616161; }
.login-footer .sep { margin: 0 12px; color: #E0E0E0; }
.login-footer a { color: var(--theme, #2E7D32); }
.login-roles { margin-top: 32px; }
.login-roles p { font-size: 13px; color: #616161; margin-bottom: 8px; text-align: center; }
.role-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.role-chip {
    padding: 6px 12px; border-radius: 16px; border: 1px solid #E0E0E0;
    font-size: 12px; color: #616161; background: #fff;
}
.role-chip.active { border-color: var(--c); color: var(--c); background: rgba(0,0,0,0.02); }
.login-agreement { margin-top: 24px; text-align: center; font-size: 12px; color: #9E9E9E; }
.login-agreement a { color: var(--theme, #2E7D32); }

/* 图形验证码 */
.form-group .captcha-img {
    height: 32px;
    width: 96px;
    margin-left: 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #E0E0E0;
    display: block;
    object-fit: cover;
    background: #F5F5F5;
}
.form-group.with-captcha { padding-right: 8px; }

/* === 注册页 === */
.register-container { padding: 16px; max-width: 480px; margin: 0 auto; }
.register-container .section { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.register-container .section h3 { font-size: 15px; color: #212121; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #F5F5F5; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.role-card {
    background: #fff; border: 1px solid #E0E0E0; border-radius: 8px;
    padding: 16px 8px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.role-card i { font-size: 24px; color: var(--c); }
.role-card span { font-size: 14px; color: #212121; font-weight: 500; }
.role-card small { font-size: 11px; color: #9E9E9E; }
.role-card.active { border-color: var(--c); background: rgba(0,0,0,0.02); }
.btn-submit {
    width: 100%; height: 48px; background: var(--theme, #2E7D32); color: #fff;
    border: none; border-radius: 24px; font-size: 16px; font-weight: 500; margin-top: 16px;
}
.agreement { margin: 12px 0; font-size: 12px; color: #9E9E9E; text-align: center; }
.agreement a { color: var(--theme, #2E7D32); }
.empty-state { text-align: center; padding: 60px 20px; color: #9E9E9E; }
.empty-state i { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }

/* === 货源卡片 === */
.goods-card {
    background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 10px;
    display: flex; gap: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.goods-thumb { width: 80px; height: 80px; border-radius: 6px; background: #f5f5f5; flex-shrink: 0; object-fit: cover; }
.goods-info { flex: 1; min-width: 0; }
.goods-title { font-size: 15px; font-weight: 600; color: #212121; display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.goods-spec { font-size: 12px; color: #616161; margin-bottom: 4px; }
.goods-region { font-size: 12px; color: #9E9E9E; margin-bottom: 6px; }
.goods-price-row { display: flex; justify-content: space-between; align-items: center; }
.goods-actions { display: flex; gap: 8px; margin-top: 8px; }

/* === 拼团卡片 === */
.group-card {
    background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.group-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.group-card-head .title { font-size: 15px; font-weight: 600; color: #212121; }
.group-card-head .tag-hot { background: #FFEBEE; color: #D32F2F; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.group-price-row { display: flex; align-items: baseline; gap: 8px; margin: 8px 0; }
.group-price-row .group-price { color: #FF8F00; font-size: 22px; font-weight: 700; }
.group-price-row .market-price { color: #9E9E9E; text-decoration: line-through; font-size: 13px; }
.group-progress { margin: 10px 0; }
.group-progress-info { display: flex; justify-content: space-between; font-size: 12px; color: #616161; margin-bottom: 4px; }
.group-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #616161; margin: 8px 0; }
.group-meta-item { display: flex; align-items: center; gap: 2px; }
.countdown-text { color: #D32F2F; font-weight: 600; }

/* === 挂牌卡片 === */
.listing-card {
    background: #fff; border-radius: 8px; padding: 0; margin-bottom: 10px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.listing-card-head { padding: 6px 12px; font-size: 12px; color: #fff; }
.listing-card-head.supply { background: #2E7D32; }
.listing-card-head.demand { background: #1976D2; }
.listing-card-body { padding: 12px; }
.listing-card-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.listing-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.listing-card-meta .label { color: #9E9E9E; }
.listing-card-meta .value { color: #212121; }

/* === 订单卡片 === */
.order-card {
    background: #fff; border-radius: 8px; padding: 12px; margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.order-card-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid #F5F5F5; margin-bottom: 8px; }
.order-card-no { font-size: 12px; color: #9E9E9E; }
.order-card-status { font-size: 13px; font-weight: 600; }
.order-card-body { font-size: 14px; }
.order-card-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid #F5F5F5; margin-top: 8px; }

/* === 订单状态条 === */
.status-bar { display: flex; justify-content: space-between; padding: 12px 0; }
.status-bar-item { display: flex; flex-direction: column; align-items: center; flex: 1; font-size: 11px; color: #9E9E9E; position: relative; }
.status-bar-item::before { content: ''; width: 24px; height: 24px; border-radius: 50%; background: #E0E0E0; margin-bottom: 4px; z-index: 2; }
.status-bar-item::after { content: ''; position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background: #E0E0E0; z-index: 1; }
.status-bar-item:last-child::after { display: none; }
.status-bar-item.done::before { background: #2E7D32; }
.status-bar-item.done::after { background: #2E7D32; }
.status-bar-item.current::before { background: var(--theme); }
.status-bar-item.done, .status-bar-item.current { color: #212121; font-weight: 600; }

/* === 个人中心头部 === */
.profile-header {
    background: linear-gradient(135deg, var(--theme) 0%, rgba(var(--theme-rgb), 0.85) 100%);
    color: #fff;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 600;
}
.profile-info { flex: 1; }
.profile-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.profile-phone { font-size: 13px; opacity: 0.9; }
.profile-credit { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 12px; font-size: 13px; margin-top: 6px; }
.profile-credit .score { font-size: 16px; font-weight: 700; }
.profile-stats { display: flex; flex-wrap: wrap; justify-content: space-around; padding: 16px 12px; background: #fff; border-radius: 8px; margin: -12px 12px 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: relative; z-index: 2; }
.profile-stat-item { text-align: center; width: 33.33%; padding: 6px 0; }
.profile-stat-num { font-size: 18px; font-weight: 700; color: #212121; }
.profile-stat-label { font-size: 12px; color: #9E9E9E; }
.profile-menu { background: #fff; border-radius: 8px; margin: 0 12px 12px; overflow: hidden; }
.profile-menu-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #F5F5F5; }
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item i.icon { width: 24px; color: var(--theme); margin-right: 12px; font-size: 16px; }
.profile-menu-item .label { flex: 1; font-size: 15px; }
.profile-menu-item .arrow { color: #BDBDBD; }
.profile-menu-item:active { background: #F5F5F5; }
.profile-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: 8px; margin: 0 12px 12px; overflow: hidden; }
.profile-grid-item { text-align: center; padding: 14px 4px; border-right: 1px solid #F5F5F5; position: relative; }
.profile-grid-item:last-child { border-right: none; }
.profile-grid-item i { font-size: 22px; color: var(--theme); display: block; margin-bottom: 6px; }
.profile-grid-item .label { font-size: 12px; color: #616161; display: block; }
.profile-grid-item .tag { position: absolute; top: 6px; right: 50%; transform: translateX(20px); }
.profile-grid-item:active { background: #F5F5F5; }

/* === 横向滚动卡 === */
.scroll-x { display: flex; overflow-x: auto; gap: 10px; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .group-card { min-width: 280px; max-width: 280px; }

/* === 金刚区 === */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; padding: 16px 8px; background: #fff; border-radius: 8px; margin-bottom: 12px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.quick-item .icon-wrap { width: 44px; height: 44px; border-radius: 50%; background: #F5F5F5; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.quick-item .name { font-size: 12px; color: #616161; }

/* === Banner 轮播 === */
.banner { position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: #f5f5f5; }
.banner-track { display: flex; transition: transform 0.4s ease; }
.banner-slide { flex-shrink: 0; width: 100%; }
.banner-slide img { width: 100%; height: 140px; object-fit: cover; display: block; }
.banner-dots { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; }
.banner-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: all 0.3s; }
.banner-dots .dot.active { background: #fff; width: 16px; border-radius: 3px; }

/* === 跑马灯 === */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee-track { display: inline-block; padding-left: 100%; animation: marquee 20s linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* === 设置页面专用样式 === */
.settings-card { background: #fff; border-radius: 14px; margin: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.settings-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: linear-gradient(135deg, #FAFAFA, #F0F0F0); border-bottom: 1px solid #EEE; font-size: 15px; font-weight: 600; color: #424242; }
.settings-head i { color: var(--theme, #2E7D32); font-size: 16px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.04); border-radius: 8px; }
.settings-body { padding: 16px; }
.settings-field { margin-bottom: 14px; }
.settings-field:last-child { margin-bottom: 0; }
.settings-field > label { display: block; font-size: 13px; color: #757575; margin-bottom: 6px; font-weight: 500; }
.settings-field input, .settings-field select, .settings-field textarea { width: 100%; height: 44px; padding: 0 14px; border: 1px solid #E0E0E0; border-radius: 10px; font-size: 14px; background: #FAFAFA; transition: all 0.2s; box-sizing: border-box; outline: none; color: #212121; }
.settings-field input:focus, .settings-field select:focus, .settings-field textarea:focus { border-color: var(--theme, #2E7D32); background: #fff; box-shadow: 0 0 0 3px rgba(46,125,50,0.08); }
.settings-field input:disabled { background: #F0F0F0; color: #9E9E9E; }
.settings-field textarea { height: 80px; padding: 12px 14px; resize: none; line-height: 1.5; }
.settings-field .text-red { color: #D32F2F; }
.settings-avatar { text-align: center; padding: 20px 0 12px; }
.settings-avatar img { display: block; width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.12); margin: 0 auto 10px; }
.settings-avatar > div[id*=Placeholder] { width: 80px; height: 80px; border-radius: 50%; background: #F0F0F0; display: flex; align-items: center; justify-content: center; color: #BDBDBD; font-size: 28px; margin: 0 auto; }
.settings-avatar .avatar-btn { display: inline-block; margin-top: 10px; padding: 6px 16px; border: 1px dashed var(--theme, #2E7D32); border-radius: 16px; color: var(--theme, #2E7D32); font-size: 12px; font-weight: 500; cursor: pointer; }
.settings-info-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #F5F5F5; }
.settings-info-row:last-child { border-bottom: none; }
.settings-info-row .label { color: #9E9E9E; font-size: 14px; }
.settings-info-row .value { color: #212121; font-size: 14px; font-weight: 500; }
.settings-notify-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #F5F5F5; }
.settings-notify-row:last-child { border-bottom: none; }
.settings-notify-row .label { color: #424242; font-size: 14px; font-weight: 500; }
.settings-notify-row .desc { color: #BDBDBD; font-size: 12px; margin-top: 2px; }
.settings-btn { display: flex; width: 100%; height: 46px; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 12px; background: var(--theme, #2E7D32); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 4px; }
.settings-btn:active { opacity: 0.85; transform: scale(0.98); }
.settings-btn i { font-size: 14px; }
.settings-logout { display: flex; width: 100%; height: 46px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #D32F2F; border-radius: 12px; background: #fff; color: #D32F2F; font-size: 15px; font-weight: 600; text-decoration: none; margin: 12px 0; }
.settings-logout:active { background: #FFEBEE; }
.settings-region { display: flex; gap: 6px; }
.settings-region input, .settings-region select { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border: 1px solid #E0E0E0; border-radius: 10px; font-size: 14px; background: #FAFAFA; box-sizing: border-box; outline: none; color: #212121; }
.settings-region select:focus { border-color: var(--theme, #2E7D32); background: #fff; }
.settings-avatar-name { font-size: 16px; font-weight: 600; color: #212121; margin-top: 6px; }
.settings-role-tag { display: inline-block; margin-top: 6px; padding: 3px 14px; border-radius: 12px; background: rgba(var(--theme-rgb, 46,125,50), 0.12); color: var(--theme, #2E7D32); font-size: 12px; font-weight: 500; }
.settings-save-wrap { padding: 0 12px 4px; }

/* === 开关组件 === */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #D0D0D0; transition: 0.3s; border-radius: 24px; }
.slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: 0.3s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: var(--theme, #2E7D32); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* === 钱包 Tab 切换 === */
.wallet-tabs { display: flex; gap: 6px; background: #fff; border-radius: 12px; padding: 5px; margin: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.wallet-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; border-radius: 9px; font-size: 14px; color: #9E9E9E; font-weight: 500; text-decoration: none; transition: all 0.3s; }
.wallet-tab i { font-size: 14px; }
.wallet-tab.active { background: var(--theme, #2E7D32); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* === 移动端分页 === */
.m-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 12px; }
.m-pagination .m-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; height: 36px; padding: 0 16px; border: 1px solid var(--theme, #2E7D32); border-radius: 18px; background: #fff; color: var(--theme, #2E7D32); font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.m-pagination .m-page-btn:active { background: var(--theme, #2E7D32); color: #fff; }
.m-pagination .m-page-info { font-size: 13px; color: #757575; font-weight: 500; padding: 6px 14px; background: #F5F5F5; border-radius: 14px; }

/* === 搜索栏 === */
.search-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-radius: 24px; margin-bottom: 12px; }
.search-bar i { color: #9E9E9E; }
.search-bar input { flex: 1; border: none; background: transparent; font-size: 14px; }
.search-bar .city { color: var(--theme); font-size: 13px; }

/* === 分页/加载更多 === */
.load-more { text-align: center; padding: 16px; color: #9E9E9E; font-size: 13px; }
.load-more a { color: var(--theme); }

/* === 模态框 === */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
    display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 80%; max-width: 360px; overflow: hidden; }
.modal-title { padding: 16px; font-size: 16px; font-weight: 600; text-align: center; border-bottom: 1px solid #F5F5F5; }
.modal-content { padding: 16px; font-size: 14px; color: #616161; }
.modal-input { width: 100%; padding: 10px; border: 1px solid #E0E0E0; border-radius: 6px; margin-top: 8px; font-size: 14px; }
.modal-foot { display: flex; border-top: 1px solid #F5F5F5; }
.modal-foot button { flex: 1; height: 44px; border: none; background: transparent; font-size: 15px; }
.modal-foot .cancel { color: #9E9E9E; }
.modal-foot .ok { color: var(--theme); font-weight: 600; }

/* === 浮动按钮 === */
.fab {
    position: fixed; right: 16px; bottom: 70px;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--theme); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 50; cursor: pointer;
}

/* === 开关切换 .switch === */
.switch {
    position: relative; display: inline-block;
    width: 42px; height: 24px; flex-shrink: 0;
    vertical-align: middle;
}
.switch input {
    opacity: 0; width: 0; height: 0; position: absolute;
}
.switch::before {
    content: ''; position: absolute; inset: 0;
    background: #BDBDBD; border-radius: 24px;
    transition: background 0.2s ease;
}
.switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}
.switch input:checked ~ ::before,
.switch:has(input:checked)::before { background: var(--theme, #2E7D32); }
.switch:has(input:checked)::after { transform: translateX(18px); }
/* 兼容不支持 :has() 的旧浏览器，使用同级选择器回退 */
.switch input:checked + ::before { background: var(--theme, #2E7D32); }
.switch input:checked + ::after { transform: translateX(18px); }
