:root { --gold: #f5b301; }
body { background: #f6f8fb; }
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.order-card { transition: transform .15s; }
.order-card:hover { transform: translateY(-2px); }
.budget { color: #e6501e; font-weight: 700; }
/* 大厅卡片底色：按订单状态 / 剩余时间区分 */
/* 已取消：浅灰；符合接单条件时按剩余时间：<1天浅红，1–2天浅黄，>2天绿色 */
.order-card.bg-cancelled { background-color: #e9ecef; }
.order-card.bg-urgent   { background-color: #ffe3e3; }  /* 剩余 < 1 天：浅红 */
.order-card.bg-soon     { background-color: #fff3cd; }  /* 剩余 1–2 天：浅黄 */
.order-card.bg-ok       { background-color: #e8f5e9; }  /* 剩余 > 2 天：绿色 */
.badge { font-weight: 500; }
h4, h5 { overflow-wrap: anywhere; }
.order-card h5, td a { overflow-wrap: anywhere; }

/* 星级评分输入 */
.star-rating { display: inline-flex; flex-direction: row-reverse; font-size: 1.8rem; }
.star-rating input { display: none; }
.star-rating label { color: #ccc; cursor: pointer; padding: 0 2px; }
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label { color: var(--gold); }

/* 星级展示 */
.stars-show { color: var(--gold); letter-spacing: 1px; }

.timeline { list-style: none; padding-left: 0; }
.timeline li { border-left: 2px solid #dee2e6; padding: 4px 0 4px 14px; margin-left: 6px; }
.delivery-photo { max-height: 320px; width: auto; }

/* ---------- 手机端适配 ---------- */
/* 表格强制横向滚动，禁止列被压缩成竖排文字 */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table-responsive .table { min-width: 620px; margin-bottom: 0; }
.table-responsive .table.table-wide { min-width: 1080px; }
.table th { white-space: nowrap; }
/* 表格内操作按钮不换行、不被压缩成竖排文字 */
.table td .btn, .table td .btn-sm { white-space: nowrap; flex: 0 0 auto; }
.table td .d-flex { flex-wrap: wrap; }


/* 页头工具栏：窄屏下标题与搜索框换行排列 */
.page-toolbar { flex-wrap: wrap; row-gap: .5rem; }
.page-toolbar form { flex: 1 1 260px; }

@media (max-width: 767.98px) {
  .container, .container-fluid { padding-left: 12px; padding-right: 12px; }
  .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .card.p-3, .card.p-4 { padding: 0.9rem !important; }
  .navbar-brand { font-size: 1.05rem; }
  h4 { font-size: 1.15rem; }
  h5 { font-size: 1.05rem; }
  .order-card h5 { font-size: 1.02rem; }

  /* 触控目标：按钮和输入框更易点 */
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; padding-left: .5rem; padding-right: .5rem; }
  .form-control, .form-select { font-size: 16px; }  /* 防 iOS 聚焦自动放大 */
  .nav-link { padding: .5rem .8rem; }

  /* 星级评分加大，方便手指操作 */
  .star-rating { font-size: 2.4rem; }
  .star-rating label { padding: 0 4px; }

  /* 表格在窄屏下的紧凑显示 */
  table { font-size: .85rem; }
  .table td, .table th { padding: .45rem .4rem; }

  /* 订单详情预算与状态不挤压 */
  .budget.fs-4 { font-size: 1.15rem !important; }
  .badge.fs-6 { font-size: .78rem !important; }

  footer { font-size: .78rem; }
}

/* 密码显示/隐藏切换按钮 */
.pw-toggle { color: #6c757d; }
.pw-toggle:hover { color: #495057; }
.pw-toggle.active { color: #0d6efd; background-color: #e7f1ff; border-color: #0d6efd; }
.pw-toggle svg { display: block; }

/* ---------- 按钮点击效果：涟漪 + 按压反馈 ---------- */
.btn, .order-card { position: relative; overflow: hidden; }
.btn { transition: transform .08s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.95); }            /* 按下时轻微收缩，提供触感反馈 */
.order-card:active { transform: scale(.992); }

/* 涟漪（点击位置扩散的圆） */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, .16);
  transform: scale(0);
  animation: ripple-anim .55s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(2.4); opacity: 0; } }
/* 深色按钮上的涟漪改用浅色，保证可见 */
.btn.btn-primary .ripple,
.btn.btn-success .ripple,
.btn.btn-danger .ripple,
.btn.btn-dark   .ripple,
.btn.btn-info   .ripple,
.btn.btn-warning .ripple { background: rgba(255, 255, 255, .35); }

/* ===== 自适应布局：按终端类型 / 屏幕分辨率适配 ===== */
/* 手机：单列紧凑、触控友好、输入框 16px 防 iOS 自动缩放 */
@media (max-width: 576px) {
  .container, .container-fluid { padding-left: 10px; padding-right: 10px; }
  h4 { font-size: 1.15rem; }
  h5 { font-size: 1.05rem; }
  .card { border-radius: 12px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { font-size: 16px; }
  .table { font-size: .82rem; }
  .order-card h5 { font-size: 1rem; }
  .budget { font-size: 1.15rem; }
  .navbar-brand { font-size: 1rem; }
  .nav-link { padding-left: .5rem; padding-right: .5rem; }
  /* 筛选区在小屏纵向堆叠，避免挤压 */
  .card form .row > [class*='col-'] { flex: 0 0 100%; max-width: 100%; }
}
/* 平板：适度加宽内容区 */
@media (min-width: 577px) and (max-width: 992px) {
  .container, .container-fluid { max-width: 100%; }
  .btn { min-height: 40px; }
}
/* 大屏桌面：容器跟随屏幕宽度自适应，不再限制最大宽度，充分利用空间 */
@media (min-width: 1400px) {
  .container, .container-fluid { max-width: 100%; padding-left: 1.25rem; padding-right: 1.25rem; }
}
/* 超宽屏（≥2200px，如 4K）：限制最大 1920px 居中，避免单行文字过长影响阅读 */
@media (min-width: 2200px) {
  .container, .container-fluid { max-width: 1920px; margin-left: auto; margin-right: auto; }
}
/* 手机端隐藏次要元素（桌面才展示的列/说明） */
.client-mobile .only-desktop { display: none !important; }
.client-mobile .table-responsive { font-size: .82rem; }
/* 平板/手机：消息气泡更宽，提高可读性 */
.client-mobile .card-body, .client-tablet .card-body { padding: .85rem; }
/* 触控设备加大可点击区域 */
.client-mobile .list-group-item, .client-tablet .list-group-item { padding-top: .85rem; padding-bottom: .85rem; }

/* ===== 在线状态徽标 ===== */
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.online-dot.on { background: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, .18); }
.online-dot.off { background: #adb5bd; }

/* 导航项禁止文字竖排换行（项多时整体换到第二行，但每项保持单行） */
.navbar .nav-link, .navbar .navbar-brand { white-space: nowrap; }
/* 聊天输入区按钮不压缩、不换行 */
#btnRec, #btnSend, #btnImg { white-space: nowrap; flex-shrink: 0; }

/* ===== 微信风格：聊天界面 ===== */
.wx-wrap { background: #EDEDED; min-height: 60vh; border-radius: 8px; overflow: hidden; }
.wx-header { background: #EDEDED; border-bottom: 1px solid #d9d9d9; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
.wx-header .back { font-size: 20px; text-decoration: none; color: #333; }
.wx-header .title { font-weight: 600; font-size: 16px; }
.wx-header .sub { font-size: 12px; color: #8a8a8a; }
.wx-header .more { margin-left: auto; font-size: 20px; color: #333; text-decoration: none; }

.wx-avatar { width: 40px; height: 40px; border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 17px; }
.wx-avatar.sm { width: 32px; height: 32px; font-size: 14px; }

.wx-body { background: #EDEDED; padding: 12px 12px 4px; height: 58vh; overflow-y: auto; }
.wx-time { text-align: center; font-size: 12px; color: #a6a6a6; margin: 10px 0; }
.wx-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-start; }
.wx-row.me { flex-direction: row-reverse; }
.wx-bubble { max-width: 68%; padding: 9px 12px; border-radius: 5px; position: relative;
  word-break: break-word; white-space: pre-wrap; font-size: 15px; line-height: 1.45; }
.wx-bubble.you { background: #fff; }
.wx-bubble.me  { background: #95EC69; }
.wx-bubble.you::after { content: ''; position: absolute; left: -5px; top: 13px;
  border: 5px solid transparent; border-right-color: #fff; border-left: 0; }
.wx-bubble.me::after { content: ''; position: absolute; right: -5px; top: 13px;
  border: 5px solid transparent; border-left-color: #95EC69; border-right: 0; }
.wx-bubble img { max-width: 130px; border-radius: 4px; display: block; }

/* 语音消息：喇叭 + 波形 + 时长（微信式） */
.wx-voice { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.wx-voice .dur { font-size: 13px; opacity: .75; }
.wx-voice .wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.wx-voice .wave i { width: 2px; height: 7px; background: currentColor; display: block; border-radius: 2px; }
.wx-voice.playing .wave i { animation: wxwave .55s infinite alternate; }
.wx-voice.playing .wave i:nth-child(2) { animation-delay: .15s; }
.wx-voice.playing .wave i:nth-child(3) { animation-delay: .3s; }
.wx-voice.playing .wave i:nth-child(4) { animation-delay: .45s; }
@keyframes wxwave { from { height: 6px; } to { height: 15px; } }

/* 底部输入栏（微信式） */
.wx-foot { background: #F7F7F7; border-top: 1px solid #d9d9d9; padding: 8px 10px; }
.wx-bar { display: flex; align-items: flex-end; gap: 8px; }
.wx-ibtn { font-size: 22px; background: none; border: none; padding: 2px 4px; line-height: 1; color: #555; }
.wx-input { flex: 1; border: 1px solid #d9d9d9; border-radius: 4px; padding: 7px 10px;
  background: #fff; resize: none; max-height: 96px; font-size: 15px; }
.wx-send { background: #07C160; color: #fff; border: none; border-radius: 4px;
  padding: 7px 14px; font-size: 14px; }
.wx-hold { flex: 1; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff;
  padding: 9px; text-align: center; user-select: none; font-size: 15px; color: #555; }
.wx-hold.rec { background: #d9d9d9; }
.wx-panel { background: #F7F7F7; border-top: 1px solid #e3e3e3; padding: 10px; display: none; }
.wx-panel.show { display: block; }
.wx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wx-cell { text-align: center; font-size: 12px; color: #666; text-decoration: none; }
.wx-cell .ico { font-size: 26px; display: block; border: 1px solid #dcdcdc; border-radius: 8px;
  padding: 8px 0; background: #fff; margin-bottom: 4px; }
.wx-emoji { font-size: 24px; padding: 2px 4px; cursor: pointer; display: inline-block; }
.wx-emoji:active { transform: scale(.86); }

/* 表情分类标签页（微信式） */
.wx-emo-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid #e3e3e3; margin-bottom: 8px; }
.wx-emo-tab { flex: 0 0 auto; border: none; background: none; font-size: 13px; color: #888;
  padding: 4px 9px; border-radius: 14px; cursor: pointer; }
.wx-emo-tab.active { background: #e3f4e9; color: #07C160; font-weight: 600; }
.wx-emo-grid { display: none; max-height: 168px; overflow-y: auto; }
.wx-emo-grid.show { display: block; }
.wx-emo-grid .wx-emoji { font-size: 26px; padding: 4px 6px; }

/* 已撤回消息提示（微信式灰色小字） */
.wx-recalled { color: #b2b2b2; font-size: 13px; }

/* 长按气泡操作菜单（撤回 / 复制） */
.wx-ctx { position: fixed; z-index: 1200; background: #4c4c4c; border-radius: 8px; padding: 4px;
  display: none; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.wx-ctx.show { display: block; }
.wx-ctx-btn { display: block; width: 100%; border: none; background: none; color: #fff;
  font-size: 14px; padding: 9px 18px; text-align: center; white-space: nowrap; }
.wx-ctx-btn + .wx-ctx-btn { border-top: 1px solid rgba(255,255,255,.15); }
.wx-ctx-btn:active { background: rgba(255,255,255,.12); }

/* 微信式会话列表 / 通讯录 */
.wx-list { background: #fff; border-radius: 8px; overflow: hidden; }
.wx-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid #f2f2f2; text-decoration: none; color: inherit; }
.wx-item:last-child { border-bottom: none; }
.wx-item .mid { flex: 1; min-width: 0; }
.wx-item .nm { font-size: 15px; font-weight: 500; }
.wx-item .last { font-size: 13px; color: #9a9a9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-item .rt { font-size: 12px; color: #b0b0b0; text-align: right; }
.wx-unread { background: #FA5151; color: #fff; border-radius: 9px; min-width: 18px; height: 18px;
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* 聊天区高度自适应：手机占满可用空间，减少整页滚动 */
@media (max-width: 576px) {
  .wx-body { height: calc(100vh - 300px); min-height: 320px; }
  .wx-bubble { max-width: 72%; }
}
@media (min-width: 577px) {
  .wx-body { height: calc(100vh - 320px); min-height: 360px; }
}

/* ===== 用户头像（经典QQ头像 / 上传图片） ===== */
img.wx-avatar, .ava-img { object-fit: cover; border-radius: 5px; }
.qq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px; max-height: 260px; overflow-y: auto; padding: 8px;
  border: 1px solid #e3e3e3; border-radius: 8px; background: #fafafa; }
.qq-opt { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px;
  cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.qq-opt:hover { transform: scale(1.08); }
.qq-opt.sel { border-color: #07C160; box-shadow: 0 0 0 2px rgba(7,193,96,.25); }
.av-tabs .nav-link { color: #555; }
.av-tabs .nav-link.active { background: #07C160; color: #fff; }
.profile-avatar { width: 84px; height: 84px; border-radius: 10px;
  object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.12); margin-bottom: 8px; }

/* 我的订单：整行可点击跳转，带悬停与按压反馈 */
.clickable-table .order-row { cursor: pointer; transition: background .15s, box-shadow .15s, transform .1s; }
.clickable-table .order-row:hover { background: #f0f7ff; }
.clickable-table .order-row.row-pressed { background: #dbeafe; transform: scale(.995); box-shadow: inset 0 0 0 2px #93c5fd; }

/* ===== 移动端导航折叠面板：紧凑宫格 + 点击反馈 ===== */
@media (max-width: 991.98px) {
  #nav { padding-bottom: .4rem; }
  /* 两个菜单区都改为网格：主导航 3 列，账号区 3 列 */
  #nav .navbar-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 6px 0 2px;
  }
  /* li 不占格，子链接直接成为网格单元 */
  #nav .nav-item { display: contents; }
  /* 下拉菜单：点击「关注 / 社交 / 个人信息」后在下方整行展开为网格 */
  #nav .dropdown-menu {
    position: static !important; float: none; width: 100%;
    display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
    grid-column: 1 / -1;
    background: transparent; border: 0; box-shadow: none; padding: 2px 0 4px; margin: 0;
    transform: none !important;
  }
  #nav .dropdown-menu.show { display: grid; }
  /* 链接变胶囊 chip */
  #nav .nav-link, #nav .dropdown-item {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 9px 2px; margin: 0;
    border-radius: 10px; overflow: hidden; position: relative;
    background: rgba(255, 255, 255, .13);
    color: #fff; font-size: .92rem; white-space: nowrap;
    transition: transform .12s ease, background .15s ease;
  }
  #nav .nav-link:active, #nav .dropdown-item:active {
    transform: scale(.92);
    background: rgba(255, 255, 255, .3);
  }
  #nav .nav-active { background: #ffc107; color: #212529 !important; }
  #nav .nav-active:active { background: #e0a800; }
  #nav .nav-active-gold { background: rgba(255, 193, 7, .25); }
  /* 账号区图标 chip 稍窄、昵称自适应省略 */
  #nav .nav-user .nav-link { min-width: 0; }
  #nav .nav-user .text-truncate { display: block; }
  /* chip 上涟漪用浅色 */
  #nav .nav-link .ripple, #nav .dropdown-item .ripple { background: rgba(255,255,255,.4); }
}

/* 桌面端当前页高亮（下拉项保持温和高亮） */
@media (min-width: 992px) {
  #nav .nav-active { color: #ffc107; }
  #nav .dropdown-item.nav-active { background: #fff3cd; }
}

/* ===== 按钮执行状态反馈 ===== */
.btn.busy { pointer-events: none; opacity: .8; }
.btn .spinner-border-sm { width: .95em; height: .95em; border-width: 2px; }
.btn.btn-flash-ok  { box-shadow: 0 0 0 3px rgba(25,135,84,.4) !important; }
.btn.btn-flash-err { box-shadow: 0 0 0 3px rgba(220,53,69,.4) !important; }

/* ===== 悬浮按钮：返回首页 / 返回顶部 ===== */
.fab-group {
  position: fixed; right: 14px; bottom: 16px; z-index: 1050;
  display: flex; flex-direction: column; gap: 10px;
}
.fab {
  width: 48px; height: 48px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s;
  position: relative; overflow: hidden;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .32); }
.fab:active { transform: scale(.86); }
.fab-home { background: #0d6efd; color: #fff; }
.fab-top  { background: #ffc107; color: #212529; }
.fab-hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.fab-refresh { background: #198754; color: #fff; }
