/* ============================================================
   用户端样式
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
}

.brand-logo {
  font-size: 21px;
}

.brand-name {
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 实时状态 */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-mute);
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.live-dot i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  display: block;
}

.live-dot.on i {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  animation: pulse 2s infinite;
}

.live-dot.on {
  color: var(--ok);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* 公告 */
.notice-bar {
  max-width: var(--maxw);
  margin: 12px auto 0;
  padding: 10px 14px;
  background: var(--warn-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #fcd34d;
  width: calc(100% - 36px);
}

.notice-text {
  flex: 1;
  white-space: pre-wrap;
}

.notice-close {
  background: none;
  border: none;
  color: #fcd34d;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
}

.notice-close:hover {
  opacity: 1;
}

/* 布局 */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--gap);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
}

.price-range {
  display: flex;
  align-items: center;
  gap: 7px;
}

.range-sep {
  color: var(--text-mute);
  font-size: 12px;
}

.side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.stat-mini b {
  display: block;
  font-size: 21px;
  color: var(--accent);
  line-height: 1.2;
}

.stat-mini span {
  font-size: 11px;
  color: var(--text-mute);
}

/* 内容区 */
.content {
  min-width: 0;
}

.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.tab {
  padding: 5px 13px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

.view-switch {
  display: flex;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.view-btn {
  width: 28px;
  height: 25px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}

.view-btn.active {
  background: var(--surface-2);
  color: var(--accent);
}

/* 单子卡片 */
.order-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 13px;
}

.order-list.list-mode {
  grid-template-columns: 1fr;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
}

.order-card:hover {
  border-color: #3d4b5c;
  transform: translateY(-2px);
}

.order-card.full {
  opacity: 0.62;
}

.order-card.full:hover {
  transform: none;
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.order-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.order-slots {
  font-size: 11.5px;
  color: var(--text-dim);
}

.order-slots b {
  color: var(--ok);
}

.order-slots b.full {
  color: var(--text-mute);
}

/* 列表视图 */
.list-mode .order-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}

.list-mode .order-top {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.list-mode .order-desc {
  -webkit-line-clamp: 1;
}

.list-mode .order-bottom {
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.list-mode .order-price-box {
  text-align: right;
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.pager-info {
  font-size: 12px;
  color: var(--text-dim);
}

/* 接单表单 */
.claim-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.order-brief {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}

.brief-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.brief-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.form-tip {
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.6;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding: 8px 11px;
  border-radius: 0 4px 4px 0;
}

/* 我的接单 */
.my-claims-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.claim-row {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.claim-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.claim-row-title {
  font-weight: 500;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.claim-row-meta {
  font-size: 11.5px;
  color: var(--text-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.claim-note {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 6px 9px;
  border-radius: 4px;
}

/* ---------------------------------------------- 账号 */

/* 头像 */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  overflow: hidden;
  text-transform: uppercase;
}

.avatar.has-img {
  background-image: none;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.avatar-xl {
  width: 76px;
  height: 76px;
  font-size: 28px;
}

.auth-bar {
  display: flex;
  gap: 6px;
}

/* 用户菜单 */
.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 150px;
}

.user-trigger:hover {
  border-color: #3d4b5c;
  background: var(--surface-2);
}

.user-trigger #user-nickname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caret {
  color: var(--text-mute);
  font-size: 10px;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 232px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 200;
}

.user-dropdown.open {
  display: flex;
}

.dropdown-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border-soft);
}

.dropdown-info {
  min-width: 0;
}

.dropdown-info b {
  display: block;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-info span {
  font-size: 11.5px;
}

.dropdown-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
}

.dropdown-stats b {
  display: block;
  font-size: 16px;
  color: var(--accent);
  line-height: 1.3;
}

.dropdown-stats div:nth-child(2) b {
  color: var(--ok);
}

.dropdown-stats div:nth-child(3) b {
  color: var(--text-dim);
  font-size: 13px;
}

.dropdown-stats span {
  font-size: 10.5px;
  color: var(--text-mute);
}

.dropdown-item {
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: var(--danger-soft);
}

/* 接单时显示申请人 */
.claim-as {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.claim-as b {
  font-size: 13.5px;
}

/* 头像编辑 */
.avatar-edit {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
}

/* 页脚 */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 20px 18px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mute);
  flex-wrap: wrap;
}

.footer-sep {
  opacity: 0.5;
}

/* 详情弹窗 */
.detail-grid {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 9px 14px;
  font-size: 13px;
}

.detail-grid dt {
  color: var(--text-mute);
}

.detail-grid dd {
  color: var(--text);
  word-break: break-word;
}

.detail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.detail-desc {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: var(--text-dim);
  background: var(--bg-soft);
  padding: 12px;
  border-radius: var(--radius-sm);
}

/* 移动端 */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .sidebar {
    position: static;
  }

  .filter-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .filter-title {
    grid-column: 1 / -1;
  }

  .order-list {
    grid-template-columns: 1fr;
  }

  .side-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .filter-card {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    padding: 0 12px;
  }

  .brand-name {
    font-size: 14px;
  }

  .live-dot span {
    display: none;
  }
}